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

2
  • The text you posted contains very personal information. I would edit these out.
    – user148199
    Commented May 11, 2019 at 18:25
  • 1
    @Doesitmatter Thank you, I just removed all the information. Commented May 12, 2019 at 14:33

1 Answer 1

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}
1
  • Thank you very much. That was exactly what I was looking for. Commented Dec 30, 2018 at 4:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .