# 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).

-
tex.ac.uk/tex-archive/info/math/voss/mathmode/Mathmode.pdf has some explanations at page 33. – qbi Jul 28 '10 at 18:02
You mean section 33, page 60. Very useful document there. Thanks. – Willie Wong Jul 28 '10 at 18:31
Subequations are probably what most other people people will want. In my case I wanted to keep the same counter for all the equations. Your answer lead me to find the command \renewcommand{\theequation}{A\arabic{equation}} which does what I need. – Niall Murphy Jul 29 '10 at 19:22