2

I'm using Polyglossia to write a book of probability in arabic, and I've recently changed of machine, then I've some problems (great) of typesetting my old files, which are compiling usually in my old machine. One problem is that, with the font "traditional arabic", the compilation gives parenthesis behind the words... i.e are not on the some line with the characters...even if all the characters are latin.. see the following example, in referred equation and in it's reference. What happens and how can I solve this problem ?

I give an example file, and I hope that it's not a problem for the font... We can see that there is no problem in compilation for the font "Simplified Arabic", for example ...

\documentclass[14pt,a4paper]{extbook}

\usepackage{amsmath,amssymb}
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2,AutoFakeSlant=-0.02]{Traditional Arabic}
\setsansfont[Script=Arabic,Scale=1.5]{Traditional Arabic}

\begin{document}
\LR{
Let  $E_{1}, E_{2},\ldots, E_{n}$, some disjoint events (of null intersection), then
\begin{equation} %eqn3.1
\label{eqn3.1}
P \left(\bigcup_{1}^{n} E_{i}\right) = \sum_{i = 1}^{n} P (E_{i})
\end{equation}
The equation
  \eqref{eqn3.1} generalizes to...
}
\end{document}

enter image description here

Hello I just saw your answer but the main font of the book must be the font "Traditional Arabic". I put the example of the other font to watch the difference... By the way I've just installed windows 8.1 and the result is better but is still not very good... not like your font which is exactly centered around the number 1... That's what I want for my font !

enter image description here

You can find an example with arbic text here, after updating to windows 8.1

The TEX File
\documentclass[14pt,a4paper]{extbook}

\usepackage{amsmath,amssymb}
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2,AutoFakeSlant=-0.02]{Traditional Arabic}
\setsansfont[Script=Arabic,Scale=1.5]{Traditional Arabic}

\begin{document}
\LR{
Let  $E_{1}, E_{2},\ldots, E_{n}$, some disjoint events (of null intersection), then
\begin{equation} %eqn3.1
\label{eqn3.1}
P \left(\bigcup_{1}^{n} E_{i}\right) = \sum_{i = 1}^{n} P (E_{i})
\end{equation}
The equation
  \eqref{eqn3.1} generalizes to...
}
\\
لاحظ أنه يتبع أن، لكل مجموعة منتهية للحوادث المتنافية   
 $E_{1}, E_{2},\ldots, E_{n}$,
\begin{equation} %eqn3.1
\label{eqn3.2}
P \left(\bigcup_{1}^{n} E_{i}\right) = \sum_{i = 1}^{n} P (E_{i})
\end{equation}
تبع المعادلة من المسلّمة 3 عبر تعريف![3]   
 $E_{i}$  كالمجموعة الخالية، لكل          
$i$  أكبر من     
  $n$.    المسلّمة  3 متكافئة مع المعادلة       
 \eqref{eqn3.2}  لما فراغ العينة محدود      
 (لماذا؟)   
 لكن، العمومية المضافة للمسلّمة $3$ ضرورية لما
 فراغ العينة غير محدود.     
 \end{document}

enter image description here

  • I'm a little ashamed to ask this so please excuse my ignorance. But can you put a screenshot of your old machine output with a MWE containing also some arabic text so that we can confirm that the output is as you want to have? – percusse Aug 13 '14 at 8:31
  • I'm little ashamed but I don't know how to do a screenshot... By the way, I want to upload the pdf file obtained for illustration of the example, and I don't know how... For the original problem, it's not about the arabic text. I put the example tex file with only english text for this... In this example, the parenthesis are very bad... – Faouzi Bellalouna Aug 13 '14 at 9:01
  • You can press prntscrn on your keyboard and Paste it on Paint or any graphical program. Then save it as an png image. You can draw arrows on it if you want to show things explicitly too. Then edit your question and click add picture at the top bar and select the image you want to upload. – percusse Aug 13 '14 at 9:34
  • Ok I installed gimp to export pdf in image... it gives this.. which is not beautiful at all... – Faouzi Bellalouna Aug 13 '14 at 10:02
  • I have no problem with this MWE , Tried it with Traditional Arabic like Simplified Arabic and the number is centered inside arentheses, try to reinstall the font – Salim Bou Aug 14 '14 at 23:14

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.