3

In the following minimal example, the first 5 rows throw an overfull hbox warning, but only if unicode-math is loaded.

\documentclass{scrartcl}

\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}

\usepackage{siunitx}
\usepackage{booktabs}


\begin{document}

\begin{tabular}{S[table-format=2.2]}
\toprule
{$x$} \\
\midrule
  45.71 \\
  50.77 \\
  60.70 \\
  60.70 \\
  49.79 \\
  20.15 \\
  12.45 \\
\end{tabular}

\end{document}

Any idea why this happens and how to resolve it?

  • Latin Modern Math adds a kern between 7 and any other character, including the boundary (so you get two 0.14235pt kerns with 77), see tex.stackexchange.com/a/219198/4427 It is undoubtedly a bug in the font metrics. – egreg Oct 11 '16 at 22:54
  • Ah, ok. I think you could provide that as an answer ;) – MaxNoe Oct 12 '16 at 7:22
2

Due to what I consider a bug in the font tables/metrics, the character 7 from Latin Modern Math is kerned with whatever follows it, including the boundary, by adding 0.14235pt of kerning, see https://tex.stackexchange.com/a/219198/4427

Indeed, you get the overfull box message only for the top five rows of data, where a digit 7 appears; the overfull is exactly 0.14235pt for all five rows but the second, where the overfull is 0.2847pt:

Overfull \hbox (0.14235pt too wide) detected at line 17
Overfull \hbox (0.2847pt too wide) detected at line 18
Overfull \hbox (0.14235pt too wide) detected at line 19
Overfull \hbox (0.14235pt too wide) detected at line 20
Overfull \hbox (0.14235pt too wide) detected at line 21

There's not much one can do, I'm afraid, except asking the people in charge of Latin Modern Math to remove that wrong kerning.

  • Or use another math font, which is what I will do. Thanks :) – MaxNoe Oct 12 '16 at 8:17

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.