[Tugindia] new environment

Badri T Natarajan tbadri at mail.tapmi.org
Tue Apr 13 06:41:56 CEST 2004


The section labels are used instead of the labels I specify. That is for the reason you explained. However, placing the label right after the (single) caption but within the environment doesn't help. Placing it outside the environment like in the text fragment below does work for some reason. 
Perhaps there is something still fragile about it.

\section{Introduction}
We have survey responses on a 1---7 scale.......... This data
may be viewed as Exhibit \ref{exh:01} and Exhibit \ref{exh:02}.
\begin{exhibit}
\centering
\begin{tabular}{p{10pt}p{30pt}p{40pt}p{45pt}p{50pt}p{50pt}p{55pt}p{50pt}} \hline
n&Resort Visits&Annual Family Income&Attitude Towards
Travel&Importance Attached to Family Vacation&Household Size&Age
of Head of Household&Amount Spent on Family Vacation\\\hline
 1&1&50.2&5&8&3&43& M (2)\\
30&2&41.3&3&3&2&42& L (1)\\ \hline
\end{tabular}
\caption{Information on Resort Visits: Training Sample}
\end{exhibit}\label{exh:01}

\begin{exhibit}
\centering
\begin{tabular}{p{10pt}p{30pt}p{40pt}p{45pt}p{50pt}p{50pt}p{55pt}p{50pt}} \hline
n&Resort Visits&Annual Family Income&Attitude Towards
Travel&Importance Attached to Family Vacation&Household Size&Age
of Head of Household&Amount Spent on Family Vacation\\\hline
 1&1&50.8&4&7&3&45& M (2)\
12&2&38.2&2&2&3&49& L (1)\\ \hline
\end{tabular}
\caption{Information on Resort Visits: Holdout Sample}
\end{exhibit}\label{exh:02}

 -----Original Message-----
From: 	David Kastrup [mailto:dak at gnu.org] 
Sent:	Monday, April 12, 2004 5:37 PM
To:	TUGIndia Mailing List
Cc:	cvr at river-valley.org
Subject:	Re: [Tugindia] new environment

"Badri T Natarajan" <tbadri at mail.tapmi.org> writes:

> Though the exhibits appear without error, the code is causing an
> error with the numbering of the exhibits and tables (floats?). I
> have \label{exhibit1} inside the exhibit environment. In the text I
> say "See Exhibit \ref {exhibit1}". In the output I get "See Exhibit
> 1". However subsequent references are all numbered incorrectly.

As you don't include a minimal example exhibiting your problem, one
can only guess.

You are probably doing the common error of placing the \label command
before the \caption.  Since an exhibit may contain more than one
caption, it is the captions that get numbered, not the exhibits.  For
that reason the label just refers to the current section (which at
the time of the label is the outermost referable entity).

Place the label after the caption.





More information about the tugindia mailing list