11

Recently I was writing a document in LaTeX using Linux Libertine. Overall I love this font, but I found a strange case of italicized text where there is almost no space between the word of and a successive mathematical expression. Picture, with MWE:

\documentclass{standalone}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}

\begin{document} \textit{Let $d$ be the dimension of $V$ or of ${}^LG$.} \end{document}

enter image description here

To my eye both of's are way too close to the following text and it looks glaringly bad.

I suspect this is happening because of the default spacing parameters for an italic f are small. And that scares me a bit because these are very low-level parameters (at least in LaTeX).

Is there an easy way to increase the space here? Ideally I could change a single parameter somewhere, though I think it is unlikely to be this easy. Alternatively, assuming I have to add in space manually each time, what is the best way to do this?

  • 3
    Even with Computer Modern, the transition from a text italic f to math can look a bit squeezed. In that situation, an italic correction \/ is recommended. You might try it here, – barbara beeton Oct 23 '23 at 19:54

2 Answers2

11

The mathtools documentation states quite wisely

Italic correction is a treacherous area.

As Barbara mentioned in her comment, math is bound to be a bit cramped after an italic f. Furthermore, the libertine math letters have almost no side bearing, which aggravates the effect:

(Top: libertine, bottom: CM.)

You've got a couple of workarounds

  • As Barbara said, introduce an italic correction \/ manually.
  • Use the option mathic=true from the mathtools package. For this to work, however, you must use the LaTeX inline math syntax \(...\).
\documentclass{article}

\usepackage{libertine} \usepackage[libertine]{newtxmath} \usepackage{mathtools} \mathtoolsset{mathic=true}

\begin{document} \itshape Let $d$ be the dimension of $V$ or of ${}^LG$.

Let $d$ be the dimension of/ $V$ or of/ ${}^LG$.

Let $d$ be the dimension of (V) or of ({}^LG). \end{document}

enter image description here

Take your pick. (Until egreg answers and explains how to do it properly :-).)

campa
  • 31,130
  • In all three, my eye sees a bit too much space between "V" and "or". – murray Oct 24 '23 at 14:18
  • 1
    @murray The italic o has a larger side bearing on the left. – campa Oct 24 '23 at 14:28
  • @murray BTW thanks for the edit. While "exaggerate" wasn't what I had in mind, "exasperate" was a false friend. – campa Oct 24 '23 at 20:13
  • The same o left-side bearing gives the same, seemingly too-wide gap between "V" and "or" for all the fonts I tried, including CM (and Latin Modern), Tex Gyre Terms, Tex Gyre Schola, and Lucida Bright. – murray Oct 25 '23 at 19:41
1

I suggest to use text mode for this, maybe with a bit of manually added space:

\documentclass{article}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\newcommand{\spacesuper}[1]{\,\textsuperscript{#1}}
\begin{document}
\textit{Let $d$ be the dimension of $V$ or of ${}^LG$.}

\textit{Let d be the dimension of V or of \textsuperscript{L}G.}

\textit{Let d be the dimension of V or of \spacesuper{L}G.} \end{document}

enter image description here

Marijn
  • 37,699