What OpenType math fonts are there available for usage in TeX/LaTeX, e.g. with the unicode-math
package?
Here is a MWE which you can use to show off the font.
\documentclass{article}
\pagestyle{empty}
\usepackage{amsmath}
\DeclareMathOperator\Res{Res}
\newcommand*\diff{\mathop{}\!\mathup{d}}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\usepackage{unicode-math}
%%%
% Set up you text and math fonts
%%%
\begin{document}
\begin{theorem}[Residue theorem]
Let $f$ be analytic in the region $G$ except for the isolated
singularities $a_1,a_2,\dots,a_m$. If $\gamma$ is a closed
rectifiable curve in $G$ which does not pass through any of the
points $a_k$ and if $\gamma\approx 0$ in $G$, then
\[
\frac{1}{2\pi i} \int\limits_\gamma f\Bigl(x^{\mathbf{N}\in\mathbb{C}^{N\times 10}}\Bigr)
= \sum_{k=1}^m n(\gamma;a_k)\Res(f;a_k)\,.
\]
\end{theorem}
\begin{theorem}[Maximum modulus]
Let $G$ be a bounded open set in $\BbbC$ and suppose that $f$ is a
continuous function on $G^-$ which is analytic in $G$. Then
\[
\max\{\, |f(z)|:z\in G^- \,\} = \max\{\, |f(z)|:z\in \partial G \,\}\,.
\]
\end{theorem}
First some large operators both in text:
$\iiint\limits_{Q}f(x,y,z) \diff x \diff y \diff z$
and
$\prod_{\gamma\in\Gamma_{\bar{C}}}\partial(\tilde{X}_\gamma)$;\
and also on display
\[
\iiiint\limits_{Q}f(w,x,y,z) \diff w \diff x \diff y \diff z
\leq
\oint_{\partial Q} f'\Biggl(\max\Biggl\{
\frac{\Vert w\Vert}{\vert w^2+x^2\vert};
\frac{\Vert z\Vert}{\vert y^2+z^2\vert};
\frac{\Vert w\oplus z\Vert}{\vert x\oplus y\vert}
\Biggr\}\Biggr)\,.
\]
\end{document}
Here is a similar MWE for ConTeXt. The images in the answer will only be shown for LaTeX output but the ConTeXt output looks very similar.
%%%
% Set up you text and math fonts
%%%
\setupmathlabeltext[Res=Res]
\definemathcommand[Res][nolop]{\mfunctionlabeltext{Res}}
\definemathcommand[diff]{\mathop{}\!\mfunctionlabeltext{diff}}
\defineenumeration
[theorem]
[text={Theorem},
style=italic,
title=yes,
titlestyle=normal,
distance=0pt,
titleleft={(},
titleright={).~},
alternative=serried,
width=fit]
\starttext
\starttheorem[title={Residue theorem}]
Let $f$ be analytic in the region $G$ except for the isolated
singularities $a_1,a_2,\dots,a_m$. If $\gamma$ is a closed
rectifiable curve in $G$ which does not pass through any of the
points $a_k$ and if $\gamma\approx 0$ in $G$, then
\startformula
\frac{1}{2\pi i} \int\limits_\gamma f\Bigl(x^{{\mathbf N}\in\mathbb{C}^{N\times 10}}\Bigr)
= \sum_{k=1}^m n(\gamma;a_k)\Res(f;a_k)\,.
\stopformula
\stoptheorem
\starttheorem[title={Maximum modulus}]
Let $G$ be a bounded open set in $\mathbb{C}$ and suppose that $f$ is a
continuous function on $G^-$ which is analytic in $G$. Then
\startformula
\max\{\, |f(z)|:z\in G^- \,\} = \max\{\, |f(z)|:z\in \partial G \,\}\,.
\stopformula
\stoptheorem
First some large operators both in text:
$\iiint\limits_{Q}f(x,y,z) \diff x \diff y \diff z$
and
$\prod_{\gamma\in\Gamma_{\bar{C}}}\partial(\tilde{X}_\gamma)$;\
and also on display
\startformula
\iiiint\limits_{Q}f(w,x,y,z) \diff w \diff x \diff y \diff z
\leq
\oint_{\partial Q} f'\Biggl(\max\Biggl\{
\frac{\Vert w\Vert}{\vert w^2+x^2\vert};
\frac{\Vert z\Vert}{\vert y^2+z^2\vert};
\frac{\Vert w\oplus z\Vert}{\vert x\oplus y\vert}
\Biggr\}\Biggr)\,.
\stopformula
\stoptext
Best Answer
The TeX Gyre Fonts
Latin Modern
This is the default font family loaded by
unicode-math
, but can also be set up explicitly. It is an OpenType version of Latin Modern, a clone of DEK’s Computer Modern, based on Monotype Modern, and of the AMS symbol fonts. The default fonts are therefore nearly identical to those of classic LaTeX.This conversion is the work of the GUST project, which later created the TeX Gyre fonts from the free URW fonts, which were based on the Adobe PostScript fonts. All of these fonts (except TeX Gyre DejaVu Math, a conversion of an existing OpenType font into a math font) have similar repertoires and features. They support all European languages as well as Romanizations of other languages.
The vast majority of the fonts on this page similarly cloned an existing font, but changed the name to avoid confusion or to comply with the license. Some have gone through three or four iterations of this.
GUST is the Polish TeX users’ group. Many of the people most motivated to extend existing fonts were from Southern or Eastern Europe, since fonts that already covered Western European languages and Greek letters for math were almost able to support their native languages.
TeX Gyre Bonum
This is a clone of Bookman.
TeX Gyre Pagella
This is a clone of Palatino.
TeX Gyre Schola
This is a clone of Century Schoolbook.
TeX Gyre Termes
This is a clone of Times.
TeX Gyre DejaVu Math
This font is an extension of the DejaVu Serif font, which is based on Arev, which is based on Bitstream Vera, which is based on Bitstream Prima.
It is significantly different from the other TeX Gyre fonts, as they were conversions of legacy fonts to Unicode, and this turns an existing, comprehensive Unicode font by someone else into a math font. The DejaVu project was started by Štěpán Roh of the Czech Republic.
DejaVu Math TeX Gyre
The version of the same font distributed by the DejaVu project rather than the TeX Gyre project.
Other Free Fonts
XITS
This is an fork by Khaled Hosny of the STIX font. it was one of the first free OpenType math fonts to come in both a regular and a bold weight, meaning that
\boldmath
,\mathversion{bold}
and\boldsymbol
will all work with it.Libertinus
Libertinus is a fork by Khaled Hosny of the Linux Libertine font family by Philipp Poll. It comes in a bold weight, like his font XITS Math.
Dr. Hosny is also an expert on typesetting math in the Arabic script, so his fonts Libertinus Math and Amiri make excellent companions if you are writing in a language such as Arabic, Persian or Urdu.
Asana Math
Asana is a close match for Palatino, and therefore its clones, such as Pagella. You should use one of them as the text font. If you try to make Asana the text font, you will not get either styles or ligatures.
It was created by Apostolos Syropoulos, based on Type 1 fonts by Young Ryu, and is similar in appearance to the
pxfonts
package.STIX Two
This is the successor to the STIX font of which XITS is a clone. It was added to CTAN, TeX Live and MikTeX in 2018.
GFS Neohellenic
This font has only minor slab serifs, making it a good choice for presentations. It is based on the public-domain font New Hellenic, inspired by a Greek font from Renaissance Venice.
The math version was commissioned from the Greek Fonts Society by the Department of Mathematics at the University of the Aegean.
Garamond Math
This font was added to CTAN in 2019. It is based on EB Garamond.
Fira Math
This font is based on the Fira Go sans-serif font. It was added to CTAN in November 2018.
Erewhon Math
Erewhon Math is based on Utopia, via Heuristica and Erewhon. Its math symbols are based on the
fourier
package. It was added to CTAN in December 2019.The recommended way to load it is with
But
\setmainfont{Erewhon}
and\setmathfont{Erewhon-Math}
also work. As of February 2020, I needed the following workaround beforefourier-otf
to enable bold text:KpMath
This is an OpenType version of
kpfonts
by Christophe Caignaert.KpMath fonts provide 5 styles, and can be set via math versions:
The
\boldmath
and\boldsymbol
commands switch to thebold
math version, so most authors will want to pick one of these weights as the default and the other as bold, e.g.might better match the weights of the text fonts. This lets you format headers with
\bfseries\boldmath
to have the math match the text.If you truly need to switch between three or more math styles in the same document, you can adapt the
\boldsymbol
code fromamsbsy.sty
to other math styles.New Computer Modern
A fork of Latin Modern that adds support for more script and math symbols, including Greek, Cyrillic, Hebrew, Cherokee and all the symbols in the STIX fonts. It also comes in a slightly-heavier Book weight. As of 2020, there are some features of Latin Modern it does not yet support, such as optical sizes and upright italics.
In book weight:
And in regular weight:
Concrete Math
The
concmath-otf
package offers an Opentype version of the Concrete Math font created by Ulrik Vieth in MetaFont.concmath-otf.sty
is a replacement for the originalconcmath.sty
package.XCharter
XCharter-Math is an Opentype mathematical font based on Bitstream Charter meant to be used with XCharter text fonts.
Neo Euler (Free but Incomplete)
A conversion by Khaled Hosny of the AMS Euler font designed by Hermann Zapf for the book DEK co-authored, Concrete Mathematics: A Foundation for Computer Science.
The code @davislor wrote below is now available in a package, although you will still need to download
euler.otf
from its repository. You can now write eitheror
But here is the explanation of what they do:
AMS Euler was originally matched with the font Concrete Roman, which is now available from the Computer Modern Unicode project as CMU Concrete. Euler goes well with Zapf’s other famous fonts, the serif font Palatino (and therefore its many clones, including Pagella and Asana) and the sans-serif font Optima (which has an OpenType clone, URW Classico). Linux Libertine and its extension Libertinus are also good matches for it, and Libertinus Math, also by Khaled Hosny, shows some similarities.
Neo Euler was abandoned in 2010 and has a smaller repertoire of glyphs than the other fonts (nor will Zapf, who passed away in 2015, draw any more), so if it is missing any glyph you need, you might want to load it with the
range=
option, to use it with a fallback font that contains the glyphs it’s missing. The following loads all glyphs defined in Neo Euler, loads CMU Concrete as the text font, and uses Libertinus Math as the fallback for the rest (such as the ratio).Since Neo Euler has upright glyphs and no italic glyphs, it requires the
math-style=upright
option ofunicode-math
. Unfortunately, the font metrics for subscripts and superscripts appear to be broken, so this example turns off script style for letters and numerals. It also makes sure to load the Greek lowercase letters as upright. If you want to use it with the full range of math alphabets, see below for a demo of how to fill in the missing pieces from other fonts.Another popular set-up is to use the upright letters from Neo Euler in combination with Palatino.
STIX Math Regular
One of the first attempts to create a comprehensive set of all scientific, technical and mathematical symbols. STIX was based on Elsevier’s Esstix, and inspired by Monotype’s Times 4-Line Mathematics Series 569, a font from the middle of the century that simplified typesetting mathematics on mechanical printing presses. The OpenType math support is not complete, which led to the XITS Math project being created.
Noto Sans Math (Incomplete)
As of June 2020, this font is available from the Noto fonts GitHub page. It does not yet fully implement OpenType math features, so you will get a warning if you use it as your primary math font.
Berenis ADF Pro (Incomplete)
This is an incomplete font not included with TeX Live. It is available gratis from the foundry. The text font also contains rare ligatures not shown here, as they look out of place in a mathematical text.
Whether this should be considered an “OpenType math font” is debatable. It lacks an OpenType math table, and
unicode-math
0.81 will not consider it valid as the main math font. This sample falls back to Latin Modern Math as the default math font, then loads every glyph this font defines over that, which you can do for any TrueType or OpenType font. It contains only upright symbols, so it will only work with themath-style=upright
option ofunicode-math
(or if you kitbash it to import symbols from the text fonts; see below).Despite being licensed under the GPL2, it does not come with any source files.
Commercial Fonts
Lucida (Commercial)
Distributed by the TeX User Group. https://tug.org/store/lucida/index.html
Minion Math (Commercial)
Distributed by its designer, Johannes Küster. It comes in four weights and five optical sizes, the most of any OpenType math font (as of 2019).
Cambria Math (Commercial)
This is the font Microsoft Office uses for its equations. The font ships with Microsoft Windows Vista and later, with MS Office, and an early version was bundled with some versions of the MS Office viewers. Monotype sells licenses to use it on workstations and embed it in webpages, but the most likely way to have a legal copy of it on Linux is with a symbolic link in
/usr/local/share/fonts/
or~/.fonts
tocambria_01.ttf
on a Windows partition.Stylistic Sets and Alternates
Many of these fonts contain either stylistic sets or stylistic alternates that allow you to select between different versions of some of the symbols in the font. STIX Two has an especially large number, and actually documents them. If a font doesn’t, you can still check what it currently supports by opening it in FontForge. This is in addition to the choices you can make with package options.
For example, both XITS and STIX Two include a Stylistic Set 8 with alternative upright integrals. (In fact, STIX Two supports every stylistic set XITS Math does.) You can select them as follows:
For comparison, here is the vanilla XITS example again:
A common use of these alternative styles is on the script alphabet. Traditionally, LaTeX had separate alphabets for
\mathcal
and\mathscr
. However, the Unicode consortium decided that no mathematical texts use both of these with different meanings, so they were different presentation forms assigned to the same codepoints.However,
unicode-math
allows you to load different alphabets as\mathcal
and\mathscr
, and also\mathbfcal
and\mathbfscr
. Some fonts, such as XITS, implement this as a stylistic set, some, such as Asana Math, implement it as a stylistic alternative, and others require you to load a different font of you want to do that. For example, to do it with Asana Math:Kitbashing Math Fonts
It is possible to load symbols from any font into a math style, and use them as symbols with
\symup
. For example, nearly all fonts include a QED symbol at U+220E, but what it looks like varies considerably. To get the version in XITS Math (the black tombstone that matches the 1997 edition of The Art of Computer Programming), you can use the commands:Another common request is to combine the letters of a text font family with the symbols of a math font. Since Neo Euler is the math font lacking italic letters at all, it makes a good example. A frequent recommendation is to combine Euler with Hermann Zapf’s other creation, Palatino. Since both Pagella and Asana are clones of Palatino, we can use Pagella as the text fonts and take all the missing glyphs, including italic math letters, from Asana.
This gives us the repertoire to convert the sample to ISO style (a great excuse to show off upright and italic math letters together). Constants such as π and i remain upright (written
2 \symup{\pi i}
, the denominator still shows Euler math letters). Uppercase Greek letters, such as the Gamma function, are now italic rather than upright, but symbols based on Greek letters, such as summation and product, remain the same.Essentially, this adds a few lines to the bottom of the preamble filling in all the remaining math alphabets and setting up digits to match the text font.
Here again is the example with Neo Euler as the math font:
(The eagle-eyed will have noticed one more unexplained line of code, which sets the
partial
andnabla
package options toupright
. Neo Euler contains the upright ∂ symbol in U+2202, but not the cursive ∂ symbol at U+1D715, which confusesunicode-math
. Otherwise, load U+1D715 from another math font.)It is often a good idea to set up subscripts, superscripts, sub-subscripts and super-superscripts to use a smaller optical size, to make it more legible at smaller sizes. There are three methods. There might be a companion font designed for smaller sizes. which you would load with
script-font=
. (The commercial font Aldus is intended as this for Palatino.) Many fonts, including Latin Modern and all the TeX Gyre fonts, come with different optical sizes and you can select a smaller one, e.g.script-features={OpticalSize=8}, sscript-features={OpticalSize=6}
. Finally, math fonts support the font featuresscript-features={Script=Math, Style=MathScript}, sscript-features={Script=Math, Style=MathScriptScript}
.For more information, see the documentation of the
unicode-math
andfontspec
packages.