0

I am trying to add this to latex, but can't find how to do it. I tried using

    \begin {align*}
        x+1 &=  y   &=  x   \\
        x   &=  y+1 &=  x   \\
    \end {align*}

but it doesn't work.. Also the {equation} only works for 2 sides Any ideas? enter image description here

1
  • How do you mean " the {equation} only works for 2 sides Any ideas?" ?
    – Au101
    Feb 11 '18 at 4:03
3

It seems you're looking for alignat.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{5}
       && x+1 &=  y   &&=  x   \\
       && x   &=  y+1 &&=  x   \\
\end{alignat*}
\end{document}

enter image description here

4
  • My thoughts exactly =) The only downside is the poor spacing around the second = signs, y + 1= x is very bad with that spacing between the 1 and the =, do you know how that can be fixed, possibly a nice &{}=?
    – Au101
    Feb 11 '18 at 4:07
  • @Au101 You're right, it was not pretty. Now it's slightly better, I hope.
    – user121799
    Feb 11 '18 at 4:13
  • Yes that's much better! I'd give you another +1 if I had another to give :P I was also wondering about && but I didn't have enough confidence never actually having used alignat myself. I was about to start experimenting, but you already answered, so I thought a comment would be better =)
    – Au101
    Feb 11 '18 at 4:17
  • @Au101 I also try to avoid this as much as possible. Especially if the equation reads x+1=...=x ;-)
    – user121799
    Feb 11 '18 at 4:19

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.