I have been trying to label images in subfigures and then reference them in the caption of the main figure environment. But I get error "Label without proper reference" and "reference undefined error" for all the three subfigures. Can anyone find out the problem?
\begin{figure}[t]
\begin{subfigure}{0.3\linewidth}
\includegraphics[width=\linewidth]{./Figures/img1}
\label{fig:original}
\end{subfigure}
\begin{subfigure}{0.3\linewidth}
\includegraphics[width=\linewidth]{./Figures/img2}
\label{fig:smooth}
\end{subfigure}
\begin{subfigure}{0.3\linewidth}
\includegraphics[width=\linewidth]{./Figures/img3}
\label{fig:binarySkeleton}
\end{subfigure}
\caption{\ref{fig:original}Image 1 \ref{fig:smooth}image 2 \ref{fig:binarySkeleton} Image 3 }
\label{fig:pre-processing}
\end{figure}
Best Answer
If you have images/plots that has labels a, b, c in them, and you don't need captions, then you can use
{\phantomsubcaption\label{subfiglabel}}
. For example: