1

The following code prevents the number of the equation from appearing.

\documentclass{book}

\usepackage{amsmath}

\usepackage{polyglossia}

\setdefaultlanguage[numerals=maghrib, calendar=gregorian]{arabic}

\newfontfamily\arabicfont[Script=Arabic, Scale=1.1, WordSpace=2]{Amiri}

\setotherlanguage{english}


\begin{document}


 \begin{equation}
 X=Y
 \end{equation} 



\end{document}

enter image description here

The problem disappears when switching English with Arabic; that is when taking English as the main language. Also, the problem disappears when one removes [Script=Arabic]; but this makes a disaster if one includes an Arabic text.

Sorry if the question is not well edited. Thanks in advance.

  • 1
    I don't have Amiri font but tried another font and got no error (but I can not read arabic) do you get a tex error? if so please add the exact error message from the log into your question, use the {} button to mark as a code section so lines are preserved – David Carlisle Jan 5 '17 at 20:27
  • 1
    Can you add an image showing result after compiling – Salim Bou Jan 5 '17 at 20:37
  • @ David Carlisle : It does not seem that on the chosen Arabic font; I tried with three others, and get the same result. – Yassine Guerboussa Jan 5 '17 at 20:59
  • @Salim Bou: I don't know how to add an image; though when compiling the parenthese "(" appears instead of the number. – Yassine Guerboussa Jan 5 '17 at 21:04
  • I edited your question parenthesis appears like this or without numbers? – Salim Bou Jan 5 '17 at 21:25
4

I used a different font and saw 1)( as shown in Salim's image. The following forced the () to appear in LTR order using this font but possibly won't work for you (I'll delete if not)

enter image description here

\documentclass{book}

\usepackage{amsmath}

\usepackage{polyglossia}

\setdefaultlanguage[numerals=maghrib, calendar=gregorian]{arabic}


\newfontfamily\arabicfont[Script=Arabic, Scale=1.1, WordSpace=2]{ScheherazadeRegOT.ttf}

\setotherlanguage{english}

\makeatletter

\def\tagform@#1{\maketag@@@{\selectlanguage{english}(\ignorespaces#1\unskip\@@italiccorr)}}
\makeatletter

\begin{document}


 \begin{equation}
 X=Y
 \end{equation} 



\end{document}
  • Yes, it works; I'm really thankful. Can you please add a comment on the main source of the problem; anyway, I don't need such an explanation to be happy! – Yassine Guerboussa Jan 5 '17 at 22:41
  • 2
    @YassineGuerboussa I couldn't trace exactly where it went wrong but )( is basically () but typeset in the wrong direction so I forced \setlanguage{english} into the macro that prints the number (apart from that it is the standard definition) which persuaded it to print left to right. – David Carlisle Jan 5 '17 at 22: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.