[XeTeX] Unicode Arabic inside English with XeTeX

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


Hi Will,

2007/3/11, Will Robertson <wspr81 at gmail.com>:
>
> Hi Manuel,
>
> No trouble asking here if you get stuck, that's why we're here!


Thanks, you're very kind :)

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,


I thought I was using XeLaTeX...

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


Yes, it does work without the \normalfont at the end.

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


They do work fine. However I had to change the name \arabic to \arabi (or
anything else) because of an error:

!LaTeX Error: Command \arabic already defined.

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!


I see, that's useful. I had a look at the document
ftp://tug.ctan.org/pub/tex-archive/macros/xetex/latex/fontspec/fontspec.pdf.
I find it difficult to understand or to find the information I want, but I
think defining the size in the command and not with the font would be
something like this:

\newcommand\arabi[1]{{\fontsize{18}{18}\arabicfont#1}}

It seems to work.

Hope this helps,


It does!

Thank you, Will!

Take care, Manuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/xetex/attachments/20070311/159e6dd0/attachment.html 


More information about the XeTeX mailing list