我需要用 xelatex 编译一个 beamer 幻灯片。我将“Latin Modern Math”设置为我的数学字体,但它被重置为无衬线字体。看起来很糟糕。
如果我将 \documentclass 设置为 article,则一切正常。
最小工作示例:
\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}
我运行 Debian stretch,所有 tex 包均来自 repos。texlive 版本:
$ 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 粘贴在那里:http://pastebin.com/MM1h2EU2
答案1
中的字体设置beamer
旨在“按原样”使用,但无法“很好地”加载其他字体设置。对于这些,您希望保留完全控制权
\usefonttheme{professionalfonts}