1

I tried with this MWE:

\documentclass{article}

\usepackage{caption,subcaption}
\usepackage{cleveref}
\usepackage{hyperref}

\begin{document}

See \cref{subfig1}, \ref{subfig1}

\begin{figure}
 \subcaptionbox{Subfigure\label{subfig1}}
  {A FIGURE}
\caption{Figure}
\label{fig1}
\end{figure}

\end{document}

Without hyperref, all is nice, with hyperref I get ?? for the \cref instance. I tried installing the latest versions of all three packages, nothing changed apparently.

  • 3
    You do know that you have to load cleveref after hyperref, right? – Joseph Wright Feb 28 '14 at 15:18
  • @JosephWright I didn't know, now I do. As in the question kindly linked by @egreg, I assumed that hyperref had to be loaded last. – Jellby Feb 28 '14 at 15:30
2

You have to load cleveref after hyperref. Then everything works.

See fig. 1a, 1a

It is kind of mentioned in the manual:

If you are using both varioref and hyperref, make sure you are loading them in the correct order, otherwise cross-references will reference completely the wrong thing without any warning in the LATEX output or log! The packages must be loaded in the following order: varioref, hyperref, cleveref.

Not the answer you're looking for? Browse other questions tagged or ask your own question.