<< | Page list | >>
How to set up LyX to use it for Arabic
1. Installation under Windows
- Install LyX for Windows
- In the Windows installer don't forget to select to install the spell checker for "العربية".
2. Installation under Linux
- install LaTeX (in Debian Etch (4.0), latex is provided by the texlive package, and Arabic support for it (both arabi and ArabTeX) is provided by texlive-lang-arab)
- install LyX
- install fonts that support Arabic characters (will be used as LyX's screen font) (for example use RedHat's recently released Liberation Fonts), which have the Arabic glyphs (as well as many many other languages) )
3. Prerequisite
- In Tools→Preferences→Look and feel→Screen fonts, select the fonts which have Arabic glyphs. (On Windows the standard fonts like Arial already support Arabic characters.) (When you have installed the Liberation fonts under Linux, set Liberation Serif, Liberation Sans, and Liberation Mono, for Roman, Sans Serif, and Typewriter, respectively).
4. Testing the Installation
- Run LyX and press Ctrl+N to open a new document. Write a few words in English, and press Ctrl+R.
A PDF viewer program should be opened; check that it displays the text correctly.
- Open another document and call the menu Document → Settings.
Select there in the Document class drop-list the class article (Arabic),
and press OK. Now set the document language to Arabic (Arabi).
Type in a few words, press Ctrl+R, and check the output.
5. Usage
LyX offers the two languages Arabic (Arabi) and Arabic (ArabTeX). Both can be used to typeset Arabic, while the first language uses the LaTeX-package arabi and the second one the the LaTeX-package arabTeX. Using the arabi package has the advantage that you can easily mix different languages with Arabic in your documents because its supports LaTeX's multi-language support. However, you might not be content with the output of Arabi's Arabic characters. In this case you can use the document language Arabic (ArabTeX).
To use the ArabTeX package also the Arabi package must be installed. Arabi can be used without ArabTeX installed.
When you use other languages than Arabic in your document and your document language is not Arabic, then all Arabic parts must be set to the language Arabic (Arabi).
Note: When you use non-TeX fonts for your document ArabTeX cannot be used!
6. Fonts
It is important that you select for your document fonts that contain the Arabic script. Otherwise you will get error messages when viewing your file as PDF. If you use in the document settings the option use non-TeX fonts, you can use any OpenType or TrueType font. Here is a list of known OpenType an TrueType fonts containing the Arabic script:
Name
| Font Family
| Contains also
| Type
|
---|
Amiri
| roman
| CP 1252 and Baltic, Farsi, Kazakh, Pashto, Sindhi, Turkish, Uighur, Urdu
| TrueType
|
Andalus
| roman
| CP 862, CP 1252
| TrueType
|
Arabic Transparent
| sans serif
| none
| TrueType
|
Arabic Typesetting
| sans serif
| CP 1250, CP 1252, CP 1254, CP 1257
| OpenType
|
Aref Ruqaa
| roman
| CP 1252
| TrueType
|
Arial
| sans serif
| almost all writing systems
| OpenType
|
Cairo
| sans serif
| CP 1252 and TrueType
| OpenType
|
Courier New
| typewriter
| almost all writing systems
| OpenType
|
FreeFont
| roman, sans serif, typewriter
| almost all writing systems
| OpenType and Web Open Font Format
|
Hussaini Nastaleeq
| roman
| Farsi, Urdu
| TrueType
|
Jomhuria
| sans serif
| almost all writing systems
| TrueType and Web Open Font Format
|
Lateef
| roman
| CP 1252
| OpenType and Graphite
|
Mada
| sans serif
| CP 1252
| OpenType
|
Microsoft Sans Serif
| sans serif
| almost all writing systems
| OpenType
|
Noto Kufi Arabic
| not applicable
| Farsi, Urdu
| TrueType
|
Noto Naskh
| not applicable
| Farsi, Urdu
| TrueType
|
Reem Kufi
| sans serif
| CP 1252
| OpenType
|
Scheherazade
| roman
| CP 1252
| OpenType and Graphite
|
Simplified Arabic
| sans serif
| CP 862, CP 1252
| TrueType
|
Simplified Arabic Fixed
| typewriter
| CP 862, CP 1252
| TrueType
|
Tahoma
| sans serif
| almost all writing systems
| OpenType
|
Times New Roman
| roman
| almost all writing systems
| OpenType
|
Traditional Arabic
| roman
| CP 862, CP 1252
| TrueType
|
Here is an example of some of the above fonts:
7. Creating a shortcut to switch the language
- Go to the LyX menu Tools→Preferences→Editing→Shortcuts
- Search for the shortcut "language", select it and use the Modify button.
- In the appearing dialog change "language" to "language
XXX
" where XXX
should be either arabic_arabtex
or arabic_arabi
, depending on the LaTeX-package you want to use. Bind it to a key you want, for example to F12.
- Now search again for the shortcut "language", select it and use the Modify button.
- In the appearing dialog change "language" to "language english". Bind it to a key you want, for example to Ctrl+F12.
Now you can start typing, using F12 / Ctrl+F12 to switch between Arabic and English.
7.1 Possible problems
- If you do not see Arabic, check that LyX's preferences are properly set (Check if the screen fonts support Arabic).
- If you succeed in viewing an English DVI file, but fail with the Arabic one, there is a problem with the Arabic TeX packages.
7.2 Notes
- It is possible to add new templates to LyX. Place the template files in
~:\Documents and Settings\<username>\Application Data\LyX2.2\templates. Then reconfigure LyX by using the menu Tools → Reconfigure and restart LyX.
Arabic in LyX (Linux)
8. Initial Setup
- In Tools -> Preferences... -> Look and feel -> Keyboard, make sure that "Use keyboard map" is checked, and then type in
null
as "first", and arabic
as "second".
- (Only for ArabTeX:) In Tools -> Preferences... -> Language settings -> Language, type:
\usepackage{arabtex,cp1256} \setcode{cp1256}
as the "Language package",
\begin{arabtext}
as "Command start",
\end{arabtext}
as "Command end".
- Make sure you Save the settings, then close LyX and start it up again.
9. Using ArabTeX
Now you are ready to start writing Arabic documents: start a new document, make sure that in Document→Settings→Language, the language is English (not Arabic (ArabTeX)!), and the encoding is either "cp1256" or "LaTeX default" (not "Use language's default encoding"). And in Document→Settings→Document Class, choose the "article (Arabic)" class. Paragraphs starting in Arabic will be RTL, and those starting in English will be LTR.
10. References
Arabic Fonts Windows