[ad_1]
Is there a way to change the default font used in beamer
class with a custom font (say, Calibri by using fontspec
), but not change any font in math mode?
E.g., if I set \setsansfont
, then \mathsf
is the custom font, not Computer Modern. Passing the option no-math
to fontenc
doesn’t help.
What I also tried was to specify a new \newfontfamily
and try to set \setbeamerfont{normal text}{family=...}
, which should be inherited by all text elements in beamer, but the text is still in Computer Modern.
Also, using unicode-math
as answered here doesn’t work as well (on top of that, compilation is a bit slower).
\documentclass{beamer}
\usepackage[no-math]{fontspec}
\usepackage{unicode-math}
%\newfontfamily{\calfamily}{calibri}[
\setsansfont{calibri}[
Extension=.ttf,
Path=fonts/,
UprightFont=*,
BoldFont=*b,
ItalicFont=*i,
BoldItalicFont=*z,
SmallCapsFont=*l
]
\setmathfont{Latin Modern Math}
%\setbeamerfont{normal font}{family=\calfamily}
\begin{document}
\begin{frame}{}
\textit{a}
a
\(a \mathsf{a}\)
\end{frame}
\end{document}
[ad_2]
Source link