Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

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

share|improve this answer
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 at 11:47
    
It works :) Can you explain me the use of [4] with pagebreak? –  Andrea Apr 10 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. –  karlkoeller Apr 10 at 14:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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