# Alignment not what I would expect

I'm using the following source:

\usepackage[fleqn]{amsmath}

\begin{aligned} \notag &t_m & = & \alpha_1(m_1) & \oplus & \alpha_2(m_2) & \oplus & \cdots & \oplus & \alpha_{m-1}(m_{m-1}) & \oplus & \alpha_{m}(0) \oplus \gamma_{m-1}(0) \oplus m_m0^* \\ &t_a & = & \alpha_1(a_1) & \oplus & \alpha_2(a_2) & \oplus & \cdots & \oplus & \alpha_{a-1}(a_{a-1}) & \oplus & \alpha_{a}(a_a0^*) \end{aligned}


I would expect to get a nicely aligned formula with proper spacing between the elements, with the first line extending further than the second. Instead I get this:

What am I doing wrong?

• I cannot reproduce your result. It is perfectly aligned for me. – karlkoeller Jul 13 '13 at 7:28
• @karlkoeller: I am not using this tool for my paper, but just for demonstration the problem also appears (not as badly though) using writelatex: writelatex.com/268839jtnqlb . Sometimes there's excessive spacing - sometimes none at all. – orlp Jul 13 '13 at 7:31

Perhaps the alignedat environment is more suitable here.

\documentclass[11pt,fleqn]{article}
\usepackage[T1]{fontenc}
\usepackage{geometry}

\begin{document}
\begin{equation*}
\begin{alignedat}{5}
t_m &= \alpha_1(m_1) &&\oplus\alpha_2(m_2) &&\oplus\cdots\oplus\alpha_{m-1}(m_{m-1}) &&\oplus\alpha_{m}(0) &&\oplus \gamma_{m-1}(0) \oplus m_m0^* \\
t_a &= \alpha_1(a_1) &&\oplus\alpha_2(a_2) &&\oplus\cdots\oplus\alpha_{a-1}(a_{a-1}) &&\oplus\alpha_{a}(a_a0^*)
\end{alignedat}
\end{equation*}
\end{document}


For a comprehensive explanation have a look at the »Math mode« document.

• That looks beautiful, let me try that out. – orlp Jul 13 '13 at 7:39

Your code works perfectly fine for me. However, I suspect that a missing ampersand pair caused your problem. For instance, the code (notice the missing ampersands between \oplus and \alpha_2(m_2)):

\begin{aligned} \notag &t_m &= &\alpha_1(m_1) & \oplus \alpha_2(m_2) & \oplus & \cdots & \oplus & \alpha_{m-1}(m_{m-1}) & \oplus & \alpha_{m}(0) \oplus \gamma_{m-1}(0) \oplus m_m0^* \\ &t_a &= &\alpha_1(a_1) & \oplus \alpha_2(a_2) & \oplus & \cdots & \oplus & \alpha_{a-1}(a_{a-1}) & \oplus & \alpha_{a}(a_a0^*) \end{aligned}


gives me exactly what you got there.