5

In a nested enumerate environment, I want to specify the format of the items using the [a)] syntax. I noted that the indentation of the left margin changes when explicitly specifying the item format.

\documentclass{article}
\usepackage{enumerate}

\begin{document}
Text that is long enough to fill two lines. Text that is long enough to fill two lines. Text that is long enough to fill two lines. Text that is long enough to fill two lines.
\begin{enumerate}
    \item maybe
\begin{enumerate}
    \item maybe
    \item maybe
    \item maybe
\end{enumerate}
    \item maybe 
\begin{enumerate}[(a)]
    \item maybe
    \item maybe
    \item maybe
\end{enumerate}
    \item maybe
\end{enumerate}
Text
\end{document}

This generates the following output:

Different indentation in two enumerate environments

What is the explanation for this behaviour? A fix would be to use enumitem together with its [label=(\alph*)] syntax. I am surprised about enumerate's inconsistency here. Is there a way to fix it without using enumitem?

1 Answer 1

7

enumerate is a very simple package but I think its behaviour here is more or less as expected.

The standard code has some fixed margins specified for each level and these margins are large enough to hold the default labels for a reasonable range of numeric values.

However with enumerate you can have a long label such as

[{my very long label} a)]

and the package has to do something sensible, so for such a label it makes the counter use

\alph

sets the list label format to

my very long label \alph{enumi})

and sets

\leftmargini

to the width of

my very long label f)\hspace{\labelsep}

(it uses the width of the value at 7 so for roman numerals it gets vii which is usually the widest in the 0-9 range.)

You could set \leftmargini (or \leftmarginii for the nested case) back again after \begin{enumerate}[...], or perhaps more simply don't use enumerate package at all and just define \theenumi (or \theenumii for the nested case) to use the counter format you need and don't change the other list parameters.

1
  • @LukasD.Sauer -- Just in case you haven't already guessed this on your own: David Carlisle is the author of the enumerate package. :-)
    – Mico
    Commented May 17 at 9:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .