超过 26 个字母的编号

超过 26 个字母的编号

读完这个答案后https://tex.stackexchange.com/a/52604/10898我无法使用该alphalph包来替换任一级别的计数器。请参阅下面的代码:

\documentclass[letterpaper]{article}
\usepackage{alphalph} % unable to use this package based on the answer given.
\usepackage{enumitem}
\setlist[enumerate,1]{label=(\roman*)}
\setlist[enumerate,2]{label=(\alph*)}
\begin{document}
\begin{enumerate}
\item 
    \begin{enumerate}
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item 
    \item
    \item 
    \item 
    \item 
    \item
    \item 
    \item 
    \item 
    \end{enumerate}
\end{enumerate}
\end{document}

我已做出适当的替换,但没有得到任何结果:

\makeatletter
\newalphalph{\alphmult}[mult]{\@alph}{26}
\makeatother
\renewcommand{\theenumi}{\alphmult{\value{enumi}}}

答案1

我回答了同样的问题这里的文档enumitem有一个关于计数器的额外部分。它的部分8.1 新的计数器表示

\documentclass[]{article}
\usepackage{alphalph}
\usepackage{enumitem}

\makeatletter
\def\enumalphalphcnt#1{\expandafter\@enumalphalphcnt\csname c@#1\endcsname}
\def\@enumalphalphcnt#1{\alphalph{#1}}
\makeatother
\AddEnumerateCounter{\enumalphalphcnt}{\@enumalphalphcnt}{aa}
\setenumerate{label=\arabic*}
\setenumerate[2]{label=\enumalphalphcnt*)}
\begin{document}
\begin{enumerate}
\item foo
\item bar
\item next level
\begin{enumerate}
\item foo \item bar \item foo
\item bar \item foo \item bar
\item foo \item bar \item foo
\item bar \item foo \item bar
\item foo \item bar \item foo
\item bar \item foo \item bar
\item foo \item bar \item foo
\item bar \item foo \item bar
\item foo \item bar \item foo
\item bar \item foo \item bar
\item foo \item bar \item foo
\item bar \item foo \item bar
\item foo \item bar \item foo
\item bar \item foo \item bar
\item foo \item bar \item foo
\item bar \item foo \item bar
\end{enumerate}
\end{enumerate}
\end{document}

相关内容