I have released a package named marathi which aims for typing Marathi language with great efficiency. This package requires XeLaTeX or LuaLaTeX. XeLaTeX with package fontspec provides a way to map arabic numerals with Devanagari ones. Try the following code -
% !TEX TS-Program = xelatex
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}
\begin{document}
\section{एक}
\section{दोन}
\end{document}
This gives correct mapping of Devanagari numerals. Unfortunately this function is not available with LuaLaTeX. Try the following code.
% !TEX TS-Program = lualatex
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Renderer=Harfbuzz,Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}
\begin{document}
\section{एक}
\section{दोन}
\end{document}
This gives the following warning -
Input mapping not supported in LuaTeX.
Why is it not possible in LuaLaTeX is my first question.
I have tried to generate Devanagari numerals with LuaLaTeX using a solution given in this answer. It works almost fine unless a package using definition \@arabic is used. Try this code (you need to install package marathi and as per the package requirement Shobhika font which is mostly included in the TeX-distribution) -
\documentclass{article}
\usepackage{marathi}
\begin{document}
\section{एक}
\section{दोन}
\end{document}
This shall produce good results with both XeLaTeX and LuaLaTeX, but I got an error with package when I used a package which treats \@arabic differently. There might be many such packages. The answer which I have referred also warns us about its effects, though I would like to use a softer way which will not produce un-predicted errors but will give me Devanagari numerals where necessary. Is there any way to make the package ignore the redefinition of \@arabic when it is already used by a package, but mapping the numerals when there is no such package loaded. Concerned definitions can be found on line no. 66 and 67 of the package.
Package babel does not give local enumeration. Try this code.
\tracinglostchars = 2 % Print a warning message if a character is missing.
\documentclass{article}
\usepackage[paperwidth=10cm]{geometry} % To format the MWE for TeX.SX
\usepackage[english, bidi=basic, layout=sectioning.counters]{babel}
\usepackage{fontspec}
\babelprovide[import, main, mapdigits]{marathi}
\defaultfontfeatures{Scale = MatchLowercase, Ligatures=TeX}
\babelfont{rm}[Scale=1.0,Ligatures={Common,Discretionary},Numbers=OldStyle]{Shobhika}
\babelfont{sf}[Ligatures={Common, Discretionary}]{Shobhika}
\babelfont[marathi]{rm}{Shobhika}
\babelfont[marathi]{sf}{Shobhika}
\begin{document}
\begin{enumerate}
\item अबक
\begin{enumerate}
\item अबक
\begin{enumerate}
\item अबक
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{document}

polyglossiarenews the enumeration counters ingloss-marathi.ldf.babel-mr.iniis lacking these definitions. I have asked this question here on the GitHub repo. – Niranjan Jun 08 '20 at 07:02babel(which you can use with\babelprovide[import, maparabic, alph=alphabetic]{hindi}), but it is not defined for Marathi. You can, however, create it yourself withenumitem. – Davislor Jun 08 '20 at 07:04babel-hin.iniand if the counters are good enough for the requirements of Marathi, I'll open up a new pull request. I personally manage to get everything right in my documents. I opened this question to ease the process for other new Marathi users with the help of my package. I want to give my users the best that LaTeX has. – Niranjan Jun 08 '20 at 07:10\babelfont{rm}[Scale = 1.0]{Shobhika}. Even theScale=parameter is a very minor tweak that only matters if you’re scaling every other font you use to the height of the main font. This font doesn’t have any of the OpenType features I used for Libertinus in my example, it’s not sans-serif, and it supports both scripts I wanted to use. A\babelfontwill automatically be called with the currently-selected language and its associated script. So you don’t need to copy all that code. :) – Davislor Jun 08 '20 at 07:33Renderer=Harfbuzzto the\defaultfontfeaturescommand. It is very much needed to get Devanagari ligatures right. – Niranjan Jun 08 '20 at 07:40