This is my current method of allowing page breaks between my aligned equations

left &= right1 \\
     &= right2.

It works, but it doesn't behave like I want it to.

Suppose the above example breaks between pages. The first line (on the first page) will come out correctly, because it centers based on the whole of "left = right1".

However, I want the second line (on the second page) to be centered with respect to only "= right2". (By default, it is centered taking the "left =" on the previous page into account, which doesn't look natural - the line appears to be more to the right than it should be.)

How can I accomplish this?

  • 5
    It would be very hard to do that in TeX, for the same reason it is very hard to have a different paragraph shape at the top of the the page. Math alignments and paragraph alignment happen first and then only later the output routine chops off pages at allowed break points. TeX never goes back and re-adjusts the horizontal material at that point. – David Carlisle Aug 5 '12 at 9:40

Of course, David is right. Page breaking is done at a later time, when the decisions about the math alignments and paragraph building are already done.

The following example might provide a solution for the simplified example in the question. It contains two equations with two choices. Either the equations are on the same page or they are separated on two pages. This information provides a reference system. I am using module abspage of package zref, because the page numbers should then always be unique and they are numbers, \thepage might be something else.

But the labels cannot be set right away. Package amsmath sets his equations twice. In the first run it measures it and sets them in the second run with a correct placement of the equation number. Therefore we need to set the labels in the second run.

If we know the page numbers of the equations, we can set them differently.



\setlength{\textheight}{2.5\baselineskip}% for testing



    \text{left} &= \text{right1}\\
    &= \text{right2}
    \text{left} = \text{right1}\\
    = \text{right2}


However the drawback is that the equations are written twice in the source code. This does not scale well. Each added equation doubles the choices. The equation can be on the same page as the previous equation or on a new page. Thus n equations require (n-1)2 choices.

At least it could be reduced to (n - 1) choices, if the cases are neglected, where the whole equation system spans more than two pages.

  • In practice, I guess I'm just going to have to break things up manually in the end, by doing the align first and then switching to a regular equation on the next page. Agreed? Seems like somewhat of a bummer. One would think that LaTeX allowed some kind of "going back" by means of auxiliary files, i.e. running the compiler more than once, in order to automate this process. – MayGodBlessKnuth Aug 7 '12 at 2:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.