Using eqref with multiple equations

1,042 views
Skip to first unread message

cesar....@gmail.com

unread,
Jan 22, 2015, 6:58:18 PM1/22/15
to mathja...@googlegroups.com
If I have the following equations:

\begin{align} \label{ref1}
a = b\\
c = d\\
e = f\\
g = h\\
i = j
\end{align}

all equations are automatically numbered, since I have

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  TeX: {
    equationNumbers: {autoNumber: "all"}
  }
});
</script>

How can I access the 2. or the 3. equation with \eqref{} or \ref{}?

Many thanks in advance,

--
Cesar

Davide P. Cervone

unread,
Jan 22, 2015, 7:16:40 PM1/22/15
to mathja...@googlegroups.com
Put the \label{} on the line that you want to refer to.  E.g.,

\begin{align} 
a = b\\
c = d\\
e = f\label{eq1-line3}\\
g = h\\
i = j
\end{align}

would make \ref{eq1-line3} refer to the equation number for the third line in the alignment.  Since the \label{ref1} in your example is on the first line, it refers to the equation number for the first line.

Davide



--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cesar Romani

unread,
Jan 22, 2015, 10:37:58 PM1/22/15
to mathja...@googlegroups.com, Davide P. Cervone
On 22/01/2015 07:16 p.m., Davide P. Cervone wrote:
> Put the \label{} on the line that you want to refer to. E.g.,
>
> \begin{align}
> a = b\\
> c = d\\
> e = f\label{eq1-line3}\\
> g = h\\
> i = j
> \end{align}
>
> would make \ref{eq1-line3} refer to the equation number for the third
> line in the alignment. Since the \label{ref1} in your example is on
> the first line, it refers to the equation number for the first line.
>
> Davide

Thanks. I already know what was the reason I didn't get any display when
I put labels on the equations. I was putting labels in the following
way:

\begin{align}
a = b\\
c = d\\ \label{eq1-line2}
e = f\\ \label{eq1-line3}
g = h\\
i = j
\end{align}

then I didn't get any display with it. I had to put the \\ after the
labels!

Regards,

--
Cesar

Reply all
Reply to author
Forward
0 new messages