TeXblog

 Typography with TeX and LaTeX

Prevent page breaks

11 June 2008 by Stefan Kottwitz

A page break directly after a first item of a itemize oder enumerate environment or other lists may be annoying. How to prevent that? A common way to prevent a page break is to use a minipage (or samepage) environment, but you cannot use that for just a part of the list.
The needspace package allows to define how much vertical space is needed. If there is enough space it continues normally, but if the space left on the page is less than requested a page break is inserted. The documentation of needspace is inside the sty-file itself. Her is an example:

\usepackage{needspace}
...
\needspace{5\baselineskip}
Remarks:
  \begin{itemize}
    \item ...
...

Then immediately after Remarks: no pagebreak could happen.

This topic was discussed in the LaTeX Community Forum, on Matheplanet and on mrunix.de.

This entry was posted on 11 June 2008 at 4:25 PM and is filed under Layout. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply