[Tex/LaTex] Customization of chapter entries in Table of Contents

table of contentstitletoctocloft

I want to customize chapter entries in Table of Contents.

\documentclass[final]{book}

\title{Title}
\author{Author}
\date{}

\begin{document}

\maketitle
\tableofcontents

\chapter*{Chapter Title}
\addcontentsline{toc}{chapter}{Chapter Title}

\end{document}
  1. By default, chapter entries in Table of Contents are bolded. I want to make them not bolded. For example, in other situations where I would like to use not bolded text in otherwise bolded environment, I would use \textnormal command. However, I am not able to find a way to redefine chapter entry in ToC to use that setting.

  2. By default, subsections entries have dot leaders, but chapter entries does not. I would like to add dot leaders to chapter entries in ToC.

I found tocloft package. It looks like it should be able to do both of those things, but I was not able to find suitable example in its documentation.

Best Answer

The tocloft package indeed provides lots of handy macros to shape nearly every aspect of the appearance of the table of contents (and of the lists of figures and tables too).

Once the tocloft package is loaded in the preamble

\usepackage{tocloft}

you'd issue the command

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

to enable dot leaders for chapter-level entries in the ToC.

To get normal-weight (non-bold) chapter-level entries and page numbers, you'd issue the commands

\renewcommand{\cftchapfont}{\mdseries}
\renewcommand{\cftchappagefont}{\mdseries}

Additional comment: Without the tocloft package, LaTeX will start the ToC on an odd-numbered page. With the tocloft package loaded, the default is to start the ToC on the next available page, regardless of whether it's odd-numbered (aka "recto") or even-numbered ("verso"). If you want to restore the basic-LaTeX method, be sure to specify the option titles when loading the package:

\usepackage[titles]{tocloft}

A side-effect of this setup, though, is that you could no longer use the package's macros (cf. subsection 2.2 of the user guide) to influence the appearance of the headers of the ToC, the LoF, and the LoT.