I am writing a presentation using the beamer class and XeTeX. I have changed the sans font using \setsansfont. Now some symbols in my equations are rendered using the mono font (like the lowercase letters).

How can I force math mode to render all symbols in the equations in the default Computer Modern, ignoring the font set with \setsansfont?

  • Could you pleas edit your question and add that you are seeing this behavior with beamer slides. That would be helpful for people having the same problem and searching for a solution.
    – Caramdir
    Commented Feb 7, 2011 at 16:07
  • I changed the tags.
    – Leo Liu
    Commented Feb 7, 2011 at 16:18

3 Answers 3


By default, Beamer does some math font manipulation, because many fonts, such as the cm-sans used by default, don't provide matching mathematical glyphs. If you want the standard Computer Modern (serif) math font, just say


in the preamble. This suppresses any auto-manipulations.

  • Note that you don't have to (and in fact shouldn't) sign with your name since it automatically appears in the lower right corner of your post. Commented Feb 8, 2011 at 16:19
  • I was looking into changing only the math font for the metropolis theme. This solution works much better than fiddling with the packageunicode-math. Commented Jan 19 at 14:43

Yes, it was a beamer issue. Using


solves the problem. Thanks for pointing me in the right direction, though.

  • Yes. I didn't noitce it is beamer here.
    – Leo Liu
    Commented Feb 7, 2011 at 16:01
  • 1
    And you'd use \usefonttheme[onlymath]{serif}.
    – Leo Liu
    Commented Feb 7, 2011 at 16:12
  • 1
    This change makes more symbols appear in the sans font, instead of the less, e.g. now numbers are in the sans font. Could this be a beamer issue? Commented Feb 7, 2011 at 15:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .