0

I want to use tcolorbox in my Arabic document with polyglossia.

I want to insist on RTL display, but somehow LTR keeps appearing.

In the MWE below:

  1. The first displayed line (ordinary text) is correctly RTL.

  2. The second displayed line (containing multiple tcbox) is incorrect;

  3. The third displayed line (same as second, but with some arabic text beginning the line) is correct RTL.

How can I change the code for the second line to insist on RTL?

\documentclass{article}
\usepackage{tcolorbox}
\usepackage{polyglossia}
\newfontfamily\arabicfont[Script=Arabic]{Scheherazade}
\setmainlanguage{arabic}
\begin{document}
\tcbset{nobeforeafter}
١ \hspace{1cm} ٢ \hspace{1cm}  ٣

\tcbox{١}  \tcbox{٢}  \tcbox{٣}

كلمة \tcbox{١}  \tcbox{٢}  \tcbox{٣}
\end{document}
  • Where is this Scheherazade font available? I am unsure whether this possible this way with tcolorbox at all – user31729 Jan 15 '18 at 13:10
  • the font is unimportant. you can use Times New Roman, or any arabic script font – Tim Jan 15 '18 at 13:18
  • Well, how should tcolorbox know that it should use RTL? – user31729 Jan 15 '18 at 13:19
  • I presume that is the business of polyglossia and the 'setmainlanguage' command. But I don't know. – Tim Jan 15 '18 at 14:00

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.