Unbreakable block
See Preventing page breaks between lines in the UK TeX FAQ. Basically, you may use one of the following:
- the
samepage
environment; - a
\parbox
or aminipage
; - the
\needspace
command of the package of the same name.
You may also need "to accept that not everything can be accomplished totally automatically".
A \vbox
(or \vtop
) will never be broken across pages:
\vbox{%
Text here will not split over pages, it will remain
as one continuous chunk. If there isn't enough room
for it on the current page a pagebreak will happen
before it and the whole chunk will start on the next
page.}
(unless you \setbox
it, and later \unvbox
it)
You can also use packages to create and format the environment via options:
- package
adjustbox
- package
mdframed
with the optionnobreak
- package
tcolorbox