I'm having trouble with the way the characters are spaced in the Metropolis Beamer theme, while using the serif font for math mode. Here's a MWE:


\usetheme[progressbar = frametitle,
block = fill,
background = light






        \mathbb E[Y]

I've compiled this with XeTeX, MacTeX distribution (I had to install the fira sans font system-wide to get the theme to work). As you can see, the character spacing is way off: enter image description here This seems to happen with some characters and not others, but is pervasive throughout the document, and looks quite bad.

I would be grateful for any advice for how to fix this without changing the theme or font. Perhaps there is some way of requiring the math font switch within the .sty file, in a way that results in the spacing being correct. Thank you.

  • 1
    Seems to be a xetex problem. No problem with pdftex or luatex (though you shouldn't load the inputenc package with xetex and luatex). My advice would be to use pdftex and be happy, unless there are particular reasons for using xetex.
    – campa
    Commented Dec 3, 2021 at 11:59
  • Apparently you need \usefonttheme{professionalfonts} with xetex, see e.g. tex.stackexchange.com/a/266138/82917
    – campa
    Commented Dec 3, 2021 at 12:07
  • @campa thanks a lot for your comment. Xetex is for the fira sans font, which breaks with Pdflatex. But the command in your second comment seems to fix everything! If you type it up as an answer I will accept it. Commented Dec 3, 2021 at 12:54

1 Answer 1


If I ask for \showoutput, I get

......\hbox(7.5+2.5)x19.65225, shifted 143.81882, display
.......\U/msb/m/n/10 E
.......\OT1/cmr/m/n/10 [
.......\TU/lmr/m/it/10 glyph#117
.......\OT1/cmr/m/n/10 ]

and this is the cause: there is no kerning between characters in different fonts. With your setup.

If I also load \usefonttheme{professionalfonts}, the tracing becomes

......\hbox(7.5+2.5)x20.25005, shifted 143.51991, display
.......\U/msb/m/n/10 E
.......\OT1/cmr/m/n/10 [
.......\OML/cmm/m/it/10 Y
.......\OT1/cmr/m/n/10 ]

and the kern is present.

enter image description here

  • Thank you for the explanation. Commented Dec 3, 2021 at 13:03

You must log in to answer this question.

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