# How to keep the alignment of equation array on a new page?

I have a very long equations inside

\begin{eqnarray}
long equation go over 2 pages...
\end{eqnarray}


I can't break into two by

 \begin{eqnarray}
1/n of long
\end{eqnarray}
\begin{eqnarray}
b/n of long
\end{eqnarray}


Unfortunately, the alignment is gone since the alignment of the second page is based on the first equation on the second page. I wonder is there a way to keep the same alignment for a really long equations?

-
best to avoid eqnarray altogether and use align and friends from amsmath; see eqnarray-vs-align – cmhughes Nov 29 '12 at 0:29
@cmhughes: Thanks for the tip. – Chan Nov 29 '12 at 0:31

Instead of using eqnarray, use align (or any of the other environments provided by the amsmath package). During the document preparation, using \allowdisplaybreaks[1] in the preamble, allows an individual automatic page break inside displayed equations; a simple example:

\documentclass{article}
\usepackage[paperheight=4cm]{geometry}% just for the example
\usepackage{amsmath}

\allowdisplaybreaks[1]

\begin{document}

\begin{align*}
a &= b \\
&= c \\
&= c \\
&= c \\
&= c \\
&= c \\
&= c \\
&= c
\end{align*}

\end{document}


As egreg mentions in his comment, once the document is finished, is best to suppress \allowdisplaybreaks[1] from the preamble and use \displaybreak inside the corresponding displayed equation and put it in the best place for the break (which may not be the one automatically chosen); this command is best placed immediately before the line change command where it is to take effect:

\documentclass{article}
\usepackage[paperheight=4cm]{geometry}% just for the example
\usepackage{amsmath}

\begin{document}

\begin{align*}
a &= b \\
&= c \\
&= c \\
&= c \displaybreak\\
&= c \\
&= c \\
&= c \\
&= c
\end{align*}

\end{document}


The reasons for not using eqnarray can be found in Avoid eqnarray! by Lars Madsen.

-
This is right when working on the document. In the final revision \allowdisplaybreaks should be disabled and \displaybreak put in the best place for a break, which may not be the one chosen automatically. – egreg Nov 29 '12 at 0:33
Thanks a lot, that's exactly what I'm looking for. – Chan Nov 29 '12 at 0:35
@egreg I added your comment to my answer. Thank you! – Gonzalo Medina Nov 29 '12 at 0:41
It would be nice if latex had a way to write displaybreak[30], which would change the breaking penalty. Then, you could put optional displaybreaks everywhere, and latex would choose the best one(s). – Neil G Dec 24 '12 at 6:57
Let me tell you that this site is awesome. Many of the things that I don't know how to do in LaTeX were already asked and answered by someone here in this site! :) – Vicent Jul 11 '14 at 21:21