2

This question already has an answer here:

So I am using the IEEEtran document class for the first time and I have a problem. When I cross-reference a figure/table/section/whatever with \ref I get the expected reference number. But I would like to automatically insert the associated prefix -- Figure, Section, whatever -- which can be done with the package cleveref. However, when I use the \cref command, I get the output ?? in the pdf document.

My preamble is like this

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first 
% footnote. If that is unneeded, please comment it out.

\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}

\usepackage[nameinlink,noabbrev,capitalise]{cleveref}
\usepackage{hyperref}

One of my figures is defined like this:

\begin{figure}[h]
  \centering
  \includegraphics[scale=.5]{graphs/full_vector_gen_8.eps}
  \caption{Experiment results for the Full Vector algorithm with generation size 8.}
  \label{fig:res-fv-gen-8}
\end{figure}

And the \cref command is \cref{fig:res-fv-gen-8} for instance. None of my \cref commands work.

EDIT: Noticed that I get this warning: LaTeX Warning: Reference 'fig:res-fv-gen-8' on page 1 undefined on input line 3.

marked as duplicate by Mico, user36296, Sebastiano, Phelype Oleinik, Reinstate Monica - M. Schröder Feb 6 '18 at 22:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    cleveref must always be loaded after hyperref. No exceptions. – Mico Feb 6 '18 at 21:22
  • 1
    Thank you so much @Mico and yes it is a duplicate then. I thought it was a problem with IEEETran and thanks for the edit :) – Lars Nielsen Feb 6 '18 at 21:38