【问题标题】:How to enumerate only on \alph level in an enumerate environment, but on \arabic between environments?如何在枚举环境中仅在 \alph 级别上枚举,但在环境之间的 \arabic 上枚举?
【发布时间】:2020-07-22 19:30:24
【问题描述】:

我正在尝试在 LaTeX 中创建一个枚举,其中第一个枚举输出以下内容:

(1a) 这是一个例子
(1b) 另一个例子

但我的乳胶文档中的下一个枚举输出以下内容:

(2a) 这是一个例子
(2b) 另一个例子

所以我只想更新枚举中的 alpha(并保持整数相同),但如果有意义的话,我想更新不同枚举之间的整数。

这有可能吗?最好是自动的,我已经尝试过对每个 \item 分别使用方括号并且可以工作,但是当我删除一个枚举部分时,它会有很多变化。

谢谢!

【问题讨论】:

  • 请创建一个minimal reproducible example,向我们展示您使用的文档类等
  • 我的文档类是\article。我还没有其他任何东西,我只想知道这是否可能

标签: latex


【解决方案1】:

enumerate 包的可能性:

\documentclass{article}
\usepackage{enumerate}

\newcounter{foo}

\usepackage{etoolbox}

\AtBeginEnvironment{enumerate}{\addtocounter{foo}{1}}

\begin{document}

\begin{enumerate}[({\thefoo}a)]
\item one
\item two
\end{enumerate}


text


\begin{enumerate}[({\thefoo}a)]
\item one
\item two
\end{enumerate}

text

\begin{enumerate}[({\thefoo}a)]
\item one
\item two
\end{enumerate}


\end{document}

【讨论】:

    猜你喜欢
    • 2023-04-04
    • 2013-10-27
    • 2011-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-02
    相关资源
    最近更新 更多