# eqnarray with subnumber

When I use eqnarray

\begin{eqnarray}

eq\\
eq\\
eq\\

\end{eqnarray}


this show me

eq (1)
eq (2)
eq (3)


In some papers I see this output

eq (1a)
eq (1b)
eq (1c)


how I can make this way ?

-
Duplicates: How can I use alignedat in subequations?, although it works the same with align and friends; using subequations. Also, rather use amsmath's align environment instead of eqnarray. See \eqnarray vs \align. – Werner Jan 11 '12 at 20:12

amsmath has an environment subequations that will do what you want:

\begin{subequations}
\begin{eqnarray}
eq \\
eq \\
eq
\end{eqnarray}
\end{subequations}


some observations:

• you don't want blank lines withn the scope of display math; they will result in error messages.
• you don't want \\ at the end of the last line, or you'll end up with too much space below the display.
• it would really be better to use one of the multi-line display structures provided by amsmath rather than eqnarray (see this article for the reasons why).

to find out what structures are provided by amsmath, if you have a tex live installation, type texdoc amsmath at a command line prompt.

-

Avoid eqnarray! Use the align environment inside the subequations environment from the amsmath package.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}

\begin{document}
\begin{subequations}
\begin{align}
(a+b)^2 &= a^2+2ab+b^2 \\
(a-b)^2 &= a^2-2ab+b^2  \\
(a+b)(a-b) &= a^2-b^2
\end{align}
\end{subequations}
\end{document}

-

The second look (with a, b, c ... appended to the "main" equation number) can be achieved with the subequations environment of the amsmath package. The following MWE (minimum working example) demonstrates the basic usage of this package:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{subequations}
\begin{align}
a &= b\\
c &= d\\
e &= f
\end{align}
\end{subequations}
\end{document}


Finally: Don't use the eqnarray environment -- use the align environment instead. The eqnarray environment has several severe shortcomings; for a justification of this assertion see, for instance, "\eqnarray vs \align".

-