# Are subcaption, cleveref and hyperref compatible? [duplicate]

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.

## marked as duplicate by egreg, lockstep, Werner, Svend Tveskæg, MicoFeb 28 '14 at 16:11

• 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
You have to load cleveref after hyperref. Then everything works.