4

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

Arun Debray
  • 7,126
  • 2
  • 30
  • 54
Masud
  • 43

2 Answers2

3

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.

Arthur Reutenauer
  • 2,920
  • 19
  • 17
3

There is a gloss-bengali.ldf file, such that, when you use the polyglossia command: \setdefaultlanguage[numerals=Bengali,changecounternumbering=true]{bengali}, the numbering for page and for section down to subparagraph are changed to Bengali digits. Bengali names for the parts of a document are also in the file.

Some random text:

bengali sections

MWE

\documentclass[12pt]{article}
\usepackage{fontspec}
\setmainfont[Script=Bengali,Scale=1.5]{Noto Serif Bengali}
\usepackage{polyglossia}
\setdefaultlanguage[numerals=Bengali,
changecounternumbering=true]{bengali}
\begin{document}
\today
\tableofcontents
\section{কখগঘ কাকিকী কেকৈককোকৌ}
\subsection{ক}
০১২৩৪৫৬৭৮৯ \bengalidigits{123 456 789} 
\newpage
\section{কখগঘ কাকিকী কেকৈককোকৌ}
কখগঘ
\subsection{ক}
কখগঘ
\subsubsection{ক}
কখগঘ
\subsubsection{ক}
কখগঘ
\subsubsection{ক}
কখগঘ
\end{document}

From the .ldf code, it should be straightforward to add the chapter, figure, table and footnote counters. Which leaves csquotes package quotation marks , perhaps equation numbering, and maybe the biblatex bibliography (and numeric citation style). And a note in the .ldf says the calendar still has to be done.

Certainly, section numbers and page numbers are available.

Cicada
  • 10,129