The default maximum depth for the list environments enumerate
and itemize
is four. Using more than four nested levels will lead to the error: “Too deeply nested”.
One way to increase the depth of a list is using a mix of enumerate
and itemize
. However, obviously, some levels will be a bulleted rather than enumerated.
The enumitem
package allows you to define new lists with an arbitrary number of levels. For example, let’s create nested lists with up to five levels.
Define a new list longenum
of type enumerate
which has 5 levels. Set the label style for each level they way you like. I used roman
, alph
and arabic
.
\usepackage{enumitem} \newlist{longenum}{enumerate}{5} \setlist[longenum,1]{label=\roman*)} \setlist[longenum,2]{label=\alph*)} \setlist[longenum,3]{label=\arabic*)} \setlist[longenum,4]{label=(\roman*)} \setlist[longenum,5]{label=(\alph*)}
That’s all you need to know. The rest is straight forward, just use longenum
instead of enumerate
for each level and create a nested lists with up to 5 levels.
Here is the complete sample code with the output below:
\documentclass[11pt]{article} \usepackage{enumitem} \newlist{longenum}{enumerate}{5} \setlist[longenum,1]{label=\roman*)} \setlist[longenum,2]{label=\alph*)} \setlist[longenum,3]{label=\arabic*)} \setlist[longenum,4]{label=(\roman*)} \setlist[longenum,5]{label=(\alph*)} \begin{document} \section*{Enumerated list with 5 levels} \begin{longenum} \item Level 1 first \item Level 1 second \begin{longenum} \item Level 2 first \item Level 2 second \begin{longenum} \item Level 3 first \item Level 3 second \begin{longenum} \item Level 4 first \item Level 4 second \begin{longenum} \item Level 5 first \item Level 5 second \end{longenum} \end{longenum} \end{longenum} \end{longenum} \end{longenum} \end{document}
Thanks for the tips!
Your blog is really helpful, keep going! 😉
Interesting, though imho (in normal circumstances) a list with more than 2 levels means that something is wrong with this document. (Excluding law bills, technical docs etc., for which this advice is really useful, I imagine.)
Nice post once again. Thank you. For other kinds of enumeration, e.g. Greek letters, binary numbers or English number words, check out the moreenum package http://www.ctan.org/pkg/moreenum.
Its useful because normal enumerate envoronment does not support more than four levels…. Good thing is that, it can be nested to more levels, as well…
Thank you very much for this hint! I’ve searched for a solution for a couple of days 🙂
Thank you very much. Its worked
Thanks a lot, do you know how it would work on Beamer?