Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
All notable changes to this package will be documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com).
# [v2026A] - 2026-05

## Added

- `bgcolor` key for background rules (#217, #287, #595)
- Warning messages for out-of-bound cell spans (#418, #419)
- Warning messages for extreme negative `rowsep` and `colsep` values (#428)
- `xcolor` package as dependency (#645)

## Changed

- Rename `fg` and `bg` keys to `fgcolor` and `bgcolor` respectively
- Extendable column algorithm (#210, #658)
- Internal state-tracking variables are now local (#401)
- `ninecolors` dependency when `xcolor` is loaded (#643)


## Fixed

- Handling for non-existent class styles (#636)
- Shrinking heuristics for rules and background cells (#428)
- `belowsep` and `rightsep` values before cell content evaluation (#387, #470)
- Gobble leading spaces inside braced cells (#590)
- Ensure `\topskip` cancellation only applies on explicitly generated new pages (#587)
- Limit the internal page overfill dimen to a minimum of 0pt (#587)
- Restore original linebreak definitions when `beamerarticle` is loaded (#632)
- Make `glossaries` interact with the `tabularray` measuring phase (#635)
- Refactor `longtable` to handle manual page breaks correctly (#164, #184)

# [v2025C] - 2025-11-27

Expand Down
70 changes: 50 additions & 20 deletions tabularray-dev.sty
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
\providecommand\DeclareCurrentRelease[2]{}
\DeclareRelease{v2024}{2022-01-01}{tabularray-2024.sty}
\DeclareRelease{v2021}{2021-01-01}{tabularray-2021.sty}
\DeclareCurrentRelease{}{2025-01-01}
\DeclareCurrentRelease{}{2026-01-01}

\ProvidesExplPackage{tabularray-dev}{2026-02-23}{2026A-DEV}
{Develoment and experimental variant of tabularray}
\ProvidesExplPackage{tabularray-dev}{2026-05-11}{2026A-DEV}
{Development and experimental variant of tabularray}

%% \IfFormatAtLeastTF, xparse and lthooks are added in LaTeX 2020-10-01
%% Note that \@ifl@t@r or \@ifpackagelater means 'this date or later'
Expand Down Expand Up @@ -55,20 +55,29 @@
}
\NewDocumentCommand \TblrParboxRestore { } { \@parboxrestore }

\cs_set_eq:NN \__tblr_cr: \@normalcr
\cs_set_eq:NN \__tblr_center_cr: \@centercr

\AddToHook {package/beamerarticle/after} [tabularray]
{
\cs_set_eq:NN \__tblr_cr: \beamer@origbreak
\cs_set_eq:NN \__tblr_center_cr: \beamer@origbreakcenter
}

\NewDocumentCommand \TblrAlignBoth { }
{
\let \\ = \@normalcr
\let \\ = \__tblr_cr:
\leftskip = \z@skip
\@rightskip = \z@skip
\rightskip = \@rightskip
\parfillskip = \@flushglue
}

\NewDocumentCommand \TblrAlignLeft { } { \raggedright }
\NewDocumentCommand \TblrAlignLeft { } { \raggedright \let \\ = \__tblr_center_cr: }

\NewDocumentCommand \TblrAlignCenter { } { \centering }
\NewDocumentCommand \TblrAlignCenter { } { \centering \let \\ = \__tblr_center_cr: }

\NewDocumentCommand \TblrAlignRight { } { \raggedleft }
\NewDocumentCommand \TblrAlignRight { } { \raggedleft \let \\ = \__tblr_center_cr: }

\cs_set_eq:NN \TblrNewPage \newpage

Expand Down Expand Up @@ -2632,16 +2641,16 @@
\tblr_set_cell:nn { #1 } { #2 }
}

\tl_new:N \l__tblr_row_span_num_tl
\tl_new:N \l__tblr_col_span_num_tl
\int_new:N \l__tblr_row_span_num_int
\int_new:N \l__tblr_col_span_num_int

\cs_new_protected:Npn \tblr_set_cell:nn #1 #2
{
\tl_set:Nn \l__tblr_row_span_num_tl { 1 }
\tl_set:Nn \l__tblr_col_span_num_tl { 1 }
\int_set:Nn \l__tblr_row_span_num_int { 1 }
\int_set:Nn \l__tblr_col_span_num_int { 1 }
\__tblr_keys_set:nn { cell/outer } { #1 }
\__tblr_keys_set:nn { cell/inner } { #2 }
\__tblr_set_span_spec:VV \l__tblr_row_span_num_tl \l__tblr_col_span_num_tl
\__tblr_set_span_spec:NN \l__tblr_row_span_num_int \l__tblr_col_span_num_int
}
\cs_generate_variant:Nn \tblr_set_cell:nn { nV }

Expand Down Expand Up @@ -2698,8 +2707,8 @@

\__tblr_keys_define:nn { cell/outer }
{
r .tl_set:N = \l__tblr_row_span_num_tl,
c .tl_set:N = \l__tblr_col_span_num_tl,
r .int_set:N = \l__tblr_row_span_num_int,
c .int_set:N = \l__tblr_col_span_num_int,
}

\__tblr_keys_define:nn { cell/inner }
Expand Down Expand Up @@ -2791,22 +2800,40 @@
}
\cs_generate_variant:Nn \__tblr_cell_unknown_key:n { V }

\msg_new:nnn { tabularray } { crop-rowspan }
{ Row ~ span ~ of ~ cell ~ [#1][#2] ~ is ~ too ~ large ~ and ~ cropped ~ to ~ #3. }

\msg_new:nnn { tabularray } { crop-colspan }
{ Column ~ span ~ of ~ cell ~ [#1][#2] ~ is ~ too ~ large ~ and ~ cropped ~ to ~ #3. }

%% Whether to allow page breaks in the middle of multirow cells
\bool_new:N \lTblrCellBreakBool

\cs_new_protected:Npn \__tblr_set_span_spec:nn #1 #2
\cs_new_protected:Npn \__tblr_set_span_spec:NN #1 #2
{
\int_compare:nNnT { \c@rownum + #1 - 1 } > { \c@rowcount }
{
\int_set:Nn #1 { \int_max:nn { 1 } { \c@rowcount - \c@rownum + 1 } }
\msg_warning:nneee { tabularray } { crop-rowspan }
{ \int_use:N \c@rownum } { \int_use:N \c@colnum } { \int_use:N #1 }
}
\int_compare:nNnT { \c@colnum + #2 - 1 } > { \c@colcount }
{
\int_set:Nn #2 { \int_max:nn { 1 } { \c@colcount - \c@colnum + 1 } }
\msg_warning:nneee { tabularray } { crop-colspan }
{ \int_use:N \c@rownum } { \int_use:N \c@colnum } { \int_use:N #2 }
}
\int_compare:nNnT { #1 } > { 1 }
{
\__tblr_prop_gput:nnn { inner } { rowspan } { true }
\__tblr_data_gput:neenn { cell }
{ \int_use:N \c@rownum } { \int_use:N \c@colnum } { rowspan } {#1}
\__tblr_data_gput:neene { cell }
{ \int_use:N \c@rownum } { \int_use:N \c@colnum } { rowspan } { \int_use:N #1 }
}
\int_compare:nNnT { #2 } > { 1 }
{
\__tblr_prop_gput:nnn { inner } { colspan } { true }
\__tblr_data_gput:neenn { cell }
{ \int_use:N \c@rownum } { \int_use:N \c@colnum } { colspan } {#2}
\__tblr_data_gput:neene { cell }
{ \int_use:N \c@rownum } { \int_use:N \c@colnum } { colspan } { \int_use:N #2 }
}
\int_step_variable:nnNn
{ \int_use:N \c@rownum } { \int_eval:n { \c@rownum + #1 - 1 } } \l__tblr_i_tl
Expand Down Expand Up @@ -2858,7 +2885,6 @@
{ [\l__tblr_i_tl][\int_eval:n {\c@colnum + #2}](1) / belowpos } {1}
}
}
\cs_generate_variant:Nn \__tblr_set_span_spec:nn { VV }

%% Obsolete \multicolumn and \multirow commands

Expand Down Expand Up @@ -4738,6 +4764,10 @@
\cs_new_protected:Npn \__tblr_get_cell_text_real:nn #1 #2
{
\group_begin:
\bool_if:NT \lTblrMeasuringBool
{
\cs_if_exist:NT \glsifmeasuring { \cs_gset_eq:NN \glsifmeasuring \@firstoftwo }
}
\dim_set:Nn \belowsep
{
\__tblr_data_item:nen { row }
Expand Down
1 change: 1 addition & 0 deletions testfiles/rowcol-007.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
96c80abaddba2db82b0cda98ebe7b4c2
Binary file added testfiles/rowcol-007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions testfiles/rowcol-007.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
\documentclass{article}
\input{regression-test}

\begin{document}
\START

\BEGINTEST{Warning for out-of-bound span}
\begin{tblr}{
cell{2}{2}={c=2,r=2}{}
}
1 & 2 \\
3 & 4 \\
\end{tblr}
\ENDTEST
\end{document}
10 changes: 10 additions & 0 deletions testfiles/rowcol-007.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
============================================================
TEST 1: Warning for out-of-bound span
============================================================
Package tabularray Warning: Row span of cell [2][2] is too large and cropped to 1.
Package tabularray Warning: Column span of cell [2][2] is too large and cropped to 1.
============================================================
[1
] (rowcol-007.aux)
Loading