summaryrefslogtreecommitdiff
path: root/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-crossref.html
blob: c4b0763ff22e72a1b04fb5ffd4b965be57615e8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<head>
<title>UK TeX FAQ -- question label crossref</title>
</head><body>
<h3>LaTeX gets cross-references wrong</h3>
<p/>Sometimes, however many times you run LaTeX, the cross-references
are just wrong. Remember that
the <code>\</code><code>label</code> command must come <em>after</em> the <code>\</code><code>caption</code> command, or
be part of it. For example,

<pre>
  \begin{figure}          \begin{figure}
  \caption{A Figure}  or  \caption{A Figure%
  \label{fig}                   \label{fig}}
  \end{figure}            \end{figure}
</pre>
<p/>You can, just as effectively, shield the <code>\</code><code>caption</code> command from its
associated <code>\</code><code>label</code> command, by enclosing the caption in an
environment of its own.  For example, people commonly seek help after:
<blockquote>
<pre>
\begin{center}
  \caption{A Figure}
\end{center}
\label{fig}
</pre>
</blockquote><p>
has failed to label correctly.  If you really need this centring (and
those in the know commonly reject it), code it as:
<blockquote>
<pre>
\begin{center}
  \caption{A Figure}
  \label{fig}
\end{center}
</pre>
</blockquote><p>
<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=crossref">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=crossref</a>
</body>