[XeTeX] Unicode Arabic inside English with XeTeX

Will Robertson wspr81 at gmail.com
Sun Mar 11 07:18:19 CET 2007


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}

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}}

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


More information about the XeTeX mailing list