2

everyone:

I came across a problem. Following is how I format my table of contents:

\usepackage{tocloft}

\tocloftpagestyle{empty}

\renewcommand{\cftdot}{…}

\renewcommand{\cftdotsep}{0}

\renewcommand\cftsecleader{\cftdotfill{\cftdotsep}}

Its effect is as follows: enter image description here

My question is How to format the leading dots of section page number and subsection page number respectively. I want a different leading line for my subsection page number. I do not know how to set up it separately. Thanks in advance.

0
1

May be this is what you are asking:

\documentclass{article}
\usepackage{blindtext}
\usepackage{tocloft}
\renewcommand{\cftsecdotsep}{7}
\renewcommand\cftsecleader{\bfseries\large\cftdotfill{\cftsecdotsep}}
\renewcommand{\cftsubsecdotsep}{4}
\renewcommand\cftsubsecleader{\normalsize\cftdotfill{\cftsubsecdotsep}}
\renewcommand{\cftsubsubsecdotsep}{1}
\renewcommand\cftsubsubsecleader{\small\cftdotfill{\cftsubsubsecdotsep}}
\begin{document}
  \tableofcontents
  \Blinddocument
\end{document}

enter image description here

2
  • 1
    So how to align the different leading lines? They are ragged on the right. Apr 26 '15 at 8:32
  • @LawrenceLiu So it's do this for me.
    – touhami
    Apr 26 '15 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.