<< Tips and Tweaks for running LyX on Windows | Page list | How to set up LyX on Windows for Armenian >>
How to set up LyX to use it for Arabic
Installation under Windows
- Install LyX for Windows using the official installer or this alternative installer
- Install the packages arabTeX and arabi using MiKTeX's Package Manager.
- Install the Arabic spell checker from here or here
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) )
Prerequisites
- If LyX doesn't correctly accept your keyboard input, open the menu Tools → Preferences to use a keyboard map as shown in this screenshot. Then click Save and restart LyX.
- 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).
- In Tools→Preferences→Language settings→Language, assure that "Right-to-left language support" is checked.
Testing the Installation
- Run LyX and press Ctrl-N to open a new document. Write a few words in English, and press Ctrl-D.
Yap, MiKTeX's DVI-preview 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-D, and check the output.
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 (the package babel). 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 Arabic (ArabTeX), you have to load ArabTeX with this line in the document preamble:
\usepackage{arabtex}
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.
Notes
- It is possible to add new templates to LyX. Place the template files in
~:\Documents and Settings\<username>\Application Data\lyx15\templates. Then reconfigure LyX by using the menu Tools → Reconfigure and restart LyX.
Arabic in LyX (Linux)
Initial Setup
- Create a file called
arabic.bind in ~/.lyx/bind/ (where ~/.lyx is your LyX user directory).
Place the following lines in it:
\bind_file cua
\bind "F12" "language XXX"
Where XXX should be either arabic_arabtex or arabic_arabi, depending on which backend you will want to use.
This means that F12 will be used for switching between your default language and Arabic, and the rest of the key bindings (keyboard shortcuts) will be taken from the cua.bind file.
- In Tools -> Preferences... -> Look and feel -> User interface, select the file you just created as the "Bind file".
- 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.
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. Now you can start typing, using the F12 key to switch between Arabic and English. Paragraphs starting in Arabic will be RTL, and those starting in English will be LTR.
References
Arabic