[XeTeX] incompatibility with amsmath

Will Robertson wspr81 at gmail.com
Sun Aug 3 03:37:31 CEST 2008


On 03/08/2008, at 10:26 AM, Andrew Moschou wrote:

> Thanks for the information!

In terms of how to fix this problem, the easiest is simply to ensure  
that amsmath is loaded first and your definition is \AtBeginDocument:

\@ifpackageloaded{amsmath}{%
   \AtBeginDocument{\XeTeXmathcode`\-="2 \symMRM "2212}%
}{%
   \AtBeginDocument{%
     \@ifpackageloaded{amsmath}{%
       \PackageError{fontspec}{%
         Please load amsmath before fontspec%
       }{Bad things happen when amsmath changes things behind my back.}%
     }}%
}{}


However, if you're willing to break out memoir's "\AtEndPackage" code  
(which IMO should have it's own package), you could write instead  
(untested)

\def\define at mathminus{%
   \AtBeginDocument{\XeTeXmathcode`\-="2 \symMRM "2212}}

\@ifpackageloaded{amsmath}{\define at mathminus}{%
   \AtEndPackage{amsmath}{\define at mathminus}}

This would be a little bit more friendly :)

Hope this helps,
Will
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2415 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20080803/705fdebe/attachment-0001.bin 


More information about the XeTeX mailing list