TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 2 equations. When I use \ref{} for the second equation, it gives the correct number but directs to the wrong place. How can I fix this? Thanks

\section{Chapter 16}
\int_{C}f(x,y)ds=\int_{a}^{b}f\left(x(t),y(t)\right)\cdot |\vec{r}\,'(t)|\cdot dt
See \ref{2d}
|\vec{r}_x\times \vec{r}_y|=\sqrt{1+\left(\dfrac{\partial f}{\partial x}\right)^2+\left(\dfrac{\partial f}{\partial y}\right)^2} 
See \ref{area}
share|improve this question
Did you run latex twice? – Sigur Jul 31 '14 at 1:17
Welcome to TeX.SX! – Adam Liter Jul 31 '14 at 1:18
Welcome! Please provide a minimal example to facilitate the debugging. Sigur suggestion should sort it out! – anderstood Jul 31 '14 at 2:55
Looking at the aux file, both labels refer to equation.16.1, ignoring the subsection number. Not sure how to fix it yet. – John Kormylo Jul 31 '14 at 3:34
It's not \theequation, and \subsection definitely calls \refstepcounter. – John Kormylo Jul 31 '14 at 4:21
up vote 7 down vote accepted

Put your \numberwithin{equation}{subsection} line after \usepackage{hyperref}. Apparently there is a conflict between amsmath and hyperref.

A very similar situation is described here: Hyperlinking problems when using subequations, hyperref and cleveref

share|improve this answer
This works! Thank you so much – leocanada Aug 1 '14 at 1:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.