2

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:

enter image description here

Question: In LaTeX, how can we achieve something similar to nested numbered lists in Microsoft WORD, as shown below?

enter image description here

5

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:

\setlist[enumerate,2]{label=\theenumi.\arabic*.,ref=\theenumi.\arabic*}

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:

\setlist[enumerate,2]{label=\theenumi.\arabic*.,ref=\theenumi.\arabic*}
\setlist[enumerate,3]{label=\theenumii.\arabic*.,ref=\theenumii.\arabic*}

The toplevel counter is enumi, the next level is enumii, 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.

\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate,2]{label=\theenumi.\arabic*.,ref=\theenumi.\arabic*}
\begin{document}
\begin{enumerate}
   \item First level item
   \item First level item
   \begin{enumerate}
     \item Second level item
     \item Second level item
   \end{enumerate}
 \end{enumerate}

\end{document}  

output of code

  • Your suggestion works (thank you). Could you please explain the line \setlist[enumerate,2]{label=\theenumi.\arabic*.,ref=\theenumi.\arabic*}. For example, when I changed enumerate,2 to enumerate,3 in the above line it changed the second level numbering to alpha (a) Second level (b) Second level. When I changed from 2 to 4 or 5, it did not do anything. I'm just trying to understand so I can use your suggestion in some other cases, as well. – nam Apr 21 '20 at 20:17
  • 1
    @nam I've updated the answer with some more detail. Does that help? – Alan Munn Apr 21 '20 at 20:30
  • That's exactly what I was after. And thank you for adding your explanation in your original response as it may help other readers, as well. – nam Apr 21 '20 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.