LuaTeX: Wrong/missing italic correction in TeXLive 2015 vs 2014

Italic correction for OTF math fonts seems to be broken in LuaTeX in TL15.

MWE:

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\begin{document}
$$V^* \quad T^6 \quad T) \quad VT$$
\end{document}


Compiling with TL14 gives

and TL15:

There is no problem for upright letters (\mathup{T}).

Using the .otf font from 2014 with TL15 produced the same result as with the 2015 font.

I can remember having similar problems with TL11/12.

So the question is: what caused this change and how can I fix it?

• Terrible regression! This should indeed be fixed as soon as possible! Jul 3, 2015 at 13:52
• Does it only happen for Latin Modern? Or for all math fonts? Jul 3, 2015 at 13:56
• @MaxNoe Also for XITS Math and TeX Gyre Termes Math (the ones I tried). On the other hand, it doesn't happen for the standard math fonts, so some bad interactions with unicode-math and luaotfload seems to be happening. Jul 3, 2015 at 13:57
• The italic correction for U+1D449 MATHEMATICAL ITALIC CAPITAL V is correctly computed to 2.14pt, but the kern is not inserted. Jul 3, 2015 at 14:12
• I can't believe that reporting it on the LuaTeX tracker doesn't get a solution, but posting it here gets a workaround in 3 hours... Jul 3, 2015 at 21:58

The problem has a long history. It was brought up in 2011, as far as I know, with a message to the TeX Live mailing list; the thread went on also in the LuaTeX list.

The problem is that LuaTeX doesn't add the italic correction in math mode after characters having category code 11. Indeed, in TeX Live 2011, the output from your code would be the same as you get now.

See How can I enable italic correction for LuaTeX? for finding a workaround that applies also to the present version of LuaLaTeX:

\documentclass{article}

\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
%\setmathfont{TeX Gyre Termes Math}

\everymath\expandafter{\the\everymath\luatexcatcodetable\CatcodeTableLaTeX}
\everydisplay\expandafter{\the\everydisplay\luatexcatcodetable\CatcodeTableLaTeX}

\begin{document}

$$V^* \quad T^6 \quad T) \quad VT$$
\end{document}


The problem was circumvented by changing the default category codes for math letters to 12. However, as suggested by Ulrike Fischer, the new release of LaTeX (2015/01/01) has changed back the category codes to 11 for every character that qualifies as a letter and so the problem has reappeared.

Quoting Joseph Wright in chat

That's a bit of a problem: we are for a start looking at fixing \CatcodeTableLaTeX so it has the right catcodes

so the workaround is not guaranteed to be valid in the future (but I hope some better remedy will be found in the meantime).

• The next version of unicode-math will also take steps to work around this problem. Jul 8, 2015 at 1:15
• fixed with unicode-math 0.8 Aug 3, 2015 at 2:28
• But not for non-letters like integral signs Sep 11, 2015 at 15:19