[comp.text.tex] Need help with LATEX table problem.

rstanton@portia.Stanford.EDU (Richard Stanton) (11/17/90)

I'm having a problem using the \ref command with LATEX tables. I start the 
table using

\begin{table}
\label{tname}
...

then refer to it in the text as \ref{tname}. However, this often either gives
me the wrong number, or even a section number (e.g. 4.2.1), which is not
what I want. This is the way I use \label in equations, sections etc, and
it always works. What's wrong here?

Thanks for any suggestions

Richard Stanton
pstanton@gsb-lira.stanford.edu

eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) (11/17/90)

rstanton@portia.Stanford.EDU (Richard Stanton) writes:

>I'm having a problem using the \ref command with LATEX tables. I start the 
>table using

>\begin{table}
>\label{tname}
>...

>then refer to it in the text as \ref{tname}. However, this often either gives
>me the wrong number, or even a section number (e.g. 4.2.1), which is not
>what I want. This is the way I use \label in equations, sections etc, and
>it always works. What's wrong here?

The \label command associates a label with a number, but first
that number must have been generated. In your case it is first
generated when you give the \caption command, so move the
\label after that.

Victor.