[XeTeX] incompatibility with amsmath

Stephen Moye stephenmoye at mac.com
Sat Aug 2 16:04:33 CEST 2008


> Hi everyone,
>
> With this document:
> \documentclass{article}
>
> \usepackage{amsmath}
>
> \usepackage{fontspec}
>
> \setmainfont{Times New Roman}
>
> \makeatletter
>
> \DeclareSymbolFont{TNR}{EU1}{\zf at family}{m}{n}
>
> \XeTeXmathcode`-=2\symTNR"2212
>
> \begin{document}
>
> $a-b$
>
> \end{document}
> I receive the message:
> ! Extended mathchar used as mathchar (71311890).
> but remove \usepackage{amsmath} and the problem goes away. This is
> unacceptable because amsmath is such an important package. Is there a
> solution? I'm using 3.1415926-2.2-0.999.2 in MiKTeX.
>
> Andrew

There was a discussion of a similar sort on comp.text.tex (XeLaTeX/ 
math/characters over 255 in OpenType font):

http://groups.google.com/group/comp.text.tex/browse_thread/thread/bcb808a5a88086da

Using Will's code with amsmath:

%---%

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage[no-math]{fontspec}
\setmainfont{Times New Roman}
\makeatletter
\DeclareSymbolFont{MRM}{EU1}{\zf at family}{m}{n}
\makeatother
\begin{document}
\XeTeXmathcode`\-="2 \symMRM "2212 % minus sign
$A-\sqrt{BgT}$
\end{document}

%---%

Notice that "\XeTeXmathcode`\-="2 \symMRM "2212" comes *after*  
\begin{document}; if it comes *before*, then you get the error. With  
Times New Roman, you also get a box instead of a minus sign. With  
Charis SIL and Garamond Premier Pro, you get a minus sign.

I'm a little curious about the difference between putting the  
\XeTeXmathcode`\-="2 \symMRM "2212" statement before as opposed to  
after \begin{document}

Stephen Moye

PS I had to fabricate this reply from the original in the archives.


More information about the XeTeX mailing list