[XeTeX] Fontspec: how to prevent execution of \@zf at math

Bruno Voisin bvoisin at mac.com
Wed May 28 18:49:34 CEST 2008


Le 28 mai 08 à 18:32, Bruno Voisin a écrit :

> For some reason [no-math] or \@zf at mathfalse do not seem to work in the
> way I expected: they do have an effect on \mathrm for example
> (yielding the same as \textrm with [math] and cmr with [no-math]), but
> not on the math digits which are taken from cmr in both cases.
>
> I must have misunderstood something somewhere. Beats me!

It was, of course, a silly mistake I made!

You need two things: first,

\SetSymbolFont{operators}{normal}{\encodingdefault}{\rmdefault}{m}{n}
\SetSymbolFont{operators}{bold}  {\encodingdefault}{\rmdefault}{b}{n}

to overcome LaTeX's default from fontmath.ltx, namely

\DeclareSymbolFont{operators}   {OT1}{cmr} {m}{n}
\SetSymbolFont{operators}{bold}{OT1}{cmr} {bx}{n}

and secondly the [no-math] option for fontspec, to prevent fontspec  
from executing \@zf at math and hence from restoring LaTeX's default  
through

\DeclareSymbolFont{legacymaths}{OT1}{cmr}{m}{n}
\SetSymbolFont{legacymaths}{bold}{OT1}{cmr}{bx}{n}
\DeclareMathSymbol{0}{\mathalpha}{legacymaths}{`0}
\DeclareMathSymbol{1}{\mathalpha}{legacymaths}{`1}
\DeclareMathSymbol{2}{\mathalpha}{legacymaths}{`2}
\DeclareMathSymbol{3}{\mathalpha}{legacymaths}{`3}
\DeclareMathSymbol{4}{\mathalpha}{legacymaths}{`4}
\DeclareMathSymbol{5}{\mathalpha}{legacymaths}{`5}
\DeclareMathSymbol{6}{\mathalpha}{legacymaths}{`6}
\DeclareMathSymbol{7}{\mathalpha}{legacymaths}{`7}
\DeclareMathSymbol{8}{\mathalpha}{legacymaths}{`8}
\DeclareMathSymbol{9}{\mathalpha}{legacymaths}{`9}

Thanks for leading me to the truth!

Bruno Voisin


More information about the XeTeX mailing list