views:

60

answers:

2

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?

+1  A: 

You could try

\begin{samepage}
 This is the first paragraph. This is the first paragraph. 
 This is the first paragraph. This is the first paragraph. 
 \nopagebreak
 This the second. This the second. This the second. 
 This the second. This the second. This the second. 
 This the second. This the second. 
\end{samepage}

samepage prevents LaTeX from pagebreaking within one paragraph, i.e. within the samepage envirnment, pagebreaksa are only between paragraphs. Thus, you need nopagebreak as well, to prevent LaTeX from pagebreaking between two paragraphs.

phimuemue
+1  A: 

A quick test reveals thatminipage has this behavior, too.

\begin{minipage}{3in}
One contiguous chunk.
\end{minipage}

\begin{minipage}{3in}
Another contiguous chunk.
\end{minipage}
Steve