[Tex/LaTex] Adding dotted lines to the LOF and LOT

table of contentstocloft

I am trying to add dotted lines in the table of contents using the tocloft package.

\usepackage{tocloft}
\renewcommand\cftchapdotsep{\cftdotsep}
\renewcommand\cftchapleader{\cftdotfill{\cftchapdotsep}}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}

I succeeded in getting them on the table of contents page, but I can't seem to figure out how to get them to show up on my list if figures and list of tables.

Best Answer

Which document class do you use? With either the book or the report document class (and the tocloft package loaded), dot leaders are enabled by default for section, figure, and table items; there should thus be no need to (re)define the macros \cftsecleader, \cftfigleader, and \cfttableader to enable dot leaders for these items in the table of contents, the list of figures, and the list of tables. To enable dot leaders for chapter items, it suffices to run

\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}

Anyway, it appears that you're using a document class that doesn't enable dot leaders by default for any of these four item types. To enable them, you should execute the following four instructions (note that the macro \cftdotsep occurs in all four of them):

\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftfigleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cfttableader}{\cftdotfill{\cftdotsep}}