Prevent a page break inside a specific paragraph

page-breaking

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!

Best Answer

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.