# Page-number-style for Marathi

I am new to this forum.

I am facing a problem in page-numbering style. I am using xelatex engine for the document in Marathi Language and in Devanagari script.

In book-document-class when I use \frontmatter and \mainmatter commands, the pages in frontmatter are numbered in roman numbers.

In Marathi Book-printing tradition the numbering style use for front-matter is "Number in Words" eg. एक, दोन, तीन...

I found a similar problem and it's solution in the discussion on this page.

The solution suggested there can be used with some modification to my problem. eg. I may change the definiation as shown in the discussion as

\def\devanagari@alph#1{% \ifcase#1\or क\or ख\or ग\or घ\or ङ\or च\or छ\or ज\or झ\or ञ\or ट\or ठ\or ड\or ढ\or ण\or त\or थ\or द\or ध\or न\or प\or फ\or ब\or भ\or > म\or य\or र\or ल\or व\or श\or ष\or स\or ह\else\@ctrerr\fi}

and instead of क, ख, ग... I may use एक, दोन, तीन...

But in that case I will also get एक, दोन, तीन in enumeration which is not desirable.

Please suggest what can be done in above case.

• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Mike Renfro Jun 11 '17 at 16:49
• I think most of what you need to construct a MWE is already in your description, but editing your question to include it explicitly will help: book document class, xelatex engine (or would lualatex work as well?), very minimal front matter and main matter divisions, and you want the Devangari numbering to only appear in the page numbering in the footer, and nowhere else? Should it override just Roman numbering, or all page numbers? – Mike Renfro Jun 11 '17 at 16:52
• Thanks for the suggestions and sorry for inconvenience. I will try to do it properly. – Sushant Jun 12 '17 at 16:56
• Regarding second point : I want to use Devanagari numbering everywhere in the document. I want to use Devanagari-numbers-in-word for page-numbering in front-matter. Main matter should show page-numbers in Devanagari-numerals. – Sushant Jun 12 '17 at 17:06

Since you may need the "numbers as words" in other places it makes sense to define a new formatting command to do that, and then use that to format the counter in the frontmatter. I've started the command with the first three words that you provided in your question. Obviously you need to fill in the rest. I've taken out the redefinitions of the other counters from the linked question. If you need those, just put them back in.

\documentclass[oneside]{book}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Sanskrit 2003}
\makeatletter
% Modify this to use your "numbers in words".
\newcommand*{\devanagari@words}[1]{%
\ifcase#1\or एक\or दोन\or तीन\or घ\or ङ\or च\or छ\or ज\or झ\or ञ\or
ट\or ठ\or ड\or ढ\or ण\or त\or थ\or द\or ध\or न\or प\or फ\or ब\or भ\or म\or
य\or र\or ल\or व\or श\or ष\or स\or ह\else\@ctrerr\fi}
% Now define a new formatting macro
\newcommand*{\devanagariwords}[1]{\expandafter\devanagari@words\csname c@#1\endcsname}
\makeatother

\begin{document}

\frontmatter
\renewcommand{\thepage}{\devanagariwords{page}}
\tableofcontents
\listoftables

\mainmatter
\chapter{सङ्ग्रहः}
\begin{table}[tbp]
\caption{A table}
\end{table}
\begin{enumerate}
\item प्रथमम्
\begin{enumerate}
\item द्वितीयम्
\begin{enumerate}
\item तृतीयम्
\begin{enumerate}
\item चतुर्थम्
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{enumerate}

\end{document}