\begin{document}

\section{Prime equation numbers}

First an equation.
\begin{equation}\label{e:previous}
A=B
\end{equation}
That was equation \eqref{e:previous}.

Then the same, with a prime on the number.\checkref
\begin{equation}
\tag{\ref{e:previous}$'$}\label{e:prevprime}
C=D
\end{equation}
And that was equation \eqref{e:prevprime}.

Notice, by the way, that when a \verb"\ref" occurs inside a \verb"\tag",
and that \verb"\tag" is then \verb"\label"'d, a \verb"\ref" for the
second \verb"\label" requires \emph{three} runs of \LaTeX{} in order to
get the proper value. (If you run through the logic of \LaTeX{}'s
cross-referencing mechanisms as they apply in this case, you will see
that this is necessary.)

\section{Subnumbered equations}

Here is a,b,c sub-numbering.
\begin{subequations}
\begin{eqnarray}
A&=&B\\
D&=&C \label{e:middle}\\
E&=&F
\end{eqnarray}
\end{subequations}
That was produced with the \env{eqnarray} environment; the middle line
was labeled as \eqref{e:middle}.

An equation following the end of the \verb"subequations" environment
should revert to normal numbering:
\begin{equation}\label{e:check}
H<K
\end{equation}
A check on the labeling: that was equation~\eqref{e:check}.

The sub-numbered equations can be spread out through the text, like
this:
\begin{subequations}
\begin{equation}
A=B
\end{equation}
The \verb"subequations" environment can span arbitrary text between
subsidiary equations. The only restriction is that if there are any
numbered equations inside the \verb"subequations" environment that break
out of the subequation numbering sequence, they would have to be handled
specially.
\begin{equation}
D=C \label{e:newmiddle}
\end{equation}
More arbitrary text.
\begin{equation}
E=F
\end{equation}
\end{subequations}
Label check: the middle one was \eqref{e:newmiddle}

A final equation for a numbering check.
\begin{equation}\label{e:final}
G=H
\end{equation}
That equation was labeled as \eqref{e:final}.

\section{Tests of \env{align}, \env{gather}, and other
AMS-\protect\LaTeX{} environments}

The \env{align} environment:
\begin{subequations}
\begin{align}
\label{align:a}A+B&=B+A\\
\label{align:b}C&=D+E\\
\label{align:c}E&=F
\end{align}
\end{subequations}
Label check: that was \eqref{align:a}, \eqref{align:b}, and
\eqref{align:c}.

The \env{align} environment again:
\begin{subequations}
\begin{align}
\label{xalign:a}A+B&=B&     B&=B+A\\
\label{xalign:b}C&=D+E&     C\oplus D&=E\\
\label{xalign:c}E&=F&       E'&=F'
\end{align}
\end{subequations}
Label check: that was \eqref{xalign:a}, \eqref{xalign:b}, and
\eqref{xalign:c}.

The \env{gather} environment. For the third line we refer to one of the
numbers in the first \env{align} structure.
\begin{subequations}
\begin{gather}
\label{gather:a}A+B=B\\
\label{gather:b}C=D+E\\
\tag{\ref{align:c}$'$}\label{gather:c}E=F
\end{gather}
\end{subequations}
Label check: that was \eqref{gather:a},
\eqref{gather:b}, and
\eqref{gather:c}.

The next \env{subequations} environment encompasses two separate
equations. A \env{split} environment:
\begin{subequations}
\begin{equation}
\label{split:x}
\begin{split}
A&=B+C+F\\
&=G
\end{split}
\end{equation}
and a \env{multline} environment:
\begin{multline}\label{multline:x}
A[B]C[D]E[F]G[[H[I]J[K]L[M]N]]=\\
H[I]J[K]L[M]N[O]P[Q]R[S]T[U]V[W]X[Y]Z
\end{multline}
\end{subequations}
Label check: That was \eqref{split:x} and \eqref{multline:x}.

\end{document}