[Tex/LaTex] AMS align / Align multiple “=”, too much space

alignamsmath

I asked this question at stackoverflow and have been kindly redirected here.

I'd like to align some equations in Latex using the AMS packages. Each equation has two equal signs that need to be aligned. So something in the line of

A = B = C
D = E = F

I've tried using the align-environment like this

\begin{align}
A &= B &= C \\
D &= E &= F
\end{align}

This works in principle (it aligns), however it adds ridiculously large spaces before the second equal sign in each line.
But I just want the line to runs as if there was no additional alignment tab. Only when I replace for example "B" by "BBB" I want the equal sign before "F" to shift to right the exact amount of space.

Could anyone help me out on that one? It's kind of driving me crazy since I don't get the idea of that strange behavior and I just can't find any solution. Maybe alignat could help, but I don't really get how that environment works.

Cheers,
Oliver

Best Answer

The ampersand & does not only mark alignment positions, it further separates columns. So, with alignat, your example could look like:

\begin{alignat}{2}
A &= B & &= C \\
D &= E & &= F
\end{alignat}

The agument to alignat stands for the number of columns.

Related Question