2

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:

\documentclass{beamer}

\usepackage{fontspec}
\usepackage{unicode-math}

\defaultfontfeatures{Ligatures={TeX}}
\setmainfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}  
\setmathfont{Latin Modern Math}

\begin{document}

\begin{frame}
$$
  \sin \frac{\pi}{4} = \frac{\sqrt{2}}{2}
$$
\end{frame}

\end{document}

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

2

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

\usefonttheme{professionalfonts}

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.