1

I wanted Bangla and Arabic to go along the curves connecting nodes. When I use Bangla tex document compiles without any problem but the text along the path gets broken! In case of Arabic, tex document doesn't even compile!

for Bangla I used the following code:

\documentclass[12pt]{report}
\usepackage{tikz, fontspec}
\usetikzlibrary{shapes, decorations.text}
\setmainfont{[Kalpurush]}

\begin{document}
 ভাঙ্গা টেক্সট
\begin{center}
    \tikz{
         \node (n1) at (0,0) [draw, shape=circle] {নোড};
         \node (n2) [below left of = n1, xshift=-2ex, yshift=-3cm] [draw, shape=circle] {নোড ২};
         \node (n3) [below right of = n1, xshift=2ex, yshift=-3cm] [draw, shape=circle] {নোড ৩};
         \draw [->>, dashed, thick, postaction={decorate, decoration={text along path, text align=center, text=ভাঙ্গা টেক্সট, reverse path, raise=.5ex}}] (n1) to [bend right=60] (n2);
         \draw [->>, dashed, thick, postaction={decorate, decoration={text along path, text align=center, text=ভাঙ্গা টেক্সট, raise=.5ex}}] (n1) to [bend left=60] (n3);
      }
\end{center}
\end{document}

and the code above gives me this:

enter image description here

and for Arabic, I used:

\documentclass[12pt]{report}
\usepackage{tikz, fontspec, polyglossia}
\usetikzlibrary{shapes, decorations.text}
\setmainfont{[Kalpurush]}
\setotherlanguage{arabic}
\newfontfamily\arabicfont[Script = Arabic, Scale=1.5]{Traditional Arabic} 

\begin{document}
\textarabic{وَصِيَّةً مِّنَ ٱللَّهِ}
\begin{center}
\tikz{
      \node (n1) at (0,0) [draw, shape=circle] {নোড};
      \node (n2) [below left of = n1, xshift=-2ex, yshift=-3cm] [draw, shape=circle] {নোড ২};
      \node (n3) [below right of = n1, xshift=2ex, yshift=-3cm] [draw, shape=circle] {নোড ৩};
      \draw [->>, dashed, thick, postaction={decorate, decoration={text along path, text align=center, text={\textarabic{وَصِيَّةً مِّنَ ٱللَّهِ}}, reverse path, raise=.5ex}}] (n1) to [bend right=60] (n2);
      \draw [->>, dashed, thick, postaction={decorate, decoration={text along path, text align=center, text={\textarabic{وَصِيَّةً مِّنَ ٱللَّهِ}}, raise=.5ex}}] (n1) to [bend left=60] (n3);
    }
\end{center}
\end{document}

and the above code doesn't even compile!

How to fix these problems?

  • 1
    well it's tricky. You need to protect all parts that shouldn't be splitted, see e.g. tex.stackexchange.com/a/361929/2388. – Ulrike Fischer May 27 at 14:01
  • @UlrikeFischer, For Bangla it works to some extent this way {{ভাঙ্গা}{টেক্সট}{দেখাচ্ছে}{কেন}}, but it actually doesn't bend word, eg. টেক্সট, as one would expect it to and in case of Arabic, I used text={{وَصِيَّةً}{مِّنَ}{ٱللَّٰهِ}} and tried to compile document by putting \textarabic in between \node (n3) and \draw[->>, above \node (n1) with \tikz{...} style but it didn't work! I also tried by replacing \tikz{..} with \begin{tikzpicture}...\end{tikzpicture} but it didn't work either! – Emon Haque May 27 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.