# Where is this whitespace coming from in align*?

I am trying to align 2 simple equations using the align* environment:

\begin{align*}
\phi(\gedge{\tilde{v}_{i_1}}{\tilde{u}_i}) & = \phi(\gedge{\tilde{v}_{i_2}}{\tilde{u}_i}) & = \gedge{v}{u} \\
\phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_1}}) & = \phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_2}}) & = \gedge{u}{v} & \qquad\mathrm{(z\,wl.\,2)}\\
\end{align*}


unfortunately the result I am getting is horrible:

Why is there so much horizontal space before the second = sign?!?

Do not worry about \gedge, it is just an arrow:

% graph edge
\newcommand{\gedge}[2]{%
#1 \to #2%
}%

-
With align, you need only one &. If you want to use multiple alignment spots, you can use the alignat environment. –  dustin Jul 9 '13 at 21:46
related, if not exactly the same: Why does aligning equations not work here? –  barbara beeton Jul 9 '13 at 21:49

So you have two options,

1. Using align

\begin{align*}
\phi(\gedge{\tilde{v}_{i_1}}{\tilde{u}_i}) & = \phi(\gedge{\tilde{v}_{i_2}}{\tilde{u}_i}) = \gedge{v}{u} \\
\phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_1}}) & = \phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_2}}) = \gedge{u}{v}  \qquad\mathrm{(z\,wl.\,2)}\\
\end{align*}

2. Using alignat

\begin{alignat*}{4}
\phi(\gedge{\tilde{v}_{i_1}}{\tilde{u}_i}) & = \phi(\gedge{\tilde{v}_{i_2}}{\tilde{u}_i}) && = \gedge{v}{u} \\
\phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_1}}) & = \phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_2}}) && = \gedge{u}{v} & \qquad\mathrm{(z\,wl.\,2)}\\
\end{alignat*}


-
The alignat solution should really use a double && to get the correct spacing. See for instance: Why does aligning equations not work here? –  Peter Grill Jul 9 '13 at 22:05
@PeterGrill or couldnt {} be placed too? –  dustin Jul 9 '13 at 22:13
For this specific case a {} would suffice, but not a general solution as it would still be r aligned, and an l aligned is probably what is desired in this case. See question I linked to. –  Peter Grill Jul 9 '13 at 22:54
@PeterGrill Heiko Oberdiek added in && already. –  dustin Jul 9 '13 at 23:10