TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Why does an environment's label have to appear after the caption?
Where to put the \label on a figure environment?

I use \documentclass{llncs}, when I reference an image labelled for example "img1" using \ref{img1} I get the number of the section instead of the number of the image ! After that I added \usepackage[compatibility=false]{caption} because I need it for another problem, and I see now that if I do \ref{img1} I get nothing else "??" !

share|improve this question

marked as duplicate by cmhughes, David Carlisle, Frank Mittelbach, Mico, egreg Jul 1 '12 at 21:13

This question was marked as an exact duplicate of an existing question.

Please add a minimal working example (MWE) that illustrates your problem. – doncherry Jul 1 '12 at 17:01
@doncherry Well the problem is simply: when I use the llncs class, the references of figures are not the number of the figure but the number of the section in which the figure is inserted. – user995434 Jul 1 '12 at 17:14
I realize it may be trivial, but as @doncherry commented, it is best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. Basically, it is better to show the problem rather than describe the problem. – Peter Grill Jul 1 '12 at 17:47
It sounds very much like you issue the \label command before the \caption command. Check for this and, if it's the case, be sure to reverse the ordering. At any rate, do post a MWE (minimum working example) so that others might have a chance to diagnose -- and, subsequently, propose a solution for -- the problem you're encountering. – Mico Jul 1 '12 at 17:47
@Mico you are right, thanks ! The problem is that I used \label command before \caption command – user995434 Jul 1 '12 at 18:01