# horizontal maya numerals (mathabx)

After researching, mathabx is the only package supporting maya numerals within tex.

For example, typing $\maya{2013}$ results in:

now the problem is... the numerals are rotated sideways (oddly, the conch shell meaning zero is not rotated).

That is.. groups are properly stacked vertically but within each group, the numbers themselves are rotated sideways

Compare with wikipedia's example for 19

I understand the reason is that the font was coded with numbers rotated, but I don't really understand what should I edit in order to get horizontal numbers

I gather the numbers are created in fonts\source\public\mathabx\maydigit.mf but opening it shows metafont and not tex, and metafont looks like chinese (mayan?) to me

Could someone help me understand how to rotate back numerals into horizontal mode?

EDIT>

Minimal example:

\documentclass{minimal}
\usepackage{mathabx}

\newcommand\mathbfont{\usefont{U}{mathb}{m}{n}}

\begin{document}

$\maya{2013}, \maya{123}, \maya{45}$
\end{document}


It produces:

What I try to achieve (edited in a graphics program):

I don't need to fix \maya since it behaves properly.

It selects the correct numeral and puts it on the proepr place. What I need is to rotate "the number symbol"

So I went ahead and tried to edit the source maydigit.mf. I thought I could try fixing "two" (two points) so instead of showing ":" it would show ".."

The relevant code is

beginchar("2",fig_width#+2appr#,fig_height#,0);
"Maya numeral 2 (ca)";
%  italcorr fig_height#*slant-0.5u#;
pickup fine.nib;
dot(1,1');
dot(2,2');
endchar;


And I figured swapping those coordinates (0.5w,0.25h) and the other would to the trick. I did it, saved source, recompiled my .tex sample... and it had no effect (it was as if the fonts had already been "compiled" and changing the source did not update the fonts used themselves).

I'm beginning to see the light. Changing that code to

beginchar("2",fig_width#+2appr#,fig_height#,0);
"Maya numeral 2 (ca)";
%  italcorr fig_height#*slant-0.5u#;
pickup fine.nib;
dot(1,1');
dot(2,2');
endchar;


works (spacing is funny, but at least the two dots are now horizontal). Not only I had to swap the coordinates, but also the suffixes (h, w).

Here the result:

I'll keep trying

• Please provide a minimal working example (MWE) we can play with.
– masu
Nov 4, 2013 at 18:16
• This one might help.
– masu
Nov 4, 2013 at 18:22
• As far as I can see, the digits are built by composing simple shapes (for 1, 2, 3, 4 and 5). There's no LaTeX support for \maya, too. Nov 4, 2013 at 19:03
• Could you tell me what the glyphs for the number 2013 should be and the order in which the should appear? Nov 4, 2013 at 19:58
• @azetina: The glyphs should be "bar (5), conch, three dots on two bars (13)". Top bar 5 (times 20^2 = 2000) middle conch 0 (times 20^1 = 0) bottom 13 (three dots + 2 bars = 3 + 10 times 20^0 = 13) so total is 2000 + 0 + 13. But again, the problem is not the macro doing the math. The problem is that the numbers are rotated (so 2 is ":" instead of "..") Nov 4, 2013 at 20:22

The following seems to work as expected:

\documentclass{article}
\usepackage{graphicx,mathabx}% http://ctan.org/pkg/{graphicx,mathabx}

\newcommand\mathbfont{\usefont{U}{mathb}{m}{n}}

\begin{document}

$\maya{2013}, \maya{123}, \maya{45}$

\noindent\hrulefill

\def\mayaexpansion{%
\mayacntc=\mayacnta\mathbfont
\ifnum\mayacntc=0 0\else
\rotatebox[origin=c]{-90}{%
\the\mayacntc\mayacntc=\mayacnta
\fi}%

$\maya{2013}, \maya{123}, \maya{45}$

\end{document}


The definition of \mayaexpansion is taken from mathabx.dcl. Inserted is a graphicx rotation of -90 degrees around the center of the object. This is only done if the object is not zero.

• Wow. You really nailed :) I can't express all my gratitude (editing all that metapost code for each glyph was driving me insane) Nov 4, 2013 at 20:50

NOTE: The following does not work with pdfLaTeX.

In the website, MayaPS: Typing Maya with TeX/LaTeX you will find a font package that enables you to use several maya glyphs like for writing numbers as what you are requesting. Here is a MWE:

\documentclass[letterpaper]{article}
\input mayaps
\begin{document}
\mayaSize{0.5cm}
\begin{minipage}{1cm}
\maya{905}\\
\maya{900}\\
\maya{913}
\end{minipage}
\end{document}


The numbers you see here, 905, 900 and 913 are those assigned to the glyphs. You can find these on page 10 and ll of the codex-map file. For you to compile the document you will need to copy the ﬁles mayaps.tex, mayaps.pro, codex.mpf, red89.tex (if needed), and mpfmap.tex (if needed) to the current directory (folder). You can find this on page 5 of the package documentation (Reference Manual).

• But MayaPS specifically states it will NOT work with PDFlatex, so it was not an option. Nov 4, 2013 at 20:21
• (although I know I didn't mention that restriction) Nov 4, 2013 at 20:52
• @drini Appreciate the upvote. Nov 4, 2013 at 20:53