I want to make a enumerated list in Bangla. I am using babel
package for Bangla support. My code is given below:
\documentclass{book}
\usepackage[english]{babel}
\babelprovide[import, onchar = fonts ids]{bengali}
% \babelfont[bengali]{rm}[Renderer=Harfbuzz]{FreeSerif}
\babelfont[bengali]{rm}[Renderer=Harfbuzz,AutoFakeBold,AutoFakeSlant=0.3]{Kalpurush}
\babelcharproperty{`।}{locale}{bengali}
% draw figures
\usepackage{tikz}
% circled numbering
\usepackage{enumitem}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{%
\node[shape=circle,fill=black!20,inner sep=2pt] (char) {#1};}}
% bangla numerals
\babelprovide[maparabic,alph=alphabetic]{bengali}
\begin{document}
\subsubsection*{গণিতের চারটি নিয়ম}
\begin{enumerate}[label=\protect\circled{\arabic*}]
\item যোগের জন্য দেওয়া সংখ্যাগুলোর যেকোন একটিকে অথবা দুটিকেই কাছাকাছি কোন রাউন্ড ফিগার করে নিই। কোন সংখ্যাকে রাউন্ড করতে হলে তার সাথে অন্য একটি ছোট সংখ্যা যোগ বা বিয়োগ করে তাকে ১০ এর গুণিতক আকারে লিখি।
\item এবার রাউন্ড করা সংখ্যার সাথে অন্য সংখ্যাটি সহজেই যোগ করে ফেলি। যোগের সময় রাউন্ড করতে নেওয়া অতিরিক্ত সংখ্যাটি আলাদা রাখি।
\item এখন প্রাপ্ত যোগফলের সাথে অতিরিক্ত সংখ্যাটি যোগ বা বিয়োগ (যেখানে যেটা লাগবে) করে দিই। তাহলে, আমরা পেয়ে গেলাম আমাদের নির্ণেয় যোগফল।
\end{enumerate}
\end{document}
Using this code I got the following output. You will see the text is not showing.
But I want something like this:
How can I achieve my desired output?
\circled
macro or maybe the fact that it is protected seems to interfere with the language that is currently selected. I found that if you place\selectlanguage{bengali}
inside your definition of the\circled
macro or after the very first occurence of\item
inside theenumerate
environment, the text of the entries reappears. But I don't fully understand why this is.tikz
uses a dirty trick to store information based on selecting a null font, which is not recognized by theonchar
algorithm.