19

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}
\begin{equation}
  V^* \quad T^6 \quad T) \quad VT
\end{equation}
\end{document}

Compiling with TL14 gives
Example with TL14
and TL15:
Example with 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?

  • 2
    Terrible regression! This should indeed be fixed as soon as possible! – egreg Jul 3 '15 at 13:52
  • Does it only happen for Latin Modern? Or for all math fonts? – MaxNoe Jul 3 '15 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. – egreg Jul 3 '15 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. – egreg Jul 3 '15 at 14:12
  • 1
    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... – Zhen Lin Jul 3 '15 at 21:58
13

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}

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

enter image description here

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).

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.