1

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

F 505
  • 525
  • 1
    Choosing one of yellow compilers should get rid of this error, if it doesn't work it is a sharelatex problem and you should ask its support. I suggest to make first a test with a minimal hello-world document with \usepackage{fontspec} but no arabic. – Ulrike Fischer Apr 27 '17 at 08:54
  • @UlrikeFischer The question has modified – F 505 Apr 27 '17 at 09:18
  • 1
    You should put at least the word "Hello World" in the document. Without it you don't get a page. – Ulrike Fischer Apr 27 '17 at 09:22
  • @UlrikeFischer I copied exactly the same code in [https://www.sharelatex.com/learn/Arabic] but it didn't produce the same result!! Seriously don't know what to do – F 505 Apr 27 '17 at 10:10
  • I told you what to do: Try first xelatex or lualatex and fontspec with some simple english (non empty!) document. – Ulrike Fischer Apr 27 '17 at 10:49

2 Answers2

2

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).

F 505
  • 525
2

Here is a solution that works with pdflatex. It needs the packages arabtex and utf8 and setting the encoding accordingly. Below is an MWE.

\documentclass{standalone}

\usepackage{arabtex} \usepackage{utf8}

\setcode{utf8}

\begin{document}

\textit{Algorithm} is a Latinization of the name of <الخوارزمی>.

\end{document}

The output is as follows.

enter image description here

Credit: Arabic script using Latex including Persia, Urdu and Kurdish لاتكس بالعربية

wsaleem
  • 372