2

When having a list like:

\documentclass[twoside]{book}

\RequirePackage{enumitem}

\begin{document}

\begin{enumerate}[label=\alph*,start=25] \item an item \item an item \item an item \item an item \item an item \item an item \item an item \item an item \end{enumerate}

\end{document}

we get the error:

! LaTeX Error: Counter too large.

See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ...

l.23 \item a n item

due to the fact that the counter exceeds 26.

When having e.g. HTML the numbering would be like: y, z, aa, ab, ac, ad or at least wrap around back to a?

Does something like this exist in LaTeX as well?

albert
  • 1,313

1 Answers1

4

Adapting one of the answers from here: Counter too large error with \item

\documentclass[twoside]{book}

\RequirePackage{enumitem,alphalph} \makeatletter \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 \begin{document} \begin{enumerate}[label={(\AlphAlphFmt*)},start=25] \item an item \item an item \item an item \item an item \item an item \item an item \item an item \item an item \end{enumerate}

\end{document}

enter image description here

  • Unrelated, but I'm curious: is there a reason for using \RequirePackage rather than \usepackage? – chsk Apr 28 '21 at 18:16
  • @chsk I just followed from the question of the OP. However, if you are interested, https://tex.stackexchange.com/questions/19919/whats-the-difference-between-requirepackage-and-usepackage – Steven B. Segletes Apr 28 '21 at 18:18
  • The reason I used \RequirePackage is that I cut and pasted it from a sty file. – albert Apr 28 '21 at 18:23
  • @StevenB.Segletes thanks, good to know! – chsk Apr 28 '21 at 19:12
  • Since we may need the equivalent in capital letters, I would suggest a slight modification in order to keep on with the difference between \alphalphFmt and \AlphAlphFmt : \makeatletter \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 – user1771398 Feb 18 '24 at 08:09