Posted by: Dave Richeson | August 30, 2012

## Ancient number systems in XeTeX

I am teaching a history of mathematics class this semester. We are beginning with a brief discussion of ancient number systems: Egyptian, Babylonian, Mayan, Chinese, Incan, GreekRoman, and Hindu-Arabic. As I was writing up the first homework assignment it occured to me that I should investigate whether these numbers could be typeset using LaTeX.

It quickly became apparent that, because fonts are involved, I would have to use XeTeX rather than LaTeX. It was a fun (although time consuming) exercise. In the end I was able to typeset Egyptian hieroglyphics, Babylonian cuneiform, and Chinese rod numerals. Because the syntax was often messy, I spent a while burying the complicated TeX in the headers so that the numbers would be easy to work with in the document.

For example, to generate the Egyptian hieroglyphics for 123 I write

\Ehun\Eten\Eten\Eone\Eone\Eone.

The fraction 1/123 is

\Efrac{\Ehun\Eten\Eten\Eone\Eone\Eone}.

To express 123 in cuneiform all I have to write is

\Bnum{123}.

To create a number board with the Chinese counting rods representing 123 I type

\Cnum{|x|x|x|}{\Cvone & \Chtwo & \Cvthree}.

If you would like to give this a try, download my .tex files:

I’d love to be able to do something similar with the Mayan numbers. I tried for a while, but couldn’t get them to work.

Disclaimer: I know my way around TeX pretty well, but I’m not a power user. It took me quite a while to get all this to work. I’m not sure I can offer much trouble-shooting advice if you can’t get this to work on your computer.

## Responses

1. That’s quite cool! We don’t offer a “History of Mathematics” type course at my college…but I’ll file this post away just in case we eventually do.

2. I don’t have a reason to use this right now, but this is so cool. Thanks for sharing.

3. This is great! Thanks for sharing.

4. Hi Professor Richeson, is it possible that you can share that History of Mathematics course with us?, maybe the reading list, the topics that you cover, some lectures notes, whatever.

• A few people have asked me that. Unfortunately, for day-to-day operations everything is on Moodle (our CMS), and thus it requires a password. But I’ll see what I can do at the end of the semester. It would be nice to do something like you suggest.

5. About Mayan numbers : your difficulty probably comes from the fact that they are not yet encoded in unicode. However, LaTeX packages exists to type Mayan http://www.math.univ-toulouse.fr/~orevkov/mayaps.html and Epi-Olmec http://obelix.ee.duth.gr/~apostolo/Epi-Olmec/ . Since both these writing systems use the same mesoamerican numbers, you can probably use any of the 2 packages for your purpose.

• Thanks! I’ll be sure to look at those links.