9

In the document below, the text in Arabic is from right to left as it should be, but the numbers inside \textLR{} are also from right to left, while I would like to have them from left to right, like in a western text. I thought \textLR{} would do it, but it doesn't. Is there something I'm doing wrong?

Here is my code:

\documentclass[12pt,a4paper]{article}
\usepackage{fontspec}
\setmainfont[Script=Arabic]{amiri}
\pagedir TRT
\pardir TRT
\bodydir TRT
\textdir TRT

\linespread{2.0}
\title{
\Huge\textsc{التزام شهادة السكنى}
}
\date{}
\begin{document}
\maketitle

\end{document}

And this is the resulting document:

Output

  • The text you posted contains very personal information. I would edit these out. – Does it matter May 11 at 18:25
  • 1
    @Doesitmatter Thank you, I just removed all the information. – Saïd Maanan May 12 at 14:33
10

To get the Unicode bidirectional algorithm working correctly, you need to use babel. There are many clever things babel can now do with lualatex and right-to-left languages. Have a look through the manual.

Try this (with lualatex):

\documentclass[12pt,a4paper]{article}
\usepackage[nil,bidi=basic-r]{babel}
\babelprovide[import=ar,main]{arabic}
\babelfont[arabic]{rm}{Amiri}

\linespread{2.0}
\title{
\Huge\textsc{...}
}
\date{}
\begin{document}
\maketitle
...
\end{document}
  • Thank you very much. That was exactly what I was looking for. – Saïd Maanan Dec 30 '18 at 4:50

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.