Is there a way to stop pagebreaks inside paragraphs in a document with \obeylines? I have found this question: How to avoid page-breaks inside paragraphs?, but none of the solutions suggested there seem to work with \obeylines. An alternative for \obeylines would also help, but I need a global command, not \\ after every line of text. (I am making a songbook where every line has a hard linebreak, so \\ would be very impractical)
Here is an example of what I tried:
\documentclass[a6paper]{article}
\usepackage[margin=100pt]{geometry}
%\usepackage[defaultlines=100]{nowidow}
\widowpenalties 1 10000
\raggedbottom
%\clubpenalties 1 10000
%\interlinepenalty 10000
\begin{document}
\obeylines
TITLE
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
~\par
bar
bar
bar
bar
bar
bar
bar
bar
\end{document}
As is, the bars are split between the two pages of the document. When I tried substituting \obeylines with a \\ on every line, the \widowpenalties command worked, but with \obeylines it doesn't.

undefined control sequenceerror on AddToHook, not really sure why; you mentioned it is a new thing? – aky-her Sep 02 '22 at 11:48