In LaTeX
, by default the numbering styles change depending on the depth of the nested lists as shown below.
\begin{enumerate}
\item First level item
\item First level item
\begin{enumerate}
\item Second level item
\item Second level item
\begin{enumerate}
\item Third level item
\item Third level item
\begin{enumerate}
\item Fourth level item
\item Fourth level item
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{enumerate}
Output of the above:
Question: In LaTeX
, how can we achieve something similar to nested numbered lists in Microsoft WORD, as shown below?
Best Answer
You can do this easily with the
enumitem
package.The
enumitem
package allows you to determine the numbering system for any level or all levels of a list class. In this example, I've used:This means "set the label of the second level of
enumerate
to be the label of the first level (\theenumi
) plus the arabic number representation of the current level (\arabic*
)."Since you likely don't want a dot after the number in references, I've added a separate specification for references that excludes it. If you want to do this for other levels, you can add a format for each sublevel:
The toplevel counter is
enumi
, the next level isenumii
, etc. The output representation of those counters is\theenumi
,\theenumii
, etc. So each definition has to refer to the representation of the counter of the previous level in its definition.