Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
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
1  
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
2  
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