When using See for example figure \ref{fig:example}., it outputs something like See for example figure 2.4.1. when the ref is in section 2.4.1. Why does it not link to the figure? The figure is defined like this:
\begin{figure}[H]
\label{fig:example}
\caption{Example figure.}
\includegraphics[width=\textwidth]{img/example.png}
\end{figure}
The figure itself does get a proper label, e.g. Figure 3: Example figure. but the reference references and links to the chapter it's in, which is completely useless. If I intentionally break the label, for example by using \label{example} without fig:, it puts ?? instead of the section, so it apparently can resolve it.
\labelshould be placed after\caption, not before, otherwise you pickup the wrong\@currentlabelcontent (which is defined by the last\refstepcounterusage – Mar 01 '17 at 15:43