Time for action – refining an extensive table of contents
We shall build the frame of a document containing some headings. We will modify the automatically created table of contents to be finer and to contain additional entries.
In Chapter 3, Designing Pages, we saw the effect of \tableofcontents
. The entries have been collected from the headings. We shall use this down to the subsubsection level.
Then we shall extend the TOC further. We will manually add entries for some headings:
Create a new document with the following code:
\documentclass{book} \setcounter{tocdepth}{3} \begin{document} \tableofcontents \part{First Part} \chapter*{Preface} \addcontentsline{toc}{chapter}{Preface} \chapter{First main chapter} \section{A section} \section{Another section} \subsection{A smaller section} \subsubsection[Deeper level]{This section has an even deeper level} \chapter{Second main chapter} \part{Second part} \chapter{Third main chapter} \appendix \cleardoublepage \addtocontents{toc}{\bigskip} \addcontentsline...