[Tex/LaTex] Error: Counter too large! with \alph{cntr} and cntr>26

counterserrorsnumbering

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.

Best Answer

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.