Take the 2-minute tour ×

I have an article with the following figure (there are 2 small charts near each other, horizontally):

  \caption{My caption}\label{mylabel}

I reference the figure with:

Figure~\ref{fig:result} shows bla-bla-bla.

The rendered PDF shows ?? instead of the figure number. I tried with the reference occurring both before and after the figure (in the LaTeX source), but it didn't make a difference.

The relevant packages I'm using are below (those removed are for titling).

\usepackage{flafter} % make sure figures do not appear before their text
\usepackage{sidecap} % use side captions for floats
\usepackage{subfig} % subfloats

I'm not sure what's wrong here, advice is appreciated. I'm using MiKTeX 2.8.

Thank you!

share|improve this question
Allowing only [h] is not much. I would add some options resulting in [htp] for instance. See texblog.net/help/latex/figure.html for reference. –  Stefan Kottwitz Aug 17 '10 at 14:18
add comment

2 Answers

up vote 11 down vote accepted

Your labels don't match. Change the reference to \ref{mylabel} or the label to label{fig:result}

share|improve this answer
Thanks, I had misinterpreted the meaning of the reference expression (I thought it was "show the current figure counter result"). –  wishihadabettername Aug 17 '10 at 14:32
add comment

Besides the mistake noted by Lev Bishop (assuming that you just did some incomplete editing for this post, and in reality the labels match), it is possible that you did not run latex enough times. For the labels to work out you need to run it at least twice.

share|improve this answer
The labels were not matching (see my comment to Lev's answer), but you get a vote for reminding me about running twice. –  wishihadabettername Aug 17 '10 at 19:11
add comment

Your Answer


