0

I am writing a reference book in which every section heading is followed by an itemized list. I often get page breaks after the section heading and just one or two of the list items. In such cases I would like the heading to move to the next page. I tried all the solutions mentioned at Avoiding page breaks shortly after section/subsection headings, but none of them had any effect. It seems like these methods apply only when a paragraph follows the heading. What can I do in my case?

2
  • Your title suggests that you were getting a page break between the heading and the list. That should never happen. The text seems to imply that the break was after an item, which can happen and jfbu's answer is the answer for that case Oct 26, 2018 at 13:06
  • Sorry - text is right; please parse the title as "Avoiding page breaks after (section headings followed by lists)".
    – KeithB
    Oct 26, 2018 at 13:46

1 Answer 1

2

I would use the needspace package.

\documentclass[a4paper]{article}

\usepackage{geometry}
\usepackage{needspace}
\begin{document}
\vspace*{17.25cm}% try 17.26cm and see the whole section moving to next page

\needspace{7\baselineskip}
\section{Foo}

\begin{itemize}
\item A

\item B

\item C

\item D
\end{itemize}
\end{document}

enter image description here

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .