# \ref{label>} yields the chapter [duplicate]

This question already has an answer here:

When I refer to a table in text, the \ref{<labeloftable>} statement produces the chapter number in which the table resides, instead of the number of the table.

Any help would be welcomed!

## migrated from stackoverflow.comDec 18 '14 at 1:10

This question came from our site for professional and enthusiast programmers.

• Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Werner Dec 18 '14 at 3:30

I figured it out. If the label statement of the table is defined before the caption statement, the \ref statement in text produces the chapter in which the table resides.