So I wish to include a few Arabic characters in my text which is primarily composed of Latin characters. Apparently this can be done using the package arabtex.

However, it does not want to compile properly. I know I have unicode support, as I am able to render IPA characters and some more obscure Latin characters.

I have directly copied the following example from Overleaf:

Here is the word ``Arabic'' written in Arabic:  \<اَلْعَرَبِيَّةُ>. You can also use the command \verb|\RL{arabic text}| like this: \RL{اَلْعَرَبيَّةُ}.

It compiles in the online compiler, but when I run it through XeLaTeX on my Linux machine, it compiles, but does not render the Arabic characters, and when run through LuaLaTeX, it doesn't compile at all.

I have no idea what's going on here.


Some of the compile errors from LuaLaTeX

! String contains an invalid utf-8 sequence.
l.1299 \global\a@first = {

! String contains an invalid utf-8 sequence.
l.1300 \catcode `
               � 1 11

And the Full output from XeLaTeX

xelatex test.tex 
This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/Debian) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(ArabTeX) scanner for code `arabtex' installed.
(ArabTeX) input encoding set to ArabTeX standard conventions.)
(ArabTeX) ZDMG transliteration.)
(ArabTeX) 3.11 local stub, 26.02.2006))
Arabic processor `ArabTeX' [20060702 patch level 3.11s (02.07.2006)]
(ArabTeX) ... now be patient ... )
(ArabTeX) scanner for code UTF-8 installed.)
(./test.aux) (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd)
(ArabTeX) 3.11 local stub, 26.02.2006)
(ArabTeX) version 3.11s (02.07.2006): second phase of patching)
(ArabTeX) input encoding set to UTF-8 conventions
(/usr/share/texlive/texmf-dist/tex/latex/arabtex/Uxnsh.fd) [1] (./test.aux)

 *File List*
 article.cls    2019/12/20 v1.4l Standard LaTeX document class
  size10.clo    2019/12/20 v1.4l Standard LaTeX file (size option)
 arabtex.sty    2003/08/22  3.11 ArabTeX main module
 arabaux.sty    2003/05/21  3.11 auxiliary macros for ArabTeX
    acmd.sty    2003/08/20  3.11 Arabic command processing 
  afonts.sty    1995/11/16  3.04 define Naskh font 
 afonts2.sty    1998/10/19  3.10 define Naskh fonts for LaTeX2e
   ascan.sty    2003/08/22  3.11 standard ZDMG input encoding 
  aparse.sty    2003/05/26  3.11 get syllables 
  awrite.sty    2003/06/05  3.11 build output word 
xarbsymb.sty    1998/07/15  3.07 symbolic output encoding 
arabskel.sty    2000/06/04  3.10 character skeleton definitions 
xarbskel.sty    1999/07/17  3.09 character skeleton definitions 
  aboxes.sty    2003/05/28  3.11 build output boxes
arabtoks.sty    1999/07/17  3.09 ArabTeX CS token definitions 
arabchrs.sty    1998/07/11  3.07 letter token definitions 
   aligs.sty    2003/05/26  3.11 compute ligatures
 aoutput.sty    2000/06/04  3.10 build output lines
  abidir.sty    2003/08/22  3.11 bidirectional linebreaking
  atrans.sty    2003/06/14  3.11 generate the transliteration 
  alatex.sty    2003/05/04  3.11 ArabTeX extensions for LaTeX 
   afoot.sty    2003/05/12  3.11 ArabTeX footnotes
   abjad.sty    2003/04/26  3.11 abjad numerals 
  apatch.sty    2006/07/02  3.11s last minute patches 
  alists.sty    2003/04/26  3.11 inverted list macros
   asect.sty    2003/04/26  3.11 section macros for Arabic
   atabg.sty    1997/01/21  3.05 LaTeX tabbing macros for Arabic
    utf8.sty    2000/06/13  3.10 UTF-8 input encoding 
 utfcode.sty    2002/03/07  3.10a Arabic+Hebrew segment of UTF-8
l3backend-xdvipdfmx.def    2020-02-03 L3 backend support: xdvipdfmx
  ts1cmr.fd    2019/12/16 v2.5j Standard LaTeX font definitions
  apatch.sty    2006/07/02  3.11s last minute patches 

(see the transcript file for additional information)
Output written on test.pdf (1 page).
Transcript written on test.log.
  • 1
    arabtex is for use with pdflatex. You want arabxetex or arabluatex. There are examples of the usage of these packages elsewhere on this site.
    – Thérèse
    Sep 30, 2022 at 18:13

1 Answer 1


If you just have a few words you don't need package support for a full bidi setup, just choose fonts that have the characters. xelatex then gives

enter image description here

\setmainfont{Noto Sans}
\newfontfamily\afont{Noto Sans Arabic}

Here is the word ``Arabic'' written in Arabic: {\afont اَلْعَرَبِيَّةُ}. You
can also use the command \verb|\RL{arabic text}| like this:
 {\afont اَلْعَرَبيَّةُ}.
  • Thanks. That worked!
    – JRCSalter
    Sep 30, 2022 at 20:19
  • Beware: this works only for single words. If there are several ones, they are ordered left-to-right, even if the words are ‘internally’ right-to-left. I’d follow the advice by Thérèse above. Oct 1, 2022 at 6:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .