[XeTeX] Polyglossia problems with package lastpage

Ulrike Fischer news3 at nililand.de
Thu Dec 17 09:24:51 CET 2009


Am Thu, 17 Dec 2009 11:21:35 +1100 schrieb Vafa Khalighi:

> I do not think, this is related to bidi, thefollowing minimal works for me
> with no problem:

> Therefore, I guess that would be polyglossia's problem.

Yes, it is. The problem is \thepage: Polyglossia redefines \@arabic
to \hebrewnumber, and \hebrewnumber contains \reset at font in one part
of its definition. Using 
\nohebrew at globalnumbers or \@hebrew at numeralstrue or removing the
\reset at font all solves the problem. \protect\reset at font seems to
work too, but I don't know if the remaining \reset at font in the aux
can make problems later.


\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setmainfont{DejaVu Sans}
\usepackage{fontspec}

\begin{document}
\makeatletter
%\nohebrew at globalnumbers
%\@hebrew at numeralstrue
\def\hebrewnumber#1{%
   \if at hebrew@numerals\hebrewalph{#1}%
   \else {%\reset at font
    \number#1}%
   \fi}
\hebrew at globalnumbers   


abc\pageref{ABC}\label{ABC}
\end{document}
 
-- 
Ulrike Fischer 



More information about the XeTeX mailing list