# Custom alignment of columns in align environment

I need to typeset two columns of equations, each row typeset with an equation number to the right as with an ordinary equation. The first column must be centered, and the second column must be left-aligned. There will be many rows, so it must automatically break at a page break as appropriate.

There are plenty of related questions, but I can't find any existing solutions that will let me do exactly what I want. (It's a real pain the align environment can't take optional column alignment specifiers.)

-
How are the equations going to be numbered? For instance, will all equations in the left-hand column be numbered independently from those in the right-hand column, or will they share the same counter? –  Mico Dec 15 '11 at 21:04
The idea is that each line would have one number, typeset to the right, like an ordinary align environment. The only difference to align is that instead of rl column alignment, I need cl column alignment. –  Jamie Vicary Dec 15 '11 at 21:15
Would it be acceptable if the first column were left-aligned or aligned at an operator? –  rdhs Dec 15 '11 at 22:06
Hi, thanks for your comment. Unfortunately the first column does need to be centre-aligned. And entries in the first column are actually going to be graphical diagrams, so there are no characters to align at. –  Jamie Vicary Dec 15 '11 at 22:14

Making align break across pages is simple: add \allowdisplaybreaks[1] to your preamble.

And since your first column is text, it's also trivial to center it within align: just wrap it in a \makebox larger than all the images (which centers its contents) and use align as normal.

\documentclass{article}
\usepackage{amsmath}

\allowdisplaybreaks[1]
\newcommand{\centerdia}[1]{\makebox[2in]{\includegraphics{#1}}}
\begin{document}
\begin{align}
\centerdia{dia1} & c=20x^2+5x-10+\frac{x^3-4x^2+500x-f(240)}{50}  \\
\centerdia{dia2} & \mu=10*\epsilon\\
\centerdia{dia3} & \mu=10*\epsilon
\end{align}
\end{document}

-

Use a modified version of align; change 2\tabcolsep into the separation you prefer.

\documentclass{article}
\usepackage{amsmath,environ}
\makeatletter
\NewEnviron{specialalign}
{\def\align@preamble{%
&\hfil
\strut@
\setboxz@h{\@lign$\m@th\displaystyle{####}$}%
\ifmeasuring@\savefieldlength@\fi
\set@field
\hfil
\tabskip2\tabcolsep
&\setboxz@h{\@lign$\m@th\displaystyle{{}####}$}%
\ifmeasuring@\savefieldlength@\fi
\set@field
\hfil
\tabskip\alignsep@
}%
\begin{align}\BODY\end{align}}
\makeatother

\begin{document}
\begin{specialalign}
x & a=b \\
yyy & c=d+e+f \\
zzzzzz & 1\ne0
\end{specialalign}
\end{document}


-
Just add \allowdisplaybreaks[1] if needed to break across pages. Nice solution! –  Werner Dec 15 '11 at 23:24
It's better to avoid \allowdisplaybreaks and add \displaybreak where really needed (before the \\ after which the break should take place). \allowdisplaybreaks is useful during document preparation. –  egreg Dec 15 '11 at 23:27