LaTeX forum ⇒ Math & ScienceReferences to Equations work only partially

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
21did21
Posts: 58
Joined: Thu Sep 08, 2011 12:27 pm

References to Equations work only partially

Postby 21did21 » Mon Feb 27, 2012 5:02 pm

Hello world !

i don't understand one thing :

i use the environnement \begin{equation} with a \label{eq9}
in my text i put this command ( \eqref{eq9} ) to cite this equation.

=> It works nice but for some equations in my document it doesn't works !

could you explain the reasons that could cause it does not work

thanks
Last edited by 21did21 on Fri Mar 02, 2012 1:16 am, edited 1 time in total.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7809
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Feb 27, 2012 5:06 pm

Hi,

possible reasons are not matching label names.
Perhaps just show a Infominimal working example, where \eqref doesn't work for you.

We had a similar question here: Problem with Equation Reference, but also there was not sufficient information given by the questioner. You know, just it doesn't work. In that case the questioner probably forgot to load amsmath, wich provides \eqref.

Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

21did21
Posts: 58
Joined: Thu Sep 08, 2011 12:27 pm

Postby 21did21 » Mon Feb 27, 2012 5:33 pm

OK sorry.

this is my code :

  1. \documentclass[final,5p,times,twocolumn]{elsarticle}
  2. \usepackage{graphics}
  3. \usepackage{graphicx}
  4. \usepackage{amsmath}
  5. \usepackage{amssymb}
  6. \usepackage{lineno}
  7. \usepackage{color}
  8. \usepackage{multirow}
  9. \usepackage{multicol}
  10. \usepackage{cuted}
  11. \journal{gggggggg}
  12. \begin{document}
  13. \begin{frontmatter}
  14. \title{\huge{dfsqcsdcsdvds}}
  15. \author[labelAAA]{azert qwerty}
  16. \address[labelAAA]{pmoi pmoi}
  17.  
  18. \begin{abstract}
  19. bbbbbbbbbbbbbbbbbbbbbbbbbb
  20. \end{abstract}
  21.  
  22. \begin{keyword}
  23. ddd \sep ffff
  24. \PACS XXXXXXXXXXXXXXXXXX \sep xxxxxxxxxx
  25.  
  26. \end{keyword}
  27. \end{frontmatter}
  28.  
  29. \section{Introduction}
  30. \label{intro.sec}
  31.  
  32. blablabla \eqref{eq1} \eqref{eq12}
  33.  
  34. \begin{equation}
  35. a=\frac{789\pi}{\lambda}sin\left(\frac{\theta}{45684}\right)
  36. \label{eq1}
  37. \end{equation}
  38.  
  39. edfvefvdzvedvrever
  40. vfev
  41. re
  42. ver
  43. v
  44. re
  45.  
  46. \begin{equation}
  47. AAAA_oppo(x)=opmlk\mu iop
  48. \label{eq12}
  49. \end{equation}


...

when i compil this \eqref{eq1} works but \eqref{eq12} no :cry:

=> it seems that when i have to number eq10 eq11 eq12 eq13 ....
it don't works

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7809
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Feb 27, 2012 5:59 pm

This code works for me, \eqref{eq12} works fine. Could you post your .log file here, as attachment, for this test code?

Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

21did21
Posts: 58
Joined: Thu Sep 08, 2011 12:27 pm

Postby 21did21 » Tue Feb 28, 2012 2:30 pm

hello!

now this example works, i just have to compil 2 times.

=> but my real .tex doesn't work even if i compil 5 times :oops:

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7809
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue Feb 28, 2012 3:05 pm

21did21 wrote:now this example works, i just have to compil 2 times.

Yes, a newly created (or updated) document may require two times compilations: int he first, the labels are written to the .aux file (yet references are unknown), in the second run LaTeX is able now to see the labels in the .aux file and can print the references.

21did21 wrote:=> but my real .tex doesn't work even if i compil 5 times :oops:


You could always make a copy and hack it down step by step, in each step compile 2 times and check. Either
  • the error goes away, so you have located the problem to exactly the code piece you removed in the step - fix that piece or show it
  • or the error remains, you end with a small example which shows the error and which you can post.

While hacking down always is a good way, building a new "similar" example is no guarantee that the error can be recreated, as you have noticed.

Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

21did21
Posts: 58
Joined: Thu Sep 08, 2011 12:27 pm

Postby 21did21 » Wed Feb 29, 2012 8:13 pm

thanks stefan for your help !

now it works (but i don't now why :P )

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Math & Science”

Who is online

Users browsing this forum: Exabot [Bot] and 6 guests