1

I have a two-line paragraph that I would like to keep on the same page:

The quick brown fox jumps over the lazy dog. He is
very happy that he can jump so high.

Sadly, the paragraph occurs at a point in the document where it is split by a page break, and this looks bad:

The quick brown fox jumps over the lazy dog. He is
----------- Page Break -------------
very happy that he can jump so high.

Is there a way to keep this text on the same page? I tried putting \begin{samepage} ... \end{samepage} around this paragraph, but it has no effect on the output, the paragraph is still split across two pages. I also tried \nopagebreak, but again no effect. Are there any other options?

And just to be clear, this paragraph is not in an environment. It's simply text in the main body of the article.

Thank you for your help!

4

1 Answer 1

2

You can use

\begin{samepage}
The quick brown fox jumps over the lazy dog. He is
very happy that he can jump so high.

\end{samepage}

Note you need the paragraph to end within the scope of the command.

2
  • Thank you, David! Yes, I was not putting enough space before \end{samepage} Dec 8, 2021 at 18:11
  • It's not the space, it's the \par that a blank line turns into. Dec 8, 2021 at 22:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .