在 LaTeX 中更改枚举环境中嵌套列表的编号
我想在 LaTeX 中生成以下内容:
1. Item
2. Item
3a. Item
3b. Item
4. Item
5. Item
基本上我已经尝试使用嵌套的 enumerate
环境,但我在实现不同的编号时遇到问题。
如何在 LaTeX 中执行上述操作?
I want to produce the following in LaTeX:
1. Item
2. Item
3a. Item
3b. Item
4. Item
5. Item
Basically I have already tried using nested enumerate
environments, but I have a problem with implementing the different numberings.
How can I do the above in LaTeX?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
{enumerate}
环境的目的是通过算法对事物进行编号。如果您确实希望数字如问题中所示显示,我无法确定您想要使用什么算法。对于您展示的示例,我认为最简单的方法就是自己对标签进行编程,而不是尝试对 LaTeX 进行编程来做到这一点。我会这样做:使用 LaTeX,解决问题的最快路径通常涉及暴力:-)
The purpose of the
{enumerate}
environment is to number things algorithmically. If you really want the numbers to appear as shown in your question, I can't identify what algorithm you want to be used. For the example you show, I think the easiest method is just to program the labels yourself instead of trying to program LaTeX to do it. I would just do it this way:With LaTeX, the quickest path to a solution often involves brute force :-)
快速而肮脏:
(Mica 的版本在此代码的第一次迭代中使用)
正确的方法涉及基于枚举定义环境,以对计数器执行正确的操作:如果您愿意,上面的代码将需要调整才能使其正常工作更改列表环境的嵌套。
Quick and dirty:
(Mica's version was used in the first iteration of this code)
The right way involves defining environments based on enumerate that do the right thing with the counters: the above code would need tweaking to get it to work right if you wanted to change the nesting of the list environments.
然后将
renewcommand
中的\Roman
更改为您想要的任何内容:\alph
或\arabic
Then change the
\Roman
in therenewcommand
to whatever you want it to be:\alph
or\arabic