Consider the example,
\documentclass{book}
\textheight=8in
\usepackage{xcolor}
\usepackage{pgfpages}
\pgfpagesuselayout{2 on 1}
\begin{document}
\LARGE
\thispagestyle{empty}
\begin{center}
\textbf{\textcolor{blue}{How to Prevent an Item from Splitting Across Two Pages?}}
\end{center}
\vskip 35pt
\Large
\begin{enumerate}
\setlength\itemsep{1em}
\item I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum.
\item I would rather specify no more than a few sentences from Lorem Ipsum.
\item I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum.
\item I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum.
\item I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum.
\item I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum.
\item I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum.
\item I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum.
\item I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum. I would rather specify no more than a few sentences from Lorem Ipsum.
\item Enough.
\end{enumerate}
\end{document}
which as you can see, has the sixth item splitting across two pages:
I would rather this wouldn't happen.
I thought, perhaps, that a simple solution might be adding the \raggedbottom
command somewhere after \begin{document}
, but I have not been able to get that to work.
My actual document has hundreds of items spread out over more than a couple of hundred pages and I would, if possible, like Latex (Pdflatex) to prevent items from being split across two pages. (I expect to try to deal with the increased white-space that this might cause later.)
QUESTION: Is there a simple way to modify the above code to that no page of a document will contain an item split across two pages? I have come across similar-type splitting questions on this site, but they either have no answer or, as I recall, a rather complex answer.
Is there a simple way to accomplish this?
Thank you.
Best Answer
Prevent page breaks between lines and allow the space between items to stretch