Possible Duplicate:
Why does an environment’s label have to appear after the caption?
I noticed that when I put the \label command before the \caption command in a figure environment, I get wrong \ref results for this figure. When I put the label in or after the \caption, the \ref will work fine. In the first case, I will get a \ref to the enclosing section (or subsection). Why is that so? And is there some documentation which tells me how to label a figure correctly?
:-)– Martin Schröder Nov 17 '11 at 11:34