How do I encourage/make Latex typeset some portion of text so that it will all appear on a consecutive even-page, odd-page pair of pages?
With trial and error, \nopagebreak
can be coaxed into doing this, but is there a strategy that Just Works? Something like a samepage
environment would be ideal, but one that:
You could put together an environment such as
\newenvironment{twopage}{% \begingroup\setbox0\vbox\bgroup }{% \egroup \ifdim\ht0>\textheight \setbox1\vsplit0 to \textheight \cleardoublepage\unvbox1\clearpage \ifdim\ht0>\textheight \PackageWarning{twopage}{Overflow in twopage environment}% \fi \unvbox0\clearpage \else \clearpage\unvbox0\clearpage \fi\endgroup }
If you want a noisier failure, change \PackageWarning
into \PackageError
, The \unvbox
es should allow for notes/floats to work properly - if you don't need that, you might consider changing them all to \box
es instead (although I'm a bit rusty on the behavior of \vsplit
with respect to box depths and skips, so that might produce funny behavior, but it would guarantee that you only took two pages by flowing anything extra off the bottom of the second page).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With