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

Ulrike Fischer news2 at nililand.de
Wed May 28 17:53:44 CEST 2008


Am Wed, 28 May 2008 17:06:08 +0200 schrieb Bruno Voisin:

> In fontspec, is there a simple switch to prevent use of the  
> legacymaths font, in other terms to prevent execution of \@zf at math?
> 
> Apparently, fontspec executes \@zf at math@maybe which tests for use of  
> either of a list of font packages, and if none is used executes  
> \@zf at math which tests additionally for use of euler and lucida and if  
> none is used redefines a number of math "elements" (including digits)  
> to be taken from a legacymaths fonts (namely CMR).
> 
> I'm willing to prevent this to happen, even though I'm not loading any  
> of the font packages \@zf at math@maybe and \@zf at math test for.  
> Specifically, I'm willing digits in maths to be taken from the main  
> text font (Verdana here).
> 
> It seems loading the unicode-math package is a solution, but I thought  
> unicode-math was considered not mature enough to be used routinely.  
> And indeed, unicode-math isn't included in TeXLive and isn't installed  
> when building and installing XeTeX from source.
> 
> I tried
> 
> \makeatletter
> \AtBeginDocument{%
>    \@zf at mathfalse}
> \makeatother

> which didn't work, 

I don't know what you mean by "didn't work". If it had any effect, than
you probably put the command after loading fontspec instead of before.
But there is no need for this: the option no-math does the same:
\DeclareOption{no-math}{\@zf at mathfalse}

> and finally resorted to
> 
> \AtBeginDocument{%
>    \DeclareMathSymbol{0}{\mathalpha}{operators}{`0}
>    \DeclareMathSymbol{1}{\mathalpha}{operators}{`1}
>    \DeclareMathSymbol{2}{\mathalpha}{operators}{`2}
>    \DeclareMathSymbol{3}{\mathalpha}{operators}{`3}
>    \DeclareMathSymbol{4}{\mathalpha}{operators}{`4}
>    \DeclareMathSymbol{5}{\mathalpha}{operators}{`5}
>    \DeclareMathSymbol{6}{\mathalpha}{operators}{`6}
>    \DeclareMathSymbol{7}{\mathalpha}{operators}{`7}
>    \DeclareMathSymbol{8}{\mathalpha}{operators}{`8}
>    \DeclareMathSymbol{9}{\mathalpha}{operators}{`9}}
> 
> Is there a simpler way of achieving the same result?

If you want to change only the digits, I would say this is the right way
to do it. 

-- 
Ulrike Fischer 



More information about the XeTeX mailing list