javadr / quran

Simplifying The Holy Quran Typesetting in XeLaTeX.
22 stars 5 forks source link

Arabic ayah number digits are in reversed order #8

Closed danishbelal closed 1 year ago

danishbelal commented 1 year ago

Salam,

thank you very much for this amazing package. It serves me a good purpose. However, I noticed, that the Ayah number digits are rendered from right to left instead of left to right. Eg. 21 is shown as ١٢. This only happens when compiling with LuaLaTeX, XeLaTeX renders it correctly. Unfortunately, I cannot easily transition my document to XeLaTeX.

Are you aware of a workaround that fixes this? I'd highly appreciate it.

This can be reproduced with this example:

\documentclass{article}
\usepackage{quran}
\usepackage{fontspec}

\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{arabic}

\setmainfont{Amiri}

\begin{document}
    \textarabic{\quranayah[89][21-24]}
\end{document}

Compile it with lualatex <file>.

Here is the output: grafik

javadr commented 1 year ago

This is an issue with polyglossia and lualatex, I think. Test \textarabic{1234} and see the result, 4321!

seloumi commented 1 year ago

How about babel package ?

\documentclass{article}
\usepackage{quran}
\usepackage[bidi=basic,english]{babel}

\babelprovide[import]{arabic}

\babelfont{rm}{Amiri}

\begin{document}

\selectlanguage{arabic}
    \quranayah[89][21-24]

\end{document}
danishbelal commented 1 year ago

This looks promising. I'll look into it and get back to you. Thank you.

danishbelal commented 1 year ago

@seloumi your approach works fine as is. However, I also need to load other fonts via fontspec and it appears that loading fonts through babel conflicts with fontspec. I cannot use your approach for my purpose, unfortunately :(.