Pagebreaks in an aligned environment.

David Carlisle d.p.carlisle at gmail.com
Sat Jan 4 02:03:04 CET 2025


On Fri, 3 Jan 2025 at 05:07, Rolf Turner <rolfturner at posteo.net> wrote:

>
>   In order to get the break
> to come after the third displayed equation, I have to put the
> \displaybreak command after the *second* equation.  This makes no sense
> to me.
>
> Can anyone explain to me what I am missing?  Or do I just have to say
> "Them's the breaks"? 🙂️
>

your  test file uses \pagebreak (which does not cause a break at all here)
not \displaybreak


Your described result presumably means you had

\documentclass{article}
\usepackage{amsmath}
\allowdisplaybreaks
\begin{document}
\begin{align*}
x &= 1 \\
y &= 2 \\
 \displaybreak z &= 3 \\
a &= 4 \\
b &= 5 \\
c &= 6 \\
\end{align*}
\end{document}


\displaybreak sets the penalty at the next \\ to force a page break if that
is possible (and warns if not.)

This is similar to the behaviour of \pagebreak outside math, where if used
in horizontal mode it causes a page break after the current line. This
forces a page break after bbb not after aaa

\documentclass{article}

\begin{document}
aaa\\ \pagebreak
bbb\\
ccc
\end{document}



David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texhax/attachments/20250104/99488099/attachment.htm>


More information about the texhax mailing list.