enumerate with custom alphabet for items

I'm looking for a way to use enumerate from package enumitem with a custom alphabet. For starting, I just wanted to use letters instead of numbers, so I renewed the command that outputs item labels. I did:

\renewcommand{\labelenumi}{\alph{enumi}}


before \begin{enumerate}. But soon after I realised that I need letters č, š and ž, and that my alphabet has 25 characters, so I decided to create a command that would output a letter corresponding to a number. I did:

\newcommand*{\xslalph}[1]{%
\ifcase#1\or a\or b\or c\or \v{c}\or d\or e\or f\or g\or h\or i%
\or j\or k\or l\or m\or n\or o\or p\or r\or s\or \v{s}%
\or t\or u\or v\or z\or \v{z}%
\else\@ctrerr\fi
}



What would be the appropriate way to "pass" some number into my \xslalph command from the enumi counter? I'm sorry for misunderstanding, but I come from the world of C-like languages and am not used to LaTeX.

First of all, welcome to TeX.SX!

enumitem allows to do use other numbering systems in enumerate environments with the \AddEnumerateCounter command. It is described in section 8.1 of the documentation.

Here's an implementation of the counter using your \xslalph command.

\documentclass{article}
\usepackage{enumitem}
\makeatletter
\newcommand{\xslalph}[1]{\expandafter\@xslalph\csname c@#1\endcsname}
\newcommand{\@xslalph}[1]{%
\ifcase#1\or a\or b\or c\or \v{c}\or d\or e\or f\or g\or h\or i%
\or j\or k\or l\or m\or n\or o\or p\or r\or s\or \v{s}%
\or t\or u\or v\or z\or \v{z}%
\else\@ctrerr\fi%
}
\makeatother
\begin{document}
\begin{enumerate}[label=\xslalph*)]
\item test
\item test
\item test
\item test
\end{enumerate}
\end{document}


• Thank you very much, can confirm this works as expected with latest TeX and enumitem on TeXStudio.
– A4L
Apr 12 '20 at 15:00
• +and I am very sorry for not RTFDing and letting myself be spoon-fed. :D
– A4L
Apr 12 '20 at 15:08
• I want to do something similar with labels from Georgian language. But I can not figure out how to do it. What should I use instead of \xslalf and \@xslalph from above? May 21 '20 at 5:35
• @EvgenyKuznetsov It should work with these commands if you change the alphabet used in the definition of \@xslalph. So you should replace a,b,c,\vc{c}, etc. with the letters of the alphabet that you want to use, placed in correct order. May 21 '20 at 14:07
• I did what you suggest but do not why but it did not work. Then I tried example from package documentation and it worked fine. Thank you for attention. May 21 '20 at 22:48