Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
4  
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

2 Answers 2

up vote 24 down vote accepted

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.

share|improve this answer
    
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}

\addbibresource{\jobname.bib}

\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}

enter image description here

share|improve this answer
    
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
1  
Use arara ;-) –  Marco Daniel Apr 19 '12 at 18:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.