Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to label in eqnarray environment in LaTeX?

4,519 views
Skip to first unread message

Ali Sadigh

unread,
Apr 1, 1993, 3:54:44 PM4/1/93
to

Hello all,

I am having difficulty making LaTeX generate correct numbers for my
equations. My problem is equivalent to the example shown at the
bottom of page 49 of "LaTeX User's Guide & Reference Manual" by
Leslie Lamport. Suppose I want to refer to equation (3) later in the text.
I understand that I should use \label{whatever} in the eqnarray environment
and refer to it by \ref{whatever}. But LaTeX does not understand which one
of the two equations I am refering to and generates ??. A similar situation
happens in an eqnarray environment when I am trying to break a long long
equation into lines and use \nonumber for all the lines except the last one,
in oreder to assign a number to the mess I generated. Then I would say
\label and \ref and latex would generate a correct equation number in front
of the equation but when I refer to it, it gives that number plus 1!
I have a feeling that I am missing something simple. Can somebody shed
some light on this matter. Thank you all.
Ali

Sunando Sen

unread,
Apr 8, 1993, 2:15:12 AM4/8/93
to

Since you are getting the equation number incremented by 1 when you refer to
it, I think you are probably putting the \label command *after* the "\\" on
each line. This effectively attaches the label to the next line, i.e., the
next equation. Instead of this:

\begin{eqnarray}
x & = & 17y \\ \label{eq:one}
y & > & a + b + c + d + e + f + g + h + i + j + \nonumber \\
& & k + l + m + n + o + p \\ \label{eq:two}
z & = & 11y \label{eq:three}
\end{eqnarray}

Try this:

\begin{eqnarray}
x & = & 17y \label{eq:one} \\
y & > & a + b + c + d + e + f + g + h + i + j + \nonumber \\
& & k + l + m + n + o + p \label{eq:two} \\
z & = & 11y \label{eq:three}
\end{eqnarray}

I Hope this answers your question.

Sunando Sen
se...@fasecon.econ.nyu.edu

0 new messages