[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#221822: \label has to be put after \caption in order to be effective



Package: tetex-bin
Version: 2.0.2-5
Severity: normal

I have a table environment which I want to give a caption as well as a
label so I can refer to it.  When I made a reference, I noticed that
it was wrong -- instead of giving the number of the table the number
of the section was given.  I tracked this down now and found out that
you have to put the \caption _before_ the \label, otherwise the \label
isn't effective.  I think this behaviour is wrong considering that my
\label is clearly within \begin{table} and \end{table} and so it's
obvious what the \label refers to.

To show this problem I have attached files test1.tex and test2.tex.
test1.tex refers to 2.1, which is wrong (it's the section), while
test2.tex refers to 1, which is correct.

This behaviour is very unintuitive and I hope this can be fixed
upstream.



-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux deprecation 2.4.22-1-686 #6 Sat Oct 4 14:09:08 EST 2003 i686
Locale: LANG=en_US, LC_CTYPE=en_US

Versions of packages tetex-bin depends on:
ii  debconf                    1.3.20        Debian configuration management sy
ii  debianutils                2.6.1         Miscellaneous utilities specific t
ii  dpkg                       1.10.15       Package maintenance system for Deb
ii  ed                         0.2-20        The classic unix line editor
ii  libc6                      2.3.2.ds1-10  GNU C Library: Shared libraries an
ii  libgcc1                    1:3.3.2-1     GCC support library
ii  libkpathsea3               2.0.2-4.3     shared libkpathsea for teTeX
ii  libpng12-0                 1.2.5.0-4     PNG library - runtime
ii  libstdc++5                 1:3.3.2-1     The GNU Standard C++ Library v3
ii  libwww0                    5.4.0-9       The W3C WWW library
ii  libxaw7                    4.3.0-0pre1v1 X Athena widget set library
ii  mime-support               3.23-1        MIME files 'mime.types' & 'mailcap
ii  perl                       5.8.1-4       Larry Wall's Practical Extraction 
ii  t1lib1                     1.3.1-3       Type 1 font rasterizer library - r
ii  tetex-base                 2.0.2-5       Basic library files of teTeX
ii  xlibs                      4.3.0-0pre1v1 X Window System client libraries
ii  zlib1g                     1:1.1.4-16    compression library - runtime

-- debconf information excluded

-- 
Martin Michlmayr
tbm@cyrius.com

Attachment: test1.tex
Description: TeX document

Attachment: test2.tex
Description: TeX document

--- test1.tex	2003-11-20 20:54:58.000000000 +1100
+++ test2.tex	2003-11-20 20:55:08.000000000 +1100
@@ -16,8 +16,8 @@
 \end{tabular}
 \end{center}
 
-\label{foo}
 \caption{foo}
+\label{foo}
 \end{table}
 
 This is a reference for table~\ref{foo}.

Reply to: