<< | Page list | >>
How to set up LyX under Windows to use it for Farsi
Installation
- Install LyX for Windows
- In the Windows installer don't forget to select to install the spell checker for "فارسی".
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).
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 Language section "Farsi",
press OK and type in a few words. Press Ctrl+R and check the output.
Possible problems
- If you do not see Farsi, check that LyX's preferences are properly set (Check if the screen fonts support the Arabic script).
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.
Setting Up LyX Under Ubuntu(mint) to Use it for Farsi
This description is not correct. For Farsi the LaTeX-package arabi should be used. This description is about the LaTeX-package arabtex that does not natively support Farsi.
- install LyX from mintinstall (package installer)
- install the package "texlive-lang-arab" from mintinstall
- open LyX and use the menu Tools → Reconfigure
- Start LyX, then in the menu Tools → Preferences go to Language Settings and select Language. Change Command start to \selectlanguage{arabic}, and change Language package to Custom, and enter \usepackage[farsi,arabic]{babel} in the provided text field.
- Still in Tools → Preferences, go to Output and select LaTeX, then change Use LaTeX font encoding to LAE,LFE in the provided text field.
- Still in Tools → Preferences, go to Editing and under Keyboard/Mouse check the Use keyboard map option and for First select Farsi from the *.kmap files that are shown when hitting the Browse button.
- Hit the Save button in the Preferences window then restart LyX.
- Still in Document → Settings, go to Language and select Arabic (Arab TeX) as the Language, then change Encoding to Other and select Unicode (utf8) as the encoding, then select None for the Language package option.
- Hit the Apply button then close the Document Settings window.
- Now enter text in your document (which should be going from right to left now), save the file as a LyX file, then select File → Export → PDF (pdflatex). You should get a PDF with Farsi in it.
References:http://forums.fedoraforum.org/showthread.php?t=268654
Using Farsi
Part numbering
When you are using a report or book document class, you will see that the parts are not numbered in the PDF output. The reason for this is that the default numbering for parts is Roman numbering. LaTeX's Farsi support automatically translates Arabic numbers to Farsi numbers, but cannot handle roman numbers.
You have two possibilities to overcome this:
- Redefine the part numbering from Roman numbers to Arabic ones by adding this line to your document preamble:
\renewcommand{\thepart}{\arabic{part}}
- Make Roman numbering work in Farsi by redefining the part numbering with this line that you add as TeX code at the first line of your document:
\renewcommand{\thepart}{\selectlanguage{english}\Roman{part}}
Note that you need to mark this fist line as English in your document.
In this LyX file the two methods are demonstrated.
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. Note: not all of them will also fully support Urdu, so you will have to try.
Windows Farsi