[XeTeX] Unicode Arabic inside English with XeTeX

Herbert Schulz herbs at wideopenwest.com
Sun Mar 11 05:55:23 CET 2007


On Mar 10, 2007, at 6:39 PM, Manuel Souto Pico wrote:

> \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.
>

Howdy,

It seems silly to be defining the font over and over with each use.  
Why not something like

\font\arabic="Scheherazade-AAT" at 12 pt

and then

\newcommand{\ar}[1]{{\arabic\selectfont#1}}

(note the nested braces). If you're not very careful (unless you're  
very lucky) having a double meaning for \ar (both a command name and  
a font) can lead to all sorts of problems.

Good Luck,

Herb Schulz
(herbs at wideopenwest.com)




More information about the XeTeX mailing list