Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 ?

share|improve this question
2  
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
add comment

3 Answers 3

up vote 4 down vote accepted

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.

share|improve this answer
add comment

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

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools}   % loads »amsmath«

\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}
share|improve this answer
add comment

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}

enter image description here

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".

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.