|
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.
- The "default" ...
\clubpenalty=10000
\widowpenalty=10000
\displaywidowpenalty=10000
% 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:
\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.
- 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@
\dimen@\pagegoal \advance\dimen@-\pagetotal % space left
\ifdim #1>\dimen@ % not enough space left
\ifdim\dimen@>\z@ \vfil\fi % only do \vfil if some space left on page
\eject
\fi \endgroup}
Alternative you can try on the page where the line should be:
\enlargesthispage*{2ex}
play a bit with the size 2ex (2 lines).
|