[XeTeX] Math Problem and XeLaTeX

Bruno Voisin bvoisin at mac.com
Sun Mar 6 10:49:43 CET 2005


Le 6 mars 05, à 09:26, Bruno Voisin a écrit :

> I think the problem is caused by the new way in which XeTeX deals with 
> PostScript fonts:

Thinking more about it, the problem lies elsewhere. In fact, I'm 
doubtful math accents have ever worked when using any OS X font (like 
Hoefler) as the source of alphabetic letters (for \sin, \cos, etc.) and 
numbers in maths, as was done by writing in the document's preamble:

	\SetSymbolFont{operators}{normal}{\encodingdefault}{\rmdefault}{m}{n}
	\SetSymbolFont{operators}{bold}  {\encodingdefault}{\rmdefault}{b}{n}
	\SetMathAlphabet{\mathrm}{normal}{\encodingdefault}{\rmdefault}{m}{n}
	\SetMathAlphabet{\mathbf}{normal}{\encodingdefault}{\rmdefault}{b}{n}
	\SetMathAlphabet{\mathit}{normal}{\encodingdefault}{\rmdefault}{m}{it}
	\SetMathAlphabet{\mathrm}{bold}  {\encodingdefault}{\rmdefault}{b}{n}
	\SetMathAlphabet{\mathit}{bold}  {\encodingdefault}{\rmdefault}{b}{it}

The problem is that 
/Library/teTeX/share/texmf.tetex/tex/latex/base/fontmath.ltx takes the 
math accents from this font, see:

	\DeclareMathAccent{\acute}{\mathalpha}{operators}{"13}
	\DeclareMathAccent{\grave}{\mathalpha}{operators}{"12}
	\DeclareMathAccent{\ddot}{\mathalpha}{operators}{"7F}
	\DeclareMathAccent{\tilde}{\mathalpha}{operators}{"7E}
	\DeclareMathAccent{\bar}{\mathalpha}{operators}{"16}
	\DeclareMathAccent{\breve}{\mathalpha}{operators}{"15}
	\DeclareMathAccent{\check}{\mathalpha}{operators}{"14}
	\DeclareMathAccent{\hat}{\mathalpha}{operators}{"5E}
	\DeclareMathAccent{\vec}{\mathord}{letters}{"7E}
	\DeclareMathAccent{\dot}{\mathalpha}{operators}{"5F}
	\DeclareMathAccent{\widetilde}{\mathord}{largesymbols}{"65}
	\DeclareMathAccent{\widehat}{\mathord}{largesymbols}{"62}
	\DeclareMathAccent{\mathring}{\mathalpha}{operators}{"17}

But unfortunately this is under the assumption that the font is encoded 
in the OT1 encoding of the CMR font:

	\DeclareSymbolFont{operators}   {OT1}{cmr} {m}{n}

and it turns out that in the encoding of the OS X font the accents are 
not at the same places. Compare the appended font tables for CMR and 
Hoefler Text.

A solution would be to redefine the math accents to correspond to their 
Unicode code points, namely:

\dot : "5F -> "02D9
\ddot: "7F -> "00A8

but this turns out to be impossible for \dot, since XeTeX, like TeX, 
can only accept 8-bit character codes for math fonts.

I'm realizing now that when I first suggested the above procedure for 
using OS X fonts in maths with XeLaTeX ( see the thread "[XeTeX] Maths 
in XeLaTeX" from 8 September 2004), I had mentioned the math accent 
issue:

> Having done the above analysis, the solution is in fact obvious, but I 
> just figured it out: after defining the OS X text fonts for the 
> XeLaTeX document to compile, write:
>
> 	\SetSymbolFont{operators}{normal}{\encodingdefault}{\rmdefault}{m}{n}
> 	\SetSymbolFont{operators}{bold}  {\encodingdefault}{\rmdefault}{b}{n}
> 	\SetMathAlphabet{\mathrm}{normal}{\encodingdefault}{\rmdefault}{m}{n}
> 	\SetMathAlphabet{\mathbf}{normal}{\encodingdefault}{\rmdefault}{b}{n}
> 	\SetMathAlphabet{\mathit}{normal}{\encodingdefault}{\rmdefault}{m}{it}
> 	\SetMathAlphabet{\mathrm}{bold}  {\encodingdefault}{\rmdefault}{b}{n}
> 	\SetMathAlphabet{\mathit}{bold}  {\encodingdefault}{\rmdefault}{b}{it}
>
> to coerce LaTeX into using these fonts for text in maths too (the 
> above assumes the text fonts are available in bold/italic/bold italic, 
> with obvious adaptations to other circumstances). The procedure is a 
> rather quick fix, and most likely to leave some issues unsolved (like 
> math accents), but it sort of works.

but then I completely forgot about it. Sorry!

Bruno

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nfssfont-cmr.pdf
Type: application/pdf
Size: 57146 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20050306/f2f461e4/nfssfont-cmr-0001.pdf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nfssfont-hfl.pdf
Type: application/pdf
Size: 81416 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20050306/f2f461e4/nfssfont-hfl-0001.pdf


More information about the XeTeX mailing list