I've been using this code in order to put dots between my ToC items and their respective page numbers:
Code: Select all
\makeatletter
\renewcommand\l@section[2]{%
\ifnum \c@tocdepth >\z@
\addpenalty\@secpenalty
\addvspace{1.0em \@plus\p@}%
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak\
\leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}
\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\endgroup
\fi}
\makeatother
\renewcommand
. My problem comes from the fact that I need to increase the number width in the ToC. I'm not exactly sure what the code above does, but I was able to figure out that if I changed \setlength\@tempdima{1.5em}%
to \setlength\@tempdima{4.0em}%
I get perfect spacing for the section items. Unfortunately, the spacing on the subsections is wrong and I'm not sure how to further modify the above code to get the number width for the subsections to also change.Any help will be much appreciated!