[Tugindia] Numbering in enumerate
Manoj Kummini
tugindia@tug.org
Tue, 1 Oct 2002 07:36:39 +0100 (BST)
Hello Kapil,
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:
\documentclass{article}
\usepackage{enumerate}
\begin{document}
\begin{enumerate}[(a) ]
\item\label{item1}
\begin{enumerate}[1 ]
\item \label{item11}
\makeatletter
\verb|\p@enumi| = \p@enumi
\verb|\p@enumii| = \p@enumii
\verb|\@currentlabel| = \@currentlabel
\makeatother
\end{enumerate}
\end{enumerate}
See item \ref{item11}% \ref{item12} \ref{item2}.
\end{document}
--- Kapil Hari Paranjape <kapil@imsc.ernet.in> wrote:
>
> Manoj Kummini <kummini@yahoo.com> wrote:
> >
> > Does this redefine the p@enumii variable? I did not see the
> > parenthesis appear while referring to these items. For that to
> > happen, doesn't one have to redefine \theenumi ?
=====
--
Manoj Kummini
http://www.geocities.com/kummini/index.html
12.58 N, 77.39 E
________________________________________________________________________
Missed your favourite TV serial last night? Try the new, Yahoo! TV.
visit http://in.tv.yahoo.com