[XeTeX] Unicode Arabic inside English with XeTeX
Manuel Souto Pico
m.soutopico at gmail.com
Sun Mar 11 01:39:39 CET 2007
Hi,
I dare sending this question to the list, although I'm not stuck anymore,
because I thought someone might find it useful one day (it took me a while
to get this done, mysefl).
I paste my document at the end of the mail. The relevant line is:
\newcommand{\ar}[1]{\font\ar="Scheherazade-AAT" at 12 pt {\ar#1}\normalfont}
This is something that allows me to print Arabic text like \ar{سلام عليكم}
within Roman text.
Before I had:
\font\ar="Scheherazade-AAT" at 12 pt
and then I got the Arabic text typing {\ar سلام عليكم} instead.
I changed the latter for the former just because I prefer the syntax \ar{}
rather than {\ar }.
I'm already happy with this result (that I achieved on my own! ;) but still
I'd like to ask: Is any of the two better than the other one? Is this the
normal way to get Arabic text in Roman-scripted documents?
I've seen other ways in other examples (from the XeTeX manual, the
scripts.sil.org XeTeX page and in this list's archives) but I could make
work none of them.
I'm also a bit puzzle that I didn't find any explicit tutorial showing what
to do for this particular case. Are most people still using ArabTex?
Any comments? Thank you!
Cheers, Manuel
PS: Here's my code:
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[11pt,a4paper]{article}
\usepackage{fontspec}% provides font selecting commands
\usepackage{xunicode}% provides unicode character macros
\usepackage{xltxtra} % provides some fixes/extras
\setromanfont{Palatino}
\newcommand{\ar}[1]{\font\ar="Scheherazade-AAT" at 12 pt {\ar#1}\normalfont}
\begin{document}
This is text in Arabic: \ar{سلام عليكم} in the middle of English text.
\end{document}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/xetex/attachments/20070311/309079dc/attachment.html
More information about the XeTeX
mailing list