<div dir="ltr">2008/8/3 Will Robertson <span dir="ltr"><<a href="mailto:wspr81@gmail.com">wspr81@gmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In terms of how to fix this problem, the easiest is simply to ensure that amsmath is loaded first and your definition is \AtBeginDocument:<br>
<br>
\@ifpackageloaded{amsmath}{%<br>
\AtBeginDocument{\XeTeXmathcode`\-="2 \symMRM "2212}%<br>
}{%<br>
\AtBeginDocument{%<br>
\@ifpackageloaded{amsmath}{%<br>
\PackageError{fontspec}{%<br>
Please load amsmath before fontspec%<br>
}{Bad things happen when amsmath changes things behind my back.}%<br>
}}%<br>
}{}<br>
</blockquote><div><br>Yes, I did something very similar this morning.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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)<br>
<br>
\def\define@mathminus{%<br>
\AtBeginDocument{\XeTeXmathcode`\-="2 \symMRM "2212}}<br>
<br>
\@ifpackageloaded{amsmath}{\define@mathminus}{%<br>
\AtEndPackage{amsmath}{\define@mathminus}}<br>
<br>
This would be a little bit more friendly :)</blockquote><div><br>I might look into this. Right now, this code has the problem that if amsmath is not loaded at all, then the minus is not defined!<br><br>Andrew<br></div></div>
</div>