1

In my thesis, I have a section with a very long name, which must appear in its entirety in the table of content.

The title consists of three lines and, unfortunately, it is split in two different pages. Is there any way to fix this by putting the whole section title in the second page?

Thanks!

  • Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Apr 14 '14 at 18:41
1

You can adopt this answer given by Karl. In case if you want the section to stay in the current page as a whole, you may use

\addtocontents{toc}{\protect\enlargethispage{\baselineskip}} % here

Change \baselineskip suitably.

Code: (adopted from linked answer):

\documentclass[12pt]{book}

\begin{document}

\tableofcontents

\chapter{Chapter}
\section{Section}
\section{Section}
\chapter{Chapter}
\section{Section}
\subsection{Subsection}
\subsection{Subsection}
\section{Section}
\subsection{Subsection}
\subsection{Subsection}
\chapter{Chapter}
\section{Section}
\section{Section}
\chapter{Chapter}
\section{Section}
\subsection{Subsection}
\subsection{Subsection}
\section{Section}
\subsection{Subsection}
\subsection{Subsection}
\chapter{Chapter}
\section{Section}
%\addtocontents{toc}{\protect\pagebreak[4]} % here
\addtocontents{toc}{\protect\enlargethispage{\baselineskip}} % here
\section{Section that has some long lines Section that has some long lines Section that has some long lines Section that has some long lines Section that has some long lines}
\subsection{Subsection}
\subsection{Subsection}
\subsection{Subsection}

\end{document}

enter image description here

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.