I would like to add italic correction at the end of inline math, depending on the italic correction of the last math character. Here is a MWE showing why I would like to have that:
%! TEX program = lualatex
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmainfont{Libertinus Serif}
\setmathfont{Libertinus Math}
\begin{document}
Some text interlaced with an \(f\) here.
\end{document}
As you can see, the f is pretty near the word "here". Of course I could just add some constant space, but ideally LaTeX would use the italic correction provided from the math font. In that way, only characters that lean heavily to the right would get an additional space (provided the font has correct italic correction). Is that possible?
I tried adding \/
both at the end of the math (\(f\/\)
) and after the math mode (\(f\)\/
), but neither had any effect. Using \(f\) \/
had some effect, though I guess latex just inserted an additional space there, not really the italic correction.
\/
to have an effect you have to set\mathitalicsmode=1
.\(overline f\)
, and only tried\(\overline f\/\)
instead of\(\overline{f\/}\)
. This is why I figured it had no effect...