TeX - LaTeX Asked on January 8, 2021
I’m writing a book about probability in Arabic, and I’m using the commands
usepackage{polyglossia}
setmainlanguage[numerals=maghrib]{arabic}
setotherlanguage{english}
newfontfamilyarabicfont[Script=Arabic]{Traditional Arabic}
With this package, the commands emph
and textit
have no effect, that is, it leaves the words in Roman. How I can repair this?
Here is an example:
documentclass[a4paper]{book}
usepackage[dvips]{graphicx}
usepackage{boxedminipage}
usepackage{amssymb}
usepackage{amsmath}
usepackage{rotating}
usepackage{fmultico}
setlength{columnseprule}{0.1pt}
usepackage{polyglossia}
setmainlanguage[numerals=maghrib]{arabic}
setotherlanguage{english}
newfontfamilyarabicfont[Script=Arabic]{Traditional Arabic}
begin{document}
hfillLR{A sample of probabilistic arabic text}
نهتم، في كثير من الأحيان، بتحديد عدد
emph{المجموعات المختلفة} المتكونة من $r$
عنصر، التي يمكن تشكيلها من مجموعة فيها $n$ عنصر.
end{document}
If you have to use the ‘Traditional Arabic’ font, which seems to have no italic/slanted version according to the comments, you can use either of two alternative methods to work around the problem:
One is to use the AutoFakeSlant
feature in the font definition, thus:
newfontfamilyarabicfont[Script=Arabic, AutoFakeSlant=-0.15]{Traditional Arabic}
As the name suggests, it takes the regular upright letters and slant them automatically (using a simple transformation, I think).
The other method is to use a different font which does have a slanted version. This way Traditional Arabic will be used for upright letters, and whenever you use emph
or textit
fontspec
will choose the other font. Notice that slanted version of Arabic fonts usually have Italic
or Slanted
after the font name. To use this method, define the font family thus:
newfontfamilyarabicfont[Script=Arabic, ItalicFont=AnotherArabicFont Slanted]{Traditional Arabic}
I think the first method is probably preferable, since finding another font which is similar enough typographically might be really tricky. I use this first method for my thesis: my main Hebrew font has no slanted version (grosso modo, Hebrew has no italics, but some attempts at designing ‘italic-like’ letter forms for specific typefaces has been made), so I use AutoFakeSlant
in order to obtain slanted version for citing titles of other works (cf. ‘The Hobbit’ in English). It works fine. Notice that for both Arabic and Hebrew one should use negative factor (I find -0.15
a reasonable choice), as they are written RTL, while LTR scripts should use a positive one.
If you need bold version you can use these parallel features:
AutoFakeBold=1.5
(you can change the factor, of course), andBoldFont=AnotherArabicFont Bold
+ BoldItalicFont=AnotherArabicFont Bold Italic
.Correct answer by Júda Ronén on January 8, 2021
In general, I advise against using bold and slanted in Arabic for emphasis: they work poorly in Arabic, especially the slant which is not always as visible and is quite alien to Arabic typesetting traditions. (Even though my own Amiri font has them, they are there to avoid the fake bold and slanted synthesized by GUI applications which are very very poor and outright break the font in many cases.) Traditionally, emphasis was done using a different calligraphic style, for example using an Nastaliq for emphasis with Naskh for the main text, or using a different font that has a bolder look, or using overlines, or different colors etc. So I suggest you employ one of those techniques based on the nature of the text your are setting.
Answered by Khaled Hosny on January 8, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP