Showing posts with label page breaks. Show all posts
Showing posts with label page breaks. Show all posts

Tuesday, September 25, 2007

Supressing page breaks in LaTeX

I wanted to keep together a paragraph and following quote on a document written in LaTeX. However, the \nopagebreak command does not work properly in this case. Indeed, \nopagebreak does not suppress the page breaks that are deliberately inserted around environments like {quote}. The solution was enclosing the text I want to keep in the same page within {samepage} environment. Something like this:

\begin{samepage}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit:
\begin{quote}
Quisque leo.
\end{quote}
\end{samepage}