3

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.

7

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.

| improve this answer | |
  • 1
    Great answer. Thanks! I have added information about \usepackage{} command for completeness (and ease of understanding for complete begginers). Luckily, in my case, next available page is odd-numbered, so no problem with that. If you know any way to use titles option of tocloft package and be able to influence appearance of the headers at the same time that would be useful for others. – Rafal Dec 7 '13 at 11:23
  • I discovered the titles option of tocloft allows titlesec to format the ToC title, as it relies on the numberless chapter format (\chapter*). – user101590 Apr 9 '17 at 10:47

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.