add tag
5 years ago निरंजन

Recent development in rendering Devanagari script with LuaLaTeX is the Harfbuzz renderer which renders Devanagari ligatures very nicely, but one new difficulty with LuaLaTeX is it doesn’t map Devanagari numerals. Try the following example with XeLaTeX and LuaLaTeX respectively.

Numerals are not mapped with Devanagari if you use LuaLaTeX. A conversation on GitHub with package managers of polyglossia suggested that this cannot be done with package fontspec as LuaLaTeX doesn’t support mapping nor it can be solved through gloss-marathi.ldf.

I am currently developing a package for typesetting Marathi language in LaTeX with less efforts. I want to have a better redefinition of numerals than the one provided by Mapping=devanagarinumerals parameter with XeLaTeX. See the following example -

Even if I type arabic numerals in the text I don’t get them because of this global redefinition.

So what I aim for is developing a parameter for LuaLaTeX which will change all the numerals which are automatically provided by LaTeX into Devanagari numerals, but will keep the text intact. So if I type 1 I should get 1 only (and not १). I want to know what should I use for this purpose. Any ideas?

Top Answer
5 years ago Anonymous 1319

An example for lualatex (TL 2020)

Bildschirmfoto 2020-06-09 um 22.34.55.png

5 years
निरंजन — Wednesday, 10th Jun 2020 15:37

@Anonymous Thanks for your efforts. I also found one answer on stackexchange which can be found here.

18 days
निरंजन — Saturday, 23rd May 2020 13:52

Are there any potential risks? Any package dependencies with the definition of @arabic?

निरंजन — Saturday, 23rd May 2020 13:44

Hey thanks. This did the trick.

Found an old answer on SE.

22 minutes
निरंजन — Saturday, 23rd May 2020 13:22

I would prefer the first way, changing all the counters to Devanagari.

निरंजन — Saturday, 23rd May 2020 13:16

Would this suffice?

3 hours
Skillmon replying to निरंजन — Saturday, 23rd May 2020 10:36

Well, I’m not quite sure I understood your question correctly. If you want to get all counters which would be printed with Arabic numbers in Devanagari instead, you could do \def\@arabic#1{<code producing Devanagari numbers>}. This would affect every counter which is defined with \the<counter>{\arabic{<counter>}}. If you just want to add the possibility to print a counter in Devanagari you could do \newcommand\devanagari[1]{\expandafter\@devanagari\csname c@#1\endcsname}\newcommand\@devanagari[1]{<code producing Devanagari numbers>} end then tell users they can use \renewcommand\the<counter>{\devanagari{<counter>}} to get a counter printed as Devanagari.

निरंजन replying to Skillmon — Saturday, 23rd May 2020 10:30

Shall I use replacements? I am not quite clear about this.

निरंजन replying to Skillmon — Saturday, 23rd May 2020 10:29

Sorry, my bad. I’ll correct it.

Skillmon — Saturday, 23rd May 2020 10:26

You could redefine \arabic to not produce Arabic numbers but Devanagari instead.

Skillmon — Saturday, 23rd May 2020 10:24

@निरंजन not really helpful, but 1234 are Arabic numerals, I II III IV are Roman numerals.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.