I'm writing a book in French, but i need to write a chapter in Arabic. To do so I've used the arabtex.
\usepackage{arabtex}
after the preamble I've done this
\chapter*{\<السلام عليكم>}
After compiling my code i get this :
! Illegal arabic command: ?.\a@cmderr ...age {Illegal arabic command: \nxp #1}\a@@cmd = {{\a@puttt #1\ar... \chapter{\<?????? ?????>}
But when ii change the arabic letter with the \<> tag
\chapter*{\<this is an arabic message>}
I got :
which is kind of random and insignificant, so how can I write in arabic in my texmaker editor and compile my code properly ?
EDIT : This is a full Example :
\documentclass[parskip=full,12pt,a4paper,twoside,frenchb,openany,fleqn]{book}
\usepackage{arabtex}
\usepackage[latin1]{inputenc}
\usepackage{titlesec}
\usepackage{ae}
\usepackage{aecompl}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[frenchb]{babel}
\usepackage[Sonny]{fncychap}
\begin{document}
\chapter{\<سلام>}
\end{document}
Best Answer
This is covered in the documentation. Page 34 of the manual explains how to use UTF-8 encoding. Applying the instructions to your example:
\usepackage[utf8]{inputenc}
is not necessary but you cannot save your file in two input encodings so you need eitherutf8
orlatin1
. Hence, you'll need to change the option forinputenc
as shown since you want to use UTF-8 for Arabic.Note that this code is using obsolete commands. (Something is still using pre-LaTeX2e font switches, for example.) Also, you should consider switching from
ae
and usingcm-super
orlmodern
fonts which include the characters and don't need the emulation.When saving the file, you have to ensure that it is saving in the correct encoding. If you were using
latin1
, try saving a new version and double-check the encoding your editor is using. Otherwise you will find characters becoming question marks.