Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

up vote 9 down vote accepted

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}
share|improve this answer
    
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 –  Herbert 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
add comment

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

share|improve this answer
    
there is also the option stillsansserifmath –  Herbert Jan 19 '12 at 12:25
    
\usefonttheme[onlymath]{serif} Plus $10^10^100$ on that. Awesome - looks so much better. –  Martin Sep 13 '13 at 4:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.