I am working in XeLaTeX + Memoir, and I have two documents: one typeset in English and another typeset in Arabic. As the two documents are related, I am using the package xr
to establish cross-references between the two. My Arabic text is using eastern Arabic (so-called Arabic-Indic) numerals. When xr
pulls in the page number of the cross-reference from the Arabic Document into my English Document, the number displayed is an Arabic-Indic ١.
What I would like is for this to be presented instead as a (regular) Arabic number as used in English: 1. Obviously these are two different characters, with different glyphs. The font I am using, Khaled Hosny's excellent Amiri, contains both (though at a later stage, the English text will be typeset in a different Latin font).
Thus, my question is how can I replace/substitute one character (1) for another (١), assuming the font contains both?
Here are the MWE files (for xr
to work, you must compile the first one, then the second one, then recompile the first one again):
minimalxr1.tex
\documentclass{memoir}
\usepackage{xr}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}
\setromanfont[Mapping=tex-text,Numbers=OldStyle,Ligatures=Common]{Amiri}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2,WordSpace=1.66]{Amiri}
\externaldocument{minimalxr2}
\begin{document}
This is a test of cross-referencing to this page \pageref{test}.
\end{document}
minimalxr2.tex
\documentclass{memoir}
\usepackage{xr}
\usepackage{polyglossia}
\setmainlanguage[numerals=mashriq]{arabic}
\newfontfamily\arabicfont[Ligatures=TeX,Script=Arabic,Scale=1.2,WordSpace=1.66]{Amiri}
\externaldocument{minimalxr1}
\begin{document}
\begin{Arabic}
هذا أنموذج
\label{test}
\end{Arabic}
\end{document}
XR
package, this has no effect. I also tried with\XeTeXinterchartokenstate
but wasn't able to get it to work (due most likely to my inexperience).