GeneralList of Appendices

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Wolf77
Posts: 4
Joined: Wed Sep 03, 2008 11:10 pm

List of Appendices

Post by Wolf77 »

Hi All,

I have an appendices problem that I hope you can help me solve. My school requires that the dissertation include a separate list of appendices that will appear after the list of tables. I am stuck, trying to creating this list of appendices (I have 7 at the moment).

As of now, all my appendices are listed in the main TOC.

Here is a MWE:

Code: Select all

\documentclass[12pt]{report}
\usepackage{hyperref}  
\usepackage{appendix}

\begin{document}
\pagenumbering{roman}

\section*{Abstract} \addcontentsline{toc}{chapter}{Abstract} \newpage 

\addcontentsline{toc}{chapter}{Contents} \tableofcontents \newpage

\addcontentsline{toc}{chapter}{List of Figures} \listoffigures \newpage

\addcontentsline{toc}{chapter}{List of Tables} \listoftables \newpage

\chapter*{List of Appendices} \addcontentsline{toc}{chapter}{List of Appendices} \newpage


\pagenumbering{arabic}


\chapter{Chapter 1} 
\input{chapter1.tex}
\newpage

\chapter{Chapter 2} 
\input{chapter2.tex}
\newpage

\appendix
\addappheadtotoc

\input{AppendixA.tex}
\newpage

\input{AppendixB.tex}

\end{document} 
Each Appendix*.tex file start with \chapter command, e.g. AppendixA.tex start with \chapter{Additional Info}

I appreciate your help in with puzzle.

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

List of Appendices

Post by gmedina »

Hi,

in the code below I give you a possible solution. The idea is to create a new contents file that will list the appendices:

Code: Select all

\documentclass[12pt]{report}
\usepackage{tocbibind}%ToC,LoF,LoT, bibliography and index automatically referenced in ToC
\usepackage{hyperref} 
\usepackage{appendix}
\usepackage{lipsum}%just to generate some text

%definition of the list of appendices
\makeatletter
  \newcommand\tableofappendices
    {\section*{List of Appendices}\@starttoc{toa}}
  \newcommand\l@appendix[2]
    {\par\noindent\bfseries{#1}\hfill\bfseries{#2}\par}
\makeatother

\begin{document}
\pagenumbering{roman}

\section*{Abstract} 
\addcontentsline{toc}{chapter}{Abstract} 

\newpage

\tableofcontents 
\clearpage
\listoffigures 
\clearpage
\listoftables 
\clearpage
\tableofappendices
\addcontentsline{toc}{chapter}{List of Appendices} 
\clearpage

\pagenumbering{arabic}

\chapter{Chapter 1}
\lipsum[1-15]
\newpage

\chapter{Chapter 2}
\lipsum[1-15]
\newpage

\appendix
\addappheadtotoc

%create each appendix using \chapter* and include them in the list of appendices
%as shown:
\addtocontents{toa}{\addvspace{20pt}}%just to separate the heading and the first entry
\chapter*{Appendix A}
%\addtocontents{toa}{\addvspace{20pt}}
\addcontentsline{toa}{appendix}{Appendix A}
\addtocontents{toa}{\addvspace{10pt}}%just to separate the entries in the list
\lipsum[1-15]
\newpage

\chapter*{Appendix B}
\addcontentsline{toa}{appendix}{Appendix B}
\addtocontents{toa}{\addvspace{10pt}}%just to separate the entries in the list
\lipsum[1-15]

\end{document} 
Remarks:
1) You can adapt and improve this idea according to your needs.
2) I loaded the tocbibind package to get the ToC , LoF and LoT automatically included in the table of contents.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Wolf77
Posts: 4
Joined: Wed Sep 03, 2008 11:10 pm

Re: List of Appendices

Post by Wolf77 »

Hello Gmedina,

Thank you for your reply. The example that you gave really does the trick.

However, I have a problem that all the references that I have in the main text to the appendices have disappeared (I use \label and \ref). Is there anyway to recreate the references and still have the separate list of appendices?

Again thank you for your help,
Wolf
Post Reply