[Tugindia] Order of \caption & \label

David Kastrup tugindia@tug.org
20 Nov 2002 14:41:49 +0100


H S Rai <hsraidce@iitr.ernet.in> writes:

> I find that while
> 
> \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"?  Before and after this change,
it should write just the caption.  Or are you referring to a
corresponding \ref?  That should not write "nothing" but rather a
reference to whatever referable material (typically chapter/section
numbers) appeared before the \label.

> where it should write the number of table at the place where label
> is referred, while table number is written correctly for the table
> along with its caption.
> 
> Any clarification?

A clarification of your above sentence could help.  It does not make
much sense.  It probably would have been easier just to give a
complete minimal example: that would have described your problem
unambiguously (unless it is due to a version-specific problem, which
I doubt).

Anyhow: tables are not referenceable material, captions are.  You can
place several captions inside of a single floating environment such
as a table, so if labels got attached to the float instead of the
captions inside, you'd have a problem with dealing with floats
containing more than one captioned object.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum