1

I am trying to align equations within an align environment. Below is a MWE

\documentclass{report}
\usepackage{amsmath}

\begin{document}


\begin{subequations}
  \begin{align}
    3 & : & A = X \\
    2 & : & A = Y \\
    2 & : & A = XY
  \end{align}
\end{subequations}

\end{document}

In this example, the 'A's are out of alignment because (I assume) the columns are right justified. I'd really like to use aligned commands, something along the lines of

\documentclass{report}
\usepackage{amsmath}

\begin{document}

\begin{subequations}
  \begin{align}{rcl}
    3 & : & A = X \\
    2 & : & A = Y \\
    1 & : & A = XY
  \end{align}
\end{subequations}

\end{document}

Sorry for my simple example, tried to make MWE as small as possible.

1
2

What you obtain is normal: when you have several alignment points, all alignment columns, but the first, have to be introduced by an ampersand, and inside this column, the alignment point is specified by a second ampersand, so that two alignment points require 3 ampersands. If the last one is missing, it is implicitly added at the end of each row, so that the second column is right aligned.

The correct code is this:

      \begin{align}
    3 & : & &A = X \\
    2 & : & &A = Y \\
    2 & : & &A = XY
  \end{align}

or maybe, if you want to ensure the = are aligned, use 3 & : & A & = X, &c.

1
  • 1
    That solved the problem perfectly. Thank you for the fast response! – llopes Nov 7 '19 at 21:02

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.