TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is an error message which I do not understand when I use amsart in conjunction with fontspec. The math text in the abstract seems to be deemed too small?

The error is

\textfont 6 is undefined (character =).

Here is a minimal working example:






share|improve this question
I'm not sure what the problem is, but loading mathspec before fontspec will solve it. – Alan Munn May 7 '12 at 17:45
@AlanMunn very clever! I'm happy with that so far, thanks! – Olivier May 7 '12 at 17:56
For some unknown (to me) reason, the mathcode of = changes in the abstract environment; with \begin{abstract}\mathcode`="303D the example compiles. – egreg May 7 '12 at 18:03
@egreg Interesting... The parenthesis are also problematic, for instance $f(x)$ in the abstract generates the same error. – Olivier May 7 '12 at 18:10
up vote 9 down vote accepted

It seems to be a bug in the compatibility of fontspec with the AMS classes. The problem happens when a font size changing command such as \Small is issued (such a command is defined by amsart and amsbook to change font size relative to the current font size).

Apparently, the legacymaths symbol font doesn't get defined, and this upsets amsart or, more precisely, the font size changing commands.

The solution is to call


(which is done by mathspec, so Alan Munn's advice works) or to define the required symbol font:

share|improve this answer
You are a genius. Thanks a lot!! – Olivier May 8 '12 at 16:12
What is the relation between mathspec and fontspec? – Alexey Nov 4 '13 at 14:16
@Alexey mathspec is built over fontspec and aims to use text fonts also for math; the results are rather good, but not for extensive math usage. – egreg Nov 4 '13 at 14:57
I see, thanks. If i understand correctly, fontspec is strongly recommended in XeLaTeX, so is it safe to use \usepackage[no-math]{fontspec}? – Alexey Nov 4 '13 at 15:00
@Alexey The no-math option basically doesn't change the font used for family 0 (upright math letters). – egreg Nov 4 '13 at 15:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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