\begin{figure} \centering \includegraphics[width=0.95\columnwidth]{sompic} \label{fig:some-pic} \caption{Some caption.} \end{figure}if you now do a \ref{fig:some-pic}, the reference will point to the parent element of the figure environment. For me, I got a reference to the subsection enclosing the figure. This was very irritating, because the text then said "see Figure 3.4.2.4 for details."
Instead you need to place the label in or after the \caption command. For some reason the \ref will then point to the figure:
\begin{figure} \centering \includegraphics[width=0.95\columnwidth]{sompic} \caption{Some caption.} \label{fig:some-pic} \end{figure}Update: And here is also the answer to the question why it is necessary to do it this way.
No comments:
Post a Comment