0

I've got a figure, which is displayed fine:

    \begin{figure}[htbp]
    \centering
        \begin{subfigure}[b]{0.48\textwidth}
                \includegraphics[width=\textwidth]{xp_potato.eps}
                \caption{X and P in the complex plane}
                %\label{fig:xp_potato}
        \end{subfigure}%
        \begin{subfigure}[b]{0.48\textwidth}
                \includegraphics[width=\textwidth]{xp_amp.eps}
                \caption{Phase modulated amplitdue}
                %\label{fig:xp_amp}
        \end{subfigure}

    \label{fig:xp}
  \caption{\textbf{Quadrature balancing problem.} ...}
\end{figure}

and now I would like to reference it (after the figure):

\hyperref[fig:xp]{Figure ~\ref{fig:xp}}

But I get this result: "Figure ??"

However when I click on it, my viewer jumps to the right figure. This scheme works fine through out my whole thesis. How can I fix this reference?

lockstep
  • 250,273
Stein
  • 297
  • 1
  • 2
  • 6
  • 1
    Looks like http://tex.stackexchange.com/questions/32325/why-does-an-environments-label-have-to-appear-after-the-caption to me – Joseph Wright May 20 '14 at 10:10
  • 4
    Maybe this related topic http://tex.stackexchange.com/questions/32325/why-does-an-environments-label-have-to-appear-after-the-caption may help? Place the \label after the \caption – Ronny May 20 '14 at 10:10

1 Answers1

0

As explained by Joseph Wright and Ronny, this is because \label should go immediately after \caption. Furthermore, don't forget to run a couple of times your work, as it is also necessary for LaTeX to get the figure numbers right (instead of ??).

Mario S. E.
  • 18,609