diff --git a/.gitignore b/.gitignore index c795b05..751831e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -build \ No newline at end of file +build +.DS_Store \ No newline at end of file diff --git a/tabularray-dev.sty b/tabularray-dev.sty index ce99279..3d2752e 100644 --- a/tabularray-dev.sty +++ b/tabularray-dev.sty @@ -23,7 +23,7 @@ \DeclareRelease{v2021}{2021-01-01}{tabularray-2021.sty} \DeclareCurrentRelease{}{2026-01-01} -\ProvidesExplPackage{tabularray-dev}{2026-05-11}{2026A-DEV} +\ProvidesExplPackage{tabularray-dev}{2026-05-28}{2026A-DEV} {Development and experimental variant of tabularray} %% \IfFormatAtLeastTF, xparse and lthooks are added in LaTeX 2020-10-01 @@ -5612,11 +5612,37 @@ \prop_clear:N \l__tblr_column_min_width_prop \int_step_variable:nNn { \c@colcount } \l__tblr_j_tl { - \tl_set:Ne \l__tblr_min_tl - { \prop_item:Ne \l__tblr_col_item_skip_size_prop { item[\l__tblr_j_tl] } } - \prop_put:Nee \l__tblr_column_min_width_prop - { \l__tblr_j_tl } { \l__tblr_min_tl } + \tl_set:Ne \l__tblr_co_tl + { \__tblr_data_item:nen { column } { \l__tblr_j_tl } { coefficient } } + \fp_compare:nNnTF { \l__tblr_co_tl } > { 0 } + { + \prop_put:Nen \l__tblr_col_item_skip_size_prop { item[\l__tblr_j_tl] } { 0pt } + } + { + \tl_set:Ne \l__tblr_min_tl + { \prop_item:Ne \l__tblr_col_item_skip_size_prop { item[\l__tblr_j_tl] } } + \prop_put:Nee \l__tblr_column_min_width_prop + { \l__tblr_j_tl } { \l__tblr_min_tl } + } + } + \prop_clear:N \l_tmpa_prop + \prop_map_inline:Nn \l__tblr_col_span_size_prop + { + \__tblr_get_span_from_to:w ##1 + \bool_set_false:N \l_tmpa_bool + \int_step_inline:nnn { \l__tblr_a_tl } { \l__tblr_b_tl } + { + \tl_set:Ne \l__tblr_co_tl + { \__tblr_data_item:nen { column } { ####1 } { coefficient } } + \fp_compare:nNnT { \l__tblr_co_tl } > { 0 } + { \bool_set_true:N \l_tmpa_bool } + } + \bool_if:NF \l_tmpa_bool + { + \prop_put:Nnn \l_tmpa_prop { ##1 } { ##2 } + } } + \prop_set_eq:NN \l__tblr_col_span_size_prop \l_tmpa_prop \prop_set_eq:NN \l__tblr_col_item_even_prop \l__tblr_col_item_skip_size_prop \str_if_eq:enTF { \__tblr_prop_item:ne { inner } { hspan } } diff --git a/testfiles/README.md b/testfiles/README.md index ade424c..ad244e5 100644 --- a/testfiles/README.md +++ b/testfiles/README.md @@ -122,3 +122,4 @@ | `table-015` | empty tables (#326) | | `table-016` | first cell starts with a square bracket (#598) | | `table-017` | set horizontal alignment of longtblr with `\SetTblrOuter` (#611) | +| `table-018` | merged cells in non-X columns (#659) | diff --git a/testfiles/cell-005.md5 b/testfiles/cell-005.md5 index 60366f5..bd02b96 100644 --- a/testfiles/cell-005.md5 +++ b/testfiles/cell-005.md5 @@ -1 +1 @@ -6da0b1c829c78ea57c29e1cfc3e5623e \ No newline at end of file +ca1202ef9f687b517c2f4ed868860251 \ No newline at end of file diff --git a/testfiles/cell-005.png b/testfiles/cell-005.png index b1f3f64..4e1eea9 100644 Binary files a/testfiles/cell-005.png and b/testfiles/cell-005.png differ diff --git a/testfiles/table-018.md5 b/testfiles/table-018.md5 new file mode 100644 index 0000000..37a9309 --- /dev/null +++ b/testfiles/table-018.md5 @@ -0,0 +1 @@ +fe43acdc67c99ddb15a832e442ed884f \ No newline at end of file diff --git a/testfiles/table-018.pdftex.tlg b/testfiles/table-018.pdftex.tlg new file mode 100644 index 0000000..a11b4c1 --- /dev/null +++ b/testfiles/table-018.pdftex.tlg @@ -0,0 +1,8 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +============================================================ +TEST 1: Test merged cells in non-X columns +============================================================ +============================================================ +[1 +] (table-018.aux) diff --git a/testfiles/table-018.png b/testfiles/table-018.png new file mode 100644 index 0000000..a107be5 Binary files /dev/null and b/testfiles/table-018.png differ diff --git a/testfiles/table-018.tex b/testfiles/table-018.tex new file mode 100644 index 0000000..7c4efcf --- /dev/null +++ b/testfiles/table-018.tex @@ -0,0 +1,33 @@ +\documentclass{article} +\input{regression-test} +\setlength{\parindent}{0pt} + +\begin{document} +\START +\BEGINTEST{Test merged cells in non-X columns} +\begin{tblr}{ + colspec = {lllXX}, + hlines, + vlines, +} + 1-1 & 1-2 & 1-3 & very very long text in the X column & sooooooooooooo very much long it will not stop and continue \\ + 2-1 & 2-2 & 2-3 & 2-4 & 2-5 \\ +\end{tblr} +\begin{tblr}{ + colspec = {lllXX}, + hlines, + vlines, +} + 1-1 & \SetCell[c=2]{c} merged & 1-3 & very very long text in the X column & sooooooooooooo very much long it will not stop and continue \\ + 2-1 & 2-2 & 2-3 & 2-4 & 2-5 \\ +\end{tblr} +\begin{tblr}{ + colspec = {llrXX}, + hlines, + vlines, +} + 1-1 & 1-2 & \SetCell[c=2]{c} merged & very very long text in the X column & sooooooooooooo very much long it will not stop and continue \\ + 2-1 & 2-2 & 2-3 & 2-4 & 2-5 \\ +\end{tblr} +\ENDTEST +\end{document} \ No newline at end of file diff --git a/testfiles/table-018.tlg b/testfiles/table-018.tlg new file mode 100644 index 0000000..a11b4c1 --- /dev/null +++ b/testfiles/table-018.tlg @@ -0,0 +1,8 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +============================================================ +TEST 1: Test merged cells in non-X columns +============================================================ +============================================================ +[1 +] (table-018.aux)