This question led to a new package:
babyloniannum
[1]
I would like to typeset Babylonian numerals as shown e.g. on
Wikipedia
[2]. Ideally I would like a command where I can type something like $\babylonian{42}$
and get it to produce the appropriate symbol, but I will be also happy if there is a font or something where I can get the symbols and then stack them together myself.
Is there anything for this already implemented?
There is a paleo-babylonian font
on this page
[1]. Using fontspec
with XeTeX or LuaTex and things like \char"1240D
, you could easily typeset what you need.
Here is a quick example for XeTeX.
Note: It turns out that the font doc is wrong (Ah! If they used TeX to generate it...) and 9 is actually mapped at 1240E
, quite logically. Also, 20 seems to be missing while 30 is mapped several times for some reason, so I'm doing 20 with 2 "10" glyphs and a bit of kerning. I'm also adjust kerning between tens and units.
\documentclass[paper=a4]{minimal}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{pgffor}
\usepackage{numname}
\newcommand{\babydisp}[1]{%
\fontspec{Santakku}{\char"#1}}
\makeatletter
\newcommand{\babynum}[1]{%
\numdigits{#1}%
\ifcase\c@xsm@mctr
\or
\babydisp{1230B} %10
\or
\babydisp{1230B}\kern-1.5pt{}\babydisp{1230B} %20 -- unknown?
\or
\babydisp{1230D} %30
\or
\babydisp{1240F} %40
\or
\babydisp{12410} %50
\fi
\kern-4pt{}%
\ifcase\c@ism@mctr
\or
\babydisp{12079} %1
\or
\babydisp{1222B} %2
\or
\babydisp{12408} %3
\or
\babydisp{120FB} %4
\or
\babydisp{1240A} %5
\or
\babydisp{1240B} %6
\or
\babydisp{1240C} %7
\or
\babydisp{1240D} %8
\or
\babydisp{1240E} %9
\fi
}
\makeatother
\begin{document}
%\noindent\foreach \n in {1,...,59}{%
%\n\quad\babynum{\n}\\
%}
\begin{minipage}{0.2\textwidth}
\noindent\foreach \n in {1,...,20}{%
\n\quad\babynum{\n}\\
}
\end{minipage}
\begin{minipage}{0.2\textwidth}
\noindent\foreach \n in {21,...,40}{%
\n\quad\babynum{\n}\\
}
\end{minipage}
\begin{minipage}{0.2\textwidth}
\noindent\foreach \n in {41,...,59}{%
\n\quad\babynum{\n}\\
}
\end{minipage} \hfill
\end{document}
Edit: There is now a package on CTAN [2], so you can use it as follows:
\documentclass[paper=a4]{minimal}
\usepackage{pgffor}
\usepackage{babyloniannum}
\begin{document}
\begin{minipage}{0.2\textwidth}
\noindent\foreach \n in {1,...,20}{%
\n\quad\babyloniannum{\n}\\
}
\end{minipage}
\begin{minipage}{0.2\textwidth}
\noindent\foreach \n in {21,...,40}{%
\n\quad\babyloniannum{\n}\\
}
\end{minipage}
\begin{minipage}{0.2\textwidth}
\noindent\foreach \n in {41,...,59}{%
\n\quad\babyloniannum{\n}\\
}
\end{minipage} \hfill
\end{document}
Edit: Version 0.4 of the package allows to typeset numbers beyond 59 (up to 60^9 = 1.0077696 × 10^16 in theory, although I think TeX will give up before that).
[1] http://www.hethport.uni-wuerzburg.de/cuneifont/\ifcase<number> <zero>\or <one>\or <two>\or ...\else <else> \fi
in TeX. - Martin Scharrer
\ifnum
into the \else
clause of \ifcase
. - Martin Scharrer
mod()
in tikz, but can I do that outside of tikz? - raphink
\numdigits
function from numname
since it does the job already. - raphink
\numdigits
returns what I need :-) - raphink
;-)
- doncherry
Wikipedia also has the two needed symbols as SVG vector graphics:
http://en.wikipedia.org/wiki/File:Babylonian_1.svg
http://en.wikipedia.org/wiki/File:Babylonian_10.svg
You can turn them rather easily to PDF using e.g. inkscape --export-pdf=<pdf> <svg>
. Then position them in the shown way for all numbers from 1-59. For larger numbers you would need to add some loop.
It is also possible to make your own font as shown in Create a symbol font from SVG symbols [1].
[1] https://tex.stackexchange.com/questions/22487/create-a-symbol-font-from-svg-symbols