[XeTeX] Patch for maths in fontspec

Will Robertson will at guerilla.net.au
Mon Jun 20 03:05:13 CEST 2005


Hello,

Before I get around to uploading a new version of fontspec, if you  
would like to apply this patch manually to get maths working while  
also defining a new \mathrm font (that is, using \setromanfont in the  
preamble), just replace the code in fontspec.sty that begins the same  
way with this:

   \ifzf at math@package\else
     \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}
     \DeclareMathSymbol{!}{\mathclose}{legacymaths}{"21}
     \DeclareMathSymbol{+}{\mathbin}{legacymaths}{"2B}
     \DeclareMathSymbol{:}{\mathrel}{legacymaths}{"3A}
     \DeclareMathSymbol{;}{\mathpunct}{legacymaths}{"3B}
     \DeclareMathSymbol{=}{\mathrel}{legacymaths}{"3D}
     \DeclareMathSymbol{?}{\mathclose}{legacymaths}{"3F}
     \DeclareMathDelimiter{(}{\mathopen} {legacymaths}{"28} 
{largesymbols}{"00}
     \DeclareMathDelimiter{)}{\mathclose}{legacymaths}{"29} 
{largesymbols}{"01}
     \DeclareMathDelimiter{[}{\mathopen} {legacymaths}{"5B} 
{largesymbols}{"02}
     \DeclareMathDelimiter{]}{\mathclose}{legacymaths}{"5D} 
{largesymbols}{"03}
     \DeclareMathDelimiter{/}{\mathord}{legacymaths}{"2F} 
{largesymbols}{"0E}
     \DeclareMathSymbol{\Gamma}{\mathalpha}{legacymaths}{"00}
     \DeclareMathSymbol{\Delta}{\mathalpha}{legacymaths}{"01}
     \DeclareMathSymbol{\Theta}{\mathalpha}{legacymaths}{"02}
     \DeclareMathSymbol{\Lambda}{\mathalpha}{legacymaths}{"03}
     \DeclareMathSymbol{\Xi}{\mathalpha}{legacymaths}{"04}
     \DeclareMathSymbol{\Pi}{\mathalpha}{legacymaths}{"05}
     \DeclareMathSymbol{\Sigma}{\mathalpha}{legacymaths}{"06}
     \DeclareMathSymbol{\Upsilon}{\mathalpha}{legacymaths}{"07}
     \DeclareMathSymbol{\Phi}{\mathalpha}{legacymaths}{"08}
     \DeclareMathSymbol{\Psi}{\mathalpha}{legacymaths}{"09}
     \DeclareMathSymbol{\Omega}{\mathalpha}{legacymaths}{"0A}
     \DeclareMathSymbol{\colon}{\mathpunct}{legacymaths}{"3A}
     \DeclareMathAccent{\acute}{\mathalpha}{legacymaths}{"13}
     \DeclareMathAccent{\grave}{\mathalpha}{legacymaths}{"12}
     \DeclareMathAccent{\ddot}{\mathalpha}{legacymaths}{"7F}
     \DeclareMathAccent{\tilde}{\mathalpha}{legacymaths}{"7E}
     \DeclareMathAccent{\bar}{\mathalpha}{legacymaths}{"16}
     \DeclareMathAccent{\breve}{\mathalpha}{legacymaths}{"15}
     \DeclareMathAccent{\check}{\mathalpha}{legacymaths}{"14}
     \DeclareMathAccent{\hat}{\mathalpha}{legacymaths}{"5E}
     \DeclareMathAccent{\dot}{\mathalpha}{legacymaths}{"5F}
     \DeclareMathAccent{\mathring}{\mathalpha}{legacymaths}{"17}
     \DeclareMathSymbol{\mathdollar}{\mathord}{legacymaths}{"24}
   \fi

Many thanks to Bruno, who gets the credit for all the maths insight  
that lead me to implementing this, for better or worse :), in the  
first place.

I'm not going to upload a new package version straight away because I  
realised that I need some commands for specifying exactly which fonts  
you would actually like to load for \mathrm, \mathit, and so  
on...when they're ready you'll see v1.8.

Thanks for all the help!

Will



More information about the XeTeX mailing list