I have been studying the way that custom enumeration labels work From source2e.pdf I get:
\def\alph#1{\expandafter\@alph\csname c@#1\endcsname}
\def\@alph#1{
\ifcase#1\or a\or b\or 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 q\or r\or s\or t\or u\or
v\or w\orx\ory\or z\else\@ctrerr\fi}
I have also been using the working example from this answer
\makeatletter
\newcommand{\greekalpha}[1]{\c@greekalpha{#1}}
\newcommand{\c@greekalpha}[1]{{
\ifcase\number\value{#1} \or α \or β \or γ \or δ \or\fi}}
\makeatother
So I tried my own version of greek alphabet in an almost gargo cult manner to see what happens:
\makeatletter
\def\greekc#1{\expandafter\@greekc\csname c@#1 \endcsname}
\def\@greekc#1{\ifcase #1 \or α\or β\or γ\or δ\else\@ctreerr \fi}
\makeatother
Unfortunately it produces an error: 'Missing number, treated as zero' in the following example:
\documentclass[11pt]{article}
\usepackage{amsfonts}
\usepackage{mathspec}
\setmathsfont(Digits,Latin,Greek)[Uppercase=Regular,Lowercase=Regular,] {Bookman Old Style}
\setmainfont{Bookman Old Style}
\usepackage{enumitem}
\begin{document}
\newcounter{greekctr}\stepcounter{greekctr}\stepcounter{greekctr}
\makeatletter
\def\greekc#1{\expandafter\@greekc\csname c@#1 \endcsname}
\def\@greekc#1{\ifcase #1 \or α\or β\or γ\or δ\else\@ctreerr \fi}
\makeatother
\makeatletter
\newcommand{\greekalpha}[1]{\c@greekalpha{#1}}
\newcommand{\c@greekalpha}[1]{%
{%
\ifcase\number\value{#1} \or α \or β \or γ \or δ \or\fi
}%
}
\makeatother
\noindent
\begin{itemize}
\item Value of counter: \thegreekctr
\item Alph counter :\alph{greekctr}
\item greekalpha: \greekalpha{greekctr}
\item greekc: \greekc{greekctr}
\end{itemize}
Working use in enumerate environment:
\AddEnumerateCounter*{\greekalpha}{\c@greekalpha}{γ}
\begin{enumerate}[label=\greekalpha*]
\item First
\item Second
\item Third
\item Fourth
\end{enumerate}
\end{document}
Could please somebody explain why my example does not work and also why the other two examples do?
