[texhax] table of contents with more than 99 entries

E. Krishnan ekmath at md5.vsnl.net.in
Wed Jul 30 21:11:46 CEST 2003

On Tue, 29 Jul 2003, Jan Chorowski wrote:

> I've got a problem with generation of a table of contents: 
> in the article class, I have about 120 different sections. 
> How can I tell latex, to reserve space for three digits for the 
> section number 

Perhaps this may help: add the lines below to your preamble:

	\renewcommand*\l at section[2]{%
  	\ifnum \c at tocdepth >\z@
    	\addvspace{1.0em \@plus\p@}%
      	\parindent \z@ \rightskip \@pnumwidth
      	\parfillskip -\@pnumwidth
      	\leavevmode \bfseries
      	\hskip -\leftskip
      	#1\nobreak\hfil \nobreak\hb at xt@\@pnumwidth{\hss #2}\par

It's a piece of code from the article.cls which deals with the 
formatting of the table of contents and I've just changed the dimension 
1.5em to 2.5em.	


More information about the texhax mailing list