LaTeX: wrong ref

If anyone has troubles with LaTeX and refs, this may be caused by wrong label-placing. Here is an example:

Auf der Gau"sschen Ebene bedeutet diese eine Spiegelung
entlang der Realachse (Abbildung ref{fig:konjugation}).
% damn... why is that ref always wrong?
begin{figure}[!ht]
 label{fig:konjugation}
 centering
 fbox{
   includegraphics[scale=0.75]{images/konjugation.png}
 }
 caption{Konjugation einer Komplexen Zahl}
end{figure}

Wikibooks has the solution. You have to put label inside caption. Otherwise it will return the number of the section. Like this:

Auf der Gau"sschen Ebene bedeutet diese eine Spiegelung
entlang der Realachse (Abbildung ref{fig:konjugation}).
% it works
begin{figure}[!ht]
 centering
 fbox{
   includegraphics[scale=0.75]{images/konjugation.png}
 }
 caption{Konjugation einer Komplexen Zahl label{fig:konjugation}}
end{figure}

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>