12

Is it possible to only change the math font in Beamer with XeLaTeX? The only partial solution I've been about to find is to create a new command:

\renewcommand\mathfamilydefault{\rmdefault}

The above command does essentially what I want, but it also strangely inserts characters (lmr) prior to maths. For example,

\mathfamilydefault{${x}_{ij} = -d_{k}/d_{0}$},

yields:

enter image description here

dr.bunsen
  • 1,781

2 Answers2

19

I think you can use \usefonttheme[onlymath]{serif}:

\documentclass{beamer}

\usefonttheme[onlymath]{serif}

\begin{document}
\begin{frame}{foo}

Hello world!

${x}_{ij} = -d_{k}/d_{0}$
\end{frame}
\end{document}

Image

Paulo Cereda
  • 44,220
16

there is no need for using that macro inside your text. It is an internal definition and has the value lmr

\documentclass{beamer}
\renewcommand\mathfamilydefault{\rmdefault}

\begin{document}
\begin{frame}{foo}
${x}_{ij} = -d_{k}/d_{0}$
\end{frame}
\end{document}
  • Thank you. Is there an easy way to get this behavior inside the equation environment? I see that inside the equation environment, Beamer defaults to non-math fonts. – dr.bunsen Jan 19 '12 at 11:59
  • I do not understand what you really want?? It is valid inside the math expression and not outside –  Jan 19 '12 at 12:21
  • Your solution is perfect. My follow-up question was: How can I change math fonts within the equation environment? I've noticed that when working with this environment the default font is non-math. – dr.bunsen Jan 19 '12 at 12:37