I have a document typeset using the
memoir class and the content is primarily divided using sections. (I'm targeting an A5 paper and so I chose sections instead of chapters since they are more space-economical.)
I would like to generally insert a page break before each section (which is easy enough), but sometimes a section is very short and might fit on the rest of the current page well. Inserting a page break in such cases creates an awkward amount of blank space both on the current and next page.
Is it at all possible in LaTeX to detect when a section would fit on the rest of the page and not
\clearpage in that case?