5

I would like to know if there is any global command that would prevent any page-breaks inside sections. All my sections are short enough. I read some solutions, such as Absolutely, definitely, preventing page break, but I would like an automatic solution.

1 Answer 1

9

Add \filbreak before \section; you can automate it with etoolbox:

\documentclass{article}
\usepackage{etoolbox}
\preto\section{\filbreak}

\usepackage{lipsum} % just for the example

\begin{document}

\section{One}
\lipsum[1-3]

\section{Two}
\lipsum[3-4]

\section{Three}
\lipsum[4-6]

\end{document}

You must log in to answer this question.

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