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
\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.



\setromanfont[Mapping=tex-text]{EB Garamond}


text (default, oldstyle): 1234567890\\
text (lining): 1234567890\\
math (why is this oldstyle?): $1234567890$

  • Are you meaning beamer rather than article? I don't think it's a good idea to use Garamond for a presentation.
    – egreg
    Feb 6, 2013 at 10:07
  • Thanks egreg. Yes, the class was beamer. Not sure how that typo got into the MWE--won't run with article. 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.)
    – Mars
    Feb 6, 2013 at 14:36

1 Answer 1


I found a solution. It's easy, it's obvious, and though it's not a complete solution, it's good enough for me. The solution is to moveNumbers=Lining from \addfontfeatures to defaultfontfeatures, like this:

\defaultfontfeatures{Mapping=tex-text, Numbers=Lining}

By making lining numbers the default, they penetrate into math mode. (I should have tried that first, but I didn't fully understand what I had in my preamble--I just knew that it worked, apart from the oldstyle/lining problem.)

This isn't a complete solution because it affects math mode throughout the document. I still don't know how to switch back and forth between lining and oldstyle numbers in math mode. Adding additional calls to \addfontfeature or \defaultfontfeature in the document have no effect on math mode. However, using lining numbers everywhere is what I wanted, anyway.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .