[XeTeX] arabic problem with polyglossia

Ross Moore ross at ics.mq.edu.au
Mon Dec 28 23:55:35 CET 2009


Hi Youssef,

On 29/12/2009, at 5:15 AM, Youssef wrote:

> Hi everyone,
>
> I'm a bit confused by the way polyglossia has been handling Arabic.
> I've tried to use arabxetex as a substitute, but to no avail.
>
> The main problem with polyglossia is that it messes up Arabic (utf)  
> inside \section{} and \chapter{}.

This seems to be the same problem that was reported
a couple of weeks ago.

It occurs with the latest Polyglossia on CTAN,
but not with an earlier version (2009/01/25 v1.0.2).


Polyglossia's alteration to  \@arabic  is not compatible
with writing values of counters into auxiliary files.

viz.

>> \thesection ->\@arabic \c at section
>>
>> \@arabic #1->\ifeastern at numerals {\addfontfeature  
>> {Mapping=arabicdigits}\number
>>  #1}\else \RL {\reset at font \number #1}\fi
>> #1<-\c at section
>> {\iftrue: (level 2) entered on line 24}
>> {true}
>>
>> \addfontfeature #1->\ifcsname zf at family@fontdef\f at family  
>> \endcsname \begingroup

This \addfontfeature instance is being expanded, for no good reason.
It ultimately leads to a failure.

The problem goes away if you change the definition of  \arabicnumber
to include some instances of \protect  as follows:

\makeatletter
\def\arabicnumber#1{%
  \ifeastern at numerals{\protect\addfontfeature{Mapping=arabicdigits} 
\number#1}%
  \else
   \protect\RL{\protect\reset at font\number#1}%
\fi}
\makeatother


I'm not sure whether this is the complete solution,
as the usage of  \addfontfeature  looks like it might result
in the same feature being added multiple times.
This might break something, or eventually overload something.
Some extra grouping braces might be needed to prevent this.



>
> I'm sending a minimal example attached together with the resulting  
> pdf and log.
>
> Any help would be much appreciated.

Hope this helps,

	Ross

> <ycherem.vcf>

------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





More information about the XeTeX mailing list