2

I am trying to redefine the enumerate labels so I can use maya numerals (\mayadigit from the mathabx package, or ideally the fixed rotated ones from here). I tried simply doing \renewcommand\theenumi{\mayadigit{enumi}} as you would do with \roman. In this case I get the following error:

Missing number, treated as zero

It seems that \roman has more structure than \mayadigit. but I cannot find what I need to define the same thing for \mayadigit.

Steve
  • 41
  • Welcome to TeX SX! Maybe with \mayadigit{\value{enumi}]? – Bernard Jul 02 '19 at 15:53
  • Well, that seems to fix the problem. I still get a dot afterwards which I would want to get rid of. Thanks a lot @Bernard – Steve Jul 02 '19 at 15:57
  • 2
    I've taken a look at the documentation of mathbax. As I understand it, the command should be \maya{...}. To remove the final dot, try using enumitem (something like [label=\maya{enumi}]. – Bernard Jul 02 '19 at 16:02
  • The thing with \maya{} is that it adds a box, which I don't like. The downside of \mayadigit{} is that it stops being correct at 21. On the other hand, while \maya{} is correct it becomes unwieldy due to the nature of the ordering (symbols stacked vertically). – Steve Jul 03 '19 at 08:56

1 Answers1

2

I managed to make this work using enumitem by looking at the moreenum package. Here is my solution, in case anyone is interested:


\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{mathabx}
\newcommand\mathbfont{\usefont{U}{mathb}{m}{n}}

\def\mayaexpansion{%
    \mayacntc=\mayacnta\mathbfont
    \ifnum\mayacntc=0 0\else
    \rotatebox[origin=c]{-90}{%
    \loop\ifnum\mayacntc>5\advance\mayacntc by -5\repeat
    \the\mayacntc\mayacntc=\mayacnta
    \loop\ifnum\mayacntc>5\advance\mayacntc by -5 5\repeat}%
    \fi}%

\makeatletter
\newcommand*{\mayalabel}[1]{%
  \expandafter\@mayalabel\csname c@#1\endcsname}
\newcommand*{\@mayalabel}[1]{%
  \protect\mayadigit{\number#1}}
\AddEnumerateCounter{\mayalabel}{\@mayalabel}{\mayadigit{5}}
\makeatother 

\makeatletter
\newcommand*{\mayafull}[1]{%
  \expandafter\@mayafull\csname c@#1\endcsname}
\newcommand*{\@mayafull}[1]{%
  \protect\ensuremath{\maya{\number#1}}}
\AddEnumerateCounter{\mayafull}{\@mayafull}{\maya{5}}
\makeatother

Using [label=\mayalabel*] gives you \mayadigit{} while [label=\mayafull*] gives you \maya{}. None of them really work beyond twenty though. The former is wrong and the latter is bulky.

Steve
  • 41