5

Here

\documentclass{article}

\usepackage{fontspec}
\usepackage{unicode-math}   % luatex
\setmainfont{EB Garamond}
\setmathfont{Garamond Math}

\begin{document}
Test \(\mathrm{Df'_2}\).
\end{document}

the prime is too close to the f. I suppose this is an error in Garamond Math. What's the right way to fix it? (I'd prefer one that doesn't require typing something different every time.)

(Df'_2 is the name of a definition. Df should therefore be typeset as ordinary text, not with the extra spacing produced by \symup.)

Toothrot
  • 3,346
  • I prefer to write like this \(\mathrm{Df\,'_2}\). –  Aug 06 '19 at 16:46
  • In unicode-math, \mathZZ commands are for “words”, not for single letters, where \symZZ should be used. – egreg Aug 06 '19 at 19:49

1 Answers1

7

Use \symrm instead of \mathrm. I also prefer to put only the letters in the argument - even if doesn't make a difference here.

\documentclass{article}

\usepackage{fontspec}
\usepackage{unicode-math}   % luatex
\setmainfont{EB Garamond}
\setmathfont{Garamond Math}

\begin{document}
Test \(\mathrm{Df}'_2\).

Test \(\symrm{Df}'_2\).

Test \(\symrm{Df'_2}\).
\end{document}

enter image description here

Ulrike Fischer
  • 327,261