tags:

views:

315

answers:

3

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...

+1  A: 

IIRC, the limitation is in the number of enumeration counters provided by default. I've never had to do this but you might want to check the LaTeX Wikibook for some hints. The last time that I had to serious tweak lists, I ended up falling back to using straight TeX macros based on some stuff in TeX for the Impatient.

D.Shawley
I don't think so --- Added a counter with \newcounter and a label with \newcommand{\labelenumv} and I still get "Too deeply nested." Maybe I'm missing something?
c4757p
I did some more delving (in `ltlists.dtx`) and it looks like the limits are pretty much hard coded if you use the LaTeX provided lists. `\list` limits you to six levels where `\enumerate` and `\itemize` limit you to four levels.
D.Shawley
You could define your own list macro based off of `\list` and extend the limit or write your own environment from scratch. It doesn't look like the standard LaTeX list environments are going to let you nest them much more deeply.
D.Shawley
+2  A: 

You need to copy the definitions of \enumerate and \itemize from file latex.ltx and change the code from

  \ifnum \@itemdepth >\thr@@\@toodeep\else

to

  \ifnum \@itemdepth >4\@toodeep\else

and you will also need to define counters enumv, control sequence \labelitemv, and bunch of other stuff to support depth 5.

N.B. If you want to do this outside a .sty file, you'll need to surround your new definitions by

\makeatletter
....
\makeatother

In all it's a fair amount of detail work, but if you are accustomed to hacking LaTeX, it is fairly straightforward. If the task seems too much, and you don't have time to learn, you could try posting a bounty here or elsewhere :-)

Norman Ramsey
No, I'm comfortable doing that. Thanks --- I'll check it out.
c4757p
That worked. Thank you.
c4757p