182

In a LaTeX article, the math characters are more "curvy" than the text characters:

\documentclass[12pt]{article}
\begin{document}
 $x^2 + y^2 = z^2$
\end{document}

article math

In a beamer presentation, the math characters do not have the same curves:

\documentclass{beamer}
\begin{document}
\begin{frame}
 $x^2 + y^2 = z^2$
\end{frame}
\end{document}

beamer math

Question

How can I get the beamer math to look just like the article math?

I would prefer if the solution was a single line (that I could place at the top of my LaTeX file) as opposed to something that needs to appear next to every piece of math.

Werner
  • 603,163
  • 7
    Just a minor point: it is generally felt to be easier to read sans serif fonts when projected than serif fonts so the lack of curves is there for a reason. – Andrew Stacey Nov 09 '11 at 21:37
  • 10
    @Andrew Sure, but I think that it is too difficult to tell the difference between what is text and what is math, especially when people are used to the mathserif font LaTeX articles but don't see that font on the slides. – Tyson Williams Nov 09 '11 at 21:45
  • 14
    Agreed. I wasn't saying Don't ever do this but rather This is there for a reason. People reading this question might not realise that there is a reason for this choice and decide to change their maths to serif simply because that's what they're used to. I happen to use colours to get round this problem so I'm in full agreement that it's good to do something to distinguish the maths from the text. – Andrew Stacey Nov 10 '11 at 07:48
  • @Andrew Do you put all math in the same color or something more complicated? – Tyson Williams Nov 12 '11 at 17:00
  • 1
    Something more complicated. The colour says what it is. On the basis that a picture paints a thousand words, you can take a look at my beamer slides at the following URL: http://mathsnotes.math.ntnu.no/mathsnotes/show/lecture+notes+2011 – Andrew Stacey Nov 12 '11 at 18:51
  • 1
    @AndrewStacey, slightly off-topic, but do you find that the cyan projects well? I remember a colloquium with colour-coded equations, and the important bit was in green on white and nobody could read it, even in the front row. – Chris H Feb 20 '14 at 10:15
  • 1
    @ChrisH I guess it depends on the projector. I did this in lectures where I was using the same projector each time and so could use feedback to figure out the right colour scheme. – Andrew Stacey Feb 20 '14 at 10:23
  • @AndrewStacey it certainly does... though it often seems to be the ambient light level at the screen that makes the difference. – Chris H Feb 20 '14 at 13:19
  • 1
    @LoopSpace I do think that nowadays it is much more acceptable to have the mathserif font appear on screen, mainly due to the improved resolutions and quality of projectors. – JJM Driessen Oct 14 '19 at 11:43

3 Answers3

220

Add \usefonttheme[onlymath]{serif} to your preamble. That is,

\documentclass{beamer}% http://ctan.org/pkg/beamer
\usefonttheme[onlymath]{serif}
\begin{document}
\begin{frame}
 $x^2 + y^2 = z^2$
\end{frame}
\end{document}

For both text and math in Computer Modern, use the serif document class option. Other combination of font selection is also possible. See this link for a nicely compiled collection.

Older versions (prior to v3.33) supported the class option \documentclass[mathserif]{beamer}.

Werner
  • 603,163
  • 8
    +1, although I don't recommend this option that makes math conflict with the overall aspect of the presentation. – egreg Nov 09 '11 at 21:39
  • 1
    @egreg, what do you mean by the "conflict with the overall aspect of the presentation". It works perfectly for me and looks great. – Alan Turing May 22 '13 at 20:52
  • 4
    @Lex Mixing "serif math" with a sans serif text font is something I wouldn't even think to use. – egreg May 22 '13 at 20:54
  • 1
    IM(unqualified)O this can look smarter than the class between different sans serif fonts that often happens because there aren't many full maths sans serif options, and the body is set in something else. – Chris H Feb 20 '14 at 10:18
  • 1
    This class option is obsolete as of beamer v3.33. As recommended by the warning message, use \usefonttheme[onlymath]{serif} instead in the current version of beamer. – Paul Gessler Jul 25 '14 at 18:21
  • Why the reference says Who is going to use CMR in presentation? Should be avoided!? – Saddle Point Dec 08 '19 at 06:26
  • @stackunderflow: Without Computer Modern you're left with different fonts in the final document. Using serif leaves you with a single document font feel. – Werner Dec 08 '19 at 18:00
  • The link seems dead... is this: http://faq.ktug.org/wiki/uploads/MathFonts.pdf the same? – Rmano Aug 26 '20 at 16:05
46

Alternatively, you can include

\usefonttheme{professionalfonts}

inside the

mode<presentation>{...} 

environment.

Abdul
  • 681
  • 3
    Actually this solution worked better for me: using the "serif" option does not properly replace the \nu-resembling "v" with the amsart curvy one. – Brightsun Mar 25 '15 at 11:16
  • 1
    You can also pass [professionalfonts] as an option to \documentclass. – Davislor Jul 27 '20 at 08:05
  • This worked better for me. the mathserif was not exactly same font as the one in articles. This professionalfonts was exactly same as article math. – hafezmg48 Mar 11 '22 at 01:28
  • 1
    @HafezMousavi What's the difference? I get the same thing when I use \usefonttheme{professionalfonts} as \usepackage[mathfonts]{serif} – xFioraMstr18 Jul 13 '23 at 01:47
9

As @egreg commented, @Werner's answer might incur conflicts. Actually, Beamer supports for different fonts through the \documentclass.

In your case:

\documentclass[mathserif]{beamer}
...

for all other combinations and styles along with the outputs please refer to this comprehensive document.