Categories:

# Malayalam Page Numbers using XeLatex

I was typesetting a book in Malayalam using XeLatex. and I was wondering if it is possible to use Malayalam numerals for page numbers.

By referring a stackexchange answer I wrote the following macro.

%%%———–Malayalam Page Number—————%%%%

\makeatletter
\def\@malnumber#1{\expandafter\@@malnumber\number#1\@nil}
\def\@@malnumber#1{%
\ifx#1\@nil
\else
\char\numexpr#1+”0D66\relax
\expandafter\@@malnumber\fi}
\def\malcounter#1{\expandafter\@malnumber\csname c@#1\endcsname}
\def\malnumeral#1{\@@malnumber#1\@nil}
\makeatother

\def\MalpageNum{\malcounter{page}}

Now the \MalpageNum command will give you the current page number using the Malayalam numerals.

br,

Hrishi

Posted in Hack, LateX, Linux, smc, XeLatex.