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.

Is there a way to compute the remaining space on the current page and issue an optional command?

share|improve this question
add comment

2 Answers

up vote 20 down vote accepted

See the needspace package. It might do what you need, or at least give inspiration for whatever it is you're trying to do :-) Namely, the \pagegoal and \pagetotal registers should help.

share|improve this answer
Thanks, exactly what I needed! –  Yiannis Lazarides Oct 12 '10 at 16:19
add comment

In ConTeXt, \testpage[n] checks if there is enough space for n lines.

share|improve this answer
Thanks! I think it is high time I start migrating to ConTeXt it seems to be the answer to a lot of difficult issues. –  Yiannis Lazarides Oct 13 '10 at 12:56
add comment

Your Answer


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.