GeneralSeperate List of Appendices

LaTeX specific issues not fitting into one of the other forums of this category.
S_David
Posts: 45
Joined: Tue Jul 07, 2009 4:16 am

Seperate List of Appendices

Post by S_David »

Hello,

How can I generate a seperate list of appendices? For example for the following code:

Code: Select all

\documentclass[a4paper,12pt,openany]{memoir}
\usepackage{appendix}
\begin{document}
\appendixpage
\appendix
\chapter{Case 1}
\chapter{Case 2}
\end{document}
Thanks in advance

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Re: Seperate List of Appendices

Post by gmedina »

Hi,

can you please explain your request in more detail? By "list of appendices" do you mean a list similar to a table of contents but including only the appendices?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
S_David
Posts: 45
Joined: Tue Jul 07, 2009 4:16 am

Seperate List of Appendices

Post by S_David »

gmedina wrote:Hi,

can you please explain your request in more detail? By "list of appendices" do you mean a list similar to a table of contents but including only the appendices?
I meant that exactly. A seperate list of appendices.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Seperate List of Appendices

Post by gmedina »

So, the appendices should appear in the new "List of Appendices", but not in the standard Table of Contents, is that correct?

Also, do you want to include the modifications that you requested in this other thread?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
S_David
Posts: 45
Joined: Tue Jul 07, 2009 4:16 am

Seperate List of Appendices

Post by S_David »

gmedina wrote:So, the appendices should appear in the new "List of Appendices", but not in the standard Table of Contents, is that correct?

Also, do you want to include the modifications that you requested in this other thread?
Yes, right.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Seperate List of Appendices

Post by gmedina »

Hi,

in the code below I defined a new list similar to a ToC, but that will be used to list the appendices: add \listofappendices in the place where you want the new list to appear.

I also used the titlesec package to format subsubsections headers as those of standard chapters, but allowing two appendices to start on the same page. Each appendix will be created now with

Code: Select all

\subsubsection{name}
and must be included in the new list by using

Code: Select all

\addcontentsline{app}{myappendix}{name}


The appendix package is no longer necessary.

Code: Select all

\documentclass[a4paper,12pt,openany]{memoir}
\usepackage{titlesec}

\makeatletter
\newcommand\listappname{List of Appendices}
\newcommand\listofappendices{%
    \chapter*{\listappname
        \@mkboth{%
           \MakeUppercase\listappname}{\MakeUppercase\listappname}}%
    \@starttoc{app}}
\newcounter{myapp}
\newcommand*{\l@myappendix}[2]{%
  \stepcounter{myapp}%
  \ifnum \c@tocdepth >\m@ne
     \vskip \cftbeforechapterskip
    {\leftskip \cftchapterindent\relax
     \rightskip \@tocrmarg
     \parfillskip -\rightskip
     \parindent \cftchapterindent\relax\@afterindenttrue
     \interlinepenalty\@M
     \leavevmode
     \@tempdima \cftchapternumwidth\relax
     \let\@cftbsnum \cftchapterpresnum
     \let\@cftasnum \cftchapteraftersnum
     \let\@cftasnumb \cftchapteraftersnumb
     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
     {\cftchapterfont\Alph{myapp}\enspace #1}\nobreak
     \cftchapterfillnum{#2}}
  \fi}
\makeatother

\begin{document}
\tableofcontents
\listofappendices

\chapter{A regular test chapter}
\section{A regular test section}
\chapter{Another regular test chapter}
\section{Another regular test section}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End of main chapters.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setcounter{secnumdepth}{3}
\titleformat{\subsubsection}[display]
  {\normalfont\huge\bfseries}{\appendixname\ \Alph{subsubsection}}{20pt}{\Huge}
\titlespacing*{\chapter} 
  {0pt}{20pt}{20pt}
\clearpage

{\centering\LARGE\bfseries Appendices\par\vskip20pt}

\subsubsection{Case 1}
\markboth{}{}
\addcontentsline{app}{myappendix}{Case 1}
\subsubsection{Case 2}
\addcontentsline{app}{myappendix}{Case 2}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
S_David
Posts: 45
Joined: Tue Jul 07, 2009 4:16 am

Re: Seperate List of Appendices

Post by S_David »

Thanks gmedina, I really appreciate your help. But I have questions: Is this mean that I can not use the standard \subsubsection{} any more after its new definition? Further, when I applied this to my code, the appendices appeared at the Table of Contents as subsubsections and in a seperate list.

How can I learn how to program my own commands? I understand nothing from your code.

Thanks in advance
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Seperate List of Appendices

Post by gmedina »

S_David wrote:Thanks gmedina, I really appreciate your help.
You are welcome.
S_David wrote:...Is this mean that I can not use the standard \subsubsection{} any more after its new definition?
Yes. If you use \subsubsection in the appendices, they won't behave as before... let me know if you don't use \paragraph in your appendices and I will make the corresponding modifications so that the subsubsections won't be changed.
S_David wrote:...Further, when I applied this to my code, the appendices appeared at the Table of Contents as subsubsections and in a seperate list.
Let's solve the problem with the subsubsections first, and then we'll take care of this. Please chack if your code include a line like this one:

Code: Select all

\setcounter{tocdepth}{5}
If so, please report the exact line of code.
S_David wrote:...How can I learn how to program my own commands? I understand nothing from your code.
Three sources will help you: 1) A good LaTeX book/manual (The LaTeX Companion, for example). 2) Packages documentation (available in CTAN). 3) Practice.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
S_David
Posts: 45
Joined: Tue Jul 07, 2009 4:16 am

Seperate List of Appendices

Post by S_David »

Hello gmedina,

So far, I don't use \subsubsection{} control sequence in the appendices, it was just a question.

Yes I have the following control sequence:

Code: Select all

\setcounter{tocdepth}{4}
Does this line cause the problem I mentioned?

Ok, I will try to read some books and tutorials to learn how to program my own commands.

Best regards
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Seperate List of Appendices

Post by gmedina »

Hi,

yes, that line causes the appendices to be included in the standard ToC. To solve this problem, please tell me which is the first sectional unit that you are sure that you won't use in your document; I mean, obviously you use \chapter and \section, but which one of the following is the first one you won't use: \subsection, \subsubsection, \paragraph, \subparagraph?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply