3

As far as I have seen, there is no definitive answer as to the best practices for using a math font together with Garamond. Currently, I have the following result: enter image description here

My setup is \usepackage{mathptmx} with a subsequent \usepackage{CormorantGaramond}. While I am happy with how the main text looks, I have a feeling there is something off with the way math text is typeset. May I ask those more experienced in fonts, whether the text above looks ideal, from the fonts usage perspective?

Perhaps irrelevant: I am using CMake. I would avoid, if possible, using xelatex.

2
  • 6
    Do you know the ebgaramond font has a corresponding math font with the ebgaramond-maths package, and even an open type math font with garamond-math?
    – Bernard
    Nov 29, 2020 at 12:39
  • ebgaramond is the one of the best suggestion, also mathastext package helps too....
    – MadyYuvi
    Nov 29, 2020 at 14:37

1 Answer 1

9

You have several options here.

In the Modern Toolchain

Although you tagged your question with pdftex, my advice is to use LuaLaTeX and unicode-math when you can, and legacy 8-bit fonts when you have to. You can use the OpenType Garamond Math font with

\usepackage{unicode-math}
\setmainfont{EB Garamond}
\setmathfont{Garamond-Math.otf}[StylisticSet={8,9}]
% If you want a script-style \mathscr in addition to
% the calligraphic-style \mathcal, add:
\setmathfont{Garamond-Math.otf}[range={scr,bfscr}]

You can check the documentation of Garamond Math for more information about the stylistic sets available. For example, stylistic set 9 fixes the tildes in math mode.

A simpler way to load unicode-math with EB Garamond and Garamond Math is:

\usepackage[ebgaramond]{fontsetup}

With ebgaramond-maths

According to the documentation, the correct usage is:

\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}

With newtx

Based on the example preamble in section 18.4 of the newtx manual:

\usepackage[lining,semibold,scaled=1.05]{ebgaramond}% Latex BOLD renders with ebgaramond semibold
\usepackage[T1]{fontenc} % best for Western European languages
\usepackage[varqu,varl]{inconsolata}% a typewriter font must be defined
\usepackage{amsmath,amsthm}% must be loaded before newtxmath
\usepackage[ebgaramond,vvarbb,subscriptcorrection]{newtxmath} % STIX Bbb
\usepackage{bm}% load after all math to give access to bold math

There is also a garamondx option if you have installed that package.

On modern installations, you should no longer need \usepackage{textcomp} or \usepackage[utf8]{inputenc}, but on older ones you might. If you consider it necessary to define a typewriter font, you probably also want to pick a sans-serif one.

With mathdesign

You can download the “expert” URW Garamond Type-1 fonts with the getnonfreefonts script from TUG and write

\usepackage[garamond]{mathdesign}
\usepackage{garamondx} 

However, URW Garamond has a restrictive license. Loading Cormorant Garamond or EB Garamond instead should also work. If mathdesign breaks small caps, the easiest fix is to load fontaxes.

With Another Math Package in XeTeX

In XeTeX (and only XeTeX), you can use the EB Garamond OpenType font with a legacy math package by loading mathspec after the other package:

\usepackage{mathspec}

\setmainfont{EB Garamond}
\setmathsfont(Digits,Latin,Greek)[Uppercase=Italic, Lowercase=Italic]{EB Garamond}

In my tests, this doesn’t always give correct spacing when you mix letters with some math symbols.

With Another Math Package

There are at least three different Garamond legacy math alphabets. The math design one is especially handy because it includes both Latin and Greek in upright, as well as italic, shape. It is therefore the only legacy version of Garamond that comes with upright lowercase Greek letters, such as \mathrm{\pi}.

The family name of this math alphabet is mdugm, and isomath has an interface to load it for \mathrm, \mathit, \mathbf and \mathbfit. You can attempt this with

\usepackage[OMLmathrm, rmdefault=mdugm]{isomath}

Or by redefining the math alphabets with commands such as:

\DeclareMathAlphabet{\mathit}{OML}{mdugm}{m}{it}
\SetMathAlphabet{\mathit}{bold}{OML}{mdugm}{mb}{it}
2
  • The very first option worked for me. At least for the Springer svjour3 template. Nov 29, 2020 at 21:27
  • Neat explanation...Helps for me too....
    – MadyYuvi
    Nov 30, 2020 at 3:38

You must log in to answer this question.

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