Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

My document guidelines for a multi-chapter thesis requires that any appendices be pulled out of the TOC and dropped into a separate List Of Appendices (LOA). The latex package put together for my University has a method in place for accomplishing this, but it requires the user to manually edit the TOC file and LOA files to populate them with content. I pieced together a more automated way to pull the individual Appendix entries from the TOC (instead of editing thesis.toc and manually deleting the lines):

\newcommand{\nocontentsline}[3]{}
\newcommand{\tocless}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}

Followed by (when declaring the first Appendix):

\tocless\chapter{The First Appendix}
\addcontentsline{toc}{chapter}{Appendices}

All other appendices use the \tocless command. This seems to work, the TOC has an entry at the end for "Appendices," and the page number associated with it corresponds to the first page of the first Appendix. Exactly what the Grad School requires for formatting.

Getting a List of Appendices to work out, in a style that matches the rest of the document, that doesn't require manually editing multiple files seems to be beyond my grasp. Any help here would be greatly appreciated.

share|improve this question
    
Check the titletoc package (partial lists) might be able to do what you want. –  Yiannis Lazarides Jan 4 '11 at 0:51
    
@Yiannis: Thanks! I took a look at it, and for the life of me, cannot get it to work. I am wondering if tocloft of minitoc might work... –  mrdillon Jan 4 '11 at 4:59
    
I think I found a solution that works just fine, however being relatively new here, I am not too sure what is the most appropriate way of conveying that solution. –  mrdillon Jan 4 '11 at 14:42
    
It would be very good if you post your working solution as an answer, even if it's to your own question. You could mark this answer as accepted then. –  Stefan Kottwitz Jan 4 '11 at 17:49
add comment

1 Answer 1

up vote 3 down vote accepted

Rooting through the cls file in the link posted above, I tried to dissect the following block, which looked rather promising:

\newcommand\listofappendices{%
    \@chapteronefalse
    \if@arabic\relax\else\renewcommand{\thepage}{\roman{page}}\fi
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapteruaf*{\listappname
      \@mkboth{\uppercase{\listappname}}%
              {\uppercase{\listappname}}}%
    \@chapteronetrue
    %% get this in contents as a section
    \addcontentsline{toc}{section}{\listappname}
    \@starttoc{loa}%
    \if@restonecol\twocolumn\fi
    \newpage\renewcommand{\thepage}{\arabic{page}}}

Basically, I realized that this command was setting up the List of Appendices for me, all I needed was a way to automatically populate it, instead of manually adding entries to the loa file.

At the head of each Appendix:

\chapter*{This is the first appendix}
\addcontentsline{loa}{appendix}{This is the entry for the first appendix in the List of Appendices}

The \chapter* suppresses a TOC entry for the appendix, while the \addcontentsline adds the entry to the LOA file. To get the style to match, I added the following line to the end of the code block in the cls file:

\newcommand\l@appendix{\@dottedtocline{1}{1.5em}{2.3em}}

Works perfectly now, and I don't have to worry about manually creating the List of Appendices every time I build my document.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.