Why does LaTeX "Table of Contents" leave gaps for missing items?
I have set tocdepth
to a lower number, so that other subsections are not included in the list. But instead of just removing thes开发者_开发知识库e items, LaTeX leaves a gap. How does it happen? How could it be prevented?
We need details, including the document class, the exact tocdepth
number, and the set of section headings actually used in your document. Two hypotheses:
You have not run LaTeX enough times for the TOC to stablize—possible but unlikely.
You have set the
tocdepth
to 1, and the document class you are using deliberately puts extra space between level 1 headings (\section
s)—slightly more likely.
The table of contents may include a stretchable space in between each of the entries. If the style allows it, put a \vfill
after the \tableofcontents
but before any \newpage
s, and see if that makes a difference.
Usually I recommend one of the titletoc or tocloft packages to format ToC entries.
I can heartily recommend the memoir
document class, which I use for everything from poetry to business cards. I'm very, very happy with the investment I made to learn it, even though it wasn't negligible.
In particular, to tinker at your TOC entry formatting, search for \cftbeforeKskip in memman.pdf.
The final solution will probably look something like this:
\setlength{\cftbeforechapterskip}{0pt}
or
\setlength{\cftbeforesectionskip}{0pt}
etc... (depending on which level of entry you want to adjust)
精彩评论