My question is closely related to this one. The difference is, that I would like to make a presentation with beamer and that I use standard fonts. As you can see in the following MWE the commas in math and text mode differ from each other.
What is the best way to fix this?
MWE:
\documentclass{beamer}
\begin{document}
\begin{frame}
$f(x,y,z) > 0$ if $x$, $y$, and $z$ are positive.
\end{frame}
\end{document}
Output:
Best Answer
The commas in maths match commas from the default serif font but are taken from the OML encoding. You can see this if you force the text to use the serif font by changing the frame to
However, now the commas are being taken from the serif font while the rest of the text is taken from sans.
It would be better to ensure that the commas are taken from the same font as maths operators, since this is changed to the sans font by
beamer
, I think. For example:The nice thing about this is that if you override Beamer's choices and insist it use serif rather than sans, your commas will still match your text:
Although the redefinition is unnecessary in this case, it is nice that you don't have to worry about removing or disabling it.
EDIT
In light of barbara's comment on the question, I ran a few tests. Although the particular punctuation suggested is unproblematic as it is already taken from
operators
rather thanletters
, the full stop is not. Moreover, there is a difference between the serif and sans full stop. In the sans font, it is square; in the serif, round.Hence, for completeness, you might like to add a line redeclaring this symbol as well:
Here's the output for commas and full stops in maths and text, after the change, with the serif versions shown on the right for comparison.