published on in Tech Tips & Tricks

Arabic Script in LaTeX

We arrived in the 21st century and one would assume that with famous software like LaTeX you’d go write the document in whatever language you like, use Unicode or UTF-8 as character encoding for your text (without even thinking about it) and it just works. Unfortunately Knuth was one these people who thought no one would ever need more than 256 characters, so unless you’re typing ASCII, you’re screwed.

I already figured out, that you can use \usepackage[utf8]{inputenc} and German Umlauts start working, but you don’t get full utf8 coverage, as lots of chars Neo allows me to type (like • or → or …) are just not available.

It took me a couple of hours to figure out, how to get Arabic letters into my latex document, because even with the ucs package they won’t work as the corresponding character definition page uni-6.def is missing. Then I stumbled upon ArabTex (in texlive-lang-arab) which is awesome and has thousands of customizable ways to create Arabic script from several input encodings or transliteration modules. So I wrote my script after reading the documentation:


 \RL{ سلام }

However, my document still would not compile:

 ! Undefined control sequence.
 l.19 \UsePackage

After some trial and error it turned out, that you need to use arabtex before using utf8 and then you’re all set :-)