[XeTeX] Arabic in XeTeX
Manuel Souto Pico
m.soutopico at gmail.com
Sat Jul 14 21:22:23 CEST 2007
Hi,
I've just seen this thread and my reply might arrive too late, but
just in case here it goes.
I've been using xelatex for some time to typeset examples in Arabic in
my thesis dissertation.
This is a simplified version of my document, I hope someone finds it
useful now or in the future:
%!TEX TS-program = xelatex (percetange, admiration, etc.)
%!TEX encoding = UTF-8 Unicode
\documentclass[a4paper,10pt,oneside]{report}
%\usepackage[utf8]{inputenc} % more utf-8
\usepackage[catalan,spanish,british]{babel}
%\usepackage[OT2,OT1,LAE,LFE,T1]{fontenc}
%%% FONTS
\usepackage{fontspec}% provides font selecting commands
\usepackage{xunicode}% provides unicode character macros
\usepackage{xltxtra} % provides some fixes/extras
\setromanfont{Palatino}%Times Roman}
%%% ARABIC SCRIPT
\newfontfamily\arabicfont{Scheherazade-AAT}
\newcommand\arabi[1]{{\fontsize{18}{18}\arabicfont#1}}
\begin{document}
In Arabic, the verb and the subject agree: e.g. \arabi{هي تتكلم} 'she
talks-fem' vs. \arabi{هو يتكلم} 'he talks-masc'.
\end{document}
Cheers, Manuel
2007/6/28, John Was <john.was at ntlworld.com>:
> Many thanks (and to Jonathan) for that. I realized after sending the PDF
> that having set Arabic to Scheherezade I had immediately overwritten it with
> another font call which reverted to Times Roman. I got Scheherezade to work
> but with reversed text and was about to ferret around for the right commands
> when these helpful e-mails arrived. I'm much obliged for all this help in
> an unfamiliar area.
>
> Best wishes
>
>
> John
>
> ----- Original Message -----
> From: "François Charette" <firmicus at ankabut.net>
> To: "Unicode-based TeX for Mac OS X and other platforms" <xetex at tug.org>
> Sent: Thursday, June 28, 2007 5:26 PM
> Subject: JunkEmail: Re: [XeTeX] Arabic in XeTeX
>
>
> >
> > In your pdf output the font is not Scheherazade, but Times New Roman.
> > Also, your output left-to-right, whereas it should be right-to-left. The
> > following should work fine:
> >
> >
> > \TeXXeTstate=1 % this turns e-TeX's bidi functionality on
> > \let\lreverypar=\everypar
> > \everypar={\setbox0=\lastbox \beginR \box0 } %this sets paragraphs from
> > right to left
> > \font\arabic = "Scheherazade:script=arab" at 12pt
> > {\arabic
> > فلقِنا [= شيخ من الصوفيّة وجماعة غُرَباء] في الطريق شيخاً من الحكماء يقال
> > له
> > أبو الحسن العامريّ، وله كتابٌ في التصوُّف قد شَحَنَه بعِلمِنا وإشارتنا،
> > وكان من
> > الجَوَّالين الذين نَقَّبوا في البلاد واطّلعوا على أسرار ﷲ في العباد؛}
> > \vfill \eject
> > \bye
> >
> > Note that in the Arabic sentence above I have removed the spaces before
> > the Arabic punctuation. I have also replaced the letters of the third
> > but last word (Allah) by the Unicode ligature U+FDF2 (see attachment):
> > this is how the name of God should looking like in Arabic typography.
> >
> > Regards,
> > François
> >
> >
> > John Was a écrit :
> >> Oops - seems I must still be doing something wrong. My input is:
> >>
> >> \font\arabic = "Scheherazade:script=arab" at 12pt
> >> {\arabic
> >> فلقِنا [= شيخ من الصوفيّة وجماعة غُرَباء] في الطريق شيخاً من الحكماء يقال
> >> له أبو الحسن العامريّ ، وله كتابٌ في التصوُّف قد شَحَنَه بعِلمِنا
> >> وإشارتنا ،
> >> وكان من الجَوَّالين الذين نَقَّبوا في البلاد واطّلعوا على أسرار الله في
> >> العباد ؛}\vfill \eject
> >> But my output is as per the attached PDF.
> >>
> >> Something amiss!
> >>
> >> Best
> >>
> >>
> >> John
> >>
> >
> >
>
>
> --------------------------------------------------------------------------------
>
>
> > _______________________________________________
> > XeTeX mailing list
> > postmaster at tug.org
> > http://tug.org/mailman/listinfo/xetex
> >
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>
More information about the XeTeX
mailing list