phthenry@iglou.com wrote:
From: Vit Zyka
Hans Hagen wrote (8:53):
Paul Tremblay wrote:
What I would need is some type of macro that can determine how much space is left on the page. If the space is less than some small, pretermined amount (say, 24 points, for example), then put the
title on
the next page, or put in a \blank[24pt, flexible]
I know nothing about writing macros, or if this is possible.
\testpage[24pt]
Vit Zyka wrote (11:35):
\penalty50 \vskip3\baselineskip plus1fil \nobreak \vskip-3\baselineskip plus-1fil
It is useful before section title etc. I believe it is implemented to ConTeXt, but I do not know the interface.
Actually, no! Both your responses help me out.
Could you explain your snippet of code? I don't quite know what the \penalty50 means.
Penalty works for both vertical and horizontal mode. Penalty is place where a break can occure (with some panalization). Border values have these meanings: \penalty10000 => \nobreak, \penalty-10000 => force \break, \penalty0 => neutral value (same penalty as \par or space) But, forget my 'solution', next example shows it does not work in ConTeXt (glues and penalty are not discarded at the top of next page). And in addition it has to cooperate with output routine (needs \raggedbotom). Actually, Hans's \testpage is based on another trick (as I look up, it is defined by comparing \pagegoal and \pagetotal registers) and it is more general. vit ------------- \setuplayout[lines=10] \showgrid \starttext \dorecurse{9}{Line \recurselevel\hfill\break}% \par \penalty50 \vskip 3\baselineskip \nobreak\vskip-3\baselineskip Hallo \stoptext -------------