Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum nesting level of lists in Latex

Tags:

latex

Is there a way to increase the maximum nesting level of lists (enumerate, etc) in Latex? I need five levels for a class, and Google isn't finding me anything...

like image 269
c4757p Avatar asked Dec 20 '09 14:12

c4757p


People also ask

How do you itemize in LaTeX?

Using lists in LaTeX is pretty straightforward and doesn't require you do add any additional packages. For unordered lists, LaTeX provides the itemize environment and for ordered lists there is the enumerate environment. The elements within both environments have to be declared beginning with the \item command.

How do I make a numbered list in LaTeX?

To create a numbered list in LaTeX, you can use the \begin{enumerate} command along with the \item command. You can also create sub-levels of the numbered lists by adding a sub-command within the greater enumerate environment.

How do you make a bulleted list in LaTeX?

Unordered (bulleted) lists are produced by the itemize environment, where each list entry starts by using the \item command, which also generates the bullet symbol.


2 Answers

Solution using enumitem package

  1. If you do not have the version 3 of the enumitem.sty installed, then download enumitem.sty manually and place it into your project's folder.
  2. For itemize lists, add the following to the preamble of your document:
 \usepackage{enumitem} \setlistdepth{9}  \setlist[itemize,1]{label=$\bullet$} \setlist[itemize,2]{label=$\bullet$} \setlist[itemize,3]{label=$\bullet$} \setlist[itemize,4]{label=$\bullet$} \setlist[itemize,5]{label=$\bullet$} \setlist[itemize,6]{label=$\bullet$} \setlist[itemize,7]{label=$\bullet$} \setlist[itemize,8]{label=$\bullet$} \setlist[itemize,9]{label=$\bullet$}  \renewlist{itemize}{itemize}{9} 

For the other list types this has to be adapted.

Troubleshooting help

  • if you get "! Undefined control sequence. \setlistdepth", the version of enumitem.sty that LaTeX uses is older then version 3.
  • if you still get the "Too deeply nested" error, then the renewlist command is missing for the list type you use
  • if you get "Package enumitem Error: Undefined label.", then the label for one of the levels was not definied with the \setlist[itemize,$LEVEL] ... command
like image 77
Alex Avatar answered Sep 21 '22 06:09

Alex


You can use the enumitem package. After what you just have to put the depth level you want:

\usepackage{enumitem} ... \setlistdepth{9} 

And you can have up to 9 nested levels for your lists, easy ;-)

This feature is available in the package since 3.0 (Ubuntu installed me the 2.2 for instance). In case where you have an old version just replace it by: http://ctan.mackichan.com/macros/latex/contrib/enumitem/enumitem.sty

Hope that helps!

like image 42
Nocia Avatar answered Sep 21 '22 06:09

Nocia