From: Vit Zyka
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
Hans Hagen wrote (8:53): Paul Tremblay wrote: 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.
Whawgh! Hans had answered the question before I sent it. Sorry, my homing pigeon was too lazy... Although Hasselt-to-Prague way in 2.5 hrs it is not so bad :)
Actually, no! Both your responses help me out. Could you explain your snippet of code? I don't quite know what the \penalty50 means. I know TeX applies a penalty to each line, but I'm confused if the penalty is for fitting the line horizontally or vertically, or both. I know what vskip does, but I'm not sure about the other commands, or the strategy. Incidently, I do very much want code that acts on titles for sections and subsections. That is my exact problem right now. I believe that ConTeXt will generally handle widows if they just occur in a regular paragraph. Hans provided a very useful tidbit in \testpage[24pt], but I'm not sure if I should use this in a macro. I have never written a macro in TeX before. I was hoping I would not have to write macros, but maybe I should just learn the basics? I guess there is a section on macros in the big manual. But that is sitting at home next to my computer that has the ConTeXt on it! Thanks Paul