[Tex/LaTex] TOC continues to next page with one line

page-breakingtable of contentswidows-orphans

Consider this example:

\documentclass{report}
%% \clubpenalty=10000                                                                                                                                                                                       
%% \widowpenalty=10000                                                                                                                                                                                      

\begin{document}
\tableofcontents

\chapter{Introduction}

\chapter{Background}

\chapter{Setup}

\chapter{Methodology}

\chapter{Data}

\chapter{Statistical Selection}

\chapter{Uncertainties}

\chapter{Results}

\section{Results of methodology 1}

\section{Results of methodology 2}

\section{Results of methodology 3}

\section{Results of methodology 4}

\section{Results of methodology 5}

\section{Resuts of methodology 6}

\section{Results of methodology 7}

\section{Results of methodology 8}

\section{Results of methodology 9}

\section{Results of methodology 10}

\section{Results of methodology 11}

\section{Results of methodology 12}

\section{Results of methodology 13}

\section{Results of methodology 14}

\section{Resullts of methodology 15}

\chapter{Conclusions}

\chapter{Appendix}

\chapter{Bibliography}

\end{document}

The TOC continues to next page with only one line:

enter image description here

There is no improvement also after I uncomment the lines:

%% \clubpenalty=10000                                                                                                                                                                                       
%% \widowpenalty=10000

which I tried according to How do I prevent widow/orphan lines?

How to make TOC either more sparse so that page 2 has more lines or more compact so that TOC is not continued to page 2?

Best Answer

You should worry about these details only when the document is finished and is in its really-really-no-more-changes-to-the-text status.

At that point, you may realize that your “Bibliography” line is no longer alone in the second page. But it could, or there might be two lines.

Moving one line to the first page is easy: add \addtocontents{toc}{\protect\enlargethispage*{\baselineskip}} to your document:

\documentclass{report}

\begin{document}

\addtocontents{toc}{\protect\enlargethispage*{\baselineskip}}

\tableofcontents

\chapter{Introduction}

\chapter{Background}

\chapter{Setup}

\chapter{Methodology}

\chapter{Data}

\chapter{Statistical Selection}

\chapter{Uncertainties}

\chapter{Results}

\section{Results of methodology 1}

\section{Results of methodology 2}

\section{Results of methodology 3}

\section{Results of methodology 4}

\section{Results of methodology 5}

\section{Resuts of methodology 6}

\section{Results of methodology 7}

\newpage

\section{Results of methodology 8}

\section{Results of methodology 9}

\section{Results of methodology 10}

\section{Results of methodology 11}

\section{Results of methodology 12}

\section{Results of methodology 13}

\section{Results of methodology 14}

\section{Resullts of methodology 15}

\chapter{Conclusions}

\chapter{Appendix}

\chapter{Bibliography}

\end{document}

and after a couple of LaTeX runs you'll obtain the desired output

enter image description here

If instead the second page of the table of contents turns out to have two or three lines, it may be impossible to squeeze them in the first page, but you can shorten the first page so as to move a couple of lines more in the second page, with

\addtocontents{toc}{\protect\enlargethispage{-3\baselineskip}

or with a different factor, depending on what you actually have at the bottom of the first page.

But, I insist, do this only when the document is in its final state, really no more changes to the text.

Related Question