Latex - 在枚举环境中跳过编号
我想跳过 Latex 枚举环境中的编号来生成列表,如下所示:
(1) 项目 1..
(2) 项目 2..
(5) 项目 5..
(6) 项目 6..
等等。
Latex 代码是自动生成的,因此理想,我想在环境中插入“silent”\item-s,以便它们跟踪编号,但输出中不会出现任何内容。但是,如果我当前只是添加空 \items,我会得到如下列表:
(1) Item 1
(2) Item 2
(3)
(4)
(5) Item 5
(6) Item 6
而空 \item-的方法是最理想的,我非常欢迎任何其他实现跳号的方法。
提前致谢!
I would like to skip numbering in a Latex enumerate environment to generate lists as follows:
(1) Item 1..
(2) Item 2..
(5) Item 5..
(6) Item 6..
and so on.
The Latex code is auto-generated, so ideally, I would like to insert "silent" \item-s in the environment, so that they will keep track of the numbering but nothing will appear on the output. However, if I simply add empty \items currently, I get lists like the following:
(1) Item 1
(2) Item 2
(3)
(4)
(5) Item 5
(6) Item 6
While the empty \item-s approach is the most ideal, I'm more than welcome to any other ways of achieving the number-skipping.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据枚举的级别,简单的
\setcounter{enumi}{5}
就足够了。 (第一个参数中的enum
之后的i
的数量是枚举的级别。另一种方法是调用
\stepcounter{enumi} 与您想要跳过的项目数一样多,这使得跳过的项目数与您跳过之前的项目数无关。
编辑:最后一个选项最像插入“silent
item
's”。编辑:最好不要破解LaTeX,而是使用
list
环境(有关如何使用它的信息,请参阅LaTeX文档)。由于您的 LaTeX 代码是自动生成的,因此生成标签并将它们放入列表环境中应该不难。Depending on the level of enumeration, a simple
\setcounter{enumi}{5}
would suffice. (the number ofi
's after theenum
in the first argument is the level of enumeration.Another approach would be to call
\stepcounter{enumi}
as many times as you want to skip items. This makes the number of skipped items independent of the number of items before you skip.EDIT: the last option is the most like inserting "silent
item
's".EDIT: its probably best not to hack LaTeX, but use the
list
environment (see the LaTeX documentation on how to use this). Since your LaTeX code is auto-generated, it should not be hard to generate the labels, and put them in a list environment.您还可以使用
\addtocounter{enumi}{2}
(例如,在您的特定情况下)跳过 2 项。You can also use
\addtocounter{enumi}{2}
(for example, in your particular case) to skip 2 items.