枚舉用數字替換大寫字母“A”?

枚舉用數字替換大寫字母“A”?

當我嘗試這樣做時:

\documentclass{amsart}
\usepackage{enumerate}

\begin{document}

\begin{enumerate}[(A1)]
\item blah
\item blah blah
\end{enumerate}

\end{document}

我得到的輸出:

(11) blah
(22) blah blah

它似乎與其他大寫字母配合得很好,但我特別需要這個清單的大寫字母“A”。我該如何修復它?

答案1

輸出確實有點令人驚訝*,正如我所期望的那樣:

(A1) 廢話

(B2) 巴拉巴拉

我預料到了這一點,因為 的輸入\begin{enumerate}[...]為您的列表引入了計數變量,實際上您給了它兩個計數變量。

這裡可能的活躍角色是

  • I對於大寫羅馬數字
  • i對於小羅馬數字
  • 1對於阿拉伯數字
  • A對於大寫字母
  • a對於小寫字母

您命令中的最後一個活躍角色獲勝。我不知道第二個數字是從哪裡來的。所有其他字元都會被忽略,例如括號或“其他大寫字母”。

如果您想enumerate忽略 5 個活動字元之一,則必須將其括在大括號中。

% arara: pdflatex

\documentclass{amsart}
\usepackage{enumerate}

\begin{document}    
    \begin{enumerate}[({A}1)]
        \item blah
        \item blah blah
    \end{enumerate} 
\end{document}

在此輸入影像描述


*我聯繫了這個包的維護者,這是卡萊爾先生的評論:

你得到 11, 22 因為每個特殊字母都會變成 \theenumi並定義為(比如說)\alph{enumi}。因此,對於A1您 get \theenumi\theenumi並定義\theenumi\alphthen 的\arabic情況,後一個定義獲勝,但您仍然會列印兩個計數器。

相關內容