Home > LaTeX > LaTeX – customizing the depth of the table of contents for different parts of document

You can set the general depth of the contents listing using:

\setcounter{tocdepth}{n} where n is the level, starting with 0 (chapters only)

in the preamble (i.e. before \begin{document}. This will work for the whole document.

If you want to have the appendixes listed only as chapters you can use the package tocvsec2 which allows you to change the depth level in different parts of the document. You can set the level up to sections in one part with:

\settocdepth{chapter}

and later set it to sections or subsections. The level will remain the way you set it until the next \settocdepth command. Be shure not to have a line \renewcommand{\tableofcontents} right before the \settocdepth.

Categories: LaTeX