One of my sections seems to be using the section number rather than the appropriate figure number for \ref's that point to figures. (Theorems and the like work fine.) As far as I can tell, there's nothing differentiating the problematic section from the other sections, but there must be as the problem doesn't go away when I compile that section on its own. Any ideas?
Edit: an example of a broken figure. (Every figure in the section is broken.)
\begin{example}
Figure~\ref{fig: hasse} depicts ...
\begin{figure}[htbp]\label{fig: hasse}
\begin{center}
\begin{tikzpicture}
\tikzstyle{every node}=[draw,circle,fill=black,minimum size=4pt,
inner sep=0pt]
[bunch of lines for the picture]
\end{tikzpicture}
\caption{Hasse diagram}
\end{center}
\end{figure}
\end{example}
This particular instance had the figure inside the example, but that doesn't make a difference.
\captionbefore\labelin that figure environment. Please show the code, so we don't have to guess. – Stefan Kottwitz Jun 01 '11 at 21:31\labelcommand after the corresponding\captioncommand (same remark applies to all floating environments). Instead of thecenterenvironment you could use the\centeringcommand right after\begin{figure}[htbp]; the environment adds extra vertical space which (in most cases) is undesired – Gonzalo Medina Jun 01 '11 at 21:44