1

I am currently using;

\usepackage[titles]{tocloft}

as well as some other packages to make a latex document from doxygen output. The table of contents however as varying line spacing on different pages. What could be causing this is there a way to force the line spacing to be consistent. It is quite a large document with many pages to the table of contents.

Hope you can help. Thanks in advance. I have read many of the questions on line spacing within toc but these don't seem to change anything.

I have noticed a line in the (long) preamble.

\setlength{\parskip}{3ex plus 2ex minus 2ex}

would this remove the variation in line spacing?

  • 1
    you have a toc with multiple pages. do all the "full" pages end at the same distance from the bottom of the page? if so, the different spacing between entries is probably at least partly attributable to a \flushbottom directive somewhere in the class file (which you don't identify). try preceding \tableofcontents by \raggedbottom (and insert \flushbottom before the first non-toc element). if that doesn't make the line spacing more uniform, we really need a compilable example that demonstrates the problem. – barbara beeton Nov 20 '17 at 18:09
0

Notice that if you use parskip package it will hack into \tableofcontents to let it use a zero parskip there. And indeed, each contents line is its own paragraph, so a non zero parskip setting adds a lot of stretch shrink to the table of contents, and it is better to avoid that.

You should try to get your latex file to contain for example

\begingroup
\makeatletter
\parskip\z@skip
\tableofcontents
\endgroup

and then report if it improves the situation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.