# problem with cross reference an equation using cleveref

I want to refer to an equation through my document, so I thought it is beter to use cleveref package, the problem is when I refer to an equation it refer to the section where the equation is.

I work on my thesis so it would be very helpful to use cleveref instead of the regular \ref command.

here, a small example.



this is the output

Replay

You have discovered one of the many reasons eqnarray should be avoided.

1. Never use eqnarray (see eqnarray vs align)
2. Never use $$ (see Why is $...$ preferable to$$ ... ?)
3. Never have two consecutive displays
4. For single equations, use equation

In order to comply with 2 and 3 in your case, use gather.

\documentclass[a4paper, 14pt]{extreport}
\usepackage{color, xcolor}
\usepackage{amsmath}
\usepackage{varioref}
\usepackage{hyperref}
\hypersetup{
citecolor=red,
urlcolor=magenta,
}
\usepackage{cleveref}
\crefname{equation}{equation}{equations}

\newcommand{\p}{\partial}

\begin{document}

\chapter{Mathematical Modelling}\label{ch:math}

\section{Reynolds equation}\label{sec:Reynolds}

The well known Reynolds equation in dimensional form is given below:
$$\label{eq:rey_car} \frac{\p}{\p x}\left(h^3 \frac{\p p}{\p x}\right) + \frac{\p}{\p y}\left(h^3 \frac{\p p}{\p y}\right) = 6\mu U \frac{\p h}{\p x} +12 \mu \frac{\p h}{\p t}$$
transform~\cref{eq:rey_car} to polar coordinate by using the following relations:
\begin{gather}
\theta = x R, \quad z = \frac{L}{2} y \nonumber \\
\frac{\p}{\p \theta}\left(h^3 \frac{\p p}{\p \theta}\right) +
\left(\frac{D}{L}\right)^2 \frac{\p}{\p z} \left(h^3 \frac{\p p}{\p z}\right) =
6 \mu U R \frac{\p h}{\p \theta} + 12 \mu R \frac{\p h}{\p t}
\label{eq:rey_polar}
\end{gather}
Now, to get the dimensionless form of \vref{eq:rey_polar}
\end{document}



Category: equations Time: 2016-07-30 Views: 0

## Related post

• Problem with cross references in table and algorithm 2015-11-28

I am having a problem with cross references, which I have not been able to solve. I have a table and an algorithm which cannot be referenced. However, the behaviour in both cases is different: when I try to reference the table, LaTex produces ??, whe

• Problem with cross reference and threeparttable - Lyx 2015-06-26

I'm having an issue with cross reference using Lyx. I'm using threeparttable with cross reference inside a float. Although the table number is 1, the compiled file shows me "Table 2" when I cross reference it. I read the following thread Combini

• Problem with cross referencing using gather environment 2013-03-11

I am using gather environment to write bunch of equations. When I try to cross-reference those equations, the equation number doesn't show up. Here is my code \documentclass[12 pt]{article} \usepackage{fullpage} \usepackage{amsmath} \usepackage{amssy

• Combining threeparttable with cross references - LyX 2013-07-29

I was wondering if there was a known issue with combining threeparttable with cross references inside a float. I have my labels inside the table captions, and this works just fine unless threeparttable is called, in which case the references are ?? o

• algorithm2e + cleveref: problem with wrong reference to line numbers 2013-03-18

For some reason I do not understand, cleverefproduces wrong references to line numbers of listings produces with the algorithm2e package. I hope that I did not miss a simple solution ... My example is the following: \documentclass[paper=A4, fontsize=

• Help with cross-referencing an equation 2014-03-27

I am trying to learn how to use the \eqref commands instead of just doing tag{1.1}, so I don't have to go back and renumber. I'm having trouble: in problem 3b, I say Now \eq{y(t, \epsilon)= y_0(t) + \epsilon y_1(t) + O(\epsilon^2), \label{eq:aa}} (\e

• Cross reference the equation: number are not consistent 2014-04-01

I have a very weird problem in Latex. I have an equation: $$\label{eq:eq1}$$ This equation has the number (1) at the end of it. This is correct and what I want. However, when I cross reference it later in the document, usi

• Make Cross References Easier to Use in Word 2011-11-25

Is there an add-in for Word (2007+ ) that makes inserting of cross references to headings (table of content items) or figures actually usable? I'm looking ideally for something I know from my Latex editor, when I want to reference something I'm offer

• Problem with un-clear error messages (using LaTeXmk[fls file] and XeLaTeX[bad file descriptor]) 2013-04-16

More or less out of the blue, I've gotten the following: xelatex: Bad file descriptor Latexmk: fls file doesn't appear to have been made I've no clue about the first and the second is confusing in that the appropriate .fls file was created during the

• Cannot cross-reference figure after using \captionof 2015-05-25

I'm using \captionof instead of \caption because I had a problem with the figure environment. Whenever I wrote the code to place two figures and some text between them, the text was placed before the figures, not between them. I read something about

• Microsoft Office Word 2003 - Problem with saving File - Perhaps equation 2011-04-01

I have a Microsoft Word File (Version 2003) with 366 pages with a lot of formulas (Microsoft Equation 3.0). The Office Password Function is also used, for opening and changing. Now everytime I try to save the file I get the following Error "The disk

• Problem with \specialcomment-command and equation/align-environments 2012-03-06

I'm using the specialcomment-command from the comment package around equation and align environments. This leads to an unwanted blank line after the math environment. When just using the simple includecomment-command, the problem does not show, neith

• Dealing With Cross-References in EE? 2013-03-15

I'm wondering what the EE design pattern, or best practice, is for cross-references. I have a products channel that needs to be cross-referenced with a number of available colours, for instance. Do I create an All Colours channel (contains all possib

• Labeling problems with exam class usage when using multiple chapters 2013-05-11

Using the exam document class I'm trying to create a questions/answers-sheet for a book. When working on the first chapter, everything worked nicely. When I came to the second chapter, I realized I would have problems with the question numbering, sin

• Word 2013 cross reference to footnotes using page numbers 2014-04-11

I am trying to cross reference footnotes in Word 2013 using page numbers, however Word will only show page 1 as the number. If you click the link the hyperlink works correctly. Does anyone know how to either update or correct the references? I have t

• Error using Nsolve with system of two equations: "Use Reduce" 2014-09-24

Having some odd behavior with some mathematica code I am running. I am solving a simple system of two equations but mathematica gives an error and asks to use Reduce? I looked up in the manual but have no clue what to do to rememdy the situation. del

• error: There was a problem with the editor 'vi' when using it with git 2012-07-26

I have this strange problem with using vi as the editor for git commit -a. Normal flow is: I type git commit -a, vi appears, I enter my commit message, and then :wq to save & exit from vi. This works fine. However, sometimes I make a typo and instead

• Problems with both LightDM and GDM using DisplayLink USB monitor 2012-09-05

When I use LightDM, it will auto-login to desktop just fine. The only problem is Compiz doesn't work, and menus don't work. I can't right-click the desktop, and I can't select program menus in the top bar (I.e clicking "File" does nothing). When

I'm using drupal 6 and the module drupal for facebook v6.x-3.3 and I have a problem with the logout functionality. Strangely when I try to logout of the website, it automatically redirects me to my facebook profile. If you return to the site, I am st