fix #659#662
Conversation
Co-Authored-By: peaR-red <pearatlatex@gmail.com> Signed-off-by: ponte-vecchio <zkogdxdkur@p.monash.edu>
There was a problem hiding this comment.
Pull request overview
Fixes issue #659, where X columns were assigned an inflated minimum width whenever a horizontally merged (\SetCell[c=...]) cell appeared in the same table, causing the table to overflow. The root cause is that \__tblr_set_column_widths_from_span_widths: recorded each column's current @col-width (the unwrapped natural width for X columns) as its minimum, which was later used by \__tblr_adjust_extendable_column_width: and locked X columns to that huge size. The fix detects columns with a non-zero coefficient (X columns) and skips recording a minimum width for them while resetting their entry in \l__tblr_col_item_skip_size_prop to 0pt.
Changes:
- In
\__tblr_set_column_widths_from_span_widths:, branch on the columncoefficient: forX-style columns, zero out the col-item skip size and don't populate\l__tblr_column_min_width_prop; otherwise behave as before. - Bump the release date in
\ProvidesExplPackageto2026-05-28. - Add a new regression test
table-018(tex, tlg, pdftex.tlg, md5) and a corresponding entry intestfiles/README.md; refreshcell-005.md5; add.DS_Storeto.gitignore.
Reviewed changes
Copilot reviewed 7 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tabularray-dev.sty | Skip min-width recording for X (coefficient > 0) columns and bump release date. |
| testfiles/table-018.tex | New regression test reproducing the merged-cell + X-column scenario from #659. |
| testfiles/table-018.tlg, table-018.pdftex.tlg, table-018.md5 | Expected log/checksum baselines for the new test. |
| testfiles/cell-005.md5 | Updated checksum reflecting the column-width fix's effect on existing test. |
| testfiles/README.md | Documents the new table-018 test entry. |
| .gitignore | Adds .DS_Store to ignore list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
peaR-red
left a comment
There was a problem hiding this comment.
Hmm, seems alright, other than a few stuff Copilot pointed out (was the AI review necessary though?).
What I'm curious about is why cell-005 warranted changes in light of this fix. Compiling locally there doesn't seem to be any noticeable difference.
Big oopsie with fat fingers, ignore the clanker.
Visually indistinguishable, but the checksum test fails, so something must be different - in any case, I've had to change it for that reason alone. |
peaR-red
left a comment
There was a problem hiding this comment.
A minor addition to \__tblr_set_column_widths_from_span_widths:...
Co-authored-by: peaR <pearatlatex@gmail.com>

See #659 which this PR patches. Specifically, this addresses the following problem:
What seemed to be happening is that before span sizes are distributed,
\__tblr_collect_column_widths_skips:populates\l__tblr_col_item_skip_size_propusing the@col-widthof each column. For X columns whereco > 0, this value is initially their unwrapped natural width, which can be massive. During\__tblr_set_column_widths_from_span_widths:, the routine evaluates the span distributions. Now, because theXcolumns are not covered by a span, the distribution logic leaves their massive natural width untouched in\l__tblr_col_item_skip_size_prop. It then populates\l__tblr_column_min_width_propfor theXcolumns using these untouched values. Consequently, when\__tblr_adjust_extendable_column_width:runs to assign the final target widths to theXcolumns, it checks against\l__tblr_column_min_width_prop. Since the recorded min width is the huge unwrapped natural width it locks theXcolumn to be that size causing table overflow as exhibited by #659.