[XeTeX] Unicode Arabic inside English with XeTeX

Manuel Souto Pico m.soutopico at gmail.com
Sun Mar 11 18:15:16 CET 2007


Hi Ross,

2007/3/11, Ross Moore <ross at ics.mq.edu.au>:
>
> Hi Will, Manuel and others,
>
> On 11/03/2007, at 7:18 AM, Will Robertson wrote:
>
> > Hi Manuel,
> >
> > No trouble asking here if you get stuck, that's why we're here!
> >
> > On 11/03/2007, at 11:09 , Manuel Souto Pico wrote:
> >
> >> \newcommand{\ar}[1]{\font\ar="Scheherazade-AAT" at 12 pt {\ar#1}
> >> \normalfont}
>
> Please do *not* use such short macro names.
> There is too likely a chance that it clashes with a macro
> defined in standard LaTeX packages, or within TeX itself.
> (In this case, \ar is used by Xy-pic for arrows in diagrams.)
>
> Even if you don't use those other packages, some of your work
> may end up within a volume alongside other people's work
> where dthey are used.
> This can creates a significant head-ache for editors of such
> volumes of conglomerate material.


I see.

It is good practice to use descriptive macro-names, rather
> than cryptic abbreviations, so that it is clear just what
> kind of material is being presented...


Well, I wrote my command after getting inspiration from an example I found
for Hebrew:

\font\H="Lucida Grande" at 10pt
{\H לחני}

That's why I used \A first and \ar later. Also I think either ArabTex or
Arabi used something of the like. And it's shorter to type than, say,
\arabic.

But I understood the lesson, I won't do it again :)

Thanks for your help.

Cheers, Manuel

> >
> > As Herb said, this won't work (more than once) because the \font\ar=
> > redefines the command \ar you've set up. Since you're using LaTeX,
> > it's also probably better to be using the fontspec interface rather
> > than the plain TeX one. Note that \normalfont isn't required above
> > (nor \selectfont).
> >
> > Following your example, this would be better:
> >
> > \font\arabicfont="Scheherazade-AAT" at 12pt
> > \newcommand\arabic[1]{{\arabicfont#1}}
>
>   ... this is a much better use of descriptive macro-names.
>
> >
> > Better still would be:
> >
> > \newfontfamily\arabicfont{Scheherazade-AAT}
> > \newcommand\arabic[1]{{\arabicfont#1}}
> >
> > The reason this is better is that the font size isn't hard coded in
> > the \arabic macro. (See the fontspec manual for explanation of
> > \newfontfamily, etc.) You don't want to have to use a different macro
> > if you want Arabic text in a section heading, for example!
> >
> > Hope this helps,
> > Will
>
>
> Cheers,
>
>         Ross
>
> ------------------------------------------------------------------------
> Ross Moore                                         ross at maths.mq.edu.au
> Mathematics Department                             office: E7A-419
> Macquarie University                               tel: +61 +2 9850 8955
> Sydney, Australia  2109                            fax: +61 +2 9850 8114
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/xetex/attachments/20070311/ef94ebc6/attachment.html 


More information about the XeTeX mailing list