I am trying to add dots between the sections and the pages in my table of contents without using the package tocloft, since it moved my title from its original position. Right now it looks like this:
I have found that if I comment the following line from my .cls file, I get the desired output.
\let\@dottedtocline\@plaintocline
Here's what the desired ouytput looks like:
I would like to leave the .cls file untouched, as I understand it is best practice.
So how can I suppress the effect of that line from my .tex file, instead of modifying the class?
Here is the \@plaintocline command definition:
\def\@plaintocline#1#2#3#4#5{%
\ifnum #1>\c@tocdepth \else
\vskip \z@ \@plus.2\p@
{\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
\parindent #2\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima #3\relax
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{#4}\nobreak
\leaders\hbox{$\m@th
\mkern \@dotsep mu\hbox{}\mkern \@dotsep
mu$}\hfill
\nobreak
\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
\par}%
\fi}


\usepackage[titles]{tocloft}then your titles are spared. – Oct 23 '15 at 15:10\renewcommand{\@dottedtocline}{}with the correct number of arguments, being gobbled. Unless\edefis used, the\@dottedtoclineis used when the outer macro is in action, not already on definition, so the redefined command comes into effect. – Oct 23 '15 at 15:10\@plaintoclineso I don't know what you want to achieve! – Oct 23 '15 at 15:19\renewcommand{\@dottedtocline}{}to the preamble gave me a "missing \begin{document}" error. Adding the same line after\begin{document}gave me an unformatted TOC with numbers (such as 11em 37em) all over – gpedrosa Oct 23 '15 at 15:43\@dottedtoclinebeing define in the LaTeX core filelatex.ltx. So your class does actually use the traditional\@dottedtoclinebut you want to switch it off? I can't give some advise on\renewcommand{\@dottedtocline}because I don't know what you want to achieve! – Oct 23 '15 at 15:48\usepackage{etoolbox} \makeatletter \patchcmd{\@plaintocline}{\hbox{}}{\hbox{.}}{}{} \let\@dottedtocline\@plaintocline \makeatother– Gonzalo Medina Oct 23 '15 at 16:15\@plaintoclineis not the same as the kernel's\@dottedtocline; a dot is missing (see my comment above). – Gonzalo Medina Oct 23 '15 at 16:16clsfile from thetex. And I've learned I cannot simply supress it, I have to redefine the command (in this particular case). Thank you for your effort and help! – gpedrosa Oct 23 '15 at 17:30revertwithundo? – Johannes_B Oct 23 '15 at 19:11