Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to create a five level deep list using the enumitem package. I found this suggestion on stackoverflow and implemented it as follows

\documentclass[twoside,a4paper,12pt]{report}
\usepackage{enumitem}
\setlistdepth{9}

\begin{document}
\begin{enumerate}
\item 1st level
    \begin{enumerate}
    \item 2nd level
        \begin{enumerate}
        \item 3rd level
            \begin{enumerate}
            \item 4th level
                \begin{enumerate}
                \item 5th level
                \end{enumerate}
            \end{enumerate}
        \end{enumerate}
    \end{enumerate}
\end{enumerate}
\end{document}

But still get the error too deeply nested. Using itemize environments is unfortunately not an option.

In the link provided it is mentioned that the \setlistdepth{} only works from a certain version on, how do I find out which version I am using?

share|improve this question
    
To see which version of a package you are using it is best to look in the .log file and search for the particular package. –  Peter Grill Jan 17 '12 at 20:48

1 Answer 1

up vote 15 down vote accepted

LaTeX has a limit of depth of lists to save counters. However, you can clone the existing enumerate environment and increase the depth with the enumitem pacakge:

\newlist{myEnumerate}{enumerate}{6}

You then need to use \setlist to set up the counters for each depth, and use \setlistdepth{} to increase the default depth limit of 6.

enter image description here

Note:

  • Without the use of \setlistdepth{9} a depth larger than 6 will result in:

    LaTeX Error: Too deeply nested.

  • Have tested this to a depth of 15 and seems to work fine, but if you have a high list depth, you really need to reconsider the formatting of the information that you are trying to convey.

Code:

\documentclass{article}
\usepackage{enumitem}
\setlistdepth{9}

\newlist{myEnumerate}{enumerate}{9}
\setlist[myEnumerate,1]{label=(\arabic*)}
\setlist[myEnumerate,2]{label=(\Roman*)}
\setlist[myEnumerate,3]{label=(\Alph*)}
\setlist[myEnumerate,4]{label=(\roman*)}
\setlist[myEnumerate,5]{label=(\alph*)}
\setlist[myEnumerate,6]{label=(\arabic*)}
\setlist[myEnumerate,7]{label=(\Roman*)}
\setlist[myEnumerate,8]{label=(\Alph*)}
\setlist[myEnumerate,9]{label=(\roman*)}

\begin{document}
\begin{myEnumerate}
\item 1st level
    \begin{myEnumerate}
    \item 2nd level
        \begin{myEnumerate}
        \item 3rd level
            \begin{myEnumerate}
            \item 4th level
                \begin{myEnumerate}
                \item 5th level
                    \begin{myEnumerate}
                    \item 6th level
                        \begin{myEnumerate}
                        \item 7th level
                            \begin{myEnumerate}
                            \item 8th level
                                \begin{myEnumerate}
                                \item 9th level
                                \end{myEnumerate}
                            \end{myEnumerate}
                        \end{myEnumerate}
                    \end{myEnumerate}
                \end{myEnumerate}
            \end{myEnumerate}
        \end{myEnumerate}
    \end{myEnumerate}
\end{myEnumerate}
\end{document}
share|improve this answer
    
that is sweet! However, I still do not fully understand it. Changing the list definition and initialization to \newlist{myEnumerate}{enumerate}{9} \setlist[myEnumerate,1,2,3,4,5,6,7,8,9]{label=(\arabic*)} will take me to the 7th(!!) level before throwing the error. Why is that? –  D.Roepo Jan 17 '12 at 21:01
    
Have updated solution to a higher limit. –  Peter Grill Jan 17 '12 at 21:56
    
What do you mean it still doesn't? I have shown the above to work to a depth of 9 and tested it to a depth of 15? How much deeper do you want it to go? –  Peter Grill Jan 18 '12 at 16:18
    
no, no. It does work, I forgot to \setlistdepth{} b/c I didn't see it have any effect. And I just want to go to depth five, where it indeed is not needed –  D.Roepo Jan 18 '12 at 16:27
    
This is a wonderful solution. However, references to labels do not include the complete nested location. Is this implementable? –  beethree Aug 5 '13 at 3:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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