See the following mwe:


  1 + 2 = 3 

Run the above code with xelatex will meet the following error:

! Package mathspec Error: `amsmath' must be loaded earlier than `mathspec'.

See the mathspec package documentation for explanation.
Type  H <return>  for immediate help.

l.54 \RequirePackage{amsmath}


$ xelatex --version XeTeX 3.14159265-2.6-0.999991 (TeX Live 2019)



The mathspec package uses a hand-made test to suggest amsmath being loaded before it: precisely, it redefines \RequirePackage, which is quite a bad thing to do.

The redefinition is not really dangerous in itself, but it's rather naïve: the redefined command just checks whether the mandatory argument to \RequirePackage is amsmath and, in this case, it emits the error message.

It happens that recent versions of unicode-math indeed do \RequirePackage{amsmath}, so the error is triggered.

However, this is a false problem: mathspec and unicode-math are very unfriendly to each other, because they want to do the same thing, namely, to take control of math typesetting.

I don't think there is any way to make them to cooperate. Load either one or the other, not both.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.