texlive[68940] Master/texmf-dist: nicematrix (22nov23)

commits+karl at tug.org commits+karl at tug.org
Wed Nov 22 22:51:01 CET 2023


Revision: 68940
          https://tug.org/svn/texlive?view=revision&revision=68940
Author:   karl
Date:     2023-11-22 22:51:00 +0100 (Wed, 22 Nov 2023)
Log Message:
-----------
nicematrix (22nov23)

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	2023-11-22 21:50:51 UTC (rev 68939)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex	2023-11-22 21:51:00 UTC (rev 68940)
@@ -2507,8 +2507,22 @@
 sept \\
 \end{NiceTabular}
 
+\subsection{La couleur spécial «nocolor»}
 
+\index{nocolor}
 
+\colorbox{yellow!50}{\textbf{Nouveau 6.26}}\enskip L'extension \pkg{nicematrix}
+propose la couleur spéciale |nocolor| utilisable dans toutes les commandes de
+coloriage fournies par \pkg{nicematrix} (dans le |\CodeBefore| ou bien dans le
+tableau proprement dit).
+
+Les cases marquées par cette couleur ne seront pas coloriées, quelles que soient
+les autres commandes de coloriage qui auraient pu s'appliquer à ces cases. 
+
+La couleur |nocolor| fournit donc un moyen commode de faire des exceptions à
+l'action d'une commande de coloriage générale.
+
+
 \section{La commande \textbackslash RowStyle}
 
 \label{RowStyle}

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	2023-11-22 21:50:51 UTC (rev 68939)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex	2023-11-22 21:51:00 UTC (rev 68940)
@@ -2442,6 +2442,21 @@
 \end{NiceTabular}
 
 
+\subsection{The special color ``nocolor''}
+
+\index{nocolor}
+
+\colorbox{yellow!50}{\textbf{New 6.26}}\enskip The extension \pkg{nicematrix}
+provides the special color |nocolor| which may be used in all the coloring
+commands provided by \pkg{nicematrix} (in the |\CodeBefore| or the array
+itself).
+
+The cells marked by this color won't be colored, whatever the other instructions
+of coloring which may apply to these cells.
+
+Therefore, the color |nocolor| is an easy way to add an exception to a more
+general coloring command.
+
 \section{The command \textbackslash RowStyle}
 
 \label{RowStyle}
@@ -7173,6 +7188,10 @@
 \nolinkurl{https:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty}
 }
 
+\subsection*{Changes between version 6.25 and 6.26}
+
+Special color |nocolor|.
+
 \subsection*{Changes between version 6.24 and 6.25}
 
 Correction of several bugs.

Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx	2023-11-22 21:50:51 UTC (rev 68939)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx	2023-11-22 21:51:00 UTC (rev 68940)
@@ -17,8 +17,8 @@
 %
 % \fi
 % \iffalse
-\def\myfileversion{6.25b}
-\def\myfiledate{2023/11/16}
+\def\myfileversion{6.26}
+\def\myfiledate{2023/11/22}
 %
 %
 %<*batchfile>  
@@ -770,14 +770,21 @@
   }
 %    \end{macrocode}
 % The classes of REVTeX do their own redefinition of |\array| and that's why the
-% previous mechanisme is not compatible with REVTeX. However, it would probably
+% previous mechanism is not compatible with REVTeX. However, it would probably
 % be possible to do something similar for REVTeX...
 %    \begin{macrocode}
-\bool_if:NTF \c_@@_revtex_bool
-  { \cs_new_protected:Npn \@@_redefine_mkpream: { } }
+\hook_gput_code:nnn { begindocument } { . }
   {
-    \cs_new_protected:Npn \@@_redefine_mkpream:
-      { \cs_set_eq:NN \@mkpream \@@_mkpream: }
+    \bool_if:NTF \c_@@_revtex_bool
+      { \cs_new_protected:Npn \@@_redefine_mkpream: { } }
+      {
+        \IfPackageLoadedTF { arydshln }
+          { \cs_new_protected:Npn \@@_redefine_mkpream: { } }
+          {
+            \cs_new_protected:Npn \@@_redefine_mkpream:
+              { \cs_set_eq:NN \@mkpream \@@_mkpream: }
+          }
+      }  
   }
 %    \end{macrocode}
 % 
@@ -1536,9 +1543,15 @@
 %    \end{macrocode}
 %
 % \medskip
-% For the vertical position, the possible values are |c|, |t| and |b|. Of
-% course, it would be interesting to program a key |T| and a key |B|.
+% If the final user has used the special color ``|nocolor|'', the following flag 
+% will be raised.
 %    \begin{macrocode}
+\bool_new:N \@@_nocolor_used_bool
+%    \end{macrocode}
+% 
+% \medskip
+% For the vertical position, the possible values are |c|, |t| and |b|. 
+%    \begin{macrocode}
 \str_new:N \l_@@_vpos_of_block_str
 \str_set:Nn \l_@@_vpos_of_block_str { c }
 %    \end{macrocode}
@@ -4145,6 +4158,12 @@
 \cs_new_protected:Npn \@@_exec_code_before:
   { 
     \seq_gclear_new:N \g_@@_colors_seq
+%    \end{macrocode}
+% The sequence |\g_@@_colors_seq| will always contain as first element the
+% special color |nocolor|: when that color is used, no color will be applied in
+% the corresponding cells by the other coloring commands of \pkg{nicematrix}.
+%    \begin{macrocode}
+    \@@_add_to_colors_seq:nn { { nocolor } } { } 
     \bool_gset_false:N \g_@@_recreate_cell_nodes_bool
     \group_begin:
 %    \end{macrocode}
@@ -10222,17 +10241,26 @@
     \@@_clip_with_rounded_corners:
     \seq_map_indexed_inline:Nn \g_@@_colors_seq
       {
-        \begin { pgfscope }
-          \@@_color_opacity ##2
-          \use:c { g_@@_color _ ##1 _tl }
-          \tl_gclear:c { g_@@_color _ ##1 _tl }
-          \pgfusepath { fill }
-        \end { pgfscope }
+        \int_compare:nNnTF { ##1 } = 1 
+          { 
+            \cs_set_eq:NN \@@_cartesian_path:n \@@_cartesian_path_nocolor:n 
+            \use:c { g_@@_color _ 1 _tl }
+            \cs_set_eq:NN \@@_cartesian_path:n \@@_cartesian_path_normal:n
+          }
+          {
+            \begin { pgfscope }
+              \@@_color_opacity ##2
+              \use:c { g_@@_color _ ##1 _tl }
+              \tl_gclear:c { g_@@_color _ ##1 _tl }
+              \pgfusepath { fill }
+            \end { pgfscope }
+         }
       }
     \endpgfpicture
   }
 %    \end{macrocode}
 %
+% 
 % \bigskip
 % The following command will extract the potential key |opacity| in its optional
 % argument (between square brackets) and (of course) then apply the command |\color|.
@@ -10603,15 +10631,18 @@
 % This command is in particular used in |\@@_rectanglecolor:nnn| (used in
 % |\@@_rectanglecolor|, itself used in |\@@_cellcolor|). 
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_cartesian_path:n #1 
+\cs_new_protected:Npn \@@_cartesian_path_normal:n #1 
   { 
-    \bool_lazy_and:nnT
-      { ! \seq_if_empty_p:N \l_@@_corners_cells_seq }
-      { \dim_compare_p:nNn { #1 } = \c_zero_dim }
+    \bool_lazy_any:nT
       {
-        \@@_expand_clist:NN \l_@@_cols_tl \c at jCol
-        \@@_expand_clist:NN \l_@@_rows_tl \c at iRow
+         { ! \seq_if_empty_p:N \l_@@_corners_cells_seq }
+         { \dim_compare_p:nNn { #1 } = \c_zero_dim }
+         { ! \@@_nocolor_used_bool }
       }
+      {
+       \@@_expand_clist:NN \l_@@_cols_tl \c at jCol
+       \@@_expand_clist:NN \l_@@_rows_tl \c at iRow
+      }   
 %    \end{macrocode}
 % We begin the loop over the columns.
 %    \begin{macrocode}
@@ -10672,9 +10703,13 @@
                 \@@_qpoint:n { row - \l_tmpa_tl }
                 \dim_set:Nn \l_@@_tmpd_dim { \pgf at y + 0.5 \arrayrulewidth }
                 \pgfsetcornersarced { \pgfpoint { #1 } { #1 } } 
-                \pgfpathrectanglecorners
-                  { \pgfpoint \l_@@_tmpc_dim \l_@@_tmpd_dim }
-                  { \pgfpoint \l_tmpa_dim \l_tmpb_dim } 
+                \cs_if_exist:cF 
+                  { @@ _ \l_tmpa_tl _ \l_@@_tmpc_tl _ nocolor }
+                  {
+                    \pgfpathrectanglecorners
+                      { \pgfpoint \l_@@_tmpc_dim \l_@@_tmpd_dim }
+                      { \pgfpoint \l_tmpa_dim \l_tmpb_dim } 
+                  }
               }
           }
       }
@@ -10691,6 +10726,30 @@
 %
 %
 % \bigskip
+% Despite its name, the following command does not create a PGF path. It
+% declares as colored by the ``empty color'' all the cells in what would be the
+% path. Hence, the other coloring instructions of \pkg{nicematrix} won't put
+% color in those cells.
+% the 
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_cartesian_path_nocolor:n #1 
+  { 
+    \bool_set_true:N \@@_nocolor_used_bool
+    \@@_expand_clist:NN \l_@@_cols_tl \c at jCol
+    \@@_expand_clist:NN \l_@@_rows_tl \c at iRow
+%    \end{macrocode}
+% We begin the loop over the columns.
+%    \begin{macrocode}
+    \clist_map_inline:Nn \l_@@_rows_tl
+      {
+        \clist_map_inline:Nn \l_@@_cols_tl 
+          { \cs_set:cpn { @@ _ ##1 _ ####1 _ nocolor } { } }
+      }
+  }
+%    \end{macrocode}
+% 
+%
+% \bigskip
 % The following command will be used only with |\l_@@_cols_tl| and |\c at jCol| (first
 % case) or with |\l_@@_rows_tl| and |\c at iRow| (second case). For instance, with
 % |\l_@@_cols_tl| equal to |2,4-6,8-*| and |\c at jCol| equal to |10|, the clist
@@ -12754,7 +12813,7 @@
   { 
 %    \end{macrocode}
 % If the first mandatory argument of the command (which is the size of the block
-% with the syntax $i$|-|$j$) has not be provided by the user, you use |1-1|
+% with the syntax $i$|-|$j$) has not been provided by the user, you use |1-1|
 % (that is to say a block of only one cell).
 %    \begin{macrocode}
     \peek_remove_spaces:n
@@ -15584,12 +15643,22 @@
                \fp_min:nn
                  {
                    \fp_min:nn 
-                     { \dim_ratio:nn { \g_@@_tmpd_dim } { \box_wd:N \l_tmpa_box } }
-                     { \dim_ratio:nn { \g_tmpb_dim } { \box_ht_plus_dp:N \l_tmpa_box } } 
+                     { 
+                       \dim_ratio:nn 
+                         { \g_@@_tmpd_dim } 
+                         { \box_wd:N \l_tmpa_box } 
+                     } 
+                     { 
+                       \dim_ratio:nn 
+                         { \g_tmpb_dim } 
+                         { \box_ht_plus_dp:N \l_tmpa_box } 
+                     } 
                  }
                  { 1.0 }
              }
-           \box_scale:Nnn \l_tmpa_box { \fp_use:N \l_tmpa_fp } { \fp_use:N \l_tmpa_fp }
+           \box_scale:Nnn \l_tmpa_box 
+             { \fp_use:N \l_tmpa_fp } 
+             { \fp_use:N \l_tmpa_fp }
            \pgfpicture
            \pgfrememberpicturepositiononpagetrue
            \pgf at relevantforpicturesizefalse
@@ -15680,8 +15749,8 @@
                \fp_min:nn
                  {
                    \fp_min:nn 
-                     { \dim_ratio:nn { \g_@@_tmpd_dim } { \box_wd:N \l_tmpa_box } }
-                     { \dim_ratio:nn { \g_tmpb_dim } { \box_ht_plus_dp:N \l_tmpa_box } } 
+                     { \dim_ratio:nn \g_@@_tmpd_dim { \box_wd:N \l_tmpa_box } }
+                     { \dim_ratio:nn \g_tmpb_dim { \box_ht_plus_dp:N \l_tmpa_box } } 
                  }
                  { 1.0 }
              }

Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2023-11-22 21:50:51 UTC (rev 68939)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2023-11-22 21:51:00 UTC (rev 68940)
@@ -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.25b}
-\def\myfiledate{2023/11/16}
+\def\myfileversion{6.26}
+\def\myfiledate{2023/11/22}
 \RequirePackage{pgfcore}
 \usepgfmodule{shapes}
 \RequirePackage{l3keys2e}
@@ -345,11 +345,18 @@
     \def\the at toks{\the\toks}
     \cs_gset_eq:NN \@mkpream \__nicematrix_old_mkpream:
   }
-\bool_if:NTF \c__nicematrix_revtex_bool
-  { \cs_new_protected:Npn \__nicematrix_redefine_mkpream: { } }
+\hook_gput_code:nnn { begindocument } { . }
   {
-    \cs_new_protected:Npn \__nicematrix_redefine_mkpream:
-      { \cs_set_eq:NN \@mkpream \__nicematrix_mkpream: }
+    \bool_if:NTF \c__nicematrix_revtex_bool
+      { \cs_new_protected:Npn \__nicematrix_redefine_mkpream: { } }
+      {
+        \IfPackageLoadedTF { arydshln }
+          { \cs_new_protected:Npn \__nicematrix_redefine_mkpream: { } }
+          {
+            \cs_new_protected:Npn \__nicematrix_redefine_mkpream:
+              { \cs_set_eq:NN \@mkpream \__nicematrix_mkpream: }
+          }
+      }
   }
 \cs_new_protected:Npn \__nicematrix_mkpream_colortbl: { }
 \hook_gput_code:nnn { begindocument } { . }
@@ -498,6 +505,7 @@
 \str_new:N \l__nicematrix_hpos_block_str
 \str_set:Nn \l__nicematrix_hpos_block_str { c }
 \bool_new:N \l__nicematrix_hpos_of_block_cap_bool
+\bool_new:N \__nicematrix_nocolor_used_bool
 \str_new:N \l__nicematrix_vpos_of_block_str
 \str_set:Nn \l__nicematrix_vpos_of_block_str { c }
 \bool_new:N \l__nicematrix_draw_first_bool
@@ -1773,6 +1781,7 @@
 \cs_new_protected:Npn \__nicematrix_exec_code_before:
   {
     \seq_gclear_new:N \g__nicematrix_colors_seq
+    \__nicematrix_add_to_colors_seq:nn { { nocolor } } { }
     \bool_gset_false:N \g__nicematrix_recreate_cell_nodes_bool
     \group_begin:
     \bool_if:NT \l__nicematrix_tabular_bool \c_math_toggle_token
@@ -5442,12 +5451,20 @@
     \__nicematrix_clip_with_rounded_corners:
     \seq_map_indexed_inline:Nn \g__nicematrix_colors_seq
       {
-        \begin { pgfscope }
-          \__nicematrix_color_opacity ##2
-          \use:c { g__nicematrix_color _ ##1 _tl }
-          \tl_gclear:c { g__nicematrix_color _ ##1 _tl }
-          \pgfusepath { fill }
-        \end { pgfscope }
+        \int_compare:nNnTF { ##1 } = 1
+          {
+            \cs_set_eq:NN \__nicematrix_cartesian_path:n \__nicematrix_cartesian_path_nocolor:n
+            \use:c { g__nicematrix_color _ 1 _tl }
+            \cs_set_eq:NN \__nicematrix_cartesian_path:n \__nicematrix_cartesian_path_normal:n
+          }
+          {
+            \begin { pgfscope }
+              \__nicematrix_color_opacity ##2
+              \use:c { g__nicematrix_color _ ##1 _tl }
+              \tl_gclear:c { g__nicematrix_color _ ##1 _tl }
+              \pgfusepath { fill }
+            \end { pgfscope }
+         }
       }
     \endpgfpicture
   }
@@ -5654,15 +5671,18 @@
       \prg_return_true:
       \prg_return_false:
   }
-\cs_new_protected:Npn \__nicematrix_cartesian_path:n #1
+\cs_new_protected:Npn \__nicematrix_cartesian_path_normal:n #1
   {
-    \bool_lazy_and:nnT
-      { ! \seq_if_empty_p:N \l__nicematrix_corners_cells_seq }
-      { \dim_compare_p:nNn { #1 } = \c_zero_dim }
+    \bool_lazy_any:nT
       {
-        \__nicematrix_expand_clist:NN \l__nicematrix_cols_tl \c at jCol
-        \__nicematrix_expand_clist:NN \l__nicematrix_rows_tl \c at iRow
+         { ! \seq_if_empty_p:N \l__nicematrix_corners_cells_seq }
+         { \dim_compare_p:nNn { #1 } = \c_zero_dim }
+         { ! \__nicematrix_nocolor_used_bool }
       }
+      {
+       \__nicematrix_expand_clist:NN \l__nicematrix_cols_tl \c at jCol
+       \__nicematrix_expand_clist:NN \l__nicematrix_rows_tl \c at iRow
+      }
     \clist_map_inline:Nn \l__nicematrix_cols_tl
       {
         \tl_set:Nn \l_tmpa_tl { ##1 }
@@ -5705,14 +5725,29 @@
                 \__nicematrix_qpoint:n { row - \l_tmpa_tl }
                 \dim_set:Nn \l__nicematrix_tmpd_dim { \pgf at y + 0.5 \arrayrulewidth }
                 \pgfsetcornersarced { \pgfpoint { #1 } { #1 } }
-                \pgfpathrectanglecorners
-                  { \pgfpoint \l__nicematrix_tmpc_dim \l__nicematrix_tmpd_dim }
-                  { \pgfpoint \l_tmpa_dim \l_tmpb_dim }
+                \cs_if_exist:cF
+                  { __nicematrix _ \l_tmpa_tl _ \l__nicematrix_tmpc_tl _ nocolor }
+                  {
+                    \pgfpathrectanglecorners
+                      { \pgfpoint \l__nicematrix_tmpc_dim \l__nicematrix_tmpd_dim }
+                      { \pgfpoint \l_tmpa_dim \l_tmpb_dim }
+                  }
               }
           }
       }
   }
 \cs_new_protected:Npn \__nicematrix_cartesian_path: { \__nicematrix_cartesian_path:n { 0 pt } }
+\cs_new_protected:Npn \__nicematrix_cartesian_path_nocolor:n #1
+  {
+    \bool_set_true:N \__nicematrix_nocolor_used_bool
+    \__nicematrix_expand_clist:NN \l__nicematrix_cols_tl \c at jCol
+    \__nicematrix_expand_clist:NN \l__nicematrix_rows_tl \c at iRow
+    \clist_map_inline:Nn \l__nicematrix_rows_tl
+      {
+        \clist_map_inline:Nn \l__nicematrix_cols_tl
+          { \cs_set:cpn { __nicematrix _ ##1 _ ####1 _ nocolor } { } }
+      }
+  }
 \cs_new_protected:Npn \__nicematrix_expand_clist:NN #1 #2
   {
     \clist_set_eq:NN \l_tmpa_clist #1
@@ -8806,12 +8841,22 @@
                \fp_min:nn
                  {
                    \fp_min:nn
-                     { \dim_ratio:nn { \g__nicematrix_tmpd_dim } { \box_wd:N \l_tmpa_box } }
-                     { \dim_ratio:nn { \g_tmpb_dim } { \box_ht_plus_dp:N \l_tmpa_box } }
+                     {
+                       \dim_ratio:nn
+                         { \g__nicematrix_tmpd_dim }
+                         { \box_wd:N \l_tmpa_box }
+                     }
+                     {
+                       \dim_ratio:nn
+                         { \g_tmpb_dim }
+                         { \box_ht_plus_dp:N \l_tmpa_box }
+                     }
                  }
                  { 1.0 }
              }
-           \box_scale:Nnn \l_tmpa_box { \fp_use:N \l_tmpa_fp } { \fp_use:N \l_tmpa_fp }
+           \box_scale:Nnn \l_tmpa_box
+             { \fp_use:N \l_tmpa_fp }
+             { \fp_use:N \l_tmpa_fp }
            \pgfpicture
            \pgfrememberpicturepositiononpagetrue
            \pgf at relevantforpicturesizefalse
@@ -8899,8 +8944,8 @@
                \fp_min:nn
                  {
                    \fp_min:nn
-                     { \dim_ratio:nn { \g__nicematrix_tmpd_dim } { \box_wd:N \l_tmpa_box } }
-                     { \dim_ratio:nn { \g_tmpb_dim } { \box_ht_plus_dp:N \l_tmpa_box } }
+                     { \dim_ratio:nn \g__nicematrix_tmpd_dim { \box_wd:N \l_tmpa_box } }
+                     { \dim_ratio:nn \g_tmpb_dim { \box_ht_plus_dp:N \l_tmpa_box } }
                  }
                  { 1.0 }
              }



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