You've saved my life in some occasions, I am writing my master thesis and as I am working with MATLAB, I found a very useful MATLAB function which "translate" MATLAB images to TeX tikzpicture.

I decided to put the images in some folders and to call them with a "input" command, so i make everything like this:

\caption{Results at time $t=100$ with $i_{max}=150$}

and everything worked fine.

Then i tried to recall the images with the \vref command, recalling the labels i wrote (i made copy+paste to be sure!) and they doesn't recall anything. They write something like:"as we can see in figure ?? on page 79"; the page is correct but there is no figure number!

Just to be clear:

  • I have uploaded all the necessary packages (I also put hyperref before varioref)
  • I use TeXShop on Mac
  • I have read all the manuals of the packages and found nothing
  • I have to give my thesis to my tutor on thursday :)

I hope some of you have a piece of advice for me!

Thank you in advice to all of you.

[EDIT] I add some more informations:

I am writing in the {book} environment, and it's a bit complicated to write here how my file is because I have one main file with the heading of my thesis recalling all the chapters. However I'll put here the code of the document which stays after the \usepackage (which are something like 40, so i don't know if it is useful to put them all...




\thispagestyle{empty} % citazione
    \vspace*{4 cm}



\thispagestyle{empty} % dedica
%   \vspace*{4 cm}
%   \textit{ \\
%   }\\
%   []\\

%   \vspace{2cm}
%   \textit{}\\
%   ()









        \fancyhead[RO,LE]{\slshape \leftmark}


%    \input{cap4}
%    \input{cap5}
%    \input{cap6}

%   \input{conclusion}  



  • Welcome to TeX.SX. Note that you don't have to sign with your name since it automatically appears in the lower right corner of your post. Commented Oct 18, 2013 at 17:20
  • Welcome to TeX.SX! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – cgnieder
    Commented Oct 18, 2013 at 17:20
  • 2
    You should load hyperref after varioref. If that still doesn't work, try (surprising as this may sound at first) loading the cleveref package as well (after hyperref). See also tex.stackexchange.com/q/51636/5001.
    – Mico
    Commented Oct 18, 2013 at 18:06
  • Thank you Mico, your advice worked for me, I am so relieved :)
    – brodegon
    Commented Oct 18, 2013 at 18:14
  • 1
    pay attention anyway, because cleveref changes the reference names; for example one has to set the {lstlisting} name (\crefname{lstlisting}{code}{codes} or \crefname{lstlisting}{script}{scripts} and \Crefname{lstlisting}{code}{codes}) but also it repeats objects name: "see for example table \vref{tab:first}" gives as output:"see for example table table first"
    – brodegon
    Commented Oct 21, 2013 at 13:21

1 Answer 1


The key piece of information, I believe, is that you load the hyperref package before the varioref package.

A solution to the problems you report consists of (a) loading varioref before hyperref and (b) loading cleveref as well, after hyperref. The reason this works is that when cleveref is loaded, it checks if varioref is loaded and, if the answer is yes, modifies some of varioref's internals in order to improve interoperability with cleveref. (Of course, for this to work cleveref must be loaded after varioref...) In the process, varioref also becomes more compatible -- I'm not sure if it's OK to say fully compatible -- with hyperref. For more information on this matter, see the posting Lost labels using intertext with varioref and hyperref.

In short, if you load the packages varioref, hyperref, and cleveref in this order, you should be able to use \vref without further problems.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .