Search code examples
listlatexcountermulti-level

Latex Error: Counter too large: Latex multilevel list


I am using multilevel list in latex with the following:

\documentclass[10pt]{article}
\usepackage{enumerate,etaremune}
\usepackage{amssymb,bibentry}
\usepackage{epstopdf}
\usepackage{paralist, soul}
\usepackage{pgffor}

\renewcommand{\labelenumiii}{\arabic{enumiii}.}

\begin{document}

    \begin{enumerate}
        \item Lavel 1
        \begin{enumerate}
            \item Lavel 2
            \begin{etaremune}
                \item Lavel 3
                \begin{etaremune}
                    \foreach \x in {1,...,30} {%
                         \item Item \x 
                        }
                \end{etaremune} 
            \end{etaremune} 
        
        \end{etaremune} 
    \end{etaremune} 
\end{document}

As I have more than 26 items at level 4, it shows dots after showing Z. Here is a screenshot showing the issue:

enter image description here

Any suggestions on how to continue with the item numbering at level 4 (i.e., AA, AB) instead of showing dots. Thank you.


Solution

  • The enumitem package has an example with reverse numbering in the user guide. It is explicitly described as "very likely not [...] the best", but if you are brave...

    \documentclass{article}
    
    \usepackage{enumitem}
    \usepackage{calc,cleveref,crossreftools}
    
    \crtrefundefinedtext{0}
    
    \usepackage{alphalph}   
    \makeatletter
    % from https://tex.stackexchange.com/a/594860/36296
    \newcommand{\AlphAlphFmt}[1]{\@alphfmt{#1}}  % Define the \alphalph wrapper for enumitem 
    \newcommand{\@alphfmt}[1]{\AlphAlph{\value{#1}}}  % Internal representation 
    \AddEnumerateCounter{\alphalphFmt}{\@alphfmt}{aaa} % Register this new format
    \makeatother
    
    \newcounter{revcount}
    \newcommand\revcounter[1]{%
      \setcounter{revcount}{1+\crtcrefnumber{enum-\EnumitemId}-\value{#1}}}
    \AddEnumerateCounter\revcounter\revcounter{} % the 2nd is dummy
    
    \SetEnumitemKey{revarabic}
      {label = \revcounter*\AlphAlphFmt{revcount}.,
       ref   = (\arabic{revcount}),
       after = \label{enum-\EnumitemId}}
       
    
    
    \usepackage{pgffor}
       
    \begin{document}
    
        \begin{enumerate}
            \item Lavel 1
            \begin{enumerate}
                \item Lavel 2
                \begin{enumerate}
                    \item Lavel 3
                    \begin{enumerate}[revarabic]
                             \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  \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  \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  \item Item  \item Item  \item Item  \item Item  \item Item 
                    \end{enumerate} 
                \end{enumerate} 
            
            \end{enumerate} 
        \end{enumerate} 
    
    \end{document}
    

    enter image description here