I have a document where multiple figures with subfloats are included, like this one:
\documentclass[pdftex, a4paper, oneside]{scrartcl}
\usepackage[lofdepth,lotdepth]{subfig}
\usepackage{graphicx}
\begin{document}
test
\ref{fig:2ref1}
\ref{fig:1ref1}
\section{test}
\begin{figure}[h]
\subfloat[][caption1]{
\includegraphics[width=0.45\textwidth]{pictures/1.pdf}
\label{fig:1ref1}
}
\subfloat[][caption]{
\includegraphics{pictures/2.pdf}
\label{fig:1ref2}
}
\end{figure}
\section{test2}
\begin{figure}[h]
\subfloat[][caption]{
\includegraphics[]{pictures/1.pdf}
\label{fig:2ref1}
}
\subfloat[][captio]{
\includegraphics{pictures/2.pdf}
\label{fig:2ref2}
}
\end{figure}
\end{document}
The problem now is that both \ref{fig:2ref1} and \ref{fig:1ref1} return 1a as picture reference, even if they are different pictures and should be 1a and 2a.


\documentclass{...}and end with\end{document}. – Jubobs Mar 21 at 12:29\caption{<caption text>}in the first figure, so thefigurecounter is not incremented, and in the secondfigureyou're still at figure 1. – Torbjørn T. Mar 21 at 14:37