texlive[59479] Master/texmf-dist: nicematrix (5jun21)

commits+karl at tug.org commits+karl at tug.org
Sat Jun 5 23:12:04 CEST 2021


Revision: 59479
          http://tug.org/svn/texlive?view=revision&revision=59479
Author:   karl
Date:     2021-06-05 23:12:03 +0200 (Sat, 05 Jun 2021)
Log Message:
-----------
nicematrix (5jun21)

Modified Paths:
--------------
    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/source/latex/nicematrix/nicematrix.dtx
    trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty

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	2021-06-05 21:11:50 UTC (rev 59478)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex	2021-06-05 21:12:03 UTC (rev 59479)
@@ -4348,7 +4348,7 @@
 \end{scope}   
 
 \vspace{2cm}
-Un exemple avec un système linéaire:\par\nobreak 
+Un exemple avec un système linéaire:
 
 \begin{Verbatim}
 $\begin{pNiceArray}{*6c|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]

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

Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx	2021-06-05 21:11:50 UTC (rev 59478)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx	2021-06-05 21:12:03 UTC (rev 59479)
@@ -15,8 +15,8 @@
 %
 % \fi
 % \iffalse
-\def\myfileversion{5.15a}
-\def\myfiledate{2021/05/06}
+\def\myfileversion{5.15b}
+\def\myfiledate{2021/06/05}
 %
 %
 %<*batchfile>
@@ -1665,7 +1665,7 @@
 %
 % It's possible to access the preceding tools with a syntax close to the syntax
 % of \pkg{colortbl}. For that, one must use the key |colortbl-like| in the
-% current environment.\footnote{As for now, this key is \emph{not} available in |\NiceMatrixOptions|.}
+% current environment.\footnote{Up to now, this key is \emph{not} available in |\NiceMatrixOptions|.}
 %
 % There are three commands available (they are inspired by \pkg{colortbl} but
 % are \emph{independent} of \pkg{colortbl}):
@@ -4134,7 +4134,7 @@
 % \end{Verbatim}
 %
 % \bigskip
-% As for now, the package \pkg{nicematrix} is not compatible with
+% Up to now, the package \pkg{nicematrix} is not compatible with
 % \cls{aastex63}. If you want to use \pkg{nicematrix} with \cls{aastex63}, send
 % me an email and I will try to solve the incompatibilies.
 % 
@@ -5276,87 +5276,7 @@
   }
 %    \end{macrocode}
 % 
-% \medskip
-% The command |\NC at rewrite@S| is a LaTeX command created by \pkg{siunitx} in
-% connection with the |S| column. In the code of \pkg{siunitx}, this command is
-% defined by:
-% \begin{Verbatim}[commandchars=\~\!\+, formatcom = \small]
-% \renewcommand*{\NC at rewrite@S}[1][]
-%   {
-%     \@temptokena \exp_after:wN
-%       {
-%         \tex_the:D \@temptokena
-%         > { \__siunitx_table_collect_begin: S {#1} }
-%         c
-%         < { \__siunitx_table_print: }
-%       }
-%     \NC at find
-%   } 
-% \end{Verbatim}
-% We want to patch this command (in the environments of \pkg{nicematrix}) in
-% order to have:
-% \begin{Verbatim}[commandchars=\~\!\+, formatcom = \small]
-% \renewcommand*{\NC at rewrite@S}[1][]
-%   {
-%     \@temptokena \exp_after:wN
-%       {
-%         \tex_the:D \@temptokena
-%         > { ~emphase!\@@_Cell:+ \__siunitx_table_collect_begin: S {#1} }
-%         ~emphase!\@@_true_c:+
-%         < { \__siunitx_table_print: ~emphase!\@@_end_Cell:+ }
-%       }
-%     \NC at find
-%   } 
-% \end{Verbatim}
-% However, we don't want do use explicitly any private command of \pkg{siunitx}.
-% That's why we will extract the name of the two |\__siunitx...| commands by
-% their position in the code of |\NC at rewrite@S|. 
 %
-% Since the command |\NC at rewrite@S| appends some tokens to the \emph{toks} list
-% |\@temptokena|, we use the LaTeX command |\NC at rewrite@S| in a group
-% (|\group_begin:|--|\group_end:|) and we extract the two command names which
-% are in the toks |\@temptokena|. However, this extraction can be done only
-% when \pkg{siunitx} is loaded (and it may be loaded after \pkg{nicematrix})
-% and, in fact, after the beginning of the document --- because some
-% instructions of \pkg{siunitx} are executed in a |\AtBeginDocument|). That's
-% why this extraction will be done only at the first use of an
-% environment of \pkg{nicematrix} with the command |\@@_adapt_S_column:|. 
-%    \begin{macrocode}
-\cs_set_protected:Npn \@@_adapt_S_column:
-  {
-    \bool_if:NT \c_@@_siunitx_loaded_bool
-      { 
-        \group_begin:
-        \@temptokena = { }
-%    \end{macrocode}
-% We protect |\NC at find| which is at the end of |\NC at rewrite@S|.
-%    \begin{macrocode}
-        \cs_set_eq:NN \NC at find \prg_do_nothing:
-        \NC at rewrite@S { }
-%    \end{macrocode}
-% Conversion of the \emph{toks} |\@temptokena| in a token list of \pkg{expl3}
-% (the toks are not supported by \pkg{expl3} but we can, nevertheless, use the
-% option |V| for |\tl_gset:NV|).
-%    \begin{macrocode}
-        \tl_gset:NV \g_tmpa_tl \@temptokena 
-        \group_end:
-        \tl_new:N \c_@@_table_collect_begin_tl
-        \tl_set:Nx \l_tmpa_tl { \tl_item:Nn \g_tmpa_tl 2 }
-        \tl_gset:Nx \c_@@_table_collect_begin_tl { \tl_item:Nn \l_tmpa_tl 1 }
-        \tl_new:N \c_@@_table_print_tl
-        \tl_gset:Nx \c_@@_table_print_tl { \tl_item:Nn \g_tmpa_tl { -1 } }
-%    \end{macrocode}
-% The token lists |\c_@@_table_collect_begin_tl| and |\c_@@_table_print_tl|
-% contain now the two commands of \pkg{siunitx}.
-% 
-% \smallskip
-% If the adaptation has been done, the command |\@@_adapt_S_column:| becomes
-% no-op (globally). 
-%    \begin{macrocode}
-        \cs_gset_eq:NN \@@_adapt_S_column: \prg_do_nothing:
-      }
-  }
-%    \end{macrocode}
 %
 % \bigskip
 % The command |\@@_renew_NC at rewrite@S:| will be used in each environment of
@@ -5367,28 +5287,82 @@
     \bool_if:nTF { ! \c_@@_siunitx_loaded_bool }
       { \cs_set_eq:NN \@@_renew_NC at rewrite@S: \prg_do_nothing: }
       {
-        \cs_new_protected:Npn \@@_renew_NC at rewrite@S:
+%    \end{macrocode}
+% For version of \pkg{siunitx} at least equal to 3.0, the adaptation is different
+% from previous ones. We test the version of \pkg{siunitx} by the existence of the
+% control sequence |\siunitx_cell_begin:w|.
+%    \begin{macrocode}
+        \cs_if_exist:NTF \siunitx_cell_begin:w 
           {
-            \renewcommand*{\NC at rewrite@S}[1][]
+            \cs_new_protected:Npn \@@_renew_NC at rewrite@S:
               {
-                \@temptokena \exp_after:wN
+                \renewcommand*{\NC at rewrite@S}[1][]
                   {
-                    \tex_the:D \@temptokena
-                    > { \@@_Cell: \c_@@_table_collect_begin_tl S {##1} }
+                    \@temptokena \exp_after:wN
+                      {
+                        \tex_the:D \@temptokena
+                        > { 
+                            \@@_Cell: 
+                            \keys_set:nn { siunitx } { ##1 } 
+                            \siunitx_cell_begin:w 
+                          }
 %    \end{macrocode}
 % |\@@_true_c:| will be replaced statically by |c| at the end of the construction
 % of the preamble.
 %    \begin{macrocode}
-                    \@@_true_c:
-                    < { \c_@@_table_print_tl \@@_end_Cell: }
+                        \@@_true_c:
+                        < { \siunitx_cell_end: \@@_end_Cell: }
+                      }
+                    \NC at find
                   }
-                \NC at find
               }
           } 
+          {
+            \cs_new_protected:Npn \@@_renew_NC at rewrite@S:
+              {
+                \renewcommand*{\NC at rewrite@S}[1][]
+                  {
+                    \@temptokena \exp_after:wN
+                      {
+                        \tex_the:D \@temptokena
+                        > { \@@_Cell: \c_@@_table_collect_begin_tl S {##1} }
+                        \@@_true_c:
+                        < { \c_@@_table_print_tl \@@_end_Cell: }
+                      }
+                    \NC at find
+                  }
+              } 
+          } 
       }
   }
 %    \end{macrocode}
 %
+% \medskip
+% The following code is used to define |\c_@@_table_collect_begin_tl| and
+% |\c_@@_table_print_tl| when the version of \pkg{siunitx} is prior to 3.0. The
+% command |\@@_adapt_S_column| is used in the environment |{NiceArrayWithDelims}|.
+%    \begin{macrocode}
+\cs_set_protected:Npn \@@_adapt_S_column:
+  {
+    \bool_if:NT \c_@@_siunitx_loaded_bool
+      { 
+        \group_begin:
+        \@temptokena = { }
+        \cs_set_eq:NN \NC at find \prg_do_nothing:
+        \NC at rewrite@S { }
+        \tl_gset:NV \g_tmpa_tl \@temptokena 
+        \group_end:
+        \tl_new:N \c_@@_table_collect_begin_tl
+        \tl_set:Nx \l_tmpa_tl { \tl_item:Nn \g_tmpa_tl 2 }
+        \tl_gset:Nx \c_@@_table_collect_begin_tl { \tl_item:Nn \l_tmpa_tl 1 }
+        \tl_new:N \c_@@_table_print_tl
+        \tl_gset:Nx \c_@@_table_print_tl { \tl_item:Nn \g_tmpa_tl { -1 } }
+        \cs_gset_eq:NN \@@_adapt_S_column: \prg_do_nothing:
+      }
+  }
+%    \end{macrocode}
+%
+%
 % \bigskip
 % The following regex will be used to modify the preamble of the array when the
 % key |colortbl-like| is used.
@@ -5416,6 +5390,7 @@
   }
 %    \end{macrocode}
 %
+% \bigskip
 % \subsection*{Parameters}
 %
 % \bigskip 
@@ -5864,11 +5839,7 @@
 % 
 % \medskip
 % The following token list correspond to the key |color| of the command
-% |\Block|. However, as of now (v. 5.7 of \pkg{nicematrix}), the key |color|
-% linked to |fill| with an error. We will give to the key |color| of |\Block|
-% its new meaning in a few months (with its new definition, the key |color| will
-% draw the frame with the given color but also color the content of the block
-% (that is to say the text) as does the key |color| of a Tikz node).
+% |\Block|. 
 %    \begin{macrocode}
 \tl_new:N \l_@@_color_tl
 %    \end{macrocode}
@@ -7209,7 +7180,7 @@
 % \item we test the existence of these nodes in order to determine whether a
 % cell is empty when we search the extremities of a dotted line.
 % \end{itemize}
-% However, it's very difficult to determine whether a cell is empty. As for now,
+% However, it's very difficult to determine whether a cell is empty. Up to now
 % we use the following technic:
 % \begin{itemize}
 % \item if the width of the box |\l_@@_cell_box| (created with the content of
@@ -8169,6 +8140,10 @@
     \bool_gset_false:N \g_@@_row_of_col_done_bool
     \str_if_empty:NT \g_@@_name_env_str 
       { \str_gset:Nn \g_@@_name_env_str { NiceArrayWithDelims } } 
+%    \end{macrocode}
+% The following line will be deleted when we will consider that only versions of
+% \pkg{siunitx} after v3.0 are compatible with \pkg{nicematrix}.
+%    \begin{macrocode}
     \@@_adapt_S_column:
     \bool_if:NTF \l_@@_NiceTabular_bool 
       \mode_leave_vertical:
@@ -10157,6 +10132,12 @@
 %    \begin{macrocode}
     \seq_gclear:N \g_@@_submatrix_names_seq
 %    \end{macrocode}
+% \medskip
+% We compose the |code-after| in math mode in order to nullify the spaces put
+% by the user between instructions in the |code-after|. 
+%    \begin{macrocode}
+    % \bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token
+%    \end{macrocode}
 % And here's the |\CodeAfter|. Since the |\CodeAfter| may begin with an
 % ``argument'' between square brackets of the options, we extract and treat that
 % potential ``argument'' with the command |\@@_CodeAfter_keys:|.
@@ -10163,6 +10144,7 @@
 %    \begin{macrocode}
     \exp_last_unbraced:NV \@@_CodeAfter_keys: \g_nicematrix_code_after_tl
     \scan_stop: 
+    % \bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token
     \tl_gclear:N \g_nicematrix_code_after_tl
     \group_end:
 %    \end{macrocode}
@@ -10661,8 +10643,8 @@
 % The following commmand (\emph{when it will be written}) will set the four
 % counters |\l_@@_row_min_int|, |\l_@@_row_max_int|, |\l_@@_col_min_int| and
 % |\l_@@_col_max_int| to the intersections of the sub-matrices which contains
-% the cell of row |#1| and column |#2|.
-% As of now, it's only the whole array (excepted exterior row and columns).
+% the cell of row |#1| and column |#2|. As of now, it's only the whole array
+% (excepted exterior rows and columns).
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_adjust_to_submatrix:nn #1 #2
   {
@@ -11571,9 +11553,6 @@
 % |\Iddots| in the environments |{NiceArray}| (the other environments of
 % \pkg{nicematrix} rely upon |{NiceArray}|). 
 %
-% The starred versions of these commands are deprecated since version~3.1 but,
-% as of now, they are still available with an error.
-%
 % 
 % \medskip
 % The syntax of these commands uses the character |_| as embellishment and
@@ -12370,8 +12349,7 @@
 % The command |\@@_arraycolor| (linked to |\arraycolor| at the beginning of
 % the |\CodeBefore|) will color the whole tabular (excepted the potential
 % exterior rows and columns). The third argument is a optional argument which a
-% list of pairs key-value. As for now, there is only one key: |except-corners|.
-% When that key is used, the cells in the corners are not colored.
+% list of pairs key-value. 
 %    \begin{macrocode}
 \NewDocumentCommand \@@_arraycolor { O { } m O { } }
   {
@@ -13627,7 +13605,7 @@
 %    \end{macrocode}
 %
 % \medskip
-% As for now, we have no option to control the style of the lines drawn by
+% Up to now, we have no option to control the style of the lines drawn by
 % |\hdottedline| and the specifier ``|:|'' in the preamble. That's why we impose
 % the style |standard|.
 %    \begin{macrocode}
@@ -13695,7 +13673,7 @@
     \@@_qpoint:n { row - \@@_succ:n \c at iRow } 
     \dim_set:Nn \l_@@_y_final_dim { \pgf at y + 0.5 \l_@@_inter_dots_dim } 
 %    \end{macrocode}
-% As for now, we have no option to control the style of the lines drawn by
+% Up to now, we have no option to control the style of the lines drawn by
 % |\hdottedline| and the specifier ``|:|'' in the preamble. That's why we impose
 % the style |standard|.
 %    \begin{macrocode}
@@ -13716,7 +13694,7 @@
 %    \end{macrocode}
 %
 % \bigskip
-% As for now, there is only one option available for the environment
+% Up to now, there is only one option available for the environment
 % |{NiceMatrixBlock}|. 
 %    \begin{macrocode}
 \keys_define:nn { NiceMatrix / NiceMatrixBlock } 
@@ -15618,16 +15596,19 @@
 %    \begin{macrocode}
 \NewDocumentCommand \@@_SubMatrix_in_code_before { m m m m ! O { } }
   {
-    \@@_cut_on_hyphen:w #3 \q_stop
-    \tl_clear_new:N \l_tmpc_tl
-    \tl_clear_new:N \l_tmpd_tl
-    \tl_set_eq:NN \l_tmpc_tl \l_tmpa_tl
-    \tl_set_eq:NN \l_tmpd_tl \l_tmpb_tl
-    \@@_cut_on_hyphen:w #2 \q_stop
-    \seq_gput_right:Nx \g_@@_submatrix_seq
-      { { \l_tmpa_tl } { \l_tmpb_tl } { \l_tmpc_tl } { \l_tmpd_tl } }
-    \tl_gput_right:Nn \g_@@_internal_code_after_tl
-      { \SubMatrix { #1 } { #2 } { #3 } { #4 } [ #5 ] }
+    \peek_remove_spaces:n
+      {
+        \@@_cut_on_hyphen:w #3 \q_stop
+        \tl_clear_new:N \l_tmpc_tl
+        \tl_clear_new:N \l_tmpd_tl
+        \tl_set_eq:NN \l_tmpc_tl \l_tmpa_tl
+        \tl_set_eq:NN \l_tmpd_tl \l_tmpb_tl
+        \@@_cut_on_hyphen:w #2 \q_stop
+        \seq_gput_right:Nx \g_@@_submatrix_seq
+          { { \l_tmpa_tl } { \l_tmpb_tl } { \l_tmpc_tl } { \l_tmpd_tl } }
+        \tl_gput_right:Nn \g_@@_internal_code_after_tl
+          { \SubMatrix { #1 } { #2 } { #3 } { #4 } [ #5 ] }
+      }
   }
 %    \end{macrocode}
 %
@@ -15644,6 +15625,13 @@
 %    \begin{macrocode}
 \NewDocumentCommand \@@_SubMatrix { m m m m O { } }
   {
+    \peek_remove_spaces:n
+      { \@@_sub_matrix:nnnnn { #1 } { #2 } { #3 } { #4 }  { #5 } }
+   }
+%    \end{macrocode}
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_sub_matrix:nnnnn #1 #2 #3 #4 #5
+  {
     \group_begin:
 %    \end{macrocode}
 % The four following token lists correspond to the position of the |\SubMatrix|.
@@ -17490,8 +17478,9 @@
 % It's now possible to specify delimiters for submatrices in the preamble of an
 % environment. 
 % 
+% The version 5.15b is compatible with the version 3.0+ of \pkg{siunitx}
+% (previous versions were not).
 %
-% \subsection*{Changes between versions 5.15 and 5.16}
 %
 % \PrintIndex
 % 

Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2021-06-05 21:11:50 UTC (rev 59478)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2021-06-05 21:12:03 UTC (rev 59479)
@@ -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{5.15a}
-\def\myfiledate{2021/05/06}
+\def\myfileversion{5.15b}
+\def\myfiledate{2021/06/05}
 \RequirePackage{pgfcore}
 \usepgfmodule{shapes}
 \RequirePackage{l3keys2e}
@@ -190,6 +190,50 @@
       { \bool_set_true:N \c__nicematrix_siunitx_loaded_bool }
       { }
   }
+\AtBeginDocument
+  {
+    \bool_if:nTF { ! \c__nicematrix_siunitx_loaded_bool }
+      { \cs_set_eq:NN \__nicematrix_renew_NC at rewrite@S: \prg_do_nothing: }
+      {
+        \cs_if_exist:NTF \siunitx_cell_begin:w
+          {
+            \cs_new_protected:Npn \__nicematrix_renew_NC at rewrite@S:
+              {
+                \renewcommand*{\NC at rewrite@S}[1][]
+                  {
+                    \@temptokena \exp_after:wN
+                      {
+                        \tex_the:D \@temptokena
+                        > {
+                            \__nicematrix_Cell:
+                            \keys_set:nn { siunitx } { ##1 }
+                            \siunitx_cell_begin:w
+                          }
+                        \__nicematrix_true_c:
+                        < { \siunitx_cell_end: \__nicematrix_end_Cell: }
+                      }
+                    \NC at find
+                  }
+              }
+          }
+          {
+            \cs_new_protected:Npn \__nicematrix_renew_NC at rewrite@S:
+              {
+                \renewcommand*{\NC at rewrite@S}[1][]
+                  {
+                    \@temptokena \exp_after:wN
+                      {
+                        \tex_the:D \@temptokena
+                        > { \__nicematrix_Cell: \c__nicematrix_table_collect_begin_tl S {##1} }
+                        \__nicematrix_true_c:
+                        < { \c__nicematrix_table_print_tl \__nicematrix_end_Cell: }
+                      }
+                    \NC at find
+                  }
+              }
+          }
+      }
+  }
 \cs_set_protected:Npn \__nicematrix_adapt_S_column:
   {
     \bool_if:NT \c__nicematrix_siunitx_loaded_bool
@@ -208,27 +252,6 @@
         \cs_gset_eq:NN \__nicematrix_adapt_S_column: \prg_do_nothing:
       }
   }
-\AtBeginDocument
-  {
-    \bool_if:nTF { ! \c__nicematrix_siunitx_loaded_bool }
-      { \cs_set_eq:NN \__nicematrix_renew_NC at rewrite@S: \prg_do_nothing: }
-      {
-        \cs_new_protected:Npn \__nicematrix_renew_NC at rewrite@S:
-          {
-            \renewcommand*{\NC at rewrite@S}[1][]
-              {
-                \@temptokena \exp_after:wN
-                  {
-                    \tex_the:D \@temptokena
-                    > { \__nicematrix_Cell: \c__nicematrix_table_collect_begin_tl S {##1} }
-                    \__nicematrix_true_c:
-                    < { \c__nicematrix_table_print_tl \__nicematrix_end_Cell: }
-                  }
-                \NC at find
-              }
-          }
-      }
-  }
 \regex_const:Nn \c__nicematrix_columncolor_regex { \c { columncolor } }
 \cs_new_protected:Npn \__nicematrix_provide_pgfsyspdfmark:
   {
@@ -2603,8 +2626,10 @@
     \tl_gclear:N \g__nicematrix_internal_code_after_tl
     \cs_set_eq:NN \CodeAfter \prg_do_nothing:
     \seq_gclear:N \g__nicematrix_submatrix_names_seq
+    % \bool_if:NT \l__nicematrix_NiceTabular_bool \c_math_toggle_token
     \exp_last_unbraced:NV \__nicematrix_CodeAfter_keys: \g_nicematrix_code_after_tl
     \scan_stop:
+    % \bool_if:NT \l__nicematrix_NiceTabular_bool \c_math_toggle_token
     \tl_gclear:N \g_nicematrix_code_after_tl
     \group_end:
     \tl_if_empty:NF \g_nicematrix_code_before_tl
@@ -5898,19 +5923,27 @@
   }
 \NewDocumentCommand \__nicematrix_SubMatrix_in_code_before { m m m m ! O { } }
   {
-    \__nicematrix_cut_on_hyphen:w #3 \q_stop
-    \tl_clear_new:N \l_tmpc_tl
-    \tl_clear_new:N \l_tmpd_tl
-    \tl_set_eq:NN \l_tmpc_tl \l_tmpa_tl
-    \tl_set_eq:NN \l_tmpd_tl \l_tmpb_tl
-    \__nicematrix_cut_on_hyphen:w #2 \q_stop
-    \seq_gput_right:Nx \g__nicematrix_submatrix_seq
-      { { \l_tmpa_tl } { \l_tmpb_tl } { \l_tmpc_tl } { \l_tmpd_tl } }
-    \tl_gput_right:Nn \g__nicematrix_internal_code_after_tl
-      { \SubMatrix { #1 } { #2 } { #3 } { #4 } [ #5 ] }
+    \peek_remove_spaces:n
+      {
+        \__nicematrix_cut_on_hyphen:w #3 \q_stop
+        \tl_clear_new:N \l_tmpc_tl
+        \tl_clear_new:N \l_tmpd_tl
+        \tl_set_eq:NN \l_tmpc_tl \l_tmpa_tl
+        \tl_set_eq:NN \l_tmpd_tl \l_tmpb_tl
+        \__nicematrix_cut_on_hyphen:w #2 \q_stop
+        \seq_gput_right:Nx \g__nicematrix_submatrix_seq
+          { { \l_tmpa_tl } { \l_tmpb_tl } { \l_tmpc_tl } { \l_tmpd_tl } }
+        \tl_gput_right:Nn \g__nicematrix_internal_code_after_tl
+          { \SubMatrix { #1 } { #2 } { #3 } { #4 } [ #5 ] }
+      }
   }
 \NewDocumentCommand \__nicematrix_SubMatrix { m m m m O { } }
   {
+    \peek_remove_spaces:n
+      { \__nicematrix_sub_matrix:nnnnn { #1 } { #2 } { #3 } { #4 }  { #5 } }
+   }
+\cs_new_protected:Npn \__nicematrix_sub_matrix:nnnnn #1 #2 #3 #4 #5
+  {
     \group_begin:
     \tl_clear_new:N \l__nicematrix_first_i_tl
     \tl_clear_new:N \l__nicematrix_first_j_tl



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