I'm using the following source:


        &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^*)

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?

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

\usepackage{mathtools}  % loads »amsmath«

        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^*)

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

enter image description here

  • 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)):

    &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^*)

gives me exactly what you got there.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.