TeXnik - Tips TeX and LaTeX

Welcome to the TeXnik website (under construction)

Widows and orphans
 Main page Index UK FAQ Documentation Software CTAN Search CTAN: Statistics Google c.t.t. Google d.c.t.t.

LaTeX puts sometimes only one ore two lines on a new page, whicht looks very ugly. There is no special comment to prevend LaTeX from doing this. Try out one of the following four solutions. Put them always in the latex preamble. Here you'll find some more information.
1. The "default" ...
\clubpenalty=10000
\widowpenalty=10000
\displaywidowpenalty=10000
2. % my \keeptogether
\def\need{\begingroup\afterassignment\n@@d \dimen@}
\def\n@@d{\vskip\z@ plus \dimen@ \penalty-60
\vskip \z@ plus-\dimen@ \endgroup}

Unfortunately, this grabs only an approximate space, and the exact amount depends on the usual "badness" of a normal break. One way to ensure getting the right space is to eliminate the badness of ordinary breaks:
3. \def\raggedbottom{\topskip 1\topskip plus1000\p@ \r@ggedbottomtrue}
\def\need#1{\vskip #1\penalty \z@ \vskip-#1}

Which works pretty well, if you don't mind raggedbottom pages.

4. Finally, there is another method that works very well, as long as you use it between paragraphs: (I.e., not in a \vadjust{}.)
\def\need#1{\par \penalty-100 \begingroup % preserve \dimen@
\fi \endgroup}
\enlargesthispage*{2ex}