1

I'm using the following source:

\usepackage[fleqn]{amsmath}

\begin{equation}
     \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}
\end{equation}

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:

enter image description here

What am I doing wrong?

2
  • I cannot reproduce your result. It is perfectly aligned for me. Commented Jul 13, 2013 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
    Commented Jul 13, 2013 at 7:31

2 Answers 2

5

Perhaps the alignedat environment is more suitable here.

\documentclass[11pt,fleqn]{article}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage{mathtools}  % loads »amsmath«

\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.


enter image description here

1
  • That looks beautiful, let me try that out.
    – orlp
    Commented Jul 13, 2013 at 7:39
0

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{equation}
 \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}
\end{equation}

gives me exactly what you got there.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .