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 have a document with some tabulars one after the other. I want the tabulars begin on a new page if there is very little room left on the actual page, like 1/4th. Otherwise, there should not be a pagebreak. So I need some kind of conditional \pagebreak, how can I do this?

share|improve this question
add comment

1 Answer

up vote 17 down vote accepted

The needspace package is very useful for that. Write for example:

\needspace{.25\textheight}
\begin{tabular}
...

If there's not enough space as requested, approximately, a page break would be inserted. There's further a command \Needspace which is exact but less efficient. A starred version \Needspace* works flush bottom instead of ragged bottom which is the behavior of the non-starred command.

share|improve this answer
    
Thanks, superb solution. –  JDoe Mar 16 '11 at 15:37
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.