I'm making a Beamer presentation and would like to use the very elegant Vollkorn fonts. Vollkorn doesn't have good math support, so I'd like to find a not-incongruous replacement. The Libertine font family have similar serif weights, and are hypothetically available for math using \usepackage[libertine]{newtxmath}
, but I just can't quite get it to work. Another constraint that will become relevant is that I'd like to render white-on-black text on some slides.
I'll be partially following this answer which suggests \usepackage{unicode-math}
and replacing mathbf
with symbf
, so I've replaced \symbf
with a dummy command when demonstrating \usepackage[libertine]{newtxmath}
for comparison.
I'm also using \usepackage{textgreek}
so I can substitude text-rendering of some Greek characters to achieve desired styles.
I'll be compiling with pdfTeX 3.141592653-2.6-1.40.22
, which has ok unicode source handling by default. I'll be comparing these to the output of XeTeX 3.141592653-2.6-0.999993
. I installed this using the TexLive package on Ubuntu, version 2021.20220204-1.
Options when using pdflatex
newtxmath + default fonts
With pdflatex
, using only \usepackage[libertine]{newtxmath}
without \usepackage{libertine}
pulls in OT1 fonts, which aren't pretty. The command mathbf
is broken. Also, the serif weights here won't work with white-on-black text for any font weight. Notice that no glyphs are missing (pdflatex finds an OT1 substitution when needed)
\usepackage{textgreek}
\usepackage[libertine]{newtxmath}
newtxmath + libertine fonts
With pdflatex
and both \usepackage{libertine}
and \usepackage[libertine]{newtxmath}
, we get a range beautiful styles, which are congruous with the body text and similar between Latin and Greek. I think the only difference here is that its using the Libertine main-text font to substitute missing glyphs, rather than OT1. Still, the serif weights won't work here for white-on-black, and I'd love to have some Vollkorn to spice things up.
\usepackage{textgreek}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
Options when using xetex
Xetex with newtxmath
Using default fonts
The first thing we notice when switching to xetex
, using \usepackage[libertine]{newtxmath}
with the default fonts is that several glyps are missing. Now, it is \boldsymbol
that is broken rather than \mathbf
. Pixel-wise, it's not too different from pdflatex.
\usepackage{textgreek}
\usepackage[libertine]{newtxmath}
Using libertine fonts
In xetex, \usepackage{libertine}
with \usepackage[libertine]{newtxmath}
is slightly broken. It substitutes computer modern fonts in some places and is overall inferior to the output from pdflatex
.
\usepackage{textgreek}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
Xetex with \usepackage{unicode-math}
Note: \usepackage{unicode-math}
isn't compatible with \usepackage[libertine]{newtxmath}
.
With the default fonts (not shown), \usepackage{unicode-math}
is not nice. Glyphs are missing and font substitutions look out of place. Compared to \usepackage[libertine]{newtxmath}
, the command \boldsymbol
breaks.
\usepackage{textgreek}
\usepackage{unicode-math}
Adding \usepackage{libertine}
(below) gives some improvements, but still has missing glyphs. Compared to pfdlatex
with newtxmath
, the command \boldsymbol
is broken. You may also notice that the weight of the descender on the text μ is slightly lighter. In my opinion the rendering by pdflatex+newtxmath
is more compatible with the style of the Latin text characters.
\usepackage{textgreek}
\usepackage{libertine}
\usepackage{unicode-math}
Adding the Vollkorn font
As far as I know, the Vollkorn font requires these two magic lines
\usepackage[]{fontspec}
\setmainfont[BoldFont=Vollkorn Bold, BoldItalicFont=Vollkorn Medium Italic, Numbers={Proportional,Uppercase}]{Vollkorn}
The packate fontspec
doesn't work with pdflatex
, so we'll be stuck with xetex
or luatex
here.
As you can see below, \usepackage{unicode-math}
is really bad with Vollkorn. This is unsurprising, because Vollkorn has no math support.
\usepackage{textgreek}
\usepackage{unicode-math}
\usepackage[]{fontspec}
\setmainfont[BoldFont=Vollkorn Bold, BoldItalicFont=Vollkorn Medium Italic, Numbers={Proportional,Uppercase}]{Vollkorn}
Removing unicode-math
and adding \usepackage{libertine}
and \usepackage[libertine]{newtxmath}
doesn't quite work either: It's substituting OT1 fonts sometimes, which look wrong.
\usepackage{textgreek}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\usepackage[]{fontspec}
\setmainfont[BoldFont=Vollkorn Bold, BoldItalicFont=Vollkorn Medium Italic, Numbers={Proportional,Uppercase}]{Vollkorn}
So, this is all quite frustrating.
- Vollkorn fonts are really nice, but fontspec restricts us to xetex/luatex
- Vollkorn doesn't support math, so we need another option. the OT and CM fonts are not congruous. The
unicode-math
package is often suggested, but doesn't really work. - Libtertine math has similar serif weighs and
\usepackage{libertine}
with\usepackage[libertine]{newtxmath}
works beautifully inpdflatex
. But, this doesn't play nice inxetex
once we add Vollkorn.
I'm assuming one option would be to do some very specific tweaking of the math styles, using various commands about which I know not. If you haven't guessed by now, there is another solution I found while writing this question, which I will post as an answer.