Artificial truth

The more you see, the less you believe.

[archives] [latest] | [homepage] | [atom/rss]

Nested enumerations in LaTeX
Mon 30 April 2012 — download

By default,

\begin{enumerate}
    \item pif
        \begin{enumerate}
            \item i
            \item j
            \item k
        \end{enumerate}
    \item paf
    \item pouf
\end{enumerate}

produces

1. pif
    a) i
    b) j
    c) k
2. paf
3. pouf

instead of

1. pif
    1.1 i
    1.2 j
    1.3 k
2. paf
3. pouf

But fortunately, the enumitem package is here, and

\usepackage{enumitem}
\begin{document}
    \begin{enumerate}[label\*=\\arabic\*.]
        \item pif
            \begin{enumerate}[label\*=\\arabic\*.]
                \item i
                \item j
                \item k
            \end{enumerate}
        \item paf
        \item pouf
    \end{enumerate}
\end{document}

will produce

1. pif
    1.1 i
    1.2 j
    1.3 k
2. paf
3. pouf

This was the random LaTeX achievement of the day.