LaTeX - customizing the depth of the table of contents for different parts of the thesis
I noticed today I had a contents four pages long. Too much, obviously. You can set the general depth of the contents listing using
\setcounter{tocdepth}{n} where n is the level, starting with 0 (chapters only)
However, this can only be done in the preamble (i.e. before \begin{document}) and goes for the whole document. I wanted to have the level up to subsection for the normal chapters but I wanted the appendixes listed only as chapters, so no sections.
I found 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:
\settocdepth{section}
and later set it to subsections. The level will remain the way you set it until the next \settocdepth command. I used it to change a few levels, particularly the appendices to \settocdepth{chapter}. At first this didn't seem to work, really frustrating. I created a new tex file to test the package and it worked there... It turned out the location of the \settocdepth command didn't do the trick. I put it right after
\appendix but it didn't change a thing. It turned out is was a different attempt at changing the depth that caused this solution not to work (irony anyone?), I had a line \renewcommand{\tableofcontents} right before the \settocdepth line which apparently caused it not to work. Problem solved!
Comments
Thank you...
... you just saved my day :-)
tank you
thank you