# Unbreakable block

I want to do something like the following in TeX:

\begin{nobreak}

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.

\end{nobreak}


Is this possible?

-

## 3 Answers

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 a minipage;
• the \needspace command of the package of the same name.

You may also need "to accept that not everything can be accomplished totally automatically".

-
Fair enough. I would have thought this was a desirable thing to have, especially for bullet lists etc. Oh well, thanks for your help. –  fredley Oct 23 '10 at 22:00
@lockstep what controls the spacing prior to samepage environment, I am getting more vertical whitespace, is this normal? –  Nicholas Hamilton Jun 7 '13 at 5:58

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:

-
Using my adjustbox package here would be overkill. A normal minipage usually does it. Of course if you want to add frames or other modifications it is the way to go. –  Martin Scharrer Oct 6 '11 at 19:53
@MartinScharrer: Of course it's only useful for modifactions. –  Marco Daniel Oct 7 '11 at 9:45