Sectioning – Using Bengali Numerals for Section and Page Numbers in LaTeX

indicpage-numberingsectioning

How i can give section numbers and page numbers with Bengali numerals in latex?

Best Answer

You can use Enrico’s answer in the other question, provided you define a macro that outputs the Bengali numerals, as in the code below:

\documentclass{article}

\makeatletter
\def\bengalidigits#1{\expandafter\@bengali@digits #1@}
\def\@bengali@digits#1{%
  \ifx @#1
  \else
    \ifx0#1০\else\ifx1#1১\else\ifx2#1২\else\ifx3#1৩\else\ifx4#1৪\else\ifx5#1৫\else\ifx6#1৬\else\ifx7#1৭\else\ifx8#1৮\else\ifx9#1৯\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
    \expandafter\@bengali@digits
  \fi
}
\makeatother

\def\bengalinumber#1{\bengalidigits{\number#1}}
\def\bengalinumeral#1{\bengalinumber{\csname c@#1\endcsname}}

\renewcommand\thesection{\bengalinumeral{section}}
\renewcommand\thepage{\bengalinumeral{page}}

\usepackage{fontspec}
\setmainfont{Lohit Bengali}

\begin{document}

\section{বৈশাখ}

\section{জ্যৈষ্ঠ}

\section{আষাঢ়}

\section{শ্রাবণ}

\section{ভাদ্র}

\section{আশ্বিন}

\end{document}

With this code I get the following result:Example with Bengali section and page numbers

Note in particular the Bengali digit 1 as the page number.

I’ll make the Bengali digit code in a package as part of Polyglossia.