Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 38 down vote accepted

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".

share|improve this answer
2  
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
add comment

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)

share|improve this answer
add comment

You can also use packages to create and format the environment via options:

share|improve this answer
3  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.