TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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
up vote 6 down vote accepted

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.

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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