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?

• 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

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.
``````\begingroup