[OS X TeX] Appendixprefix in the toc

Alan Munn amunn at msu.edu
Sun Apr 12 01:28:09 CEST 2009

At 7:35 PM +0200 4/11/09, Gewitterbukk wrote:
>Is there a smart way to use \chapter{} in the appendix so that the 
>prefix "Apendix" is used in the table of contents? What and where do 
>I have to change something?
>Output example:
>1 Section
>2 Section
>Appendix A: ...
>Appendix B: ...

This is not so simple.

Use the tocloft package plus a redefinition of the \appendix command. 
Here's a sample document that does what you want.



\setlength{\tocnumwidth}{\cftchapnumwidth} % store the starting width 
of the TOC chapter number

%\settowidth{\temp}{\bfseries\cftchappresnum\cftchapaftersnum} % 
calculate the extra space
%\addtolength{\cftchapnumwidth}{\temp} % add the extra space
% uncomment the 3 lines above  if you want the word Chapter to 
precede the number in the TOC


% comment the line above out if you include Chapter before the number 
in the TOC want the Chapter and Appendix TOC entries to line up.
\renewcommand*{\appendix}{\oldappendix \addtocontents{toc}{\changetoapp}}







Alan Munn						amunn at msu.edu
Department of Linguistics
and Germanic, Slavic, Asian and African Languages		Tel. 
Michigan State University, East Lansing MI 48824 USA	Fax	517-432-2736

More information about the macostex-archives mailing list