LaTeX forum ⇒ Math & ScienceCross referencing to eqnarray

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Cross referencing to eqnarray

Postby yotama9 » Wed Dec 16, 2009 7:26 pm

Hi.

Is there a way to cross reference to eqnarray as a normal equation? In mt thesis it is numbered as one of the equation but when I cross refer to it I get a warning.

I should note that I'm using cleverref.

Thanks.

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Postby php1ic » Wed Dec 16, 2009 8:15 pm

Do you want to reference the entire array, or just one equation in it? If you want to reference the entire array you need to use the subequations package

  1. \documentclass{article}
  2. \usepackage{amsmath}
  3.  
  4. \begin{document}
  5. \begin{subequations}\label{sub:1}
  6. \begin{align}
  7. a+b&=c\label{sub:2}\\
  8. d+e&=f\label{sub:3}
  9. \end{align}
  10. \end{subequations}
  11.  
  12. \ref{sub:1} -- \ref{sub:2} -- \ref{sub:3}
  13.  
  14. \end{document}


P.S. You should use the align environment rather than eqnarray as it has more consistent spacings.

yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Postby yotama9 » Wed Dec 16, 2009 9:46 pm

I'm confused.

Intuitively I will say your are referring to each equation by it's own.

User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Postby Juanjo » Wed Dec 16, 2009 11:47 pm

In page 18 of the manual of cleveref, one finds the following warning:
cleveref will not work properly with the standard LaTeX eqnarray en-
vironment. There is no intention to x this. The eqnarray environment
is poorly implemented, making it dicult to get it to work properly with
cleveref. You're better o using the amsmath replacements in any case,
such as gather, align, multline and split, which do work properly with
cleveref. (See http://www.tug.org/pracjourn/2006-4/madsen/)

You should avoid the eqnarray environment.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Postby php1ic » Thu Dec 17, 2009 1:42 pm

Hi yotama9,

I am now also slightly confused. Do you understand what I posted? Does it do what you want? I wasn't exactly sure what you wanted from reading your first post so guessed a little bit.

Perhaps an example that shows the problem may help.

yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Postby yotama9 » Tue Jan 12, 2010 5:10 pm

Hi.

I just stopped using eqnarray. I don't remember what I did instead.

Yotam

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Tue Jan 12, 2010 10:40 pm

yotama9 wrote:[...] I just stopped using eqnarray. I don't remember what I did instead. [...]

And now you are trying to tell us that you are not able to reconstruct the situation by looking at the concerned source code. Or what is this all about? Once more very confusing.


Best regards
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Postby yotama9 » Wed Jan 13, 2010 9:10 am

I just don't want to leave the tree open.

I am thankful for the help and I want that in the future, if somebody search the thread for a similar problem he will know if the solution was helpful or not.


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 1 guest