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:
Where to put the \label on a figure environment?

I've got the table numberin with sections:

\numberwithin{table}{section}

The following table is 2.1. for example:

\begin{table}
...
\label{thelabel}
\end{table}

But when I reference this table using \ref{thelabel} I only get the 2, not the whole table number.

How to get the label and the table number right?

share|improve this question

marked as duplicate by Werner, Stefan Kottwitz Dec 15 '11 at 15:37

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.

    
Is the \label after \caption? Yes, you need \caption in order to be able to reference it properly. –  Werner Dec 15 '11 at 15:26
    
Shame on me! Your hint was just right Werner, it pointed me to a stupid mistake. Sorry. Can be closed. –  Meinzlein Dec 15 '11 at 15:29
add comment

1 Answer

The \label should go after the \caption in the float (table or figure) in order for the referencing to work properly.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.