Insert Arabic Script – How to Insert an Arabic Script Within an English Document?

arabiccompilingfontspackages

Actually this question asked many times before such as 1, 2, 3 and the article written in ShareLaTeX guides. However, I'm using the online editor and when I tried the solutions mentioned I still get an errors and no resulted file after compilation. It appears like the used packages is not recognized.

The last choice I tried is to use this in the preamble:

\usepackage{arabxetex} 
\newfontfamily\arabicfont[Script=Arabic, Scale=1.5]{Scheherazade}

and this for the Arabic text:

\textarab{نص عربي}

After compilation I got this error:

Error

I tried the two compilers inside the yellow square but it didn't work

enter image description here

I opened a test project that has only this package and this was the result: as

Result

It's worth to mention that I can't use the offline editor

Any thoughts about how to solve it?

Thanks

Best Answer

In the preamble:

\usepackage{fontenc}
\usepackage{arabxetex} 
\usepackage{bidi}%has to be last package to be load
\newfontfamily\Kayhan[Script=Arabic]{XB Kayhan}
\newenvironment{Farsi}
{\begin{RTL}}
{\end{RTL}}

Inside the document:

\textarab{نص عربي  }

Make sure that the compiler is (Xelatex).

Related Question