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

When I type \ref{name} giving the link is on the wrong page. How do I fix this?


... %insert various \newpage

Returns incorrect page.

share|improve this question
Please post a full minimal example. – Joseph Wright Sep 25 '11 at 20:14
Does teo include a \refstepcounter? Otherwise the \label might point to the last label-able item (e.g. section) instead. – Martin Scharrer Sep 25 '11 at 20:21
You are talking about links, but your code doesn't show you load hyperref; also teo doesn't exist in standard LaTeX, so you have to show its definition. – egreg Sep 25 '11 at 20:32
The theorem package is obsolete, all its functionality is present in ntheorem. Apart from this, I don't see any problem and after adding \lipsum paragraphs I always get the correct link. – egreg Sep 25 '11 at 20:56
You mention that the link jumps to an "incorrect page". Do you perhaps have another object using the label tvi? You'll know this is the case your log file contains the output "LaTeX Warning: There were multiply-defined labels." near the end. – Werner Sep 25 '11 at 21:42

Your example works fine for me.

share|improve this answer

Your example works fine for me.

  • Follow the advice given by cmhughes
  • Did you compile your document at least twice? Check for any rerun warnings in the log-file, e.g.

    LaTeX Warning: Reference `tvi' on page ... undefined on input line 34.

    Package rerunfilecheck Warning: File `....out' has changed.

    (rerunfilecheck) Rerun to get outlines right

    (rerunfilecheck) or use package `bookmark'.

    LaTeX Warning: There were undefined references.

    LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.

  • Place a \phantomsection before \begin{teo}.

Where does the link in your example lead to? The page before or after the \begin{teo}, to the first page of your document, ...?

share|improve this answer

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.