josephwright / siunitx

A comprehensive (SI) units package for LaTeX
LaTeX Project Public License v1.3c
350 stars 25 forks source link

table-format setting may cause "Overfull \hbox" since LaTeX 2024-06-01 #735

Closed muzimuzhi closed 1 month ago

muzimuzhi commented 1 month ago

Caught from tabularray's regression test, see this job run.

When a cell content has more digits than that specified in table-format (hence it's wider than permitted), beforehand no message is raised. Since LaTeX 2024-06-01 an "Overfull \hbox" is raised. I don't know if this difference is expected.

% \RequirePackage[2023-11-01]{latexrelease}
\documentclass{article}
\usepackage{siunitx}

\begin{document}

\begin{tabular}{|S[table-format=2.1]|}
  33.11
\end{tabular}

\end{document}

log

Overfull \hbox (5.00002pt too wide) detected at line 9
muzimuzhi commented 1 month ago

This is also caught by the test suite of siunitx itself: https://github.com/josephwright/siunitx/actions/runs/9507844311/job/26208088716.

Relevant diff output

```diff *** 2200,2205 **** --- 2190,2198 ---- ! OK. \l_tmpa_box l. ... } + Overfull \hbox (5.00002pt too wide) detected at line 413 + \hbox(0.0+0.0)x-5.00002 + .\glue 0.0 plus 1.0fil Package siunitx Info: Option "table-figures-decimal" has been deprecated in this release. (siunitx) (siunitx) Use "table-format" as a replacement. *************** *** 2239,2245 **** ......\OT1/cmr/m/n/10 5 ......\mathoff .....\hbox(0.0+0.0)x-5.00002 - ......\glue -5.00002 ......\glue 0.0 plus 1.0fil .....\glue 0.0 plus 0.5fill .....\kern 0.0 --- 2232,2237 ---- *************** *** 2273,2279 **** ......\OT1/cmr/m/n/10 5 ......\mathoff .....\hbox(0.0+0.0)x0.0 - ......\glue 0.0 ......\glue 0.0 plus 1.0fil .....\glue 0.0 plus 0.5fill .....\kern 0.0 --- 2265,2270 ---- ```

josephwright commented 1 month ago

I'm happy we get a warning here: I never got round to making sure there was one. So I'll simply adjust the tests (but there is something else to check on first).

muzimuzhi commented 1 week ago

Surprisingly, now my initial example won't trigger "Overfull \hbox" any more, neither does the library-003.tex test in tabularray's repository.

But those "Overfull \hbox" messages added in https://github.com/josephwright/siunitx/commit/b25ee71439c185bc82cba09671714604912e5dab for table-emulation.lvt test in this repository persist.

I tried with format built on LaTeX 2024-06-01, "Overfull \hbox" didn't come back.

josephwright commented 1 week ago

@muzimuzhi It's changes in array I think (I didn't trace but I know Frank has tightened up as part of the tagging work)