[XeTeX] \XeTeXmathcode problem with amssymb
Jonathan Kew
jonathan_kew at sil.org
Thu May 29 23:49:50 CEST 2008
On 29 May 2008, at 9:18 pm, Mehdi Omidali wrote:
> Thank you. I have another problem. After compiling the followings
>
> \documentclass{article}
> \font\tenrgm="Scheherazade" at 15pt
> \font\sevrgm="Scheherazade" at 9pt
> \font\fivrgm="Scheherazade" at 7pt
> \newfam\fardig
> \textfont\fardig=\tenrgm
> \scriptfont\fardig=\sevrgm
> \scriptscriptfont\fardig=\fivrgm
> \XeTeXmathcode`2="7 \fardig "06F2%
> \begin{document}
> $$\mathbf{y}2x^2$$
> \end{document}
>
> again it doesn't display digits.
I don't think this is really a xetex problem, it's a question of
understanding how LaTeX deals with fonts, encodings, math characters,
families, etc. You can't change math fonts in LaTeX quite so simply.
If you turn on \tracinglostchars=1 (and maybe \tracingonline=1, so
you don't have to look into the .log file) you'll see that it is
trying to set the Persian 2's in cmbx fonts, which of course don't
support that character code.
Try a "plain" version of this:
\font\tenrgm="Scheherazade" at 15pt
\font\sevrgm="Scheherazade" at 9pt
\font\fivrgm="Scheherazade" at 7pt
\newfam\fardig
\textfont\fardig=\tenrgm
\scriptfont\fardig=\sevrgm
\scriptscriptfont\fardig=\fivrgm
\XeTeXmathcode`2="0 \fardig "06F2%
$${\bf y}2x^2$$
\end
and you'll see the 2's in the Persian font. But LaTeX's math mode
does far more complex stuff with fonts, and you're not getting the
digits in the family you expected.
(If you replace \mathbf{y} with \hbox{\bf y}, the digits will be
unaffected. But this isn't a general solution, of course.)
JK
More information about the XeTeX
mailing list