[texhax] Nested lists numbering

Philip G. Ratcliffe philipratcliffe at tiscali.it
Sat Mar 12 22:56:50 CET 2005


> I have the following question concerning nested enumerate
> environments. I have
> \begin{enumerate}
> \item Item 1
> \item Item 2
>   \begin{enumerate}
>     \item Item 1.1
>     \item Item 1.2
>   \end{enumerate}
> \end{enumerate}
>
> The dvi ouput is
> 1. Item 1
> 2. Item 2
>      (a) Item 1.1
>      (b) Item 1.2
>
> and I would like it to be
> 1. Item 1
> 2. Item 2
>      2.1. Item 1.1
>      2.2. Item 1.2
>
> I played to do it with \theenumi and \theenumii commands but I did not
> find a solution.

Try this:

\renewcommand\theenumii{\theenumi.\arabic{enumii}.}
\renewcommand\labelenumii{\theenumii}

As a general rule, for this fairly straight-forward type of modification, a
quick look at the files latex.ltx or, as in this case, artcle.cls reveals
the objects in use and their definitions.  Once you know how a particular
command is defined, it's not difficult to figure out how to hack it

Cordialmente,  Philip G. Ratcliffe
_________________________________________

Professor of Nuclear & Subnuclear Physics
Dipartimento di Fisica e Matematica
Universita degli Studi dell'Insubria
via Valleggio 11
22100 Como (CO)
Italy

Tel. +39 (031) 238.6231
Fax  +39 (031) 238.6119
Cell +39 (340) 2346580
Web  http://www.unico.it/~pgr



More information about the texhax mailing list