# [Tugindia] Order of \caption & \label

H S Rai tugindia@tug.org
Wed, 20 Nov 2002 22:16:24 +0530 (IST)

Today at 2:41pm +0100 David Kastrup wrote:

>   H S Rai writes:
>
>   > \caption{MyCaption}
>   > \label{MyLabel}
>   >
>   > works fine  in all respect, but  on changing order of  these two
>   > lines in table environment, writes nothing,
>
>   What do you mean by "writes nothing"?

nothing mean "nothing" i.e. blank,  oh! no, not even blank. Infact, if
I have a number of tables,  then \ref of Ist table produces "nothing",
and it produces 1 for 2nd \ref (which corresponds to 2nd table) and so
on. That is "n" th table will be referred as "Tab (n-1)".

>   Before and  after this change,  it should write just  the caption.
>   Or are you referring to a corresponding \ref?

Yeah, I was referring the place of \ref

<snip>
>   A clarification of your above sentence could help.

Thanks a lot for giving  sufficient input, inspite of ambiguous query,
to solve my problem and making things understandable.

>   Anyhow: tables are not referenceable material, captions are ...

Indeed, this was news for me. From now onward I would like to write:

\caption{\label{MyLabel}My Caption}

inlace of

\caption{MyCaption}
\label{MyLabel}

Once again, thanks a lot for answering query from all possible angles.

--
H.S.Rai

--- [ a version of Murphy's law ] :-

Nothing is as easy as it looks.