I'd like to manually fix some longstanding spacing issues between certain pairs of capital letters in Latin Modern Math, such as UF and YX. Because these pairs represent actual products, I'd rather not write \mathit{UF} on every occasion. Here's my attempt:
\documentclass{article}
\usepackage{unicode-math}
\directlua{
fonts.handlers.otf.addfeature {
name = "lmkern",
type = "kern",
data = {
[0x1D434] = { [0x1D435] = -100 },
[0x1D448] = { [0x1D439] = -100 },
[0x1D44C] = { [0x1D44B] = -100 }
}
}
}
\setmathfont[RawFeature=+lmkern]{Latin Modern Math}
\begin{document}
\showoutput
$AB_{AB}$\quad$UF_{UF}$\quad$YX_{YX}$
\end{document}
The relevant bits of the output are:
....\TU/LatinModernMath(1)/m/n/10
....\kern-1.0 (font)
....\TU/LatinModernMath(1)/m/n/10
....\hbox(4.991+0.0)x12.61394, shifted 2.46974, direction TLT
.....\TU/LatinModernMath(1)/m/n/7
.....\TU/LatinModernMath(1)/m/n/7
....\TU/LatinModernMath(1)/m/n/10
....\kern1.05 (italic)
....\TU/LatinModernMath(1)/m/n/10
....\hbox(4.781+0.14)x11.66193, shifted 2.46974, direction TLT
.....\TU/LatinModernMath(1)/m/n/7
.....\kern0.581 (italic)
.....\TU/LatinModernMath(1)/m/n/7
....\TU/LatinModernMath(1)/m/n/10
....\kern2.09 (italic)
....\TU/LatinModernMath(1)/m/n/10
....\hbox(4.781+0.0)x13.28593, shifted 2.46974, direction TLT
.....\TU/LatinModernMath(1)/m/n/7
.....\kern1.463 (italic)
.....\TU/LatinModernMath(1)/m/n/7
What is the meaning of \kern … (italic)? How can I specify kerning for subscripts (or smaller font sizes), and how can I override the italic kerning?
\kern … (italic)is the italic correction, by the way. – Henri Menke Jul 08 '20 at 03:59\kern, which is explained in the TeXbook, and these categorized kerns LuaTeX reports. But now I see that they are just good old italic corrections (applied in places where they aren't needed?), only that plain TeX doesn't label those kerns as such. – photon.engine Jul 08 '20 at 05:12fjwould show up like in text and be way too close together. Compare\textit{fj} \textit{f\/j} $fj$– Henri Menke Jul 08 '20 at 06:29\/) in math mode, even though the kerns in$YX$and\textit{f\/j}are both reported as "italic" kerns by LuaTeX. My question is rather: What is the difference between "italic" and "font" kerns, a difference that doesn't exist for TeX? Does the font decide which pairs receive "italic" kerns (e.g., UF but not AB), and can I override that decision? I was hoping there may be a simpler fix than what @MarcelKrüger suggested. – photon.engine Jul 08 '20 at 08:49