General ⇒ Keep lines together in \verse
Keep lines together in \verse
\begin{verse}\itshape
Line 1\\
Line 2.
Line 3\\
Line4.
Line 5\\
Line 6.
\end{verse}
The question is: how to prevent breaks at the end of page after Line 1, 3 or 5? Is there a command "keep lines together", "keep with next" or something similar?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Keep lines together in \verse
Code: Select all
\begin{minipage}{\textwidth}
\begin{verse}
…
\end{verse}
\end{minipage}
Best regards
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Keep lines together in \verse
B.A.
Re: Keep lines together in \verse
No, \nopagebreak doesn't work at this.
\enlargethispage works but I don't like using it, really. If I reorganize text, add something or change the font and \verse is moved, this added line still remains when not needed.
Is it possible that there is no command that keeps lines together?
Re: Keep lines together in \verse
Re: Keep lines together in \verse
\widowpenalty=10000
\clubpenalty=10000
\raggedbottom
in your preamble; it suppresses widows and orphans.
B.A.
Re: Keep lines together in \verse


By the way, I do use \widowpenalty10000 and \clubpenalty10000, but it doesn't work in this case. For other cases it works just fine.