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
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}