[Tugindia] Labels and enumeration
Kapil Hari Paranjape
tugindia@tug.org
Wed, 2 Oct 2002 12:55:11 +0530
Hello,
Manoj is partially right about this:
> Let me elaborate my question. When one uses \label{key} in a LaTeX
> document, an entry of the form
> \newlabel{key}{{\@currentlabel}{\thepage}}
> is made in \jobname.aux. When \label is used inside the enumerate
> environment, \@currentlabel takes the value \p@enumxxx\theenumxxx,
> where xxx denotes the current \@enumdepth. \p@enumxxx is a recursive
> definition that determines the prefix as below: if one is in an
> enumerate environment of depth three, \p@enumiii will describe how
> the previous two depths should be referred to, as in 1(a)i, which is
> the Standard LaTeX style. In enumerate.sty, the optional argument
> [(a) ] for an enumerate environment, say at depth one, sets \theenumi
> as \alph{c@enumii}, without the parentheses, and, therefore, the
> parentheses do not get carried over to the definition of \p@enumii,
> which is not modified by enumerate.sty. This is what I understood
> from reading that file; perhaps I am wrong. Because this is not
> carried over to \p@enumii, the value of \@currentlabel at lower
> depths do not have the parentheses, which will affect the way a
> reference to an item is printed. See, e.g., the following piece of
> code:
The method described in my previous email will change the actual
labels and the method by which they are displayed.
However, article.cls uses the style 1 1a and 1(a)i to generate
labels at different depths. *Without* redefining \p@enumi and friends
but only redefining \theenumi \labelenumi and friends what you will
get is (e.g.) something like a a1 a(1)i which does look ugly.
In particular, the paranthesis *will not* make it to the labels
generated.
This is a "flaw" in article.cls according to me. In other words,
\p@enumii should be \labelenumi and \p@enumiii should be
\labelenumi\labelenumii so that if the items labels are concatenated
to generate references of lower depth---at least by default!
Hope this rather technical discussion makes sense!
Regards,
Kapil.