# [texhax] need certain amount of room on page

tom sgouros tomfool at as220.org
Fri Jan 30 03:54:43 CET 2009

You want to look up \pagegoal and \pagetotal.

I did the following in a package years ago and it works ok, but the TeX
page-breaking algorithm means there is some fuzziness about what the
bottom of the page actually means and the last time I suggested
something like this, others here didn't think much of it.  You are
warned, but it works for me.

Cheers,

-tom

\newdimen\IN at spaceleft
\def\IN at pagespace{%
\ifdim\pagetotal=0pt%
\IN at spaceleft=\vsize%
\else%
\IN at spaceleft=\pagegoal%
\fi}%

D. R. Evans <doc.evans at gmail.com> wrote:

> I know I knew how to do this once upon a time, but that knowledge has
> disappeared into the mists of time :-(
>
> In plain TeX I want to do the following:
>   if there is X amount of remaining space on the current page:
>     do A
>   else
>     do B
>
> Can anyone suggest anything? I don't remember it as being difficult, but
> nothing I've tried this afternoon has quite done the job properly.
>
>   Doc
>
> --
> Web:  http://www.sff.net/people/N7DR
>
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/