Welcome to the UK List of
TeX Frequently Asked Questions
on the Web

Searching

The index of Frequently Asked Questions about TeX is searchable.

Please enter your keyword here:   then press here: ,    or:
Google

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}


Go to previous question, or next question.

Go to FAQ home.

URL for this question: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=crossref

Comments, suggestions, or error reports? - see “how to improve the FAQ”.

This is FAQ version 3.19c, last modified on 2010-01-08.