Normally, sections encourage LaTeX to
\pagebreak so that if e.g. a section is close to the end of a page, it will get pushed onto the next page. I am happy with this behavior, except for one point:
\pagebreak can potentially leave a lot of awkward spacing between the paragraphs on the previous page. Therefore, I would prefer to
\newpage instead of
\pagebreak if the section is going to have any break at all.
I do NOT want to
\newpageunconditionally, but only if the
\sectionwould have had a break anyway.
I am NOT attempting to alter the amount of text which must appear under a section in order for it to be considered "ok" with respect to page breaks (as asked in previous questions here).
Of course, I could do this manually by just adding
\newpage in front of the offending sections. However, this is undesirable because I can only apply to the absolute final text (otherwise the sections may move), and is generally brittle. If there is a way to do this automatically so I can "fire and forget", then I would greatly prefer that.
I am using titlesec in case that makes a difference. I have made no other modifications to how sections are defined.