# Error: Counter too large! with \alph{cntr} and cntr>26

I would like to have \alph{counter} for values larger than 26. The following MnWE gives me the error ! LaTeX Error: Counter too large.

\documentclass{article}
\begin{document}

\begin{enumerate}
\def\theenumi{\alph{enumi}}
\setcounter{enumi}{24}
\item twenty-five
\item twenty-six
\item twenty-seven
\end{enumerate}

\end{document}


I would like it to behave like one of these:

..., x, y, z, aa, bb, cc, ..., xx, yy, zz, aaa, bbb, ccc, ... (preferred)
..., x, y, z, aa, ab, ac, ..., ax, ay, az, ba,  bb,  bc,  ... (can be if nothing else works)


A solution without LaTeX3 extensions would be awesome as I cannot run LaTeX3 extensions.

-
Look at the alphalph package. –  egreg Apr 19 '12 at 16:09
@egreg Great! Would you like to extend it into an answer or should I post the answer as CW? –  tohecz Apr 19 '12 at 16:25

The alphalph package by H. Oberdiek provides the second numbering system out of the box. As usual with Heiko's packages, a counter representation such as

\renewcommand{\thesection}{\alphalph{\value{section}}}


is completely expandable.

And, as you remark in comments, with

\makeatletter
\newalphalph{\alphmult}[mult]{\@alph}{26}
\makeatother
\renewcommand{\thesection}{\alphmult{\value{section}}}


you get your preferred way. Of course, replace section with the counter you need.

-
For new kinds of symbol wrapping, see this question: tex.stackexchange.com/questions/37447/… –  Seamus Apr 19 '12 at 16:33
There is a way in the package you mention, it is \newalphalph{\@aalph}[mult]{\@alph}{26} \def\aalph#1{\@aalph{\value{#1}}} ;) –  tohecz Apr 19 '12 at 16:38
@egreg How do you get this to work with enumitem package. I do not want to create a question because I have seen another one and it has been closed due to the same reason. –  azetina Mar 20 '13 at 19:36
@azetina I don't think this fits in the \AddEnumerateCounter scheme of enumitem. –  egreg Mar 20 '13 at 20:22

Should you happen to use biblatex for your bibliography, you may use its \mknumalph macro for counter values up to 702 ("zz").

\documentclass{article}

\usepackage{biblatex}

% Everything from here to \begin{document} only serves to avoid biber errors
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
\end{filecontents}

\nocite{*}

\begin{document}

\begin{enumerate}
\def\theenumi{\mknumalph{\value{enumi}}}
\setcounter{enumi}{24}
\item twenty-five
\item twenty-six
\item twenty-seven
\end{enumerate}

\end{document}


-
Why do you mention "biber errors"? You don't need to run biber ;-) –  Marco Daniel Apr 19 '12 at 18:46
Tell that latexmk. ;-) –  lockstep Apr 19 '12 at 18:47
Use arara ;-) –  Marco Daniel Apr 19 '12 at 18:48