7

I am using XeLaTeX with fontspec and mathdesign to set the maths font separately. This works fine in memoir, for example, but Beamer overrides my maths font settings and uses the main font as a maths font.

Minimum example:

\documentclass[serif]{beamer}
\usepackage[utopia]{mathdesign}
\usepackage[no-math]{fontspec}
\setmainfont{Liberation Serif}
\begin{document}
\begin{frame}
\frametitle{Minimum working example}
\begin{itemize}
    \item normal text set in Liberation Serif and maths \textbf{also,} instead of Adobe Utopia as intended
        \[v_x(t) := \lim\limits_{\Delta t \rightarrow 0} \frac{\Delta x}{\Delta t} =: \frac{\mathrm{d}v_x}{\mathrm{d}t}\]
\end{itemize}
\end{frame}
\end{document}

This produces the following output, all set in the main font:

enter image description here

Your help is appreciated.

2
  • 1
    Yes, the command that worked is \usefonttheme{professionalfonts}. Sep 5, 2015 at 10:33
  • If you are using xetex you probably should be using unicode-math for changing the math font.
    – MaxNoe
    Sep 5, 2015 at 16:30

2 Answers 2

7

As you found out yourself, \usefonttheme{professionalfonts} is needed to be able to use opentype fonts with beamer.

However, I want to add that you probably should use unicode-math together with xelatex to change the math-fonts.

\documentclass[serif]{beamer}

\usefonttheme{professionalfonts}
\usepackage{fontspec}
\setromanfont{Linux Libertine O}

\usepackage{mathtools}

\usepackage{unicode-math}
% check name of font for your system, this works on Ubuntu
\setmathfont{TeX Gyre Pagella Math}

\begin{document}

\begin{frame}{Unicode-Examples}
  Some unicode in formulas:
  \begin{equation}
    α² + β² = γ²
  \end{equation}
  And a fraction: ½.
\end{frame}
\end{document}

result

5

For some reason the comments containing the answer have disappeared, but I hope it is not impolite to answer my own question on the basis of those comments.

The solution is to use \usefonttheme{professionalfonts} in the preamble.

The minimum working example is now:

\documentclass[serif]{beamer}
\usepackage[utopia]{mathdesign}
\usepackage[no-math]{fontspec}
\setmainfont{Liberation Serif}
\usefonttheme{professionalfonts}% SOLUTION
%
\begin{document}

\begin{frame}
\frametitle{Minimum working example}
\begin{itemize}
    \item normal text set in Liberation Serif and maths \textbf{also,} instead of Adobe Utopia as intended
        \[v_x(t) := \lim\limits_{\Delta t \rightarrow 0} \frac{\Delta x}{\Delta t} =: \frac{\mathrm{d}x}{\mathrm{d}t}\]
\end{itemize}
\end{frame}
\end{document}

Producing enter image description here

(having corrected the physics mistake above as well).

1
  • Please provide a MWE.
    – Sverre
    Sep 6, 2015 at 12:31

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.