0

This question already has an answer here:

If there is an "empty" section (i.e. two section titles after each other), page break is prevented, even if the second section title won't appear in the document. (Checked with book and article documentclasses.)

What is the reason? And how to solve it? (I don't want to start each section on a new page, but want to see all section titles even if all sections are empty.)

A MWE is here:

\documentclass{book}
\usepackage{pgffor}

\begin{document}
    \foreach \n in {1,...,30} {\section{Title \n}}
\end{document}

With A4 paper, default margins only Sections 1,...,26 will be shown, 27,...,30 won't.

enter image description here

marked as duplicate by David Carlisle page-breaking Feb 10 at 20:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    this is a faq, I'll find the duplicate but add some invisible text eg \mbox{} after each heading – David Carlisle Feb 10 at 20:52