2

My question is pretty much the same as Custom pagebreak in align equation with the difference, that I want the best of \allowpagebreaks and \displaybreak. Former will produce pagebreaks rather randomly, while latter will force it wherever it is. I would like to be able to specify where a pagebreak may be done, but only if necessary. I'll call that command \allowdisplaybreak for now to illustrate my point; MNWE(=Minimal Not Working Example):

\begin{align*}
    \text{first line of formula 1} \\
    \text{second line of formula 1} \allowdisplaybreak \\
    \text{first line of formula 2} \\
    \text{second line of formula 2} \allowdisplaybreak \\
    \text{first line of formula 3} \\
    \text{second line of formula 3}
\end{align*}

If this is at the end of the page, it should either break between formula one and two or two and three, but not within the formula and not at both locations (unless that is for very weird reasons advantageous).

2 Answers 2

1

Just for the record: one dirty trick is this:

\begin{align*}
    \text{first line of formula 1} \\
    \text{second line of formula 1} \intertext{}
    \text{first line of formula 2} \\
    \text{second line of formula 2} \intertext{}
    \text{first line of formula 3} \\
    \text{second line of formula 3}
\end{align*}

But it will leave a free row after each line, which is not desired.


Desired solution Correct solution


Dirty solution Cheated solution

1

The \displaybreak command takes an optional integer argument from zero to four, where zero means "don't break here" and four (the default) forces a break. You can use, e.g., \displaybreak[1] to mark preferred breaking points. Alternatively, if you only have a few points where you'd rather not have a page break, you can use \allowdisplaybreaks together with \\*, which prevents a page break after the current line.

You must log in to answer this question.

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