TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 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).

\geometry{top=1.0in, bottom=1.0in, left=1.5in, right=1.0in}
\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
up vote 14 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

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

I also had similar issue where pdflatex didn't update the Figure reference. I later found out that it is because of {\caption{.....}}\label{} incorrect usage. The \caption and \label commands have to be together like \caption{.....}\label{}. The caption command and its contents should not be enclosed with braces.

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.