14

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

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

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}

\mayadigit{17}

\[
\maya{2013},
\maya{123},
\maya{45}
\]
\end{document}

It produces: minimal output

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

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;
  adjust_dot1((0.5w,0.25h),dtsz,false,false);
  dot(1,1');
  adjust_dot2((0.5w,0.75h),dtsz,false,false);
  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;
  adjust_dot1((0.25h,0.5w),dtsz,false,false);
  dot(1,1');
  adjust_dot2((0.75h,0.5w),dtsz,false,false);
  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: enter image description here

I'll keep trying

10
  • Please provide a minimal working example (MWE) we can play with.
    – masu
    Commented Nov 4, 2013 at 18:16
  • This one might help.
    – masu
    Commented 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.
    – egreg
    Commented 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?
    – azetina
    Commented 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 "..")
    – drini
    Commented Nov 4, 2013 at 20:22

2 Answers 2

14

The following seems to work as expected:

enter image description here

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

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

\begin{document}

\mayadigit{17}

\[
  \maya{2013}, \maya{123}, \maya{45}
\]

\noindent\hrulefill

\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}%

\mayadigit{17}

\[
  \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.

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

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:

enter image description here

\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 files 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).

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .