I had a problem in referencing figures, which now I solved, thanks to an old answer by Werner.
To be precise, in my case the reference was working properly (the hyperlink was pointing to the correct figure), but I couldn't manage to substitute the double question mark with the correct figure number.
Why does the relative placement of \label and \caption matter, shouldn't the double compilation of the LaTeX code suffice? Is there a technical reason for this behaviour?
I noticed that it occurs only when compiling with pdfLaTeX, not with LaTeX.
Thanks in advance!
\labellabels "the current referencable value" and that is set typically by headings and captions. If you use\labelbefore\captionit is not an error, it is just that at that point the current referencable value is typically the section counter – David Carlisle Oct 30 '13 at 11:47\chapter,\caption, etc. commands pushes new pointer and every\end{<float>}rejects all\captionpointers. The\labelcommand then reads and stores value of pointer that is, at this time, on top of this stack no matter what happens afterwards. – Crowley Oct 30 '13 at 12:38