edit My google-fu is apparently sub-par, this has a simple solution found here: Section should automatically start new page if the whole section does not fit on current page
I want to force each section to start on a new page if the whole section doesn't fit on the remainder of the page.
I have tried to use minipages, but they fail when the text exceeds the space available on the page. (I want to allow the sections to overflow into another page only if they are the only thing on that page).
this doens't work either:
\begin{samepage}
\section{Some title}
\lipsum[1-5]
\end{samepage}
\begin{samepage}
\section{Some title}
\lipsum[1-4]
\end{samepage}
\begin{samepage}
\section{Some title}
\lipsum[1-30]
\end{samepage}