0

Possible Duplicate:
Where to put the \label on a figure environment?

My question is rather simple. I have noticed that when I use \label like this

\begin{figure}[h]
\centering
\includegraphics[width=0.5\textwidth]{Leslie_Lamport}
\label{fig:LL}
\caption{Leslie Lamport}
\end{figure}

and then refer to this label it refers rather to the section number than to the figure (I've seen it been refered as section.figurenumber but that was due to a package I believe - possibly hyperref). But when using it after the caption

\begin{figure}[h]
\centering
\includegraphics[width=0.5\textwidth]{Leslie_Lamport}
\caption{Leslie Lamport}
\label{fig:LL}
\end{figure}

it really refers to the figure number.

Can someone explain the mechanic behind \label to me?

0

1 Answer 1

1

Use the \label{fig:LL} inside the \caption{} tag.

\begin{figure}[h]
\centering
\includegraphics[width=0.5\textwidth]{Leslie_Lamport}
\caption{Leslie Lamport\label{fig:LL}}
\end{figure}
1
  • Why, just place it after \caption
    – daleif
    Commented Mar 22, 2012 at 12:10

Not the answer you're looking for? Browse other questions tagged .