Dear stackexchange users,
I want to use subfigures in my document but the solution I got so far scrambles my ability to use labels and references in my documents.
\documentclass{scrartcl}
\usepackage{subcaption} % both packages throw me an error
\usepackage{subfig} % so choose one
\begin{document}
\begin{figure}
\label{fig:first}
\caption{First figure}
\end{figure}
Now I refer to it the first figure by~\ref{fig:first}.
\end{document}
No matter how often I compile my document, I always get the messages
Package caption Warning: \label without proper reference on input line 8.
LaTeX Warning: Reference `fig:first' on page 1 undefined on input line 12.
LaTeX Warning: There were undefined references.
and the documents shows ??
instead of the references. The caption
package also has no solution to that specific error message.
Regards Jakob