Customizing the table of contents
Besides just calling \tableofcontents
to get a pre-designed list of contents, LaTeX provides basic ways to modify it. Let's use some.
We will create a document that we will use for customizing, and it will also be our working example for the following sections.
We will build the frame of a document containing some headings. We will modify the automatically created table of contents to be more nuanced and to contain additional entries.
In Chapter 3, Designing Pages, we saw the effect of \tableofcontents
. LaTeX collected the entries from the headings. We will use headings down to the subsubsection level.
Later, we will extend the TOC further. We will manually add entries for some headings. Let's start with the base document:
- Start a new
book
document:\documentclass{book}
- Set the table of contents' depth value to
3
to include headings down to the subsubsection level:\setcounter{tocdepth}{3}
- Begin the document...