I'm doing a project which generates 10 to 20 similar images, which I should implement in a report. Since they are all "generic" I would like to have an algorithm which autogenerates the image, caption and label, according to the image name. The following code is already implemented and partly operational. The issue is that the compiler generates all the images I need, as well as giving them the correct caption, but it fails at giving them a label, which I would find usefull when commenting each picture. I get a couple of warnings regarding labels without links, and several undefined references, so maybe there is some issue in the compile order. Is there any easy fix to this? I'm fairly new at Latex, would appreciate any help given =)
The code I'm using today is given below:
\foreach \i in {1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,11000,12000}
{ \lipsum [\i]
\begin{figure}[htb]
\centering
\includegraphics[width=0.8\textwidth]{Figures/Results/res_\i K.PNG}
\label{fig:res_\i}
\caption[Color temperature measurement \i K]{Color temperature measurement \i K}
% \label{fig:res_\i}
\end{figure}
}
As \autoref{fig:res_1000} depicts
\labelmust be used after\caption(or inside its argument), not before. Also [tag:cross-referencing] is the correct tag, not [tag:labels] – Nov 01 '17 at 14:01