# How to reference equations using letters and numbers

Sometimes it is convenient to refer to a group of equations by a letter and a number. For example:

2+1   (A1)
2+4   (A2)
x^4   (B3)
x^e   (B4)


Placing \tag{A\theequation}\label{eqn:thisone}\stepcounter{equation}} instead of just \label{eqn:thisone} works, but seems hacky (especially manually stepping the counter).

Is there a better way?

The subequations environment provided by the amsmath package trivially allows you to get equations grouped by number and differentiated by letter. For example,

\begin{subequations}
\begin{align}
2+1 & \\
2+4 &
\end{align}
\end{subequations}
\begin{subequations}
\begin{align}
x^4 & \\
x^e &
\end{align}
\end{subequations}


will give the output

2+1   (1a)
2+4   (1b)

x^4   (2a)
x^e   (2b)


By redefining how the equation and subequation counters are displayed, you should also be able to switch the primary labeling to Alpha and the secondary to arabic if you specifically want (A1) and (A2) instead of (1a) and (1b).