LaTeX gets cross-references wrong

Sometimes, however many times you run LaTeX, the cross-references are just wrong. Remember that the \label command must come after the \caption command, or be part of it. For example,

  \begin{figure}          \begin{figure}
  \caption{A Figure}  or  \caption{A Figure%
  \label{fig}                   \label{fig}}
  \end{figure}            \end{figure}

You can, just as effectively, shield the \caption command from its associated \label command, by enclosing the caption in an environment of its own. For example, people commonly seek help after:

\begin{center}
  \caption{A Figure}
\end{center}
\label{fig}
has failed to label correctly. If you really need this centring (and those in the know commonly reject it), code it as:
\begin{center}
  \caption{A Figure}
  \label{fig}
\end{center}

This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=crossref