### Configuring LATEX for Xepersian and TexStudio

You may sometimes get bored with MS Word of (rarely) LibreOffice Writer. There is another document editor which is more likely to programming! LATEX!

In this tutorial I will show how to install LATEX in windows with TexStudio editor, step by step with pictures.

# Configuring LATEX for Persian Text

Steps:

4. Start a new document with XePersian packages
5. Compile the document with XeTex

For the first step you should download Miktex from the main repository and install it on your system. I suggest to install for your account and choose the default directories for installation.

So start the installer:

You may face such error in the last steps. It is all right. The fix is here:

Miktex has some fndb databases (4 files) which should be deleted and the installer fails to delete them. You can delete them manually. The folder is here (if you do not changed the default directories in installation):

%appdata%\Local\MiKTeX\2.9\miktex\data\le

After removal, execute miktex update in here:

%appdata%\Programs\MiKTeX 2.9\miktex\bin\x64\internal\miktex-update.exe

Miktex will select which packages needed to be updated. Just update them.

Miktex is installed successfully! 🙂

Among the document editors I prefer TexStudio. I’ve tested followings:

• TexMaker Second best one!
• Notepad++ LATEX template. A good tutorial is here.
• lyX Graphical LATEX editor

Find the comparison here.

But the steps to install TexStudio is quiet easy:

After installing you can run the TexStudio  and write your first document! It will work with no errors. But if you want to use XePersian for Farsi text, You should do more steps.

The fons are started with XB => XB Yas, XB Zar, etc

## Start a new document with XePersian packages

Just start TexStudio and create a new document.

Basic commands for XePersian are:
 \documentclass{article} \usespackage{xepersian} \settextfont{XB Niloofar} \begin{document} سلام دنیا! \end{document} 

If you just click F6 (compile command) in TexStudio it will ask you for download permission of extra packages.