texlive[64891] Master/texmf-dist: tabularray (1nov22)

commits+karl at tug.org commits+karl at tug.org
Tue Nov 1 20:52:36 CET 2022


Revision: 64891
          http://tug.org/svn/texlive?view=revision&revision=64891
Author:   karl
Date:     2022-11-01 20:52:35 +0100 (Tue, 01 Nov 2022)
Log Message:
-----------
tabularray (1nov22)

Modified Paths:
--------------
    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.sty

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	2022-11-01 19:52:20 UTC (rev 64890)
+++ trunk/Master/texmf-dist/doc/latex/tabularray/tabularray.tex	2022-11-01 19:52:35 UTC (rev 64891)
@@ -1,7 +1,7 @@
 % -*- coding: utf-8 -*-
 % !TEX program = lualatex
 \documentclass[oneside]{book}
-\newcommand*{\myversion}{2022C}
+\newcommand*{\myversion}{2022D}
 \newcommand*{\mylpad}[1]{\ifnum#1<10 0\the#1\else\the#1\fi}
 
 \usepackage[a4paper,margin=2.5cm]{geometry}
@@ -1362,7 +1362,7 @@
 of \verb!tblr! environment, most of which are used for long tables (see Chapter \ref{chap:long}).
 
 You can use \verb!\SetTblrInner! and \verb!\SetTblrOuter! commands
-to set default inner and outer specifications of tables, respectively.
+to set default inner and outer specifications of tables, respectively (see Section \ref{sec:default}).
 
 \section{Inner Specifications}
 
@@ -1414,6 +1414,16 @@
 \end{tblr}
 \end{demohigh}
 
+By replacing stretch with row heights, we can get perfect vertical centering for your numerical tables.
+
+\begin{demohigh}
+\begin{tblr}{hlines, stretch=0, rows={ht=\baselineskip}}
+  2021 & 2022 & 2023 \\
+  0.4  & 0.5  & 0.6  \\
+  1.1  & 2.2  & 3.3  \\
+\end{tblr}
+\end{demohigh}
+
 \subsection{Rowseps and Colseps for All}
 
 The following example uses \verb!rowsep! and \verb!colsep! keys to set padding for all rows and columns.
@@ -1615,18 +1625,32 @@
 \end{demohigh}
 
 \section{Default Specifications}
+\label{sec:default}
 
 \verb!Tabularray! package provides \verb!\SetTblrInner! and \verb!\SetTblrOuter! commands
 for you to change the default inner and outer specifications of tables.
 
-In the below example, the first line draws all hlines and vlines for all tables created afterwards,
-while the second line makes all tables created afterwards vertically align at the last row.
+In general different \verb!tabularray! environments (\verb!tblr!, \verb!talltblr!,
+\verb!longtblr!, etc) could have different default specifications.
+You can list the environments in the optional arguments of these two commands,
+and they only apply to \verb!tblr! environment when the optional arguments are omitted.
 
+In the following example, the first line draws all hlines and vlines for all \verb!tblr! tables
+created afterwards, while the second line makes all \verb!tblr! tables created afterwards
+vertically align at the last row.
+
 \begin{codehigh}
 \SetTblrInner{hlines,vlines}
 \SetTblrOuter{baseline=B}
 \end{codehigh}
 
+And the following example sets zero \verb!rowsep! for all \verb!tblr! and \verb!longtblr! tables
+created afterwards.
+
+\begin{codehigh}
+\SetTblrInner[tblr,longtblr]{rowsep=0pt}
+\end{codehigh}
+
 \section{New Tabularray Environments}
 
 You can define new \verb!tabularray! environments using \verb!\NewTblrEnviron! command:
@@ -1642,10 +1666,6 @@
 \end{mytblr} Text
 \end{demohigh}
 
-If not giving the optional argument to \verb!\SetTblrInner! or \verb!\SetTblrOuter! command,
-we set the default specifications for \verb!tblr! environment.
-And different tabularray environments could have different default specifications.
-
 \section{New General Environments}
 
 With \verb!+b! argument type of \verb!\NewDocumentEnvironment! command,
@@ -2141,7 +2161,10 @@
 
 \subsection{Continuation Templates}
 
-Let us have a look at the code for defining templates of continuation text first:
+Let us have a look at the code for defining templates of continuation text first:%
+\footnote{To tell the truth, the default \texttt{conthead-text} and \texttt{contfoot-text}
+are actually stored in commands \texttt{\string\tblrcontheadname} and \texttt{\string\tblrcontfootname}
+respectively. And you may contribute your translations of them to \textbf{babel} package.}
 
 \begin{codehigh}
 \DefTblrTemplate{contfoot-text}{normal}{Continued on next page}
@@ -2817,6 +2840,11 @@
 \end{tblr}
 \end{demohigh}
 
+\section{Library \texttt{nameref}}
+
+From version 2022D, you can load \verb!nameref! library
+to make \verb!\nameref! and \verb!longtblr! work together.
+
 \section{Library \texttt{siunitx}}
 
 When writing \verb!\UseTblrLibrary{siunitx}! in the preamble of the document,
@@ -2954,12 +2982,17 @@
 in \verb!tabularray! environments with \verb!rowsep=0pt!, such as
 \verb!booktabs!/\verb!longtabs!/\verb!talltabs! environments from \verb!booktabs! library.
 
+\section{Library \texttt{zref}}
+
+From version 2022D, you can load \verb!zref! library
+to make \verb!\zref! and \verb!longtblr! work together.
+
 \chapter{History and Future}
 
 \section{The Future}
 
 Starting from 2022, except for hotfix releases for critical bugs,
-new releases will be published every three or six months.
+every new release will be published on the first day of some month.
 You may watch the milestones page for the scheduled dates of upcoming releases
 and their changes:\newline
 \centerline{\url{https://github.com/lvjr/tabularray/milestones}}

Modified: trunk/Master/texmf-dist/tex/latex/tabularray/tabularray.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tabularray/tabularray.sty	2022-11-01 19:52:20 UTC (rev 64890)
+++ trunk/Master/texmf-dist/tex/latex/tabularray/tabularray.sty	2022-11-01 19:52:35 UTC (rev 64891)
@@ -18,7 +18,7 @@
 \DeclareCurrentRelease{}{2022-01-01}
 
 \RequirePackage{expl3}
-\ProvidesExplPackage{tabularray}{2022-07-01}{2022C}
+\ProvidesExplPackage{tabularray}{2022-11-01}{2022D}
   {Typeset tabulars and arrays with LaTeX3}
 
 %% \IfFormatAtLeastTF, xparse and lthooks are added in LaTeX 2020-10-01
@@ -363,13 +363,13 @@
     \int_gincr:c { g__tblr_data_#1_key_count_int }
     \tl_const:ce
       {
-        g__tblr_data_#1_key_name_
+        c__tblr_data_#1_key_name_
           \int_use:c { g__tblr_data_#1_key_count_int } _tl
       }
       { #2 }
-    \tl_const:ce { g__tblr_data_#1_key_number_#2_tl }
+    \tl_const:ce { c__tblr_data_#1_key_number_#2_tl }
       { \int_use:c { g__tblr_data_#1_key_count_int } }
-    \tl_const:cn { g__tblr_data_#1_key_type_#2_tl } {#3}
+    \tl_const:cn { c__tblr_data_#1_key_type_#2_tl } {#3}
   }
 
 \int_new:N \g__tblr_data_row_key_count_int
@@ -406,18 +406,18 @@
 \__tblr_data_new_key:nnn { cell } { @cell-height } { dim }
 \__tblr_data_new_key:nnn { cell } { @cell-depth }  { dim }
 
-\clist_const:Nn \g__tblr_data_clist { row, column, cell }
-\tl_const:Nn \g__tblr_data_row_count_tl { \c at rowcount }
-\tl_const:Nn \g__tblr_data_column_count_tl { \c at colcount }
-\tl_const:Nn \g__tblr_data_cell_count_tl { \c at rowcount * \c at colcount }
-\tl_const:Nn \g__tblr_data_row_index_number_tl {1}
-\tl_const:Nn \g__tblr_data_column_index_number_tl {1}
-\tl_const:Nn \g__tblr_data_cell_index_number_tl {2}
+\clist_const:Nn \c__tblr_data_clist { row, column, cell }
+\tl_const:Nn \c__tblr_data_row_count_tl { \c at rowcount }
+\tl_const:Nn \c__tblr_data_column_count_tl { \c at colcount }
+\tl_const:Nn \c__tblr_data_cell_count_tl { \c at rowcount * \c at colcount }
+\tl_const:Nn \c__tblr_data_row_index_number_tl {1}
+\tl_const:Nn \c__tblr_data_column_index_number_tl {1}
+\tl_const:Nn \c__tblr_data_cell_index_number_tl {2}
 \int_new:N \g__tblr_array_int
 
 \cs_new_protected:Npn \__tblr_init_table_data:
   {
-    \clist_map_function:NN \g__tblr_data_clist \__tblr_init_one_data:n
+    \clist_map_function:NN \c__tblr_data_clist \__tblr_init_one_data:n
   }
 
 \cs_new_protected:Npn \__tblr_init_one_data:n #1
@@ -426,7 +426,7 @@
     \intarray_new:cn { g__tblr_#1_ \int_use:N \g__tblr_array_int _intarray }
       {
         \int_use:c { g__tblr_data_#1_key_count_int }
-          * \tl_use:c { g__tblr_data_#1_count_tl }
+          * \tl_use:c { c__tblr_data_#1_count_tl }
       }
     \cs_set_eq:cc { g__tblr_#1_ \int_use:N \g_tblr_level_int _intarray }
       { g__tblr_#1_ \int_use:N \g__tblr_array_int _intarray }
@@ -437,7 +437,7 @@
 \cs_new:Npn \__tblr_data_key_to_int:nnn #1 #2 #3
   {
     ( #2 - 1 ) * \int_use:c { g__tblr_data_#1_key_count_int }
-      + \tl_use:c { g__tblr_data_#1_key_number_#3_tl }
+      + \tl_use:c { c__tblr_data_#1_key_number_#3_tl }
   }
 
 %% #1: data name; #2: data index 1; #3: data index 2; #4: key name
@@ -445,7 +445,7 @@
   {
     ( #2 - 1 ) * \c at colcount * \int_use:c { g__tblr_data_#1_key_count_int }
       + ( #3 - 1 ) * \int_use:c { g__tblr_data_#1_key_count_int }
-      + \tl_use:c { g__tblr_data_#1_key_number_#4_tl }
+      + \tl_use:c { c__tblr_data_#1_key_number_#4_tl }
   }
 
 \int_new:N \l__tblr_key_count_int
@@ -472,7 +472,7 @@
       { \int_set_eq:NN \l__tblr_key_remainder_int \l__tblr_key_count_int }
     \tl_set:Nx #3 { \int_use:N \l__tblr_key_quotient_int }
     \tl_set_eq:Nc #4
-      { g__tblr_data_#1_key_name_ \int_use:N \l__tblr_key_remainder_int _tl }
+      { c__tblr_data_#1_key_name_ \int_use:N \l__tblr_key_remainder_int _tl }
   }
 
 %% #1: data name; #2: array position;
@@ -494,7 +494,7 @@
     \int_compare:nNnT { \l__tblr_key_remainder_int } = { 0 }
       { \int_set_eq:NN \l__tblr_key_remainder_int \l__tblr_key_count_int }
     \tl_set_eq:Nc #5
-      { g__tblr_data_#1_key_name_ \int_use:N \l__tblr_key_remainder_int _tl }
+      { c__tblr_data_#1_key_name_ \int_use:N \l__tblr_key_remainder_int _tl }
     \int_set:Nn \l__tblr_key_quotient_two_int
       {
         \int_div_truncate:nn
@@ -518,7 +518,7 @@
 \cs_new_protected:Npn \__tblr_data_int_from_value:nnn #1 #2 #3
   {
     \cs:w
-      __tblr_data_int_from_ \tl_use:c { g__tblr_data_#1_key_type_#2_tl } :n
+      __tblr_data_int_from_ \tl_use:c { c__tblr_data_#1_key_type_#2_tl } :n
     \cs_end:
     {#3}
   }
@@ -527,7 +527,7 @@
 \cs_new:Npn \__tblr_data_int_to_value:nnn #1 #2 #3
   {
     \cs:w
-      __tblr_data_int_to_ \tl_use:c { g__tblr_data_#1_key_type_#2_tl } :n
+      __tblr_data_int_to_ \tl_use:c { c__tblr_data_#1_key_type_#2_tl } :n
     \cs_end:
     {#3}
   }
@@ -568,7 +568,7 @@
   }
 
 \int_new:N \g__tblr_data_str_value_count_int
-\tl_set:cn { g__tblr_data_0_to_str_tl } { }
+\tl_gclear_new:c { g__tblr_data_0_to_str_tl }
 
 \cs_new_protected:Npn \__tblr_data_int_from_str:n #1
   {
@@ -646,7 +646,7 @@
 
 \cs_new_protected:Npn \__tblr_data_log:n #1
   {
-    \use:c { __tblr_data_log_ \use:c { g__tblr_data_#1_index_number_tl } :n } {#1}
+    \use:c { __tblr_data_log_ \use:c { c__tblr_data_#1_index_number_tl } :n } {#1}
     \__tblr_prop_log:n {#1}
   }
 
@@ -736,7 +736,7 @@
 \cs_generate_variant:Nn \__tblr_array_gadd_value:Nnn { cnn }
 
 \bool_new:N \g__tblr_use_intarray_bool
-\bool_set_true:N \g__tblr_use_intarray_bool
+\bool_gset_true:N \g__tblr_use_intarray_bool
 
 \AtBeginDocument
   {
@@ -1126,8 +1126,8 @@
 %%> \section{Set Hlines and Vlines}
 %%% --------------------------------------------------------
 
-\tl_set:Nn \@tblr at dash { dash }
-\tl_set:Nn \@tblr at text { text }
+\tl_const:Nn \@tblr at dash { dash }
+\tl_const:Nn \@tblr at text { text }
 
 \regex_const:Nn \c__tblr_is_color_key_regex { ^[A-Za-z] }
 
@@ -2580,7 +2580,8 @@
 %% #1: env name; #2: specifications
 \NewDocumentCommand \SetTblrInner { O{tblr} m }
   {
-    \tl_put_right:cn { l__tblr_default_ #1 _inner_tl } { , #2 }
+    \clist_map_inline:nn {#1}
+      { \tl_put_right:cn { l__tblr_default_ ##1 _inner_tl } { , #2 } }
     \ignorespaces
   }
 \cs_new_eq:NN \SetTblrDefault \SetTblrInner
@@ -2588,7 +2589,8 @@
 %% #1: env name; #2: specifications
 \NewDocumentCommand \SetTblrOuter { O{tblr} m }
   {
-    \tl_put_right:cn { l__tblr_default_ #1 _outer_tl } { , #2 }
+    \clist_map_inline:nn {#1}
+      { \tl_put_right:cn { l__tblr_default_ ##1 _outer_tl } { , #2 } }
     \ignorespaces
   }
 
@@ -3032,7 +3034,7 @@
     colspec, rowspec, column, row, cell, hline, vline, hborder, vborder, width,
     rowhead, rowfoot, columns, rows, cells, hlines, vlines, % hborders, vborders,
     leftsep, rightsep, colsep, abovesep, belowsep, rowsep, rulesep,
-    baseline, hspan, vspan, stretch, verb,
+    baseline, hspan, vspan, stretch, verb, delimiter
   }
 
 \keys_define:nn { tblr }
@@ -3059,6 +3061,7 @@
     rulesep .code:n = \__tblr_keys_gput:nn { rulesep } {#1},
     rowhead .code:n = \__tblr_keys_gput:nn { rowhead } {#1},
     rowfoot .code:n = \__tblr_keys_gput:nn { rowfoot } {#1},
+    delimiter .code:n = \__tblr_set_delimiter:n {#1},
     baseline .code:n = \__tblr_outer_gput_spec:nn { baseline } {#1},
     unknown .code:n = \__tblr_table_special_key:Vn \l_keys_key_str {#1},
   }
@@ -3099,6 +3102,17 @@
   }
 \cs_generate_variant:Nn \__tblr_keys_gput:nn { nx }
 
+\keys_define:nn { tblr-delimiter }
+  {
+    left .code:n  = \__tblr_keys_gput:nn { delim-left } { \left #1 },
+    right .code:n = \__tblr_keys_gput:nn { delim-right } { \right #1 }
+  }
+
+\cs_new_protected:Npn \__tblr_set_delimiter:n #1
+  {
+    \keys_set:nn { tblr-delimiter } {#1}
+  }
+
 %%% --------------------------------------------------------
 %%> \section{Initialize and Parse Table Outer Specifications}
 %%% --------------------------------------------------------
@@ -4556,7 +4570,7 @@
   {
     \prop_put:Nnn \l__tblr_element_styles_prop {#1} {#2}
   }
-\cs_generate_variant:Nn \__tblr_style_put:nn { nV, ne, en }
+\cs_generate_variant:Nn \__tblr_style_put:nn { nV, ne, en, eV }
 
 \cs_new:Npn \__tblr_style_item:n #1
   {
@@ -4599,6 +4613,7 @@
     l       .meta:n = { halign = l },
     c       .meta:n = { halign = c },
     r       .meta:n = { halign = r },
+    j       .meta:n = { halign = j },
     fg      .code:n = \__tblr_element_gput_style:nn { fg } {#1},
     font    .code:n = \__tblr_element_gput_style:nn { font } {#1},
     hang    .code:n = \__tblr_element_gput_style:nn { hang } {#1},
@@ -4620,7 +4635,7 @@
         \tl_set_rescan:Nnn \l__tblr_f_tl {} {#1}
         \tl_if_head_eq_catcode:VNTF \l__tblr_f_tl \scan_stop:
           {
-            \__tblr_style_put:en { \l__tblr_element_name_tl / font } \l__tblr_f_tl
+            \__tblr_style_put:eV { \l__tblr_element_name_tl / font } \l__tblr_f_tl
           }
           {
             \__tblr_style_put:en { \l__tblr_element_name_tl / #1 } {#2}
@@ -4782,7 +4797,17 @@
 %%> \section{Table Continuation Templates}
 %%% --------------------------------------------------------
 
-\DefTblrTemplate { contfoot-text } { normal } { Continued ~ on ~ next ~ page }
+\tl_if_exist:NF \tblrcontfootname
+  {
+    \tl_set:Nn \tblrcontfootname { Continued ~ on ~ next ~ page }
+  }
+
+\tl_if_exist:NF \tblrcontheadname
+  {
+    \tl_set:Nn \tblrcontheadname { ( Continued ) }
+  }
+
+\DefTblrTemplate { contfoot-text } { normal } { \tblrcontfootname }
 \SetTblrTemplate { contfoot-text } { normal }
 
 \DefTblrTemplate { contfoot } { empty } { }
@@ -4806,7 +4831,7 @@
   }
 \SetTblrTemplate { contfoot } { normal }
 
-\DefTblrTemplate { conthead-text } { normal } { ( Continued ) }
+\DefTblrTemplate { conthead-text } { normal } { \tblrcontheadname }
 \SetTblrTemplate { conthead-text } { normal }
 
 \DefTblrTemplate { conthead } { empty } { }
@@ -4839,9 +4864,9 @@
 \DefTblrTemplate { caption-lot } { empty } { }
 \DefTblrTemplate { caption-lot } { normal }
   {
-    \tl_set:Nx \l__tblr_caption_short_tl { \InsertTblrText { entry } }
-    \tl_if_empty:NT \l__tblr_caption_short_tl
-      { \tl_set:Nx \l__tblr_caption_short_tl { \InsertTblrText { caption } } }
+    \tl_if_empty:NTF \lTblrEntryTl
+      { \tl_set_eq:NN \l__tblr_caption_short_tl \lTblrCaptionTl }
+      { \tl_set_eq:NN \l__tblr_caption_short_tl \lTblrEntryTl }
     \addcontentsline { lot } { table }
       { \protect\numberline { \thetable } { \l__tblr_caption_short_tl } }
   }
@@ -5362,10 +5387,17 @@
       \l__tblr_table_lastfoot_box  { \UseTblrTemplate { lastfoot } { default } }
   }
 
+\tl_new:N \lTblrCaptionTl
+\tl_new:N \lTblrEntryTl
+\tl_new:N \lTblrLabelTl
+\clist_new:N \lTblrRefMoreClist
+
 \cs_new_protected:Npn \__tblr_build_table_label_entry:
   {
-    \tl_set:Nx \l_tmpa_tl { \InsertTblrText { label } }
-    \tl_if_eq:NnTF \l_tmpa_tl { none }
+    \tl_set:Nx \lTblrCaptionTl { \InsertTblrText { caption } }
+    \tl_set:Nx \lTblrEntryTl { \InsertTblrText { entry } }
+    \tl_set:Nx \lTblrLabelTl { \InsertTblrText { label } }
+    \tl_if_eq:NnTF \lTblrLabelTl { none }
       {
         \SetTblrTemplate { caption-tag }{ empty }
         \SetTblrTemplate { caption-sep }{ empty }
@@ -5372,10 +5404,17 @@
       }
       {
         \refstepcounter { table }
-        \tl_if_empty:NF \l_tmpa_tl { \exp_args:NV \label \l_tmpa_tl }
+        \tl_if_empty:NF \lTblrLabelTl
+          {
+            \clist_map_inline:Nn \lTblrRefMoreClist
+              { \ExpTblrTemplate { caption-ref } { ##1 } }
+            \exp_args:NV \label \lTblrLabelTl
+          }
       }
-    \tl_set:Nx \l_tmpb_tl { \InsertTblrText { entry } }
-    \tl_if_eq:NnF \l_tmpb_tl { none }
+    %% We put caption-lot code at last, so that an user can modify \lTblrEntryTl
+    %% in a caption-label template. For example, an user may want to use
+    %% short caption in nameref, but at the same time not to add LoT entry.
+    \tl_if_eq:NnF \lTblrEntryTl { none }
       { \UseTblrTemplate { caption-lot } { default } }
   }
 
@@ -5767,9 +5806,16 @@
 \regex_const:Nn \c__tblr_is_positive_integer_regex { ^ \d+ $ }
 \regex_const:Nn \c__tblr_is_negative_integer_regex { ^ - \d+ $ }
 
+\tl_new:N \l__tblr_delim_left_tl
+\tl_new:N \l__tblr_delim_right_tl
+
 \cs_new_protected:Npn \__tblr_valign_whole:Nn #1 #2
   {
     \group_begin:
+    \tl_set:Nx \l__tblr_delim_left_tl
+      { \__tblr_prop_item:nn { inner } { delim-left } }
+    \tl_set:Nx \l__tblr_delim_right_tl
+      { \__tblr_prop_item:nn { inner } { delim-right } }
     \tl_set:Nn \__tblr_vbox_align_tl {#2}
     \dim_set:Nn \l__tblr_t_dim { \box_ht:N #1 + \box_dp:N #1 }
     \tl_case:NnF \__tblr_vbox_align_tl
@@ -5805,13 +5851,40 @@
               { \__tblr_valign_whole_middle:N #1 }
           }
       }
-    \box_use_drop:N #1
+    %% we have done the job when valign is m or c
+    \box_if_empty:NF #1 { \__tblr_add_delimiters_to_box:N #1 }
     \group_end:
   }
 
+%% We use the idea of delarray package to shift table box
+%% when there are delimiters around the table
+\cs_new_protected:Npn \__tblr_add_delimiters_to_box:N #1
+  {
+    \tl_if_empty:NTF \l__tblr_delim_left_tl
+      { \box_use_drop:N #1 }
+      {
+        \box_move_down:nn
+          {
+            ( \box_dp:N #1 - \box_ht:N #1 ) / 2
+            + \tex_fontdimen:D 22 \tex_textfont:D 2
+          }
+          { \__tblr_get_vcenter_box:N #1 }
+      }
+  }
+
+\cs_new_protected:Npn \__tblr_get_vcenter_box:N #1
+  {
+    \hbox:n
+      {
+        $ \m at th \l__tblr_delim_left_tl
+        \tex_vcenter:D { \vbox_unpack_drop:N #1 }
+        \l__tblr_delim_right_tl $
+      }
+  }
+
 \cs_new_protected:Npn \__tblr_valign_whole_middle:N #1
   {
-    \hbox:n { $ \m at th \tex_vcenter:D { \vbox_unpack_drop:N #1 } $ }
+    \__tblr_get_vcenter_box:N #1
   }
 
 \cs_new_protected:Npn \__tblr_valign_whole_top:N #1
@@ -6797,66 +6870,65 @@
 
 \NewTblrLibrary { amsmath }
   {
-    \RequirePackage { amsmath, environ }
+    \RequirePackage { amsmath }
     \NewTblrEnviron { +array }
     \SetTblrInner[+array]{colsep = 5pt}
-    \NewEnviron { +matrix } [1] [] {
-      \begin{+array}[expand = \BODY]{
+    \NewDocumentEnvironment { +matrix } { O{} +b } {
+      \begin{+array}{
         column{1} = {leftsep = 0pt}, column{Z} = {rightsep = 0pt},
         cells = {c}, ##1
       }
-        \BODY
+        ##2
       \end{+array}
-    }
-    \NewEnviron { +bmatrix } [1] [] {
-      \left[\begin{+array}[expand = \BODY]{
+    } { }
+    \NewDocumentEnvironment { +bmatrix } { O{} +b } {
+      \begin{+array}{
         column{1} = {leftsep = 0pt}, column{Z} = {rightsep = 0pt},
-        cells = {c}, ##1
+        cells = {c}, delimiter = {left = [, right = ]}, ##1
       }
-        \BODY
-      \end{+array}\right]
-      \ignorespacesafterend
-    }
-    \NewEnviron { +Bmatrix } [1] [] {
-      \left\lbrace\begin{+array}[expand = \BODY]{
+        ##2
+      \end{+array}
+    } { }
+    \NewDocumentEnvironment { +Bmatrix } { O{} +b } {
+      \begin{+array} {
         column{1} = {leftsep = 0pt}, column{Z} = {rightsep = 0pt},
-        cells = {c}, ##1
+        cells = {c}, delimiter = {left = \lbrace, right = \rbrace}, ##1
       }
-        \BODY
-      \end{+array}\right\rbrace
-    }
-    \NewEnviron { +pmatrix } [1] [] {
-      \left(\begin{+array}[expand = \BODY]{
+        ##2
+      \end{+array}
+    } { }
+    \NewDocumentEnvironment { +pmatrix } { O{} +b } {
+      \begin{+array} {
         column{1} = {leftsep = 0pt}, column{Z} = {rightsep = 0pt},
-        cells = {c}, ##1
+        cells = {c}, delimiter = {left = (, right = )}, ##1
       }
-        \BODY
-      \end{+array}\right)
-    }
-    \NewEnviron { +vmatrix } [1] [] {
-      \left\lvert\begin{+array}[expand = \BODY]{
+        ##2
+      \end{+array}
+    } { }
+    \NewDocumentEnvironment { +vmatrix } { O{} +b } {
+      \begin{+array} {
         column{1} = {leftsep = 0pt}, column{Z} = {rightsep = 0pt},
-        cells = {c}, ##1
+        cells = {c}, delimiter = {left = \lvert, right = \rvert}, ##1
       }
-        \BODY
-      \end{+array}\right\rvert
-    }
-    \NewEnviron { +Vmatrix } [1] [] {
-      \left\lVert\begin{+array}[expand = \BODY]{
+        ##2
+      \end{+array}
+    } { }
+    \NewDocumentEnvironment { +Vmatrix } { O{} +b } {
+      \begin{+array} {
         column{1} = {leftsep = 0pt}, column{Z} = {rightsep = 0pt},
-        cells = {c}, ##1
+        cells = {c}, delimiter = {left = \lVert, right = \rVert}, ##1
       }
-        \BODY
-      \end{+array}\right\rVert
-    }
-    \NewEnviron { +cases } [1] [] {
-      \left\lbrace\begin{+array}[expand = \BODY]{
+        ##2
+      \end{+array}
+    } { }
+    \NewDocumentEnvironment { +cases } { O{} +b } {
+      \begin{+array} {
         column{1} = {leftsep = 0pt}, column{Z} = {rightsep = 0pt},
-        colspec = {ll}, stretch = 1.2, ##1
+        colspec = {ll}, stretch = 1.2, delimiter = {left=\lbrace, right=.}, ##1
       }
-        \BODY
-      \end{+array}\right.
-    }
+        ##2
+      \end{+array}
+    } { }
   }
 
 %% Library booktabs and commands \toprule, \midrule, \bottomrule
@@ -7070,6 +7142,28 @@
       }
   }
 
+%% Library nameref and its caption-ref template
+
+\NewTblrLibrary { nameref }
+  {
+    \RequirePackage { nameref }
+    \clist_if_in:NnF \lTblrRefMoreClist { nameref }
+      {
+        \clist_put_right:Nn \lTblrRefMoreClist { nameref }
+        \DefTblrTemplate { caption-ref }{ nameref }
+          {
+            \tl_if_eq:NnTF \lTblrEntryTl { none }
+              { \exp_args:NV \GetTitleString \lTblrCaptionTl }
+              {
+                \tl_if_empty:NTF \lTblrEntryTl
+                  { \exp_args:NV \GetTitleString \lTblrCaptionTl }
+                  { \exp_args:NV \GetTitleString \lTblrEntryTl }
+              }
+            \tl_set_eq:NN \@currentlabelname \GetTitleStringResult
+          }
+      }
+  }
+
 %% Library siunitx and S columns
 
 \NewTblrLibrary { siunitx }
@@ -7124,3 +7218,19 @@
     \clist_gput_left:Nn \g__tblr_table_known_keys_clist { measure }
     \keys_define:nn { tblr } { measure .tl_set:N = \l__tblr_inner_spec_measure_tl }
   }
+
+%% Library zref and its caption-ref template
+
+\NewTblrLibrary { zref }
+  {
+    \RequirePackage { zref-user }
+    \clist_if_in:NnF \lTblrRefMoreClist { zref }
+      {
+        \clist_put_right:Nn \lTblrRefMoreClist { zref }
+        \DefTblrTemplate { caption-ref }{ zref }
+          {
+            \exp_args:NV \zlabel \lTblrLabelTl
+          }
+      }
+  }
+



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