texlive[71661] Master/texmf-dist: nicematrix (30jun24)

commits+karl at tug.org commits+karl at tug.org
Sun Jun 30 22:09:27 CEST 2024


Revision: 71661
          https://tug.org/svn/texlive?view=revision&revision=71661
Author:   karl
Date:     2024-06-30 22:09:26 +0200 (Sun, 30 Jun 2024)
Log Message:
-----------
nicematrix (30jun24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-code.pdf
    trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf
    trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex
    trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf
    trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex
    trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
    trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty

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

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

Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex	2024-06-30 20:09:15 UTC (rev 71660)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex	2024-06-30 20:09:26 UTC (rev 71661)
@@ -1092,19 +1092,22 @@
 quelques restrictions.
 
 \begin{itemize}
-\item On ne doit pas utiliser |&| et |\\| dans le même bloc.
+\item On ne doit pas utiliser à la fois |&| et |\\| dans le même bloc.
 
 \item Pour |\\|, il n'y a pas d'autres restrictions. On peut utiliser
 |\\| dans un bloc pour composer du texte sur plusieurs lignes.  
 
 \item Pour pouvoir utiliser |&|, la clé |ampersand-in-blocks| (alias:
-|&-in-blocks|) doit avoir été activée. Le bloc est alors divisé en sous-blocs
-comme illustré ci-dessous. Attention toutefois : quand |ampersand-in-blocks| est
-utilisée, l'argument (principal) de la commande |\Block| est découpé
-syntaxiquement au niveau des esperluettes |&|, celles entre accolades sont
-masquées mais pas celles dans un environnement.\footnote{On ne peut donc écrire
-  : |\Block[ampersand-in-blocks]{}{\begin{array}{cc}1&2\end{array}}|. Bien sûr,
-  on peut le faire sans la clé |ampersand-in-blocks|.}
+|&-in-blocks|) doit avoir été activée\footnote{Si ce n'est pas le cas,
+  l'utilisation de |&| dans l'argument principal de la commande |\Block|
+  provoquera une erreur : |! Extra alignment tab has been changed to \cr| de
+  TeX.}. Le bloc est alors divisé en sous-blocs comme illustré ci-dessous.
+Attention toutefois : quand |ampersand-in-blocks| est utilisée, l'argument
+(principal) de la commande |\Block| est découpé syntaxiquement au niveau des
+esperluettes |&|, celles entre accolades sont masquées mais pas celles dans un
+environnement.\footnote{On ne peut donc pas écrire :
+  |\Block[ampersand-in-blocks]{}{\begin{array}{cc}1&2\end{array}}|. Bien sûr, on
+  peut le faire sans la clé |ampersand-in-blocks|.}
 \end{itemize}
 
 \bigskip
@@ -4591,6 +4594,7 @@
 chargée (avant ou après \pkg{nicematrix}). Les notes sont en effet composées en
 fin de tableau selon un type de liste défini par l'extension \pkg{enumitem}.
 
+\medskip
 \begin{Code}
 \begin{NiceTabular}{@{}llr@{}}
 \toprule \RowStyle{\bfseries}

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

Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex	2024-06-30 20:09:15 UTC (rev 71660)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex	2024-06-30 20:09:26 UTC (rev 71661)
@@ -1046,7 +1046,7 @@
 
 \colorbox{yellow!50}{\bfseries New 6.28}\par\nobreak
 
-The extension \pkg{nicemtrix} provides the ability to use |\\| and |&| directly
+The extension \pkg{nicematrix} provides the ability to use |\\| and |&| directly
 in the content of a block (in order to format its contents) but there is some rectrictions.
 
 \begin{itemize}
@@ -1056,7 +1056,9 @@
 block to format a text on several rows.
 
 \item In order to use |&|, the key |ampersand-in-blocks| (alias: |&-in-blocks|)
-must been activated. Then, the block is divided in sub-blocks as illustrated
+must been activated\footnote{Otherwise, the use of~|&| in the command |\Block|
+  will raise a TeX error :\\ 
+|! Extra alignment tab has been changed to \cr.|}. Then, the block is divided in sub-blocks as illustrated
 below. Be careful: with |ampersand-in-blocks| is in force, the (main) argument
 of the command |\Block| is syntactically divided into sub-blocks by splitting on
 the ampersands~|&|, the ampersands between curly braced are protected but not
@@ -1065,7 +1067,33 @@
   it's possible without the key |ampersand-in-blocks|.}
 \end{itemize}
 
-When the key |ampersand-in-blocks|
+
+\bigskip
+With the ampserand |&|, it's possible to divide horizontally a block in
+sub-blocks of \emph{the same size}.
+
+\medskip
+\begin{Code}[width=85mm]
+\begin{NiceTabular}{ll}%
+   [hvlines,ampersand-in-blocks]
+  & les cinq premiers entiers naturels \\
+3 & \Block{un&deux&trois} \\
+4 & \Block{un&deux&trois& quatre} \\
+5 & \Block{un&deux&trois&quatre&cinq} \\
+\end{NiceTabular}
+\end{Code}
+%
+\begin{NiceTabular}{ll}%
+   [hvlines,ampersand-in-blocks]
+  & les cinq premiers entiers naturels \\ 
+3 & \Block{}{un & deux & trois} \\
+4 & \Block{}{un& deux & trois & quatre} \\
+5 & \Block{}{un & deux & trois & quatre & cinq} \\
+\end{NiceTabular}
+
+
+
+
 As we can see, the blocks (which was are in fact mono-cell blocks) are divided
 into sub-blocks of the same size. However, maybe the following code would be prefered.
 
@@ -1610,19 +1638,19 @@
 will be used to use that new type of rule.
 
 \begin{itemize}
-\item the key |command| is the name (without the backslash) of a command that
-will be created by \pkg{nicematrix} and that will be available for the final
-user in order to draw horizontal rules (similarly to |\hline|);
+\item the key \Definition{command} is the name (without the backslash) of a
+command that will be created by \pkg{nicematrix} and that will be available for
+the final user in order to draw horizontal rules (similarly to |\hline|);
 
-\item the key |ccommand| is the name (without the backslash) of a command
-that will be created by \pkg{nicematrix} and that will be available for the
-final user to order to draw partial horizontal rules (similarly to |\cline|,
-hence the name |ccommand|): the argument of that command is a list of
-intervals of columns specified by the syntax~$i$ or $i$-$j$.\footnote{It's
-recommended to use such commands only once in a row because each use will
-create space between the rows corresponding to the total width of the rule.}
+\item the key \Definition{ccommand} is the name (without the backslash) of a
+command that will be created by \pkg{nicematrix} and that will be available for
+the final user to order to draw partial horizontal rules (similarly to |\cline|,
+hence the name |ccommand|): the argument of that command is a list of intervals
+of columns specified by the syntax~$i$ or $i$-$j$.\footnote{It's recommended to
+  use such commands only once in a row because each use will create space
+  between the rows corresponding to the total width of the rule.}
 
-\item the key |letter| takes in as argument a letter\footnote{The following
+\item the key \Definition{letter} takes in as argument a letter\footnote{The following
 letters are forbidden: \verb+lcrpmbVX|()[]!@<>+} that the user will use in
 the preamble of an environment with preamble (such as |{NiceTabular}| in order
 to specify a vertical rule.
@@ -1647,15 +1675,15 @@
 \index{multiplicity (key of ``custom-line'')}
 \index{color!key of ``custom-line''}
 \index{sep-color (key of ``custom-line'')}
-\item the key |multiplicity| is the number of consecutive rules that will be
-drawn: for instance, a value of $2$ will create double rules such those
+\item the key \Definition{multiplicity} is the number of consecutive rules that
+will be drawn: for instance, a value of $2$ will create double rules such those
 created by |\hline\hline| or \verb+||+ in the preamble of an environment;
 
-\item the key |color| sets the color of the rules ;
+\item the key \Definition{color} sets the color of the rules ;
 
-\item the key |sep-color| sets the color between two successive rules (should be
-used only in conjonction with |multiplicity|). The name of that key is inspired
-by the command |\doublerulesepcolor| of \pkg{colortbl}.
+\item the key \Definition{sep-color} sets the color between two successive rules
+(should be used only in conjonction with |multiplicity|). The name of that key
+is inspired by the command |\doublerulesepcolor| of \pkg{colortbl}.
 \end{itemize}
 
 \medskip
@@ -1743,10 +1771,10 @@
 \index{tikzz at tikz!key of ``custom-line''}
 \index{total-width (key of ``custom-line'')}
 
-It's possible to use the key |tikz| (if TikZ is loaded). In that case, the
-rule is drawn directly with TikZ by using as parameters the value of the key
-|tikz| which must be a list of \textsl{key=value} pairs which may be applied
-to a TikZ path.
+It's possible to use the key \Definition{tikz} (if TikZ is loaded). In that
+case, the rule is drawn directly with TikZ by using as parameters the value of
+the key |tikz| which must be a list of \textsl{key=value} pairs which may be
+applied to a TikZ path.
 
 By default, no space is reserved for the rule that will be drawn with TikZ. It
 is possible to specify a reservation (horizontal for a vertical rule and

Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx	2024-06-30 20:09:15 UTC (rev 71660)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx	2024-06-30 20:09:26 UTC (rev 71661)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment 
 %
-% This file should be compiled with $xelatex$.
+% This file should be compiled with $lualatex$.
 %
 % Copyright (C) 2018-2024 by F. Pantigny
 % ------------------------------------------
@@ -17,8 +17,8 @@
 %
 % \fi
 % \iffalse
-\def\myfileversion{6.28a}
-\def\myfiledate{2024/06/24}
+\def\myfileversion{6.28b}
+\def\myfiledate{2024/06/29}
 %
 %
 %<*batchfile>  
@@ -158,7 +158,8 @@
 \bool_const:Nn \c_@@_tagging_array_bool
   { \IfPackageAtLeastTF { array } { 2024/05/01 } \c_true_bool \c_false_bool }
 \bool_const:Nn \c_@@_testphase_table_bool
-  { \IfPackageLoadedTF { latex-lab-testphase-table } \c_true_bool \c_false_bool }
+  { \IfPackageLoadedTF { latex-lab-testphase-table } \c_true_bool \c_false_bool
+  }
 %    \end{macrocode}
 % 
 %
@@ -1499,10 +1500,11 @@
 %    \end{macrocode}
 % 
 % \medskip
-% For the vertical position, the possible values are |c|, |t| and |b|. 
+% For the vertical position, the possible values are |c|, |t|, |b|, |T| and |B|
+% (but |\l_@@_vpos_block_str| will remain empty if the user doesn't use a key
+% for the vertical position).
 %    \begin{macrocode}
 \str_new:N \l_@@_vpos_block_str
-\str_set:Nn \l_@@_vpos_block_str { c }
 %    \end{macrocode}
 %
 % 
@@ -1775,7 +1777,15 @@
 \newcounter { tabularnote }
 %    \end{macrocode}
 %
+% We want to avoid error messages for duplicate labels when the package
+% \pkg{hyperref} is used. That's why we will count all the tabular notes of the
+% whole document with |\g_@@_tabularnote_int|.
 %    \begin{macrocode}
+\int_new:N \g_@@_tabularnote_int 
+\cs_set:Npn \theHtabularnote { \int_use:N \g_@@_tabularnote_int } 
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \seq_new:N \g_@@_notes_seq
 \seq_new:N \g_@@_notes_in_caption_seq
 %    \end{macrocode}
@@ -2000,7 +2010,12 @@
 %    \begin{macrocode}
         \int_gdecr:N \c at tabularnote
         \int_set_eq:NN \l_tmpa_int \c at tabularnote
-        \refstepcounter { tabularnote }
+%    \end{macrocode}
+% The following line is only to avoid error messages for multipy defined labels
+% when the package \pkg{hyperref} is used.
+%    \begin{macrocode}
+        \int_gincr:N \g_@@_tabularnote_int
+        \refstepcounter { tabularnote } 
         \int_compare:nNnT \l_tmpa_int = \c at tabularnote
           { \int_gincr:N \c at tabularnote }
         \seq_clear:N \l_@@_notes_labels_seq 
@@ -13008,6 +13023,9 @@
     b .value_forbidden:n = true ,
     B .code:n = \str_set:Nn \l_@@_vpos_block_str B ,
     B .value_forbidden:n = true ,
+    m .code:n = \str_set:Nn \l_@@_vpos_block_str c , 
+    m .value_forbidden:n = true ,
+    v-center .meta:n = m ,
     p .code:n = \bool_set_true:N \l_@@_p_block_bool , 
     p .value_forbidden:n = true ,
     color .code:n = 
@@ -13148,20 +13166,10 @@
     \bool_set_false:N \l_tmpa_bool
     \bool_if:NT \l_@@_amp_in_blocks_bool
       { \tl_if_in:nnT { #5 } { & } { \bool_set_true:N \l_tmpa_bool } }
-    \bool_if:NTF \l_tmpa_bool
-      { \exp_args:Nee \@@_Block_vii:nnnnn }
-      {
-        \bool_if:NTF \l_@@_p_block_bool 
-          { \exp_args:Nee \@@_Block_vi:nnnnn }
-          {
-            \bool_if:nTF 
-              { 
-                ( 
-                  \int_compare_p:nNn \l_tmpa_int = \c_one_int 
-                     ||
-                  \int_compare_p:nNn \l_tmpb_int = \c_one_int  
-                ) 
-                && ! \tl_if_empty_p:n { #5 }
+    \bool_case:nF
+      { 
+        \l_tmpa_bool               { \exp_args:Nee \@@_Block_vii:nnnnn }
+        \l_@@_p_block_bool         { \exp_args:Nee \@@_Block_vi:nnnnn } 
 %    \end{macrocode}
 % For the blocks mono-column, we will compose right now in a box in order to
 % compute its width and take that width into account for the width of the
@@ -13171,12 +13179,14 @@
 % column, it's imperative. Otherwise, the process for the determination of the
 % widths of the columns will be wrong.
 %    \begin{macrocode}
-                && ! \l_@@_X_bool 
-              }
-              { \exp_args:Nee \@@_Block_iv:nnnnn }
-              { \exp_args:Nee \@@_Block_v:nnnnn }
-          }
-      }
+        \l_@@_X_bool                { \exp_args:Nee \@@_Block_v:nnnnn }
+        { \tl_if_empty_p:n { #5 } } { \exp_args:Nee \@@_Block_v:nnnnn }
+        { \int_compare_p:nNn \l_tmpa_int = \c_one_int } 
+            { \exp_args:Nee \@@_Block_iv:nnnnn } 
+        { \int_compare_p:nNn \l_tmpb_int = \c_one_int }
+            { \exp_args:Nee \@@_Block_iv:nnnnn } 
+       }       
+       { \exp_args:Nee \@@_Block_v:nnnnn }
     { \l_tmpa_int } { \l_tmpb_int } { #3 } { #4 } { #5 } 
   }
 %    \end{macrocode}
@@ -13289,7 +13299,7 @@
                 { ! \g_@@_rotate_bool } 
               }
 %    \end{macrocode}
-% When the block is mono-column in a column with a fixed width (eg |p{3cm}|), we
+% When the block is mono-column in a column with a fixed width (e.g. |p{3cm}|), we
 % use a |{minipage}|.
 %    \begin{macrocode}
               { 
@@ -13363,9 +13373,16 @@
       }
 %    \end{macrocode}
 % If we are in a mono-row block we take into account the height and the depth of
-% that block for the height and the depth of the row.
+% that block for the height and the depth of the row, excepted when the block
+% uses explicitely an option of vertical position.
 %    \begin{macrocode}
-     \int_compare:nNnT { #1 } = \c_one_int
+     \bool_lazy_and:nnT
+       { \int_compare_p:nNn { #1 } = \c_one_int }
+%    \end{macrocode}
+% If the user has not used a key for the vertical position of the block, then
+% |\l_@@_vpos_block_str| remains empty.
+%    \begin{macrocode}
+       { \str_if_empty_p:N \l_@@_vpos_block_str }
        {
          \dim_gset:Nn \g_@@_blocks_ht_dim
            {
@@ -13408,7 +13425,6 @@
                 { m }
                 { \int_compare:nNnT \c at iRow = \l_@@_last_row_int T }
             }
-
         }
         { 
           \box_use_drop:c 
@@ -14211,7 +14227,8 @@
 %    \end{macrocode}
 %
 % \bigskip
-% Now, we will put the label of the block.
+% Now, we will put the label of the block. We recall that |\l_@@_vpos_block_str|
+% is empty when the user has not used a key for the vertical position of the block.
 %    \begin{macrocode}
         \pgfpicture
         \pgfrememberpicturepositiononpagetrue
@@ -14218,6 +14235,7 @@
         \pgf at relevantforpicturesizefalse 
         \bool_lazy_any:nTF
           {
+            { \str_if_empty_p:N \l_@@_vpos_block_str } % added 2024/06/29
             { \str_if_eq_p:on \l_@@_vpos_block_str { c } }
             { \str_if_eq_p:on \l_@@_vpos_block_str { T } }
             { \str_if_eq_p:on \l_@@_vpos_block_str { B } }
@@ -14245,6 +14263,19 @@
               {
                 \str_case:on \l_@@_vpos_block_str
                   {
+%    \end{macrocode}
+% We recall that |\l_@@_vpos_block_str| is empty when the user has not used a key
+% for the vertical position of the block.
+%    \begin{macrocode}
+                    { } { % added 2024-06-29
+                          \str_case:on \l_@@_hpos_block_str
+                            {
+                              c { center } 
+                              l { west } 
+                              r { east } 
+                              j { center }
+                            }
+                        } 
                     c { 
                         \str_case:on \l_@@_hpos_block_str
                           {
@@ -15695,6 +15726,7 @@
       {
         \nullfont
         \c_math_toggle_token
+        \colorlet { current-color } { . }
         \@@_color:o \l_@@_delimiters_color_tl 
         \left .
         \vcenter 
@@ -15706,7 +15738,7 @@
           } 
         \right #1 
         \tl_if_empty:nF { #3 } { _ { \smash { #3 } } }
-        ^ { \smash { #4 } } 
+        ^ { \color { current-color } \smash { #4 } } 
         \c_math_toggle_token
       } 
       { #2 }
@@ -15744,9 +15776,12 @@
   {
     left-shorten .bool_set:N = \l_@@_brace_left_shorten_bool ,
     left-shorten .default:n = true ,
+    left-shorten .value_forbidden:n = true ,
     right-shorten .bool_set:N = \l_@@_brace_right_shorten_bool ,
+    right-shorten .default:n = true ,
+    right-shorten .value_forbidden:n = true ,
     shorten .meta:n = { left-shorten , right-shorten } , 
-    right-shorten .default:n = true ,
+    shorten .value_forbidden:n = true ,
     yshift .dim_set:N = \l_@@_brace_yshift_dim , 
     yshift .value_required:n = true ,
     yshift .initial:n = \c_zero_dim ,
@@ -17387,6 +17422,7 @@
   }
   { 
     The~available~keys~are~(in~alphabetic~order):~
+    &-in-blocks,~
     allow-duplicate-names,~
     ampersand-in-blocks,~
     caption-above,~
@@ -17446,6 +17482,7 @@
   }
   {
     The~available~keys~are~(in~alphabetic~order):~
+    &-in-blocks,~
     ampersand-in-blocks,~
     b,~
     baseline,~
@@ -17511,6 +17548,7 @@
   }
   {
     The~available~keys~are~(in~alphabetic~order):~
+    &-in-blocks,~
     ampersand-in-blocks,~
     b,~
     baseline,~
@@ -17575,6 +17613,7 @@
   }
   {
     The~available~keys~are~(in~alphabetic~order):~
+    &-in-blocks,~
     ampersand-in-blocks,~
     b,~
     baseline,~

Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2024-06-30 20:09:15 UTC (rev 71660)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2024-06-30 20:09:26 UTC (rev 71661)
@@ -18,8 +18,8 @@
 %% and version 1.3 or later is part of all distributions of
 %% LaTeX version 2005/12/01 or later.
 %% 
-\def\myfileversion{6.28a}
-\def\myfiledate{2024/06/24}
+\def\myfileversion{6.28b}
+\def\myfiledate{2024/06/29}
 \RequirePackage{pgfcore}
 \usepgfmodule{shapes}
 \RequirePackage{l3keys2e}
@@ -33,7 +33,8 @@
 \bool_const:Nn \c__nicematrix_tagging_array_bool
   { \IfPackageAtLeastTF { array } { 2024/05/01 } \c_true_bool \c_false_bool }
 \bool_const:Nn \c__nicematrix_testphase_table_bool
-  { \IfPackageLoadedTF { latex-lab-testphase-table } \c_true_bool \c_false_bool }
+  { \IfPackageLoadedTF { latex-lab-testphase-table } \c_true_bool \c_false_bool
+  }
 \cs_new_protected:Npn \__nicematrix_error:n { \msg_error:nn { nicematrix } }
 \cs_new_protected:Npn \__nicematrix_warning:n { \msg_warning:nn { nicematrix } }
 \cs_new_protected:Npn \__nicematrix_error:nn { \msg_error:nnn { nicematrix } }
@@ -485,7 +486,6 @@
 \bool_new:N \l__nicematrix_p_block_bool
 \bool_new:N \l__nicematrix_nocolor_used_bool
 \str_new:N \l__nicematrix_vpos_block_str
-\str_set:Nn \l__nicematrix_vpos_block_str { c }
 \bool_new:N \l__nicematrix_draw_first_bool
 \bool_new:N \l__nicematrix_vlines_block_bool
 \bool_new:N \l__nicematrix_hlines_block_bool
@@ -543,6 +543,8 @@
     \dim_const:Nn \c__nicematrix_innersep_middle_dim { 0.17 em }
   }
 \newcounter { tabularnote }
+\int_new:N \g__nicematrix_tabularnote_int
+\cs_set:Npn \theHtabularnote { \int_use:N \g__nicematrix_tabularnote_int }
 \seq_new:N \g__nicematrix_notes_seq
 \seq_new:N \g__nicematrix_notes_in_caption_seq
 \tl_new:N \g__nicematrix_tabularnote_tl
@@ -658,6 +660,7 @@
           }
         \int_gdecr:N \c at tabularnote
         \int_set_eq:NN \l_tmpa_int \c at tabularnote
+        \int_gincr:N \g__nicematrix_tabularnote_int
         \refstepcounter { tabularnote }
         \int_compare:nNnT \l_tmpa_int = \c at tabularnote
           { \int_gincr:N \c at tabularnote }
@@ -7104,6 +7107,9 @@
     b .value_forbidden:n = true ,
     B .code:n = \str_set:Nn \l__nicematrix_vpos_block_str B ,
     B .value_forbidden:n = true ,
+    m .code:n = \str_set:Nn \l__nicematrix_vpos_block_str c ,
+    m .value_forbidden:n = true ,
+    v-center .meta:n = m ,
     p .code:n = \bool_set_true:N \l__nicematrix_p_block_bool ,
     p .value_forbidden:n = true ,
     color .code:n =
@@ -7167,26 +7173,18 @@
     \bool_set_false:N \l_tmpa_bool
     \bool_if:NT \l__nicematrix_amp_in_blocks_bool
       { \tl_if_in:nnT { #5 } { & } { \bool_set_true:N \l_tmpa_bool } }
-    \bool_if:NTF \l_tmpa_bool
-      { \exp_args:Nee \__nicematrix_Block_vii:nnnnn }
+    \bool_case:nF
       {
-        \bool_if:NTF \l__nicematrix_p_block_bool
-          { \exp_args:Nee \__nicematrix_Block_vi:nnnnn }
-          {
-            \bool_if:nTF
-              {
-                (
-                  \int_compare_p:nNn \l_tmpa_int = \c_one_int
-                     ||
-                  \int_compare_p:nNn \l_tmpb_int = \c_one_int
-                )
-                && ! \tl_if_empty_p:n { #5 }
-                && ! \l__nicematrix_X_bool
-              }
-              { \exp_args:Nee \__nicematrix_Block_iv:nnnnn }
-              { \exp_args:Nee \__nicematrix_Block_v:nnnnn }
-          }
-      }
+        \l_tmpa_bool               { \exp_args:Nee \__nicematrix_Block_vii:nnnnn }
+        \l__nicematrix_p_block_bool         { \exp_args:Nee \__nicematrix_Block_vi:nnnnn }
+        \l__nicematrix_X_bool                { \exp_args:Nee \__nicematrix_Block_v:nnnnn }
+        { \tl_if_empty_p:n { #5 } } { \exp_args:Nee \__nicematrix_Block_v:nnnnn }
+        { \int_compare_p:nNn \l_tmpa_int = \c_one_int }
+            { \exp_args:Nee \__nicematrix_Block_iv:nnnnn }
+        { \int_compare_p:nNn \l_tmpb_int = \c_one_int }
+            { \exp_args:Nee \__nicematrix_Block_iv:nnnnn }
+       }
+       { \exp_args:Nee \__nicematrix_Block_v:nnnnn }
     { \l_tmpa_int } { \l_tmpb_int } { #3 } { #4 } { #5 }
   }
 \cs_new_protected:Npn \__nicematrix_Block_iv:nnnnn #1 #2 #3 #4 #5
@@ -7284,7 +7282,9 @@
               }
           }
       }
-     \int_compare:nNnT { #1 } = \c_one_int
+     \bool_lazy_and:nnT
+       { \int_compare_p:nNn { #1 } = \c_one_int }
+       { \str_if_empty_p:N \l__nicematrix_vpos_block_str }
        {
          \dim_gset:Nn \g__nicematrix_blocks_ht_dim
            {
@@ -7317,7 +7317,6 @@
                 { m }
                 { \int_compare:nNnT \c at iRow = \l__nicematrix_last_row_int T }
             }
-
         }
         {
           \box_use_drop:c
@@ -7877,6 +7876,7 @@
         \pgf at relevantforpicturesizefalse
         \bool_lazy_any:nTF
           {
+            { \str_if_empty_p:N \l__nicematrix_vpos_block_str } % added 2024/06/29
             { \str_if_eq_p:on \l__nicematrix_vpos_block_str { c } }
             { \str_if_eq_p:on \l__nicematrix_vpos_block_str { T } }
             { \str_if_eq_p:on \l__nicematrix_vpos_block_str { B } }
@@ -7892,6 +7892,15 @@
               {
                 \str_case:on \l__nicematrix_vpos_block_str
                   {
+                    { } { % added 2024-06-29
+                          \str_case:on \l__nicematrix_hpos_block_str
+                            {
+                              c { center }
+                              l { west }
+                              r { east }
+                              j { center }
+                            }
+                        }
                     c {
                         \str_case:on \l__nicematrix_hpos_block_str
                           {
@@ -8847,6 +8856,7 @@
       {
         \nullfont
         \c_math_toggle_token
+        \colorlet { current-color } { . }
         \__nicematrix_color:o \l__nicematrix_delimiters_color_tl
         \left .
         \vcenter
@@ -8858,7 +8868,7 @@
           }
         \right #1
         \tl_if_empty:nF { #3 } { _ { \smash { #3 } } }
-        ^ { \smash { #4 } }
+        ^ { \color { current-color } \smash { #4 } }
         \c_math_toggle_token
       }
       { #2 }
@@ -8878,9 +8888,12 @@
   {
     left-shorten .bool_set:N = \l__nicematrix_brace_left_shorten_bool ,
     left-shorten .default:n = true ,
+    left-shorten .value_forbidden:n = true ,
     right-shorten .bool_set:N = \l__nicematrix_brace_right_shorten_bool ,
+    right-shorten .default:n = true ,
+    right-shorten .value_forbidden:n = true ,
     shorten .meta:n = { left-shorten , right-shorten } ,
-    right-shorten .default:n = true ,
+    shorten .value_forbidden:n = true ,
     yshift .dim_set:N = \l__nicematrix_brace_yshift_dim ,
     yshift .value_required:n = true ,
     yshift .initial:n = \c_zero_dim ,
@@ -10113,6 +10126,7 @@
   }
   {
     The~available~keys~are~(in~alphabetic~order):~
+    &-in-blocks,~
     allow-duplicate-names,~
     ampersand-in-blocks,~
     caption-above,~
@@ -10167,6 +10181,7 @@
   }
   {
     The~available~keys~are~(in~alphabetic~order):~
+    &-in-blocks,~
     ampersand-in-blocks,~
     b,~
     baseline,~
@@ -10225,6 +10240,7 @@
   }
   {
     The~available~keys~are~(in~alphabetic~order):~
+    &-in-blocks,~
     ampersand-in-blocks,~
     b,~
     baseline,~
@@ -10286,6 +10302,7 @@
   }
   {
     The~available~keys~are~(in~alphabetic~order):~
+    &-in-blocks,~
     ampersand-in-blocks,~
     b,~
     baseline,~



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