I'm writing a paper to submit a conference.
However, I am having some problems fixing non-resolved references in latex.
\begin{figure*}[ht!]
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=1\linewidth]{fig/toy}
\vspace*{-1cm} % for cosmetic change
\label{fig:toynetwork_example}
\caption{A toy network}
\end{subfigure}%
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=1\linewidth]{fig/exampleProcedure13}
\vspace*{-1cm} % for cosmetic change
\label{fig:firstIterationFin}
\caption{After first iteration}
\end{subfigure}
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=1\linewidth]{fig/proposed_adjacency_matrix}
\vspace*{-0.4cm} % for cosmetic change
\label{fig:proposed_adjacency_matrix}
\caption{Adjacency matrix}
\end{subfigure}%
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=1\linewidth]{fig/proposed_influence_matrix}
\vspace*{-0.4cm} % for cosmetic change
\label{fig:proposed_influence_matrix}
\caption{Influence matrix}
\end{subfigure}%
\hspace*{0.2cm}
\vspace*{0.3cm} % for cosmetic change
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=1\linewidth]{fig/proposed_update_order}
\vspace*{-0.4cm} % for cosmetic change
\label{fig:proposed_update_order}
\caption{Update order}
\end{subfigure}%
\caption{Example network}
\label{fig:example_network_procedure}
\end{figure*}
The PDF file shows ??
rather than the reference.
Can you help me?
Best Answer
The
\label
must go after or inside the\caption
command. It cannot be placed before. This is because\caption
increments the relevant counter, which is what\label
hooks onto. If you put the\label
first, there is nothing onto which it might hook.For example, turning your code into a (semi-)Minimal Working Example by adding a preamble and substituting standard images:
Code: