[XeTeX] arabic

Zdenek Wagner zdenek.wagner at gmail.com
Thu Apr 5 10:22:35 CEST 2012


2012/4/4 Kamal Abdali <k.abdali at acm.org>:
> My point was that some of the functionality of language-specific packages is
> already built-in into XeTeX. Facility for inputting the text is one such.

Yes, the basic functionality is built into XeTeX. It can render
properly the Arabic script, it can properly select the correct form
and characters are connected. However, it still remains a LTR writing
system. If you enter a paragraph containing just (written in latin
script for illustration):

bismi lahi l-rahmani l-rahimi

all words will be correct but the sentence will be left aligned and
the words will be in the opposite order. If you read it from right to
left, you will see

l-rahimi l-rahmani lahi bismi

You need at least the bidi package in order to have the output
properly aligned and words in the right order. ArabXeTeX and
polyglossia know that bidi is needed and load it automatically. Of
course, if you type a teble with a single column containing a single
word in each row, you cannot see the above mentioned problem.

> ArabTeX has special Tex commands for representing individual Arabic letters,
> and for turning vocalization on or off. These are redundant in XeTeX. We can
> just type the text, adding vowel marks to any letter if needed. Below is a
> (trivial) modification of the previous (trivial) program to illustrate this
> (for those who are new to typesetting Arabic with TeX).
>
> Of course, for advanced editing, you are better off using special packages.
> Personally I am quite happy at present with the package polyglossia. It has
> support for several languages, including most of the languages that use the
> Arabic script. The nice thing is that you can mix texts from as many
> languages and alphabets as you need. For the text direction control,
> polyglossia has the bidi package loaded already.
>
> \documentclass[12pt]{article}
> \usepackage{fontspec}
> \newfontfamily\A[Script=Arabic,Scale=1.4,WordSpace=2]{Amiri} % Scheherazade
> \begin{document}
> \begin{tabular}{c c c}
> {\A
> مُثَلَّث
> }& {\A
> ١٢٣٤
> }&
> Triangle
> \end{tabular}
>
> \end{document}
> =================
> =============
>
> On Wed, Apr 4, 2012 at 06:09, Zdenek Wagner <zdenek.wagner at gmail.com> wrote:
>>
>> 2012/4/3 Kamal Abdali <k.abdali at acm.org>:
>> > With XeTeX, there seems less need of language-specific packages because
>> > the
>> > characters of various alphabets can be directly typed. So this produces
>> > the
>> > same output as Nathan's program:
>> >
>> In such a trivial case you certainly do not need other packages but
>> for real use with an Arabic script you need at least the bidi package.
>>
>> > \documentclass[12pt]{article}
>> > \usepackage{fontspec}
>> > \newfontfamily\A[Script=Arabic,Scale=1.4,WordSpace=2]{Amiri} %
>> > Scheherazade
>> >
>> > \begin{document}
>> > \begin{tabular}{c c}
>> > {\A
>> > مثلث
>> > } & {\A
>> > ١٢٣٤
>> > }
>> > \end{tabular}
>> >
>> > \end{document}
>> > =====================
>> >
>> > On Sun, Apr 1, 2012 at 11:15, Nathan Sidoli <nathan.sidoli at utoronto.ca>
>> > wrote:
>> >>
>> >> This works for me:
>> >> ------
>> >> \documentclass[12pt,a4paper]{article}
>> >>
>> >> \usepackage{fontspec}
>> >>
>> >> \usepackage[novoc,fdf2noalif]{arabxetex} %
>> >> \newfontfamily\arabicfont[Script=Arabic,Scale=1.4,WordSpace=2]{Amiri} %
>> >> Scheherazade
>> >> \newcommand{\A}{\textarabic} % Tag for all Arabic text
>> >>
>> >> \begin{document}
>> >>
>> >> \begin{tabular}{c c}
>> >> {\A{m_tl_t}} & {\A{1234}}
>> >> \end{tabular}
>> >>
>> >> \end{document}
>> >> --------
>> >>
>> >>
>> >>
>> >> On 12/04/01 23:37, Jean-Louis Cordonnier wrote:
>> >>>
>> >>> My tex file works properly with text only but gives an error if I want
>> >>> to use tabular :
>> >>>
>> >>> \begin{tabular}[l]
>> >>> \textarab[voc]{`arabI}
>> >>> \end{tabular}
>> >>>
>> >>>
>> >>> Le 18/01/2012 18:55, Zdenek Wagner a écrit :
>> >>>>
>> >>>> 2012/1/18 Jean-Louis Cordonnier<jlcord2 at wanadoo.fr>:
>> >>>>>
>> >>>>> I try to write a few word in arabic ;
>> >>>>> I get this error message :
>> >>>>> Package bidi Error: Oops! you have loaded package xunicode before
>> >>>>> bidi
>> >>>>> packag
>> >>>>> e. Please load package xunicode after bidi package, and then try to
>> >>>>> run
>> >>>>> xelatex
>> >>>>> on your document again.
>> >>>>>
>> >>>> Load arabxetex before xltxtra. Arabxetex loads bidi, xltxtra loads
>> >>>> xunicode.
>> >>>>
>> >>>>> I dont understand why (where in bidi documentation ?)
>> >>>>>
>> >>>>> My file
>> >>>>>
>> >>>>> |\documentclass{article}
>> >>>>> \usepackage{xltxtra}
>> >>>>> \newfontfamily{\arabicfont}[Script=Arabic,Scale=1.5]{Traditional
>> >>>>> Arabic}
>> >>>>> \usepackage{arabxetex}
>> >>>>>
>> >>>>> \begin{document}
>> >>>>> \section{\textarab[utf]{العربية}}
>> >>>>> \textarab[utf]{السلم عليكم و رحمت الله و بركته}
>> >>>>>
>> >>>>> \section{Legacy syntax}
>> >>>>> When he goes---``Salamun alaykum!''\\
>> >>>>> She replies—“Wa alaykumus-salam, dear!”
>> >>>>> \end{document}|
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> --------------------------------------------------
>> >>>>> Subscriptions, Archive, and List information, etc.:
>> >>>>>  http://tug.org/mailman/listinfo/xetex
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>> --------------------------------------------------
>> >>> Subscriptions, Archive, and List information, etc.:
>> >>>   http://tug.org/mailman/listinfo/xetex
>> >>
>> >>
>> >>
>> >>
>> >> --------------------------------------------------
>> >> Subscriptions, Archive, and List information, etc.:
>> >>  http://tug.org/mailman/listinfo/xetex
>> >
>> >
>> >
>> >
>> >
>> > --------------------------------------------------
>> > Subscriptions, Archive, and List information, etc.:
>> >  http://tug.org/mailman/listinfo/xetex
>> >
>>
>>
>>
>> --
>> Zdeněk Wagner
>> http://hroch486.icpf.cas.cz/wagner/
>> http://icebearsoft.euweb.cz
>>
>>
>>
>> --------------------------------------------------
>> Subscriptions, Archive, and List information, etc.:
>>  http://tug.org/mailman/listinfo/xetex
>
>
>
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex
>



-- 
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz



More information about the XeTeX mailing list