By default, Beamer does some math font manipulation, because many fonts, such as the cm-sans used by default, don't provide matching mathematical glyphs. If you want the standard Computer Modern (serif) math font, just say
\usefonttheme{professionalfonts}
in the preamble. This suppresses any auto-manipulations.
XeLaTeX (via fontspec
) actually uses the Latin Modern version of Computer Modern. So to change back to it you can do two things:
- Install the Latin Modern Fonts into your system and load the font using
\newfontfamily
- Use the standard
\fontfamily...\selectfont
method.
% !TEX TS-program = XeLaTeX
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
%\newfontfamily\lmodern{Latin Modern Roman} % If font exists on your system
% Optical sizes need to be set up manually using the [SizeFeatures] option
% or select the font using the regular font selection methods
\newcommand{\lmr}{\fontfamily{lmr}\selectfont} % Latin Modern Roman
\newcommand{\lmss}{\fontfamily{lmss}\selectfont} % Latin Modern Sans
\newcommand{\lmss}{\fontfamily{lmtt}\selectfont} % Latin Modern Mono
\begin{document}
Some text in Linux Libertine.
{\lmr Some text in Latin Modern}
\end{document}
Alternatively, if you are mainly using Computer Modern in your document, you can use \newfontfamily
to define the alternative font.
As noted by Andrey Vihrov, the second solution is probably to be preferred, since the optical sizes of Latin Modern are set up when the font is loaded in the regular way. With the first solution, you would need to add the optical size information using the [SizeFeatures]
option when declaring the \newfontfamily
.
If you want to restore the defaults completely (rather than just have access to the Latin Modern fonts with a command) you can redefine \rmdefault, \sfdefault
and \ttdefault
instead (as suggested by Ulrike Fischer). This will override the \setmainfont
settings.
\renewcommand\rmdefault{lmr}
\renewcommand\sfdefault{lmss}
\renewcommand\ttdefault{lmtt}
Edit note: Please note that the current version of this answer has been reorganized to reflect the discussion in the comments. Thanks.
Best Answer
You can use
\usefonttheme{serif}
to get the default serif fonts.You may add
to get nice scalable fonts.