This is a question that has been asked before in various ways, but I have yet to find a general answer to it. Perhaps I'm misunderstanding something and the solution is actually very simple.
I have a section of a document where page breaks are absolutely not accepted. It consists of a few paragraphs, followed by some formulas. What I want is that the section should be bumped down to the next page if there is not enough space for it on the current page, even if that means that the current page would only contain a single row of text.
I've tried all the usual solutions. When I use \begin{samepage}, I still sometimes get page breaks in the middle of the section.
If I use \begin{minipage}, then the section does not get a page break in the middle of it, but instead it gets pushed to the bottom of the previous page (i.e. it flows beyond the end of the page).
Is there any generic solution for what I want to do? If so, how? And if not, how can I solve this?
One more note: This document is automatically generated, so I can't solve it by manually putting page breaks where they are needed.
sectionyour environment will leave the section on the previous page, whilesamepagewould force it to swap aswell. – Pawel Sep 25 '13 at 16:26\sectioninside the environment.;-)– egreg Sep 25 '13 at 17:30\sectioninside and it lands on the next page some unwanted vertical space appears, as in the picture – Pawel Sep 26 '13 at 08:07\@minipagetruejust after\bgroup. – egreg Sep 26 '13 at 09:04\begin{minipage}vector which ruined my text spacing relative to the rest of my document. – Charney Kaye Aug 26 '16 at 20:56