Latex 中列表的最大嵌套级别
有没有办法增加 Latex 中列表(枚举等)的最大嵌套级别?我的课程需要五个级别,但 Google 没有找到任何内容......
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
使用 enumitem 包的解决方案
对于其他列表类型,必须对此进行调整。
如果您收到“!未定义的控制序列。\setlistdepth”,则故障排除帮助
enumitem.sty
版本早于版本 3。\setlist[itemize,$LEVEL] 定义。 .
命令Solution using enumitem package
For the other list types this has to be adapted.
Troubleshooting help
enumitem.sty
that LaTeX uses is older then version 3.\setlist[itemize,$LEVEL] ...
command您可以使用 enumitem 包。之后你只需输入你想要的深度级别:
你的列表最多可以有 9 个嵌套级别,很简单;-)
自 3.0 起,此功能在软件包中可用(例如 Ubuntu 安装了 2.2)。如果您有旧版本,只需将其替换为:
http://ctan.mackichan.com/macros/latex/contrib/enumitem/enumitem.sty< /a>
希望有帮助!
You can use the enumitem package. After what you just have to put the depth level you want:
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!
您需要从文件
latex.ltx
中复制\enumerate
和\itemize
的定义,并将代码从 更改为 ,您
还需要定义计数器
enumv
、控制序列\labelitemv
以及其他支持深度 5 的内容。注意,如果您想在 .sty 文件之外执行此操作,则需要围绕你的新定义
总而言之,这是相当多的细节工作,但如果你习惯于破解 LaTeX,那么这相当简单。如果任务看起来太多,并且您没有时间学习,您可以尝试在此处或其他地方发布赏金:-)
You need to copy the definitions of
\enumerate
and\itemize
from filelatex.ltx
and change the code fromto
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
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 :-)
您还可以在
enumerate-environment
中使用itemize-environment
。You could also just use an
itemize-environment
within anenumerate-environment
.IIRC,限制在于默认提供的枚举计数器的数量。我从来没有这样做过,但你可能想查看 LaTeX Wikibook 获取一些提示。上次我不得不认真调整列表时,我最终回到使用基于 TeX 供不耐烦的人使用。
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.