I'm using EB Garamond with XeLaTeX and Beamer as follows. (I'm not actually sure whether it's all necessary--advice accepted.):
\usepackage[T1]{fontenc} % not sure why
\usepackage[urw-garamond]{mathdesign} % use URW Garamond rather than Computer Modern in math when EB Garamond is missing a character
\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text} % not sure why
\setromanfont[Mapping=tex-text]{EB Garamond}
(I previously loaded EB Garamond as a system font on a Mac using its Font book app.)
EB Garamond uses oldstyle numbers by default. I can easily change to lining numbers in regular text by various means, e.g. by inserting this at the top of the document: \addfontfeatures{Numbers=Lining}
. However, none of the methods I've tried has any effect on math in $$
, \[\]
, etc.; the oldstyle numbers remain. This is a Beamer issue--the problem doesn't occur with the article class.
How can I switch to lining numbers in math mode (without resorting to \mbox
)? A full minimal working example is below.
Thanks!
\documentclass[12pt]{beamer}
\usepackage[T1]{fontenc}
\usepackage[urw-garamond]{mathdesign}
\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{EB Garamond}
\usefonttheme{serif}
\begin{document}
\begin{frame}
text (default, oldstyle): 1234567890\\
\addfontfeatures{Numbers=Lining}
text (lining): 1234567890\\
math (why is this oldstyle?): $1234567890$
\end{frame}
\end{document}
beamer
rather thanarticle
? I don't think it's a good idea to use Garamond for a presentation.beamer
. Not sure how that typo got into the MWE--won't run witharticle
. I just fixed it. (I'm not someone in the "presentations must be in san serif" camp. For me a Garamond is a good choice for presentations; I've given it quite a bit of thought, and have worked up a Beamer class that I like.)