0

I am not able to get page numbers in Kannada even after i set it as my main language.

\setmainlanguage[numerals=Kannada]{kannada}
Mico
  • 506,678

1 Answers1

1

There is nothing applicable in the language definition file (.ldf) yet, but adapting code from other modules and changing to Kannada seems to work:

sections and footnotes

footnotes and pagenumbers

You must use a font that contains the digits.

MWE

\documentclass{article}
\usepackage{polyglossia}
\newfontfamily\kannadafont{Noto Sans Kannada}[Script=Kannada]
\setmainlanguage[numerals=Kannada]{kannada}

\makeatletter %--- \def\kannadadigits#1{\expandafter@kannada@digits #1@} \def@kannada@digits#1{% \ifx @#1% terminate \else % ೦೧೨೩೪೫೬೭೮೯ \ifcase#1೦\or೧\or೨\or೩\or೪\or೫\or೬\or೭\or೮\or೯\fi \expandafter@kannada@digits \fi } %--- \def\kannadanumber#1{% \kannadadigits{\number#1}% } %--- \let@arabic\kannadanumber% %--- \makeatother

\begin{document} \section{ಕನ್ನಡ} ಕಖಗಘ \subsection{ಕನ್ನಡ} ಕಖಗಘ \kannadanumber{132 456 987}

೦೧೨೩೪೫೬೭೮೯ \section{ಕಖಗಘ} \today \subsection{ಕಖಗಘ}

\section{ಕಖಗಘ} ಕಖಗಘ\footnote{ಕಖಗಘ} ಕಖಗಘ\footnote{ಕಖಗಘ} ಕಖಗಘ\footnote{ಕಖಗಘ}

\end{document}

Cicada
  • 10,129
  • Thanks it is working. Can we add this to kannada.ldf ? – karthik holla Oct 18 '21 at 13:53
  • @karthikholla Yes. It will affect the whole document. Maybe also useful for other cases and users might be to add digit choice as a package/language option. – Cicada Oct 18 '21 at 14:00
  • @karthikholla Look at bengalidigits.sty code and bengali.ldf - these have the program logic that can be used. – Cicada Oct 18 '21 at 14:04