I need to compile a beamer slideshow with xelatex. I set "Latin Modern Math" as my math font but it was reset to sans serif. Looks awful.

If I set \documentclass as article, everything works.

Minimal working example:



\setmainfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}  
\setmathfont{Latin Modern Math}


  \sin \frac{\pi}{4} = \frac{\sqrt{2}}{2}


It compiles into pdf file looking like that:enter image description here

I run Debian stretch, all tex packages are from repos. texlive version:

 $ dpkg -s texlive
Package: texlive
Status: install ok installed
Priority: optional
Section: tex
Installed-Size: 68
Maintainer: Debian TeX Maintainers 
Architecture: all
Multi-Arch: foreign
Source: texlive-base
Version: 2016.20161008-1
Depends: texlive-latex-base (>= 2016), texlive-latex-recommended (>= 2016), texlive-fonts-recommended (>= 2016)
Description: TeX Live: A decent selection of the TeX Live packages
 The TeX Live software distribution offers a complete TeX system. It
 encompasses programs for typesetting, previewing and printing of TeX
 documents in many different languages, and a large collection of TeX macros
 and font libraries. . This metapackage provides a decent selection of the
 TeX Live packages which should suffice for the most common tasks. . The
 distribution also includes extensive general documentation about TeX, as
 well as the documentation accompanying the included software packages.
Homepage: http://www.tug.org/texlive/

xelatex.log is pasted there: http://pastebin.com/MM1h2EU2

1 Answer 1


The font set up in beamer is meant to be usable 'as is' but doesn't 'play nicely' with loading other font set ups. For those, you want to retain full control with


You must log in to answer this question.

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