6

The table of contents of my document is similar to this example:

1 Chapter
    1.1 Section
    1.2 Section
2 Chapter
    2.1 Section
        2.1.1 Subsection
        2.1.2 Subsection
    2.2 Section
---------- page break ----------
        2.2.1 Subsection
        2.2.2 Subsection
3 Chapter
    3.1 Section
    3.2 Section

I want to manually move the page break one row up, before the 2.2 Section line. Is it possible? How?

0

1 Answer 1

10

Add \addtocontents{toc}{\protect\pagebreak[4]} just before that section.

MWE:

\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}
\section{Section}
\addtocontents{toc}{\protect\pagebreak[4]} % <--------------
\section{Section}
\subsection{Subsection}
\subsection{Subsection}
\subsection{Subsection}

\end{document}

Output:

enter image description here

Output with that line commented:

enter image description here

3
  • 2
    Of course this should be done only at the last minute, when no more text will be added to the document and the table of contents is stable.
    – egreg
    Apr 10, 2014 at 11:47
  • It works :) Can you explain me the use of [4] with pagebreak?
    – Andrea
    Apr 10, 2014 at 13:51
  • 1
    @Andrea Of course. The optional argument (from 0 to 4) tells LaTeX how insistent the pagebreak request is. The higher the number, the more insistent the request is. Apr 10, 2014 at 14:32

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.