1

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}

pdflatex newtxmath default

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}

pdflatex newtxmath libertine

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}

xetex + newtxmath + default

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 + newtxmath + libertine fonts

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}

xetex unicode libertine

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}

xetex+vollkorn+unicode

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}

xetex libertine newtxmath 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 in pdflatex. But, this doesn't play nice in xetex 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.

1 Answer 1

1

The final permutation, which I arrived on after exhaustive search, is to use fontspec to pull in the Vollkorn font, then use \usepackage[libertine]{newtxmath} without importing \usepackage{libertine}.

\usepackage{textgreek}
\usepackage[libertine]{newtxmath}
\usepackage[]{fontspec}
\setmainfont[BoldFont=Vollkorn Bold, BoldItalicFont=Vollkorn Medium Italic, Numbers={Proportional,Uppercase}]{Vollkorn}

solution

Of course, this still leaves much to be desired:

  • \mathbf and \operatorname don't work on Greek.
    • With \usepackage{libertine}, it was possible to match styles by inserting text glyphs.
    • Now, the Vollkorn font is used. Bold does not look good, but standard medium-weight Vollkorn might stand in for bold Libertine in a pinch.
  • The Libertine font works really well in \text mode for styling math, Vollkorn not so much. I'm really missing the bold μ.

I'm sure there's some way to make xetex default to Libertine text and not Vollkorn text within math environments, without breaking the \mathbf and \operatorname commands, but what is it?

1

You must log in to answer this question.

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