4

I try to setup an environment for translating some Tex document to arabic but that gives me some headaches. I always end up with a document having ??????? instead of the arabic letters.

Simple example

\documentclass[a4paper,oneside,12pt]{article}
\usepackage{arabtex}
\usepackage{utf8}
\begin{document}
\begin{arabtext}
بسم الله الرحمن الرحيم
\end{arabtext}
\end{document}

Looks like I forget something small but I can't figure it out.

Thanks for help.

Here the log file:

This is XeTeX, Version 3.1415926-2.3-0.9997.5 (MiKTeX 2.9 64-bit) (preloaded format=xelatex 2013.5.31)  31 MAY 2013 13:06
entering extended mode
**Arabic.tex
(C:\Users\user\Desktop\Text\Arabic.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic, 
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat
vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm
an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese, 
romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis
sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u
senglishmax, welsh, loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size12.clo"
File: size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\arabtex.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\aconfig.sty"
LaTeX2e detected 
BABEL detected
\a@moduledate=\count88
\a@maindate=\count89
)
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\arabaux.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\acmd.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\afonts.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\afonts2.sty"))
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\ascan.sty"
(ArabTeX) scanner for code `arabtex' installed.
(ArabTeX) input encoding set to ArabTeX standard conventions.)
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\aparse.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\awrite.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\xarbsymb.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\arabskel.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\xarbskel.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\aboxes.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\arabtoks.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\arabchrs.sty"))
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\aligs.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\aoutput.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\abidir.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\atrans.sty"
(ArabTeX) ZDMG transliteration.)
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\alatex.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\afoot.sty"))
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\abjad.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\apatch.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\alists.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\asect.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\atabg.sty")
Invalid UTF-8 byte or sequence at line 1299 replaced by U+FFFD.
Invalid UTF-8 byte or sequence at line 1299 replaced by U+FFFD.
Invalid UTF-8 byte or sequence at line 1300 replaced by U+FFFD.

("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\alocal.sty"
(ArabTeX) 3.11 local stub, 26.02.2006))
Arabic processor `ArabTeX' [20060702 patch level 3.11s (02.07.2006)]
(ArabTeX) ... now be patient ... )
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\utf8.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\utfcode.sty"
Package: utfcode 2002/03/07  3.10a Arabic+Hebrew segment of UTF-8
\u@lb=\count119
\u@lq=\count120
)
Package: utf8 2000/06/13  3.10 UTF-8 input encoding 
Invalid UTF-8 byte or sequence at line 30 replaced by U+FFFD.
Invalid UTF-8 byte or sequence at line 30 replaced by U+FFFD.
Invalid UTF-8 byte or sequence at line 31 replaced by U+FFFD.

(ArabTeX) scanner for code UTF-8 installed.)
(C:\Users\user\Desktop\Text\Arabic.aux)
LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.

("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\apatch.sty"
Invalid UTF-8 byte or sequence at line 1299 replaced by U+FFFD.
Invalid UTF-8 byte or sequence at line 1299 replaced by U+FFFD.
Invalid UTF-8 byte or sequence at line 1300 replaced by U+FFFD.
\a@lines=\count121
\a@Lwidth=\dimen125
\a@displaywidth=\dimen126

("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\alocal.sty"
(ArabTeX) 3.11 local stub, 26.02.2006)
(ArabTeX) version 3.11s (02.07.2006): second phase of patching)
LaTeX Font Info:    Try loading font information for U+xnsh on input line 5.

("C:\Program Files\MiKTeX 2.9\tex\latex\arabtex\uxnsh.fd"
File: uxnsh.fd  1999/10/19 v3.10 ArabTeX Naskh extd. font definitions
)
LaTeX Font Info:    Font shape `U/xnsh/m/n' will be
(Font)              scaled to size 17.28003pt on input line 5.
 [1

]
(C:\Users\user\Desktop\Text\Arabic.aux)

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size12.clo    2007/10/19 v1.4h 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
  apatch.sty    2006/07/02  3.11s last minute patches 
   uxnsh.fd     1999/10/19 v3.10 ArabTeX Naskh extd. font definitions
 ***********

 ) 
Here is how much of TeX's memory you used:
 2504 strings out of 429156
 22340 string characters out of 3168943
 90459 words of memory out of 3000000
 5744 multiletter control sequences out of 15000+200000
 4602 words of font info for 17 fonts, out of 3000000 for 9000
 786 hyphenation exceptions out of 8191
 25i,4n,23p,239b,124s stack positions out of 5000i,500n,10000p,200000b,50000s

Output written on Arabic.pdf (1 page).
egreg
  • 1,121,712
Bax
  • 85
  • You must surround the arabic text by \begin{arabtext} \end{arabtext}. But consider to use xelatex or lualatex instead of standard pdftex. – Ulrike Fischer May 31 '13 at 09:54
  • Thx for the reply. Tested this already, does not help. Sorry that I forgot to add it in the code. I've added it now. – Bax May 31 '13 at 10:29
  • As Ulrike pointed out, you should definitely consider using xelatex or lualatex. See this answer as a start: http://tex.stackexchange.com/questions/21065/typesetting-arabic-with-lualatex/46627#46627 – ClintEastwood May 31 '13 at 10:35
  • It works fine for me. Show your log-file. – Ulrike Fischer May 31 '13 at 10:38
  • I can't access the file. – Ulrike Fischer May 31 '13 at 11:02
  • I have added to log file above. Also changed to xelatex without better result. Sorry but I failed to bring the log in a more readable format. – Bax May 31 '13 at 11:21
  • Sorry I obviously misleaded you: You can't use xetex together with your code. arabtex and inputenc are for pdflatex. If you want to switch to xelatex you must change the document along the line mentioned by clintEastwood. – Ulrike Fischer May 31 '13 at 11:34
  • Thx. I will change my document. Anyhow I doubt that this will help me. I looks like a general problem here. – Bax May 31 '13 at 11:38
  • The lines Invalid UTF-8 byte or sequence at line ... look quite suspicious. I don't get them (TeX Live, though, not MiKTeX). – egreg May 31 '13 at 12:40
  • You are absolutely right. I am suspecting and encoding issue somewhere. – Bax May 31 '13 at 13:32
  • You get the invalid UTF-8 byte as some of the arabtex files are in ansi and contain non-ascii input and xetex doesn't like this. But as arabtex isn't meant to work with xetex simply don't bother. Your original code should work with pdflatex (it does on my miktex). If you want to use xelatex you must use code suitable for this engine. – Ulrike Fischer May 31 '13 at 13:42
  • Thank you. As you noticed, I am very new to Tex. I am looking for a good way to migrate my documents to a more stable word processor as they are running wild in MS. I am back to pdflatex as it's currently more easy to handle for me. XeTex gave me a lot of other headaches on my first steps. Thanks again for you help, I'll keep trying. – Bax May 31 '13 at 13:50
  • Well if you want to write non-western scripts xelatex will give you much less headache in the end: xelatex understands utf8 natively and can use open type fonts directly. – Ulrike Fischer May 31 '13 at 16:02
  • @UlrikeFischer Could you summarise your comments here as an answer? – Joseph Wright Aug 17 '13 at 14:14
  • @JosephWright: Hm. Difficult. As Bax edited the example inbetween and then mixed up pdflatex + xelatex I don't see a real question to answer. Can't you close it as "to localized"? – Ulrike Fischer Aug 17 '13 at 15:48
  • @UlrikeFischer No TL any more: either 'unclear' or 'off-topic' has to suffice. – Joseph Wright Aug 17 '13 at 15:50

0 Answers0