Absolutely, definitely, preventing page break
Just enclose your text in an unbreakable unit; before it issue a combination of glue and penalties that will fill the page if the unit has to go to the next one.
\documentclass{article}
\usepackage{lipsum}
\newenvironment{absolutelynopagebreak}
{\par\nobreak\vfil\penalty0\vfilneg
\vtop\bgroup}
{\par\xdef\tpd{\the\prevdepth}\egroup
\prevdepth=\tpd}
\begin{document}
\lipsum[1]
\begin{absolutelynopagebreak}
\lipsum[1-3]\lipsum*[4]
\end{absolutelynopagebreak}
HERE WE RESTART \lipsum[2]
\end{document}
Try changing \lipsum[1-3]
into \lipsum[1-2]
and the unit will stay in one page.
One solution may be to use \filbreak
before the section, which is defined in plain TeX as \vfil\penalty-200\vfilneg
. This suggests that the line is a favorable break location. It worked for a similar problem of mine, at least.
You need to not only prevent page breaks (minipage) but also allow the previous page to stretch (most easily by using \raggedbottom
)