texlive[69906] Master/texmf-dist: tabularray (16feb24)

commits+karl at tug.org commits+karl at tug.org
Fri Feb 16 22:04:00 CET 2024


Revision: 69906
          https://tug.org/svn/texlive?view=revision&revision=69906
Author:   karl
Date:     2024-02-16 22:04:00 +0100 (Fri, 16 Feb 2024)
Log Message:
-----------
tabularray (16feb24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/tabularray/README.txt
    trunk/Master/texmf-dist/doc/latex/tabularray/tabularray.pdf
    trunk/Master/texmf-dist/doc/latex/tabularray/tabularray.tex
    trunk/Master/texmf-dist/tex/latex/tabularray/tabularray-2021.sty
    trunk/Master/texmf-dist/tex/latex/tabularray/tabularray.sty

Modified: trunk/Master/texmf-dist/doc/latex/tabularray/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tabularray/README.txt	2024-02-16 21:03:43 UTC (rev 69905)
+++ trunk/Master/texmf-dist/doc/latex/tabularray/README.txt	2024-02-16 21:04:00 UTC (rev 69906)
@@ -1,5 +1,5 @@
 Package: Typeset tabulars and arrays with LaTeX3
-Copyright: 2021-2023 (c) Jianrui Lyu <tolvjr at 163.com>
+Copyright: 2021-2024 (c) Jianrui Lyu <tolvjr at 163.com>
 CTAN: https://ctan.org/pkg/tabularray
 Repository: https://github.com/lvjr/tabularray
 Repository: https://bitbucket.org/lvjr/tabularray

Modified: trunk/Master/texmf-dist/doc/latex/tabularray/tabularray.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tabularray/tabularray.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tabularray/tabularray.tex	2024-02-16 21:03:43 UTC (rev 69905)
+++ trunk/Master/texmf-dist/doc/latex/tabularray/tabularray.tex	2024-02-16 21:04:00 UTC (rev 69906)
@@ -1,7 +1,7 @@
 % -*- coding: utf-8 -*-
 % !TEX program = lualatex
 \documentclass[oneside]{book}
-\newcommand*{\myversion}{2023A}
+\newcommand*{\myversion}{2024A}
 \newcommand*{\mylpad}[1]{\ifnum#1<10 0\the#1\else\the#1\fi}
 
 \usepackage[a4paper,margin=2.5cm]{geometry}
@@ -1570,6 +1570,7 @@
   \K{long} & change the table to a long table & \None \\
   \K{tall} & change the table to a tall table & \None \\
   \K{expand} & you need this key to use verb commands & \None \\
+  \K{expand+} & like \K{expand} but appends to previous values & \None \\
 \end{spectblr}
 
 \subsection{Set Baseline in Another Way}
@@ -1607,19 +1608,27 @@
 need to see every \verb!&! and \verb!\\! when splitting the table body with \verb!l3regex!.
 And you can not put cell text inside any table command defined with \verb!\NewTableCommand!.
 But you could use outer key \verb!expand! to make \verb!tabularray! expand
-every occurrence of a specified macro \underline{once} before splitting the table body.
+every occurrence of any of the specified macros \underline{once} and \underline{in the given oder} before splitting the table body.
 Note that you \underline{can not} expand a command defined with \verb!\NewDocumentCommand!.
+You can also use \verb!expand+! if you still want to keep the macros in the current \verb!expand! setting.
 
 To expand a command without optional argument, you can define it with \verb!\newcommand!.
 
 \begin{demohigh}
-\newcommand*\tblrbody{
- \hline
+\newcommand*\tblrrowa{
   20 & 30 & 40 \\
+}
+\newcommand*\tblrrowb{
   50 & 60 & 70 \\
+}
+\newcommand*\tblrbody{
  \hline
+  \tblrrowa
+  \tblrrowb
+ \hline
 }
-\begin{tblr}[expand=\tblrbody]{ccc}
+\SetTblrOuter{expand=\tblrbody\tblrrowa}
+\begin{tblr}[expand+=\tblrrowb]{ccc}
  \hline
   AA & BB & CC \\
   \tblrbody
@@ -2865,6 +2874,16 @@
 \end{tblr}
 \end{demohigh}
 
+\section{Library \texttt{hook}}
+
+This library is experimental, please see\\
+\url{https://github.com/lvjr/tabularray/wiki/HooksAndVariables}.
+
+\section{Library \texttt{html}}
+
+This library is experimental, please see\\
+\url{https://github.com/lvjr/tabularray/wiki/HooksAndVariables}.
+
 \section{Library \texttt{nameref}}
 
 From version 2022D, you can load \verb!nameref! library

Modified: trunk/Master/texmf-dist/tex/latex/tabularray/tabularray-2021.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tabularray/tabularray-2021.sty	2024-02-16 21:03:43 UTC (rev 69905)
+++ trunk/Master/texmf-dist/tex/latex/tabularray/tabularray-2021.sty	2024-02-16 21:04:00 UTC (rev 69906)
@@ -12,7 +12,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 \RequirePackage{expl3}
-\ProvidesExplPackage{tabularray}{2021-12-01}{2021Q}
+\ProvidesExplPackage{tabularray}{2024-02-16}{2021R}
   {Typeset tabulars and arrays with LaTeX3}
 
 \RequirePackage{xparse}
@@ -1011,6 +1011,9 @@
 \dim_zero_new:N \rulewidth
 \dim_set:Nn \rulewidth {0.4pt}
 
+\prop_new:N \g__tblr_defined_hdash_styles_prop
+\prop_new:N \g__tblr_defined_vdash_styles_prop
+
 \prop_gset_from_keyval:Nn \g__tblr_defined_hdash_styles_prop
   { solid = \hrule height \rulewidth }
 \prop_gset_from_keyval:Nn \g__tblr_defined_vdash_styles_prop
@@ -2830,6 +2833,13 @@
 %%  \section{Initialize Table Inner Specifications}
 %%% --------------------------------------------------------
 
+\prop_new:N \g__tblr_initial_table_prop
+\prop_new:N \g__tblr_initial_rows_prop
+\prop_new:N \g__tblr_initial_columns_prop
+\prop_new:N \g__tblr_initial_cells_prop
+\prop_new:N \g__tblr_initial_hlines_prop
+\prop_new:N \g__tblr_initial_vlines_prop
+
 \prop_gset_from_keyval:Nn \g__tblr_initial_table_prop
   {
     stretch = 1,

Modified: trunk/Master/texmf-dist/tex/latex/tabularray/tabularray.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tabularray/tabularray.sty	2024-02-16 21:03:43 UTC (rev 69905)
+++ trunk/Master/texmf-dist/tex/latex/tabularray/tabularray.sty	2024-02-16 21:04:00 UTC (rev 69906)
@@ -18,7 +18,7 @@
 \DeclareCurrentRelease{}{2022-01-01}
 
 \RequirePackage{expl3}
-\ProvidesExplPackage{tabularray}{2023-03-01}{2023A}
+\ProvidesExplPackage{tabularray}{2024-02-16}{2024A}
   {Typeset tabulars and arrays with LaTeX3}
 
 %% \IfFormatAtLeastTF, xparse and lthooks are added in LaTeX 2020-10-01
@@ -167,6 +167,24 @@
 \dim_new:N \leftsep
 \dim_new:N \rightsep
 
+%% Some functions for lwarp to remove rules and boxes
+\cs_new:Npn \tblr_hrule_ht:n #1
+  {
+    \hrule height ~ #1 \scan_stop:
+  }
+\cs_new:Npn \tblr_vrule_wd_ht_dp:nnn #1 #2 #3
+  {
+    \vrule width ~ #1 ~ height ~ #2 ~ depth ~ #3 \scan_stop:
+  }
+\cs_new_protected:Npn \tblr_box_use:N #1
+  {
+    \box_use:N #1
+  }
+\cs_new_protected:Npn \tblr_vbox_set:Nn #1 #2
+  {
+    \vbox_set:Nn #1 {#2}
+  }
+
 %%% --------------------------------------------------------
 %%> \section{Data Structures Based on Property Lists}
 %%% --------------------------------------------------------
@@ -1086,6 +1104,9 @@
 \dim_zero_new:N \rulewidth
 \dim_set:Nn \rulewidth {0.4pt}
 
+\prop_new:N \g__tblr_defined_hdash_styles_prop
+\prop_new:N \g__tblr_defined_vdash_styles_prop
+
 \prop_gset_from_keyval:Nn \g__tblr_defined_hdash_styles_prop
   { solid = \hrule height \rulewidth }
 \prop_gset_from_keyval:Nn \g__tblr_defined_vdash_styles_prop
@@ -2662,6 +2683,7 @@
 \cs_new_protected:Npn \__tblr_builder:nnn #1 #2 #3
   {
     \int_gincr:N \g_tblr_level_int
+    \__tblr_hook_use:n { tabularray/trial/before }
     \bool_set_true:N \lTblrMeasuringBool
     \__tblr_clear_prop_lists:
     \__tblr_clear_spec_lists:
@@ -2689,6 +2711,7 @@
     \__tblr_enable_content_commands:
     \__tblr_calc_cell_and_line_sizes:
     \bool_set_false:N \lTblrMeasuringBool
+    \__tblr_hook_use:n { tabularray/trial/after }
     \LogTblrTracing { step = build ~ the ~ whole ~ table}
     \__tblr_build_whole:
     \int_gdecr:N \g_tblr_level_int
@@ -2751,11 +2774,9 @@
   {
     \__tblr_hook_split_before:
     \tl_set:Nx \l__tblr_expand_tl { \__tblr_spec_item:nn { outer } { expand } }
-    \tl_set:Nx \l__tblr_expand_tl { \tl_head:N \l__tblr_expand_tl }
-    \tl_if_empty:NF \l__tblr_expand_tl
+    \tl_map_inline:Nn \l__tblr_expand_tl
       {
-        \exp_last_unbraced:NNV
-        \__tblr_expand_table_body:NN \l__tblr_body_tl \l__tblr_expand_tl
+        \__tblr_expand_table_body:NN \l__tblr_body_tl ##1
       }
   }
 
@@ -2953,6 +2974,13 @@
 %%> \section{Initialize Table Inner Specifications}
 %%% --------------------------------------------------------
 
+\prop_new:N \g__tblr_initial_table_prop
+\prop_new:N \g__tblr_initial_rows_prop
+\prop_new:N \g__tblr_initial_columns_prop
+\prop_new:N \g__tblr_initial_cells_prop
+\prop_new:N \g__tblr_initial_hlines_prop
+\prop_new:N \g__tblr_initial_vlines_prop
+
 \prop_gset_from_keyval:Nn \g__tblr_initial_table_prop
   {
     stretch = 1,
@@ -3193,6 +3221,7 @@
     B       .meta:n = { baseline = B },
     valign  .meta:n = { baseline = #1 }, % obsolete, will be removed some day
     expand  .code:n = \__tblr_outer_gput_spec:nn { expand } {#1},
+    expand+ .code:n = \__tblr_outer_gconcat_spec:nn { expand } {#1},
     headsep .code:n = \__tblr_outer_gput_spec:nn { headsep } {#1},
     footsep .code:n = \__tblr_outer_gput_spec:nn { footsep } {#1},
     presep  .code:n = \__tblr_outer_gput_spec:nn { presep }  {#1},
@@ -3210,6 +3239,11 @@
   }
 \cs_generate_variant:Nn \__tblr_outer_gput_spec:nn { ne }
 
+\cs_new_protected:Npn \__tblr_outer_gconcat_spec:nn #1 #2
+  {
+    \__tblr_outer_gput_spec:ne {#1} { \__tblr_spec_item:nn { outer } { #1 } \exp_not:n { #2 } }
+  }
+
 \regex_const:Nn \c__tblr_option_key_name_regex { ^ [A-Za-z\-] + $ }
 
 \msg_new:nnn { tabularray } { unknown-outer-key }
@@ -5505,6 +5539,7 @@
 
 \cs_new_protected:Npn \__tblr_build_whole:
   {
+    \__tblr_hook_use:n { tabularray/table/before }
     \tl_if_eq:enTF { \__tblr_spec_item:nn { outer } { long } } { true }
       { \__tblr_build_long_table:e { \__tblr_spec_item:nn { outer } { halign } } }
       {
@@ -5518,6 +5553,7 @@
               { \__tblr_spec_item:nn { outer } { baseline } }
           }
       }
+    \__tblr_hook_use:n { tabularray/table/after }
   }
 
 \dim_new:N \l__tblr_remain_height_dim
@@ -5573,8 +5609,19 @@
                 % \pagetotal maybe exceed \pagegoal after adding presep,
                 % or after adding rowhead or rowfoot of the table.
                 % In these cases, we will not typeset table in this page,
-                % but rather do some negative \vskip and execute \newpage.
-                \skip_vertical:n { \pagegoal - \pagetotal }
+                % but rather force a page break.
+                \group_begin:
+                  \dim_set:Nn \l_tmpb_dim
+                    {
+                      % Enough to overfill the page (including shrink).
+                      \pagegoal - \pagetotal + \l_tmpa_dim
+                      + \__tblr_box_height:N \l__tblr_table_firsthead_box
+                      + \__tblr_box_height:N \l__tblr_table_firstfoot_box
+                    }
+                  \skip_vertical:n { \l_tmpb_dim }
+                  \tex_penalty:D 9999
+                  \skip_vertical:n { -\l_tmpb_dim }
+                \group_end:
               }
               {
                 \__tblr_build_page_table:nnx {#1}
@@ -5582,8 +5629,8 @@
                   { \int_use:N \l__tblr_prev_i_int }
                 \int_incr:N \l__tblr_table_page_int
                 \int_set:Nn \l__tblr_long_from_int { \l__tblr_prev_i_int + 1 }
+                \TblrNewPage
               }
-            \TblrNewPage
             \hbox{}\kern-\topskip\nobreak
             \noindent
             \LogTblrTracing { page }
@@ -5796,7 +5843,7 @@
 \cs_new_protected:Npn \__tblr_build_one_table:nnNN #1 #2 #3 #4
   {
     \box_clear:N \l__tblr_table_hlines_box
-    \vbox_set:Nn \l__tblr_table_box
+    \tblr_vbox_set:Nn \l__tblr_table_box
       {
         \int_step_variable:nnNn {#1} {#2} \l__tblr_i_tl
           {
@@ -5804,9 +5851,9 @@
               { \int_compare_p:nNn { \l__tblr_i_tl } > {#1} }
               { \bool_if_p:N #3 }
               { \__tblr_put_one_hline:n { \__tblr_build_hline:V \l__tblr_i_tl } }
-            \hrule height ~ 0pt % remove lineskip between hlines and rows
+            \tblr_hrule_ht:n { 0pt } % remove lineskip between hlines and rows
             \__tblr_put_one_row:n { \__tblr_build_row:N \l__tblr_i_tl }
-            \hrule height ~ 0pt
+            \tblr_hrule_ht:n { 0pt }
           }
         \bool_if:NT #4
           {
@@ -5818,7 +5865,7 @@
             - \box_ht:N \l__tblr_table_hlines_box
             - \box_dp:N \l__tblr_table_hlines_box
           }
-        \box_use:N \l__tblr_table_hlines_box
+        \tblr_box_use:N \l__tblr_table_hlines_box
       }
   }
 
@@ -6253,11 +6300,11 @@
     \__tblr_get_row_inner_height_depth:VNNNN #1
       \l__tblr_row_ht_dim \l__tblr_row_dp_dim
       \l__tblr_row_abovesep_dim \l__tblr_row_belowsep_dim
-    \vrule width ~ 0pt ~ height ~ \l__tblr_row_ht_dim ~ depth ~ \l__tblr_row_dp_dim
+    \__tblr_hook_use:n { tabularray/row/before }
+    \tblr_vrule_wd_ht_dp:nnn {0pt} {\l__tblr_row_ht_dim} {\l__tblr_row_dp_dim}
     \hbox_set:Nn \l__tblr_row_vlines_box
       {
-        \vrule width ~ 0pt ~ height ~ \l__tblr_row_ht_dim
-                           ~ depth ~ \l__tblr_row_dp_dim
+        \tblr_vrule_wd_ht_dp:nnn {0pt} {\l__tblr_row_ht_dim} {\l__tblr_row_dp_dim}
       }
     \int_step_variable:nNn { \c at colcount } \l__tblr_j_tl
       {
@@ -6269,6 +6316,7 @@
       { \__tblr_build_vline_segment:nn {#1} { \int_eval:n {\c at colcount + 1} } }
     \skip_horizontal:n { - \box_wd:N \l__tblr_row_vlines_box }
     \box_use:N \l__tblr_row_vlines_box
+    \__tblr_hook_use:n { tabularray/row/after }
   }
 
 %% Read from table specifications and calculate inner height/depth of the row
@@ -6442,8 +6490,12 @@
       }
   }
 
-\tl_new:N \l__tblr_cell_rowspan_tl
-\tl_new:N \l__tblr_cell_colspan_tl
+%% These public variables are updated by default before building a cell
+\tl_new:N \lTblrCellRowSpanTl
+\tl_new:N \lTblrCellColSpanTl
+\tl_new:N \lTblrCellBackgroundTl
+\bool_new:N \lTblrCellOmittedBool
+
 \dim_new:N \l__tblr_cell_wd_dim
 \dim_new:N \l__tblr_cell_ht_dim
 
@@ -6460,17 +6512,17 @@
       { \__tblr_data_item:nen { column } {#2} { leftsep} }
     \tl_set:Nx \l__tblr_y_tl
       { \__tblr_data_item:nen { column } {#2} { rightsep } }
-    \tl_set:Nx \l__tblr_cell_colspan_tl
+    \tl_set:Nx \lTblrCellColSpanTl
       { \__tblr_data_item:neen { cell } {#1} {#2} { colspan } }
-    \int_compare:nNnTF { \l__tblr_cell_colspan_tl } < {2}
+    \int_compare:nNnTF { \lTblrCellColSpanTl } < {2}
       { \dim_set:Nn \l__tblr_cell_wd_dim { \l__tblr_w_tl } }
       {
         \__tblr_get_span_horizontal_sizes:NNNNN #1 #2
           \l__tblr_o_dim \l__tblr_cell_wd_dim \l__tblr_q_dim
       }
-    \tl_set:Nx \l__tblr_cell_rowspan_tl
+    \tl_set:Nx \lTblrCellRowSpanTl
       { \__tblr_data_item:neen { cell } {#1} {#2} { rowspan } }
-    \int_compare:nNnTF { \l__tblr_cell_rowspan_tl } < {2}
+    \int_compare:nNnTF { \lTblrCellRowSpanTl } < {2}
       { \dim_set:Nn \l__tblr_cell_ht_dim { \l__tblr_h_tl } }
       {
         \__tblr_get_span_vertical_sizes:NNNNN #1 #2
@@ -6482,8 +6534,73 @@
     \group_end:
   }
 
+%% These public variables are updated by html library before building a cell
+\tl_new:N \lTblrCellAboveBorderStyleTl
+\tl_new:N \lTblrCellAboveBorderWidthTl
+\tl_new:N \lTblrCellAboveBorderColorTl
+\tl_new:N \lTblrCellBelowBorderStyleTl
+\tl_new:N \lTblrCellBelowBorderWidthTl
+\tl_new:N \lTblrCellBelowBorderColorTl
+\tl_new:N \lTblrCellLeftBorderStyleTl
+\tl_new:N \lTblrCellLeftBorderWidthTl
+\tl_new:N \lTblrCellLeftBorderColorTl
+\tl_new:N \lTblrCellRightBorderStyleTl
+\tl_new:N \lTblrCellRightBorderWidthTl
+\tl_new:N \lTblrCellRihgtBorderColorTl
+
+%% #1: row number in tl; #2: column number in tl
+%% This function is called only when html library is loaded.
+%% The properties can be used by tagpdf, tex4ht and lwarp packages
+\cs_new_protected:Npn \__tblr_expose_cell_properties:NN #1 #2
+  {
+    \__tblr_expose_cell_border:NNnn #1 #2 { hline } { Above }
+    \tl_set:Nx \l_tmpa_tl { \int_eval:n { #1 + \lTblrCellRowSpanTl } }
+    \__tblr_expose_cell_border:NNnn \l_tmpa_tl #2 { hline } { Below }
+    \__tblr_expose_cell_border:NNnn #1 #2 { vline } { Left }
+    \tl_set:Nx \l_tmpb_tl { \int_eval:n { #2 + \lTblrCellColSpanTl } }
+    \__tblr_expose_cell_border:NNnn #1 \l_tmpb_tl { vline } { Right }
+  }
+
+\tl_new:N \l__tblr_dash_value_tl
+\tl_new:N \l__tblr_dash_value_head_tl
+\tl_new:N \l__tblr_dash_value_tail_tl
+\tl_new:N \l__tblr_width_value_tl
+\tl_new:N \l__tblr_color_value_tl
+
+%% #1: row number in tl; #2: column number in tl;
+%% #3: hline or vline; #4: position of border (Above/Below/Left/Right).
+\cs_new_protected:Npn \__tblr_expose_cell_border:NNnn #1 #2 #3 #4
+  {
+    %% get border style
+    \tl_set:Nx \l__tblr_dash_value_tl %% may be empty
+      { \__tblr_spec_item:ne { #3 } { [#1][#2](1) / @dash } }
+    \tl_set:Nx \l__tblr_dash_value_head_tl { \tl_head:N \l__tblr_dash_value_tl }
+    \tl_set:Nx \l__tblr_dash_value_tail_tl { \tl_tail:N \l__tblr_dash_value_tl }
+    \exp_args:NV \tl_if_eq:NNTF \l__tblr_dash_value_head_tl \@tblr at dash
+      {
+        \tl_set_eq:cN { lTblrCell #4 BorderStyleTl } \l__tblr_dash_value_tail_tl
+        %% get border width
+        \tl_set:Nx \l__tblr_width_value_tl
+          { \__tblr_spec_item:ne { #3 } { [#1][#2](1) / wd } }
+        \tl_if_empty:NTF \l__tblr_width_value_tl
+          { \tl_set:cn { lTblrCell #4 BorderWidthTl } { 0.4pt } }
+          { \tl_set_eq:cN { lTblrCell #4 BorderWidthTl } \l__tblr_width_value_tl }
+        %% get border color
+        \tl_set:cx { lTblrCell #4 BorderColorTl }
+          { \__tblr_spec_item:ne { #3 } { [#1][#2](1) / fg } }
+      }
+      {
+        \tl_clear:c { lTblrCell #4 BorderStyleTl }
+        \tl_set:cn { lTblrCell #4 BorderWidthTl } { 0pt }
+        \tl_clear:c { lTblrCell #4 BorderColorTl }
+      }
+  }
+
 \cs_new_protected:Npn \__tblr_build_cell_content:NN #1 #2
   {
+    \bool_if:NT \l__tblr_html_variables_bool
+      { \__tblr_expose_cell_properties:NN #1 #2 }
+    \__tblr_hook_use:n { tabularray/cell/before }
     \hbox_set_to_wd:Nnn \l__tblr_a_box { \l__tblr_cell_wd_dim }
       {
         \tl_if_eq:NnTF \g__tblr_cell_halign_tl {j}
@@ -6502,7 +6619,7 @@
             \c__tblr_valign_m_tl
               {
                 \vfil
-                \int_compare:nNnT { \l__tblr_cell_rowspan_tl } < {2}
+                \int_compare:nNnT { \lTblrCellRowSpanTl } < {2}
                   {
                     \box_set_ht:Nn \l__tblr_a_box
                       { \__tblr_data_item:nen { row } {#1} { @row-upper } }
@@ -6522,7 +6639,7 @@
             \c__tblr_valign_f_tl
               {
                 \vfil
-                \int_compare:nNnTF { \l__tblr_cell_rowspan_tl } < {2}
+                \int_compare:nNnTF { \lTblrCellRowSpanTl } < {2}
                   {
                     \box_set_dp:Nn \l__tblr_a_box
                       { \__tblr_data_item:nen { row } {#1} { @row-foot } }
@@ -6532,7 +6649,7 @@
                       {
                         \__tblr_data_item:nen
                           { row }
-                          { \int_eval:n { #1 + \l__tblr_cell_rowspan_tl - 1 } }
+                          { \int_eval:n { #1 + \lTblrCellRowSpanTl - 1 } }
                           { @row-foot }
                       }
                   }
@@ -6550,16 +6667,22 @@
     \skip_horizontal:n { \l__tblr_x_tl }
     \box_use:N \l__tblr_c_box
     \skip_horizontal:n { \l__tblr_y_tl - \l__tblr_cell_wd_dim + \l__tblr_w_tl }
+    \__tblr_hook_use:n { tabularray/cell/after }
   }
 
 \cs_new_protected:Npn \__tblr_build_cell_background:NN #1 #2
   {
-    \int_compare:nNnT { \__tblr_data_item:neen { cell } {#1} {#2} { omit } } = {0}
+    \bool_set:Nn \lTblrCellOmittedBool
       {
+        \int_compare_p:nNn
+          { \__tblr_data_item:neen { cell } {#1} {#2} { omit } } = {1}
+      }
+    \bool_if:NF \lTblrCellOmittedBool
+      {
+        \tl_set:Nx \lTblrCellBackgroundTl
+          { \__tblr_data_item:neen { cell } {#1} {#2} { background } }
         \group_begin:
-        \tl_set:Nx \l__tblr_b_tl
-          { \__tblr_data_item:neen { cell } {#1} {#2} { background } }
-        \tl_if_empty:NF \l__tblr_b_tl
+        \tl_if_empty:NF \lTblrCellBackgroundTl
           {
             \__tblr_get_cell_background_width:NNN #1 #2 \l_tmpa_dim
             \__tblr_get_cell_background_depth:NNN #1 #2 \l_tmpb_dim
@@ -6567,7 +6690,7 @@
               { \dim_use:N \l_tmpa_dim }
               { \l__tblr_row_ht_dim }
               { \dim_use:N \l_tmpb_dim }
-              { \l__tblr_b_tl }
+              { \lTblrCellBackgroundTl }
           }
         \group_end:
       }
@@ -6576,7 +6699,7 @@
 %% #1: row number; #2: column number; #3 resulting dimension
 \cs_new_protected:Npn \__tblr_get_cell_background_width:NNN #1 #2 #3
   {
-    \int_compare:nNnTF { \l__tblr_cell_colspan_tl } < {2}
+    \int_compare:nNnTF { \lTblrCellColSpanTl } < {2}
       { \dim_set:Nn #3 { \l__tblr_x_tl + \l__tblr_w_tl + \l__tblr_y_tl } }
       {
         \dim_set:Nn #3 { \l__tblr_o_dim + \l__tblr_cell_wd_dim + \l__tblr_q_dim }
@@ -6586,7 +6709,7 @@
 %% #1: row number; #2: column number; #3 resulting dimension
 \cs_new_protected:Npn \__tblr_get_cell_background_depth:NNN #1 #2 #3
   {
-    \int_compare:nNnTF { \l__tblr_cell_rowspan_tl } < {2}
+    \int_compare:nNnTF { \lTblrCellRowSpanTl } < {2}
       { \dim_set_eq:NN #3 \l__tblr_row_dp_dim }
       {
         \dim_set:Nn #3
@@ -6622,7 +6745,7 @@
     \dim_zero:N #4
     \dim_add:Nn #4
       { \prop_item:Ne \l__tblr_row_item_skip_size_prop { item[#1] } }
-    \int_step_inline:nnn { #1 + 1 } { #1 + \l__tblr_cell_rowspan_tl - 1 }
+    \int_step_inline:nnn { #1 + 1 } { #1 + \lTblrCellRowSpanTl - 1 }
       {
         \dim_add:Nn #4
           {
@@ -6634,7 +6757,7 @@
     \dim_set:Nn #5
       {
         \__tblr_data_item:nen { row }
-          { \int_eval:n { #1 + \l__tblr_cell_rowspan_tl - 1 } } { belowsep }
+          { \int_eval:n { #1 + \lTblrCellRowSpanTl - 1 } } { belowsep }
       }
     %\tl_log:x { cell[#1][#2] ~:~ \dim_use:N #3, \dim_use:N #4, \dim_use:N #5 }
   }
@@ -6651,7 +6774,7 @@
     \dim_zero:N #4
     \dim_add:Nn #4
       { \prop_item:Ne \l__tblr_col_item_skip_size_prop { item[#2] } }
-    \int_step_inline:nnn { #2 + 1 } { #2 + \l__tblr_cell_colspan_tl - 1 }
+    \int_step_inline:nnn { #2 + 1 } { #2 + \lTblrCellColSpanTl - 1 }
       {
         \dim_add:Nn #4
           {
@@ -6663,7 +6786,7 @@
     \dim_set:Nn #5
       {
         \__tblr_data_item:nen { column }
-          { \int_eval:n {#2 + \l__tblr_cell_colspan_tl - 1} } { rightsep }
+          { \int_eval:n {#2 + \lTblrCellColSpanTl - 1} } { rightsep }
       }
     %\tl_log:x { cell[#1][#2] ~:~ \dim_use:N #3, \dim_use:N #4, \dim_use:N #5 }
   }
@@ -6916,7 +7039,11 @@
 
 \NewDocumentCommand \UseTblrLibrary { m }
   {
-    \clist_map_inline:nn {#1} { \use:c { __tblr_use_lib_ ##1: } }
+    \clist_map_inline:nn {#1}
+      {
+        \use:c { __tblr_use_lib_ ##1: }
+        \cs_undefine:c { __tblr_use_lib_ ##1: }
+      }
   }
 
 %% Library amsmath and environments +array, +matrix, +cases, ...
@@ -7200,6 +7327,29 @@
       }
   }
 
+%% Library hook provides some public hooks
+
+\cs_new_protected:Npn \__tblr_hook_use:n #1 {}
+
+\NewTblrLibrary { hook }
+  {
+    \cs_set_eq:NN \__tblr_hook_use:n \hook_use:n
+    \hook_new_pair:nn { tabularray/trial/before } { tabularray/trial/after }
+    \hook_new_pair:nn { tabularray/table/before } { tabularray/table/after }
+    \hook_new_pair:nn { tabularray/row/before } { tabularray/row/after }
+    \hook_new_pair:nn { tabularray/cell/before } { tabularray/cell/after }
+  }
+
+%% Library html provides more public variables
+%% These variables can be used by tagpdf, tex4ht and lwarp packages
+
+\bool_new:N \l__tblr_html_variables_bool
+
+\NewTblrLibrary { html }
+  {
+    \bool_set_true:N \l__tblr_html_variables_bool
+  }
+
 %% Library nameref and its caption-ref template
 
 \NewTblrLibrary { nameref }



More information about the tex-live-commits mailing list.