I am trying to get a leader of dots going from my chapter titles to my
page number in the table of contents. (LaTeX normally produces these
leaders only for lower level headings like sections and subsections.)
I have tried the 'tocloft' package, but the commands for doing this do
not produce any results.
I would be grateful for a clearer suggestions of commands.
Many thanks,
Jan
it would be helpful with a minimal example (compilable) example of what
you have tried
--
/daleif
DK-TUG president
memoir and mh bundle maintainer
With tocloft you have the \cftZleader command that puts the leaders
and \cftdotsep is the space between dots (\def\cftdotsep{\cftnodots}
removes the leaders by giving to \cftdotsep a huge value)
You then have to check the \cftsubsecleader (without /s/ weirdly)
command (for subsection):
\def\cftsubsecleaders{\cftdotfill\cftdotsep} normally
and check the value of \cftdotsep expressed in "mu" units without
the unit: for example \def\cftdotsep{5}
This should work... With interfaces:
\tocsetup{subsection/dotsep=5} does the job (the leader is automatically
set if dotsep is not \cftnodots) - at least for the next version...
Regards.
Copy the definition of \l@chapter from your document class file, make it
a \renewcommand, and then substitute the definition of \dottedtocline
for the \hfil (adding a \normalfont to negate the bold):
\documentclass{report}
\makeatletter
\renewcommand*\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 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{\normalfont$\m@th
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
mu$}\hfill \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi}
\makeatother
\begin{document}
\tableofcontents
\chapter{foo}
Stuff
\section{bar}
More stuff
\end{document}
///Peter