texlive[63912] Master/texmf-dist: nicematrix (16jul22)

commits+karl at tug.org commits+karl at tug.org
Sat Jul 16 21:53:27 CEST 2022


Revision: 63912
          http://tug.org/svn/texlive?view=revision&revision=63912
Author:   karl
Date:     2022-07-16 21:53:27 +0200 (Sat, 16 Jul 2022)
Log Message:
-----------
nicematrix (16jul22)

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	2022-07-16 19:53:10 UTC (rev 63911)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex	2022-07-16 19:53:27 UTC (rev 63912)
@@ -463,7 +463,7 @@
 option à mettre entre chevrons est proposée par |\Block| pour spécifier du code
 LaTeX qui sera inséré \emph{avant} le début du mode mathématique.\footnote{Cet
   argument entre chevrons peut aussi être utilisé pour insérer une commande de
-  fonte comme |\bfseries|, ce qui peut être utilie dans le cas où la commande |\\| apparaît dans le
+  fonte comme |\bfseries|, ce qui peut être utile dans le cas où la commande |\\| apparaît dans le
   contenu du bloc.}
 
 \medskip
@@ -523,7 +523,9 @@
 \item la clé |color| prend en argument une couleur et l'applique au contenu et
 trace également le cadre avec cette couleur ;
 \item les clés |hlines|, |vlines| et |hvlines| tracent les filets correspondants
-dans le bloc ;
+dans le bloc\footnote{Néanmoins, les filets ne sont pas tracés dans les
+  sous-blocs du bloc, conformément à l'esprit de \pkg{nicematrix}: les filets ne
+sont pas tracés dans les blocs (cf. section~\ref{rules} p.~\pageref{rules}).} ;
 \item la clé |line-width| fixe la largeur utilisée pour tracer les filets (n'a
 d'intérêt que si |draw|, |hvlines|, |hlines| ou |vlines| est utilisée) ;
 \item la clé |rounded-corners| impose des coins arrondis (pour le cadre dessiné
@@ -754,6 +756,7 @@
 il faut utiliser les clés |L|, |R| et |C| de la commande |\Block|.
 
 \section{Les filets horizontaux et verticaux}
+\label{rules}
 
 Les techniques habituelles pour tracer des filets peuvent être utilisées dans
 les environnements de \pkg{nicematrix}, à l'exception de |\vline|. Il y a
@@ -1139,8 +1142,7 @@
 
 La commande |\diagbox| (inspirée par l'extension \pkg{diagbox}) permet, quand
 elle est utilisée dans une case, de couper cette case selon une diagonale
-descendante.\footnote{L'auteur de ce document considère que ce type de
-  construction est un piètre choix graphique.}
+descendante.
 
 \medskip
 \begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1179,6 +1181,16 @@
 qui sera créée par \pkg{nicematrix} et que l'utilisateur pourra utiliser pour
 tracer des filets horizontaux (de manière similaire à |\hline|) ; 
 
+\item \colorbox{yellow!50}{\textbf{Nouveau 6.11}}\enskip la clé |ccommand|
+indique le nom (sans la contre-oblique) d'une commande qui sera créée par
+\pkg{nicematrix} et que l'utilisateur pourra utiliser pour tracer des filets
+horizontaux partiels (de manière similaire à |\cline|, d'où le nom |ccommand|) :
+l'argument de cette commande est une liste d'intervalles de colonnes spécifiés
+par la syntaxe $i$ ou $i$-$j$ ;\footnote{Il est recommandé de n'utiliser ces
+  commandes qu'une seule fois par ligne car chaque utilisation crée un espace
+  vertical entre les rangées correspondant à la largeur totale du trait qui sera
+  tracé.}
+
 \item la clé |letter| prend en argument une lettre\footnote{Les lettres
   suivantes ne sont pas autorisées : \verb+lcrpmbVX|()[]!@<>+} qui pourra être
 utilisée par l'utilisateur dans le préambule d'un environnement à préambule
@@ -1209,7 +1221,7 @@
 
 \medskip
 Ce système permet en particulier de définir des commandes pour tracer des filets
-avec une couleur spécifique (et ces filets respecteront les blocs et les coinn
+avec une couleur spécifique (et ces filets respecteront les blocs et les coins
 comme les autres filets de \pkg{nicematrix}).
 
 \medskip
@@ -1249,11 +1261,11 @@
 qui doit être une liste de couples \textsl{clé=valeur} applicables à un chemin
 Tikz.
 
-Par défaut aucune réservation de place n'est faite par défaut pour le filet qui
-sera tracé avec Tikz. On peut demander une réservation (horizontale pour un
-filet vertical et verticale pour un filet horizontal) avec la clé |total-width| qui
-est donc en quelque sorte la largeur du filet qui sera tracé (cette largeur
-n'est pas calculée à partir des caractéristiques fournies par la clé |tikz|).
+Par défaut aucune réservation de place n'est faite pour le filet qui sera tracé
+avec Tikz. On peut demander une réservation (horizontale pour un filet vertical
+et verticale pour un filet horizontal) avec la clé |total-width| qui est donc en
+quelque sorte la largeur du filet qui sera tracé (cette largeur n'est \emph{pas}
+calculée à partir des caractéristiques fournies par la clé |tikz|).
 
 \bigskip
 Voici ce que l'on obtient avec la clé |dotted| de Tikz.
@@ -1308,10 +1320,11 @@
 p.~\pageref{Cdots}).
 
 \medskip
-L'extension \pkg{nicematrix} prédéfinit en fait la commande |\hdottedline| et la
-lettre «|:|» pour ces filets en pointillés.\footnote{Néanmoins, l'utilisateur peut écraser ces définitions de |\hdottedline| et de
-«|:|» avec |custom-line| s'il le souhaite (par exemple pour les remplacer par des
-lignes en tiretés).}
+L'extension \pkg{nicematrix} prédéfinit en fait les commandes |\hdottedline| et
+|\cdottedline| et la lettre «|:|» pour ces filets en
+pointillés.\footnote{Néanmoins, l'utilisateur peut écraser ces définitions de
+  |\hdottedline|, |\cdottedline| et de «|:|» avec |custom-line| s'il le souhaite
+  (par exemple pour les remplacer par des lignes en tiretés).}
 
 \smallskip
 \begin{BVerbatim}
@@ -1322,6 +1335,7 @@
       { 
         letter = : , 
         command = hdottedline , 
+        ccommand = cdottedline ,
         dotted 
       }
   } 
@@ -1328,8 +1342,9 @@
 \end{BVerbatim}
 
 \bigskip
-Dans les environnements de \pkg{nicematrix}, il est donc possible d'utiliser la
-commande |\hdottedline| pour tracer des filets horizontaux en pointillés.
+Dans les environnements de \pkg{nicematrix}, il est donc possible d'utiliser les
+commandes |\hdottedline| et |\cdottedline| pour tracer des filets horizontaux en
+pointillés. 
 
 \medskip
 \begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
@@ -1337,6 +1352,7 @@
 1 & 2 & 3 & 4 & 5 \\
 ~emphase#\hdottedline@
 6 & 7 & 8 & 9 & 10 \\
+ emphase#\cdottedline{1,4-5}@
 11 & 12 & 13 & 14 & 15
 \end{pNiceMatrix}
 \end{BVerbatim}
@@ -1344,6 +1360,7 @@
 1 & 2 & 3 & 4 & 5 \\
 \hdottedline
 6 & 7 & 8 & 9 & 10 \\
+\cdottedline{1,4-5}
 11 & 12 & 13 & 14 & 15
 \end{pNiceMatrix}$
 
@@ -1638,7 +1655,7 @@
 
 \medskip
 La commande |\rowcolors| accepte une liste de couples \textsl{clé=valeur} comme
-argument optionnel en dernière position (l'argument optionel en première
+argument optionnel en dernière position (l'argument optionnel en première
 position correspond à l'espace colorimétrique). Les clés disponibles sont
 |cols|, |restart| et |respect-blocks|.
 \begin{itemize}
@@ -2216,7 +2233,8 @@
   spécificateurs de colonne |X|).}
 
 
-Comme avec les extensions \pkg{tabu} et \pkg{tabularray}, le spécificateur |X|
+Comme avec les extensions \pkg{tabu}\footnote{L'extension \pkg{tabu} est
+  maintenant considérée comme obsolète.} et \pkg{tabularray}, le spécificateur |X|
 accepte entre crochets un argument optionnel qui est une liste de clés.
 \begin{itemize}
 \item On peut spécifier un poids pour la colonne en mettant directement un
@@ -2309,7 +2327,7 @@
 manières le chargement complet du contenu de l'environnement (d'où
 l'impossibilité de mettre du verbatim dans ce cas-là) avant composition du
 tableau. L'analyse du contenu de l'environnement donne le nombre de rangées
-(mais pas le nombre de colonnes).
+et de colonnes.
 
 \item Dans les autres cas, \pkg{nicematrix} détermine le nombre de rangées et de
 colonnes à la première compilation et l'écrit dans le fichier |aux| pour
@@ -2395,7 +2413,7 @@
 \label{Cdots}
 
 À l'intérieur des environnements de l'extension \pkg{nicematrix}, de nouvelles
-commandes sont définies : |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, et |\Iddots|.
+commandes sont définies : |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots| et |\Iddots|.
 Ces commandes sont conçues pour être utilisées à la place de |\dots|, |\cdots|,
 |\vdots|, |\ddots| et |\iddots|.\footnote{La commande |\iddots|, définie par
   \pkg{nicematrix}, est une variante de |\ddots| avec les points allant vers le
@@ -2414,7 +2432,7 @@
 avec l'option~|color|.\footnote{Il est aussi possible de changer la couleur de
   toutes ces lignes pointillées avec l'option |xdots/color| (\textsl{xdots} pour
   rappeler que cela s'applique à |\Cdots|, |\Ldots|, |\Vdots|, etc.) : cf.
-  p.~\pageref{customization}). }\par\nobreak
+  p.~\pageref{customization}. }\par\nobreak
 
 \medskip
 \begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -2478,11 +2496,11 @@
 
 \medskip
 Dans la première colonne de cet exemple, il y a deux instructions |\Vdots| mais,
-bien entendu, une seule ligne en pointillés sera.
+bien entendu, une seule ligne en pointillés sera tracée.
 
 \medskip
 En fait, dans cet exemple, il aurait été possible de tracer la même matrice plus
-rapidement avec le codage suivant :\par\nobreak
+rapidement avec le codage suivant (parmi d'autres) :\par\nobreak
 
 \medskip
 \begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -2704,8 +2722,8 @@
 \pkg{nicematrix} sans avoir à modifier chaque matrice. Pour cela,
 \pkg{nicematrix} propose deux options |renew-dots| et
 |renew-matrix|.\footnote{Comme toutes les autres options, les options
-  |renew-dots|, |renew-matrix| peuvent être fixées avec la commande
-  |\NiceMatrixOptions|, mais elles peuvent aussi être passées en option du
+  |renew-dots| et |renew-matrix| peuvent être fixées avec la commande
+  |\NiceMatrixOptions|, mais ces deux options-là peuvent aussi être passées en option du
   |\usepackage|.}
 
 \smallskip
@@ -2799,7 +2817,7 @@
 \item |xdots/color| ;
 \item |xdots/radius| ;
 \item |xdots/shorten-start|, |xdots/shorten-end| et |xdots/shorten| ;
-\item |inter| ; 
+\item |xdots/inter| ; 
 \item |xdots/line-style|.
 \end{itemize}
 %
@@ -2854,8 +2872,12 @@
   lignes en tiretés, qui, puisqu'il est incorporé dans le \textsc{pdf}, est
   affiché très rapidement par les lecteurs de \textsc{pdf}. Il est facile à
   partir de ce type de ligne de créer des lignes de points carrés alors qu'une
-  ligne de points ronds doit être construite explicitement point par point.}
+  ligne de points ronds doit être construite explicitement point par point. Voir
+néanmoins à l'adresse suivante pour un moyen d'avoir un style de pointillés
+ronds avec Tikz :\newline \small
+\url{https://tex.stackexchange.com/questions/52848/tikz-line-with-large-dots}}
 
+
 \begin{BVerbatim}[baseline=c,boxwidth=9cm]
 \tikz \draw [dotted] (0,0) -- (5,0) ;
 \end{BVerbatim}
@@ -3713,15 +3735,19 @@
 
 
 
-\subsection{Option d'alignement dans \{NiceMatrix\}}
+\subsection{Colonne par défaut dans \{NiceMatrix\}}
 
 \label{key-R}
 
-Les environnements sans préambule (|{NiceMatrix}|, |{pNiceMatrix}|,
-|{bNiceMatrix}|, etc.) proposent les options |l| et |r| qui imposent des
-colonnes alignées à gauche ou à droite.
+\colorbox{yellow!50}{\textbf{Nouveau 6.11}}\enskip Les environnements sans
+préambule (|{NiceMatrix}|, |{pNiceMatrix}|, etc.) ainsi que la commande
+|\pAutoNiceMatrix| et ses variantes, acceptent la clé |columns-type| qui indique
+le type des colonne qui sera utilisé.
 
 \medskip
+Les clés |l| et |r| sont des raccourcis pour |columns-type=l| et |columns-type=r|.
+
+\medskip
 \begin{BVerbatim}[baseline=c,boxwidth=10cm]
 $\begin{bNiceMatrix}[r]
 \cos x & - \sin x \\
@@ -3734,7 +3760,11 @@
 \end{bNiceMatrix}$
 
 
+\medskip
+La clé |columns-type| peut être utilisée dans |\NiceMatrixOptions| à condition
+de la préfixer par |matrix|, ce qui fait que son nom devient |matrix/columns-type|.
 
+
 \subsection{La commande \textbackslash rotate}
 
 \label{rotate}
@@ -3905,6 +3935,8 @@
 \end{Verbatim}
 
 
+
+
 \[C = \pAutoNiceMatrix{3-3}{C_{\arabic{iRow},\arabic{jCol}}}\]
 
 
@@ -3946,13 +3978,14 @@
 
 \medskip
 Lorsque l'option |light-syntax| est utilisée, il n'est pas possible de mettre
-d'éléments en verbatim (avec par exemple la commande
-|\verb|) dans les cases du tableau.\footnote{La raison en est que lorsque l'option |light-syntax|
+d'éléments en verbatim (avec par exemple la commande |\verb|) 
+dans les cases du tableau.\footnote{La raison en est que lorsque l'option |light-syntax|
   est utilisée, le contenu complet de l'environnement est chargé comme un
   argument de commande TeX. L'environnement ne se comporte plus comme un «vrai»
   environnement de LaTeX qui se contente d'insérer des commandes avant et
   après.}
 
+
 \subsection{Couleur des délimiteurs}
 
 Pour les environnements avec délimiteurs (|{pNiceArray}|, |{pNiceMatrix}|,
@@ -5703,9 +5736,9 @@
 %
 \[\begin{NiceArray}{*{6}{c}@{\hspace{6mm}}*{5}{c}}[nullify-dots]
 \CodeBefore [create-cell-nodes]
-  \SubMatrix({2-7}{6-11})
-  \SubMatrix({7-2}{11-6})
-  \SubMatrix({7-7}{11-11})
+  \SubMatrix({2-7}{6-last})
+  \SubMatrix({7-2}{last-6})
+  \SubMatrix({7-7}{last-last})
   \begin{tikzpicture}
     \node [highlight = (9-2) (9-6)] { } ;
     \node [highlight = (2-9) (6-9)] { } ;
@@ -5740,9 +5773,9 @@
 \begin{Verbatim}[formatcom = \small\color{gray}]
 \[\begin{NiceArray}{*{6}{c}~LetterAt{\hspace{6mm}}*{5}{c}}[nullify-dots]
 \CodeBefore [create-cell-nodes]
-  \SubMatrix({2-7}{6-11})
-  \SubMatrix({7-2}{11-6})
-  \SubMatrix({7-7}{11-11})
+  \SubMatrix({2-7}{6-last})
+  \SubMatrix({7-2}{last-6})
+  \SubMatrix({7-7}{last-last})
   \begin{tikzpicture}
     \node [highlight = (9-2) (9-6)] { } ;
     \node [highlight = (2-9) (6-9)] { } ;

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	2022-07-16 19:53:10 UTC (rev 63911)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx	2022-07-16 19:53:27 UTC (rev 63912)
@@ -15,8 +15,8 @@
 %
 % \fi
 % \iffalse
-\def\myfileversion{6.10a}
-\def\myfiledate{2022/06/26}
+\def\myfileversion{6.11}
+\def\myfiledate{2022/07/16}
 %
 %
 %<*batchfile>
@@ -267,13 +267,13 @@
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=9cm]
 % $\begin{pmatrix}
-% \frac12 & -\frac12 \\
-% \frac13 & \frac14 \\
+% \frac{1}{2} & -\frac{1}{2} \\
+% \frac{1}{3} & \frac{1}{4} \\
 % \end{pmatrix}$
 % \end{BVerbatim}
 % $\begin{pmatrix}
-% \frac12 & -\frac12 \\
-% \frac13 & \frac14 \\
+% \frac{1}{2} & -\frac{1}{2} \\
+% \frac{1}{3} & \frac{1}{4} \\
 % \end{pmatrix}$
 % 
 % \bigskip
@@ -565,7 +565,9 @@
 % \item the key |color| takes in as value a color and apply that color the
 % content of the block but draws also the frame of the block with that color;
 % \item the keys |hlines|, |vlines| and |hvlines| draw all the corresponding
-% rules in the block;
+% rules in the block;\footnote{However, the rules are not drawn in the
+% sub-blocks of the block, as always with \pkg{nicematrix}: the rules are not
+% drawn in the blocks (cf. section~\ref{rules} p.~\pageref{rules}).}
 % \item the key |line-width| is the width of the rules (this key
 % is meaningful only when one of the keys |draw|, |hvlines|, |vlines| and
 % |hlines| is used);
@@ -789,6 +791,8 @@
 %
 %
 % \section{The rules}
+%
+% \label{rules}
 % 
 % The usual techniques for the rules may be used in the environments of
 % \pkg{nicematrix} (excepted |\vline|). However, there is some small differences
@@ -1153,9 +1157,7 @@
 % \subsection{The command \textbackslash diagbox}
 %
 % The command |\diagbox| (inspired by the package \pkg{diagbox}), allows, when
-% it is used in a cell, to slash that cell diagonally downwards.\footnote{The
-% author of this document considers that type of construction as graphically
-% poor.}.
+% it is used in a cell, to slash that cell diagonally downwards.
 %
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1191,10 +1193,19 @@
 % will be used to use that new type of rule.
 % 
 % \begin{itemize}
-% \item the key |command| is the name (without the backslahs) of a command that
+% \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 \colorbox{yellow!50}{\textbf{New 6.11}}\enskip the key |cccommand| 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
 % letters are forbidden: \verb+lcrpmbVX|()[]!@<>+} that the user will use in
 % the preamble of an environment with preamble (such as |{NiceTabular}| in order
@@ -1319,27 +1330,28 @@
 % dotted rules are also used by \pkg{nicematrix} to draw continuous dotted rules
 % between cells of the matrix with |\Cdots|, |\Vdots|, etc. (cf. p.~\pageref{Cdots}).
 %
-% In fact, \pkg{nicematrix} defines by default the command |\hdottedline| and the
-% letter ``|:|'' for those dotted rules.\footnote{However, it's possible to
-% overwrite those definitions with a |custom-line| (in order, for example, to
-% switch to dashed lines).}
+% In fact, \pkg{nicematrix} defines by default the commands |\hdottedline| and
+% |\cdottedline |and the letter ``|:|'' for those dotted
+% rules.\footnote{However, it's possible to overwrite those definitions with a
+% |custom-line| (in order, for example, to switch to dashed lines).}
 %
 %\smallskip
 %\begin{BVerbatim}
 % 
-% \NiceMatrixOptions % ~textsl#présent dans nicematrix.sty@
+% \NiceMatrixOptions % ~textsl#present in nicematrix.sty@
 %   { 
 %     custom-line = 
 %       { 
 %         letter = : , 
 %         command = hdottedline , 
+%         ccommand = cdottedline ,
 %         ~emphase#dotted@ 
 %       }
 %   } 
 % \end{BVerbatim}
 %
-% Thus, it's possible to use the command |\hdottedline| to draw a horizontal
-% dotted rule.
+% Thus, it's possible to use the commands |\hdottedline| and |\cdottedline |to
+% draw horizontal dotted rules.
 %
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
@@ -1347,6 +1359,7 @@
 % 1 & 2 & 3 & 4 & 5 \\
 % ~emphase#\hdottedline@
 % 6 & 7 & 8 & 9 & 10 \\
+%  emphase#\cdottedline{1,4-5}@
 % 11 & 12 & 13 & 14 & 15 
 % \end{pNiceMatrix}
 % \end{BVerbatim}
@@ -1354,6 +1367,7 @@
 % 1 & 2 & 3 & 4 & 5 \\
 % \hdottedline
 % 6 & 7 & 8 & 9 & 10 \\
+% \cdottedline{1,4-5}
 % 11 & 12 & 13 & 14 & 15 
 % \end{pNiceMatrix}$
 %
@@ -2198,7 +2212,8 @@
 % columns |X| (this point comes from a conflict in the definitions of the
 % specifier |X|).}
 %
-% As with the packages \pkg{tabu} and \pkg{tabularray}, the specifier |X| takes
+% As with the packages \pkg{tabu}\footnote{The extension \pkg{tabu} is now
+% considered as deprecated.} and \pkg{tabularray}, the specifier |X| takes
 % in an optional argument (between square brackets) which is a list of keys.
 % \begin{itemize}
 % \item It's possible to give a weight for the column by providing a positive
@@ -2288,7 +2303,7 @@
 % \pkg{nicematrix} has, in any case, to load the whole body of the environment
 % (and that's why it's not possible to put verbatim material in the array with
 % the option |light-syntax|). The analysis of this whole body gives the number
-% of rows (but not the number of columns).
+% of rows and the number of columns.
 %
 % \item In the other cases, \pkg{nicematrix} compute the number of rows and
 % columns during the first compilation and write the result in the |aux| file
@@ -2820,7 +2835,10 @@
 % descriptor are displayed very efficiently by the \textsc{pdf} readers. It's
 % easy, starting from these dashed lines,
 % to create a line composed by square dots whereas a line of rounded dots needs
-% a specification of each dot in the \textsc{pdf} file.}
+% a specification of each dot in the \textsc{pdf} file. Nevertheless, you can
+% have a look at the following page to see how to have dotted rules with rounded
+% dots in Tikz:\newline \small
+% \url{https://tex.stackexchange.com/questions/52848/tikz-line-with-large-dots}}
 % 
 % \begin{BVerbatim}[baseline=c,boxwidth=9cm]
 % \tikz \draw [dotted] (0,0) -- (5,0) ;
@@ -3669,13 +3687,17 @@
 % supported by \pkg{nicematrix}.
 %
 %
-% \subsection{Alignment option in \{NiceMatrix\}}
+% \subsection{Default column type in \{NiceMatrix\}}
 %
 % \label{key-R}
 %
-% The environments without preamble (|{NiceMatrix}|, |{pNiceMatrix}|,
-% |{bNiceMatrix}|, etc.) provide two options |l| and |r| which generate all the
-% columns aligned leftwards (or rightwards).
+% \colorbox{yellow!50}{\textbf{New 6.11}}\enskip The environments without
+% preamble (|{NiceMatrix}|, |{pNiceMatrix}|, |{bNiceMatrix}|, etc.) and the
+% commande |\pAutoNiceMatrix| (and its variants) provide an option
+% |columns-type| to specify the type of column which will be used (the initial
+% value is, of course, |c|).
+%
+% The keys |l| and |r| are shortcuts for |columns-type=l| and |columns-type=r|.
 % 
 %
 % \medskip
@@ -3690,6 +3712,10 @@
 % \sin x & \cos x 
 % \end{bNiceMatrix}$
 %
+% \medskip
+% The key |columnts-type| is available in |\NiceMatrixOptions| but with the
+% prefix |matrix|, which means that its name is, within |\NiceMatrixOptions| :
+% |matrix/columns-type|. 
 %
 % \subsection{The command \textbackslash rotate}
 %
@@ -3867,7 +3893,7 @@
 % \[C = \pAutoNiceMatrix{3-3}{C_{\arabic{iRow},\arabic{jCol}}}\]
 %
 %
-% \subsection{The option light-syntax}
+% \subsection{The key light-syntax}
 %
 % \label{light-syntax}
 % The option |light-syntax| (inpired by the package \pkg{spalign}) allows the
@@ -3907,11 +3933,11 @@
 % the whole content of the environment is loaded as a TeX argument to be
 % analyzed. The environment doesn't behave in that case as a standard
 % environment of LaTeX which only put TeX commands before and after the content.}
-% 
 %
+%
 % \subsection{Color of the delimiters}
 %
-% For the environements with delimiters (|{pNiceArray}|, |{pNiceMatrix}|, etc.),
+% For the environments with delimiters (|{pNiceArray}|, |{pNiceMatrix}|, etc.),
 % it's possible to change the color of the delimiters with the key
 % |delimiters/color|.
 %
@@ -5617,9 +5643,9 @@
 %                            fit=#1}}%
 % \[\begin{NiceArray}{*{6}{c}@{\hspace{6mm}}*{5}{c}}[nullify-dots]
 % \CodeBefore [create-cell-nodes]
-%   \SubMatrix({2-7}{6-11})
-%   \SubMatrix({7-2}{11-6})
-%   \SubMatrix({7-7}{11-11})
+%   \SubMatrix({2-7}{6-last})
+%   \SubMatrix({7-2}{last-6})
+%   \SubMatrix({7-7}{last-last})
 %   \begin{tikzpicture}
 %     \node [highlight = (9-2) (9-6)] { } ; 
 %     \node [highlight = (2-9) (6-9)] { } ;
@@ -5654,9 +5680,9 @@
 % \begin{Verbatim}[formatcom = \small\color{gray}]
 % \[\begin{NiceArray}{*{6}{c}~LetterAt{\hspace{6mm}}*{5}{c}}[nullify-dots]
 % \CodeBefore [create-cell-nodes]
-%   \SubMatrix({2-7}{6-11})
-%   \SubMatrix({7-2}{11-6})
-%   \SubMatrix({7-7}{11-11})
+%   \SubMatrix({2-7}{6-last})
+%   \SubMatrix({7-2}{last-6})
+%   \SubMatrix({7-7}{last-last})
 %   \begin{tikzpicture}
 %     \node [highlight = (9-2) (9-6)] { } ; 
 %     \node [highlight = (2-9) (6-9)] { } ;
@@ -5767,9 +5793,17 @@
       { \msg_new:nnn { nicematrix } { #1 } { #2 \\ #3 } }
       { \msg_new:nnnn { nicematrix } { #1 } { #2 } { #3 } }
   }
-
 %    \end{macrocode}
+%
+% We try to detect whether the compilation is done on Overleaf. We use
+% |\c_sys_jobname_str| because, with Overleaf, the value of |\c_sys_jobname_str|
+% is always ``|output|''.
+%    \begin{macrocode}
+\str_if_eq:VnT \c_sys_jobname_str { output } 
+  { \bool_set_true:N \c_@@_messages_for_Overleaf_bool }
+%    \end{macrocode}
 % 
+% \bigskip 
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_msg_redirect_name:nn 
   { \msg_redirect_name:nnn { nicematrix } }
@@ -5784,7 +5818,7 @@
 %    \end{macrocode}
 % 
 %   \begin{macrocode}
-\cs_generate_variant:Nn \seq_gset_split:Nnn { N V n }
+\cs_generate_variant:Nn \seq_set_split:Nnn { N V n }
 \cs_generate_variant:Nn \keys_define:nn { n x }
 %    \end{macrocode}
 %
@@ -5973,7 +6007,7 @@
 % Idem for |\CT at drs@|.
 %    \begin{macrocode}
         \cs_set:Npn \doublerulesepcolor #1 # { \CT at drs { #1 } }
-        \cs_set:Npn\CT at drs #1 #2 
+        \cs_set:Npn \CT at drs #1 #2 
           {
             \dim_compare:nNnT \baselineskip = \c_zero_dim \noalign 
               { \cs_gset:Npn \CT at drsc@ { \color #1 { #2 } } }
@@ -6086,25 +6120,52 @@
 %
 % \bigskip
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_set_CT at arc@:
-  { \peek_meaning:NTF [ \@@_set_CT at arc@_i: \@@_set_CT at arc@_ii: }
-\cs_new_protected:Npn \@@_set_CT at arc@_i: [ #1 ] #2 \q_stop
-  { \cs_set:Npn \CT at arc@ { \color [ #1 ] { #2 } } }
-\cs_new_protected:Npn \@@_set_CT at arc@_ii: #1 \q_stop
-  { \cs_set:Npn \CT at arc@ { \color { #1 } } }
+\cs_new_protected:Npn \@@_set_CT at arc@:n #1 
+  { 
+    \tl_if_blank:nF { #1 }
+      {
+        \tl_if_head_eq_meaning:nNTF { #1 } [
+          { \cs_set:Npn \CT at arc@ { \color #1 } }
+          { \cs_set:Npn \CT at arc@ { \color { #1 } } }
+      }
+  }
+\cs_generate_variant:Nn \@@_set_CT at arc@:n { V }
 %    \end{macrocode}
 % 
 % \bigskip
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_set_CT at drsc@:
-  { \peek_meaning:NTF [ \@@_set_CT at drsc@_i: \@@_set_CT at drsc@_ii: }
-\cs_new_protected:Npn \@@_set_CT at drsc@_i: [ #1 ] #2 \q_stop
-  { \cs_set:Npn \CT at drsc@ { \color [ #1 ] { #2 } } }
-\cs_new_protected:Npn \@@_set_CT at drsc@_ii: #1 \q_stop
-  { \cs_set:Npn \CT at drsc@ { \color { #1 } } }
+\cs_new_protected:Npn \@@_set_CT at drsc@:n #1 
+  { 
+    \tl_if_head_eq_meaning:nNTF { #1 } [
+      { \cs_set:Npn \CT at drsc@ { \color #1 } }
+      { \cs_set:Npn \CT at drsc@ { \color { #1 } } }
+  }
+\cs_generate_variant:Nn \@@_set_CT at drsc@:n { V }
 %    \end{macrocode}
 % 
+% \bigskip
+% The following command must \emph{not} be protected since it will be used to
+% write instructions in the (internal) |\CodeBefore|.
+%    \begin{macrocode}
+\cs_new:Npn \@@_exp_color_arg:Nn #1 #2
+  {
+    \tl_if_head_eq_meaning:nNTF { #2 } [
+      { #1 #2 }
+      { #1 { #2 } } 
+  }
+\cs_generate_variant:Nn \@@_exp_color_arg:Nn { N V }
+%    \end{macrocode}
 % 
+% The following command must be protected because of its use of the command |\color|.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_color:n #1 
+  {
+    \tl_if_blank:nF { #1 }
+      { \@@_exp_color_arg:Nn \color { #1 } }
+  }
+\cs_generate_variant:Nn \@@_color:n { V }
+%    \end{macrocode}
+% 
 % \bigskip
 %    \begin{macrocode}
 \cs_set_eq:NN \@@_old_pgfpointanchor \pgfpointanchor
@@ -6266,7 +6327,7 @@
 %    \end{macrocode}
 %
 % \bigskip
-% Idem pour the mono-row blocks.
+% Idem for the mono-row blocks.
 %    \begin{macrocode}
 \dim_new:N \g_@@_blocks_ht_dim
 \dim_new:N \g_@@_blocks_dp_dim
@@ -6304,9 +6365,9 @@
 % 
 % \bigskip
 % If the user uses |{NiceArray}| or |{NiceTabular}| the flag
-% |\l_@@_NiceArray_bool| will be raised. 
+% |\g_@@_NiceArray_bool| will be raised. 
 %    \begin{macrocode}
-\bool_new:N \l_@@_NiceArray_bool
+\bool_new:N \g_@@_NiceArray_bool
 %    \end{macrocode}
 % In fact, if there is delimiters in the preamble of |{NiceArray}| (eg:
 % |[cccc]|), this boolean will be set to false.
@@ -6362,9 +6423,22 @@
 \tl_new:N \g_@@_aux_tl
 %    \end{macrocode}  
 % 
-%
 % \bigskip
+% The following parameter corresponds to the key |columns-type| of the
+% environments |{NiceMatrix}|, |{pNiceMatrix}|, etc. and also the key 
+% |matrix / columns-type| of |\NiceMatrixOptions|. However, it does \emph{not}
+% contain the value provided by the final user. Indeed, a transformation is done
+% in order to have a preamble (for the package \pkg{array}) which is
+% nicematrix-aware. That transformation is done with the command
+% |\@@_set_preamble:Nn|. 
 %    \begin{macrocode}
+\tl_new:N \l_@@_columns_type_tl
+\hook_gput_code:nnn { begindocument } { . }
+  { \@@_set_preamble:Nn \l_@@_columns_type_tl { c } }
+%    \end{macrocode}
+% 
+% \bigskip
+%    \begin{macrocode}
 \cs_new_protected:Npn \@@_test_if_math_mode:
   { 
     \if_mode_math: \else:
@@ -6513,6 +6587,7 @@
 %    \begin{macrocode}
 \bool_new:N \g_@@_row_of_col_done_bool
 %    \end{macrocode}
+%
 % 
 % \bigskip
 % It's possible to use the command |\NotEmpty| to specify explicitely that a
@@ -6707,7 +6782,8 @@
 % |corners| is used). 
 % 
 % \medskip
-% The following token list correspond to the key |color| of the command |\Block|. 
+% The following token list correspond to the key |color| of the command |\Block|
+% and also the key |color| of the command |\RowStyle|.
 %    \begin{macrocode}
 \tl_new:N \l_@@_color_tl
 %    \end{macrocode}
@@ -7034,15 +7110,10 @@
 % |\g_@@_tabularnotes_seq| will be cleared at the end of the environment of
 % \pkg{nicematrix} (and not at the beginning).
 %
-% Unfortunately, if the package \pkg{caption} is loaded, the command |\caption|
-% evaluates its argument twice and since it is not aware (of course) of
-% |\tabularnote|, the command |\tabularnote| is, in fact, not usable in
-% |\caption| when \pkg{caption} is loaded.\footnote{We should try to find a
-% solution to that problem.}
 %    \begin{macrocode}
         \NewDocumentCommand \tabularnote { m }
           {
-            \bool_if:nTF { ! \l_@@_NiceArray_bool && \l_@@_in_env_bool }
+            \bool_if:nTF { ! \g_@@_NiceArray_bool && \l_@@_in_env_bool }
               { \@@_error:n { tabularnote~forbidden } }
               {
 %    \end{macrocode}
@@ -7502,7 +7573,8 @@
     color .tl_set:N = \l_@@_rules_color_tl ,
     color .value_required:n = true ,
     width .dim_set:N = \arrayrulewidth ,
-    width .value_required:n = true 
+    width .value_required:n = true ,
+    unknown .code:n = \@@_error:n { Unknown~key~for~rules }
   }
 %    \end{macrocode}
 %
@@ -7820,9 +7892,11 @@
     allow-duplicate-names .value_forbidden:n = true ,
     notes .code:n = \keys_set:nn { NiceMatrix / notes } { #1 } ,
     notes .value_required:n = true ,
-    sub-matrix .code:n = 
-      \keys_set:nn { NiceMatrix / sub-matrix } { #1 } ,
+    sub-matrix .code:n = \keys_set:nn { NiceMatrix / sub-matrix } { #1 } , 
     sub-matrix .value_required:n = true ,
+    matrix / columns-type .code:n = 
+      \@@_set_preamble:Nn \l_@@_columns_type_tl { #1 },
+    matrix / columns-type .value_required:n = true ,
     unknown .code:n  = \@@_error:n { Unknown~key~for~NiceMatrixOptions } 
   }
 %    \end{macrocode}
@@ -7852,8 +7926,10 @@
                            \int_set:Nn \l_@@_last_col_int { -1 }
                          }
                          { \int_set:Nn \l_@@_last_col_int { #1 } } ,
-    l .code:n = \tl_set:Nn \l_@@_type_of_col_tl l ,
-    r .code:n = \tl_set:Nn \l_@@_type_of_col_tl r ,
+    columns-type .code:n = \@@_set_preamble:Nn \l_@@_columns_type_tl { #1 } , 
+    columns-type .value_required:n = true , 
+    l .meta:n = { columns-type = l } ,
+    r .meta:n = { columns-type = r } ,
     small .bool_set:N = \l_@@_small_bool ,
     small .value_forbidden:n = true ,
     unknown .code:n = \@@_error:n { Unknown~key~for~NiceMatrix } 
@@ -8329,7 +8405,7 @@
 %
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_array:
+\cs_new_protected:Npn \@@_array:n
   {
     \bool_if:NTF \l_@@_NiceTabular_bool
       { \dim_set_eq:NN \col at sep \tabcolsep }
@@ -8350,6 +8426,7 @@
 %    \begin{macrocode}
     [ \str_if_eq:VnTF \l_@@_baseline_tl c c t ]
   }
+\cs_generate_variant:Nn \@@_array:n { V }
 %    \end{macrocode}
 %
 % \medskip
@@ -8768,7 +8845,7 @@
 %    \end{macrocode}
 %
 % \bigskip
-% If there is a exterior row, we patch a command used in |\@@_cell_begin:w| in order to
+% If there is an exterior row, we patch a command used in |\@@_cell_begin:w| in order to
 % keep track of some dimensions needed to the construction of that ``last row''.
 %    \begin{macrocode}
     \int_compare:nNnT \l_@@_last_row_int > { -2 }
@@ -8834,21 +8911,14 @@
 %    \end{macrocode}
 %
 %
-% \bigskip
-% The preamble will be constructed in |\g_@@_preamble_tl|. 
-%    \begin{macrocode}
-    \@@_construct_preamble:
-%    \end{macrocode}
-% Now, the preamble is constructed in |\g_@@_preamble_tl|
-%
 % \medskip
-% We compute the width of both delimiters. We remember that, when the
+% We compute the width of both delimiters. We remind that, when the
 % environment |{NiceArray}| is used, it's possible to specify the delimiters in
 % the preamble (eg |[ccc]|).
 %    \begin{macrocode}
     \dim_zero_new:N \l_@@_left_delim_dim
     \dim_zero_new:N \l_@@_right_delim_dim
-    \bool_if:NTF \l_@@_NiceArray_bool
+    \bool_if:NTF \g_@@_NiceArray_bool
       { 
         \dim_gset:Nn \l_@@_left_delim_dim { 2 \arraycolsep }
         \dim_gset:Nn \l_@@_right_delim_dim { 2 \arraycolsep }
@@ -9306,7 +9376,7 @@
 % of |{NiceArray}| (|{pNiceArray}|, |{bNiceArray}|, etc.) because, for
 % |{NiceArray}|, we have the options |t|, |c|, |b| and |baseline|.
 %    \begin{macrocode}
-    \bool_if:NTF \l_@@_NiceArray_bool 
+    \bool_if:NTF \g_@@_NiceArray_bool 
       { \keys_set:nn { NiceMatrix / NiceArray } }
       { \keys_set:nn { NiceMatrix / pNiceArray } }
     { #3 , #5 } 
@@ -9314,8 +9384,7 @@
 %
 % \bigskip 
 %    \begin{macrocode}
-    \tl_if_empty:NF \l_@@_rules_color_tl
-      { \exp_after:wN \@@_set_CT at arc@: \l_@@_rules_color_tl \q_stop }
+    \@@_set_CT at arc@:V \l_@@_rules_color_tl 
 %    \end{macrocode}
 %
 % \bigskip
@@ -9331,8 +9400,9 @@
   }
 %    \end{macrocode}
 % 
+% Now, the second part of the environment |{NiceArrayWithDelims}|.
 %    \begin{macrocode}
-  {  
+  { 
     \bool_if:NTF \l_@@_light_syntax_bool
       { \use:c { end @@-light-syntax } }
       { \use:c { end @@-normal-syntax } }
@@ -9357,7 +9427,7 @@
 % Now, if there is at least one |X|-column in the environment, we compute the
 % width that those columns will have (in the next compilation). In fact,
 % |l_@@_X_columns_dim| will be the width of a column of weight $1$. For a
-% |X|-column of weight~$n$, the width will be |l_@@_X_columns_dim| multiplied
+% |X|-column of weight~$n$, the width will be |\l_@@_X_columns_dim| multiplied
 % by~$n$. 
 %    \begin{macrocode}
     \int_compare:nNnT \g_@@_total_X_weight_int > 0 
@@ -9443,13 +9513,13 @@
       }
 %    \end{macrocode}
 %
-% The construction of the real box is different when |\l_@@_NiceArray_bool| is
+% The construction of the real box is different when |\g_@@_NiceArray_bool| is
 % true (|{NiceArray}| or |{NiceTabular}|) and in the other environments because,
 % in |{NiceArray}| or |{NiceTabular}|, we have no delimiter to put (but we have
 % tabular notes to put). We begin with this case. 
 %
 %    \begin{macrocode}
-    \bool_if:NTF \l_@@_NiceArray_bool
+    \bool_if:NTF \g_@@_NiceArray_bool
       { 
         \str_case:VnF \l_@@_baseline_tl 
           { 
@@ -9492,15 +9562,13 @@
         \hbox_set:Nn \l_tmpa_box
           {
             \c_math_toggle_token
-            \tl_if_empty:NF \l_@@_delimiters_color_tl 
-              { \color { \l_@@_delimiters_color_tl } }
+            \@@_color:V \l_@@_delimiters_color_tl
             \exp_after:wN \left \g_@@_left_delim_tl
             \vcenter 
               { 
 %    \end{macrocode}
 % We take into account the ``first row'' (we have previously computed its total
-% height in |\l_tmpa_dim|). The |\hbox:n| (or |\hbox|) is necessary here. There
-% was a bug in the following line (corrected the 2021/11/23).
+% height in |\l_tmpa_dim|). The |\hbox:n| (or |\hbox|) is necessary here.
 %    \begin{macrocode}
                 \skip_vertical:n { -\l_tmpa_dim - \arrayrulewidth }
                 \hbox
@@ -9515,8 +9583,7 @@
                   }
 %    \end{macrocode}
 % We take into account the ``last row'' (we have previously computed its total
-% height in |\l_tmpb_dim|). There was a bug in the following line (corrected the
-% 2021/11/23). 
+% height in |\l_tmpb_dim|). 
 %    \begin{macrocode}
                 \skip_vertical:n { -\l_tmpb_dim + \arrayrulewidth }
               }
@@ -9525,8 +9592,7 @@
 % Otherwise, with XeLaTeX (and not with the other engines), the closing
 % delimiter is not colored.
 %    \begin{macrocode}
-            \tl_if_empty:NF \l_@@_delimiters_color_tl 
-              { \color { \l_@@_delimiters_color_tl } }
+            \@@_color:V \l_@@_delimiters_color_tl 
             \exp_after:wN \right \g_@@_right_delim_tl
             \c_math_toggle_token
           }
@@ -9558,12 +9624,14 @@
     \bool_if:NF \l_@@_Matrix_bool
       {    
         \int_compare:nNnT \c at jCol < \g_@@_static_num_of_col_int 
-          { \@@_error:n { columns~not~used } }
+          { 
+            \@@_error:n { columns~not~used } 
+            \group_begin:
+            \globaldefs = 1
+            \@@_msg_redirect_name:nn { columns~not~used } { none }
+            \group_end:
+          }
       }
-    \group_begin:
-    \globaldefs = 1
-    \@@_msg_redirect_name:nn { columns~not~used } { error }
-    \group_end:
     \@@_after_array:
 %    \end{macrocode}
 % The aim of the following |\egroup| (the corresponding |\bgroup| is, of course,
@@ -9597,7 +9665,12 @@
 % \vspace{1cm}
 % \subsection*{We construct the preamble of the array}
 %
-% The transformation of the preamble is an operation in several steps.
+% \bigskip
+% The transformation of the preamble is an operation in several
+% steps.\footnote{Be careful: the transformation of the preamble may also have
+% by-side effects, for example, the boolean |\g_@@_NiceArray_bool| will be set
+% to |false| if we detect in the preamble a delimiter at the beginning or at the
+% end.}
 %
 % \bigskip
 % The preamble given by the final user is in |\g_@@_preamble_tl| and the modified
@@ -9604,7 +9677,7 @@
 % version will be stored in |\g_@@_preamble_tl| also.
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_construct_preamble:
+\cs_new_protected:Npn \@@_transform_preamble:
   {
 %    \end{macrocode}
 % First, we will do an ``expansion'' of the preamble with the tools of the
@@ -9633,9 +9706,9 @@
 % the end).
 %    \begin{macrocode}
     \bool_if:NF \l_@@_Matrix_bool
-     {
-       \@@_newcolumntype w [ 2 ] { \@@_w: { ##1 } { ##2 } }
-       \@@_newcolumntype W [ 2 ] { \@@_W: { ##1 } { ##2 } }
+      {
+        \@@_newcolumntype w [ 2 ] { \@@_w: { ##1 } { ##2 } }
+        \@@_newcolumntype W [ 2 ] { \@@_W: { ##1 } { ##2 } }
 %    \end{macrocode}
 %
 % \bigskip
@@ -9642,22 +9715,22 @@
 % If the package \pkg{varwidth} has defined the column type |V|, we protect from
 % expansion by redefining it to |\@@_V:| (which will be catched by our system).
 %    \begin{macrocode}
-      \cs_if_exist:NT \NC at find@V { \@@_newcolumntype V { \@@_V: } }
+        \cs_if_exist:NT \NC at find@V { \@@_newcolumntype V { \@@_V: } }
 %    \end{macrocode}
 %
 % First, we have to store our preamble in the token register |\@temptokena|
 % (those ``token registers'' are \emph{not} supported by the L3 programming layer).
 %    \begin{macrocode}
-      \exp_args:NV \@temptokena \g_@@_preamble_tl 
+        \exp_args:NV \@temptokena \g_@@_preamble_tl 
 %    \end{macrocode}
 % Initialisation of a flag used by \pkg{array} to detect the end of the expansion.
 %    \begin{macrocode}
-      \@tempswatrue
+        \@tempswatrue
 %    \end{macrocode}
 % The following line actually does the expansion (it's has been copied from
 % |array.sty|). The expanded version is still in |\@temptokena|.
 %    \begin{macrocode}
-      \@whilesw \if at tempswa \fi { \@tempswafalse \the \NC at list }
+        \@whilesw \if at tempswa \fi { \@tempswafalse \the \NC at list }
 %    \end{macrocode}
 %
 % 
@@ -9670,24 +9743,24 @@
 % |\@@_patch_preamble:n|. In the same time, we will count the columns with the
 % counter |\c at jCol|.
 %    \begin{macrocode}
-      \int_gzero:N \c at jCol
-      \tl_gclear:N \g_@@_preamble_tl 
+        \int_gzero:N \c at jCol
+        \tl_gclear:N \g_@@_preamble_tl 
 %    \end{macrocode}
 % |\g_tmpb_bool| will be raised if you have a \verb+|+ at the end of the preamble.
 %    \begin{macrocode}
-      \bool_gset_false:N \g_tmpb_bool
-      \tl_if_eq:NnTF \l_@@_vlines_clist { all } 
-        { 
-          \tl_gset:Nn \g_@@_preamble_tl 
-            { ! { \skip_horizontal:N \arrayrulewidth } }
-        }
-        {
-          \clist_if_in:NnT \l_@@_vlines_clist 1 
-            { 
-              \tl_gset:Nn \g_@@_preamble_tl 
-                { ! { \skip_horizontal:N \arrayrulewidth } }
-            }
-        }
+        \bool_gset_false:N \g_tmpb_bool
+        \tl_if_eq:NnTF \l_@@_vlines_clist { all } 
+          { 
+            \tl_gset:Nn \g_@@_preamble_tl 
+              { ! { \skip_horizontal:N \arrayrulewidth } }
+          }
+          {
+            \clist_if_in:NnT \l_@@_vlines_clist 1 
+              { 
+                \tl_gset:Nn \g_@@_preamble_tl 
+                  { ! { \skip_horizontal:N \arrayrulewidth } }
+              }
+          }
 %    \end{macrocode}
 % The sequence |\g_@@_cols_vlsim_seq| will contain the numbers of the columns
 % where you will to have to draw vertical lines in the potential sub-matrices
@@ -9732,9 +9805,9 @@
 % environment |{NiceArray}| is transformed into an environment |{xNiceMatrix}|.
 %    \begin{macrocode}
     \bool_lazy_or:nnT 
-      { ! \str_if_eq_p:Vn \g_@@_left_delim_tl { . } }
-      { ! \str_if_eq_p:Vn \g_@@_right_delim_tl { . } }
-      { \bool_set_false:N \l_@@_NiceArray_bool } 
+       { ! \str_if_eq_p:Vn \g_@@_left_delim_tl { . } }
+       { ! \str_if_eq_p:Vn \g_@@_right_delim_tl { . } }
+       { \bool_gset_false:N \g_@@_NiceArray_bool } 
 %    \end{macrocode}
 %
 % \medskip
@@ -9751,7 +9824,7 @@
       {
         \bool_lazy_all:nT 
           { 
-            \l_@@_NiceArray_bool 
+            \g_@@_NiceArray_bool 
             { \bool_not_p:n \l_@@_NiceTabular_bool }
             { \tl_if_empty_p:N \l_@@_vlines_clist } 
             { \bool_not_p:n \l_@@_exterior_arraycolsep_bool }
@@ -9763,7 +9836,7 @@
       { 
         \bool_lazy_all:nT
           { 
-            \l_@@_NiceArray_bool 
+            \g_@@_NiceArray_bool 
             { \bool_not_p:n \l_@@_NiceTabular_bool }
             { \tl_if_empty_p:N \l_@@_vlines_clist } 
             { \bool_not_p:n \l_@@_exterior_arraycolsep_bool }
@@ -10273,7 +10346,7 @@
   { 
 %    \end{macrocode}
 % We test whether the version of \pkg{nicematrix} is at least 3.0. We will
-% change de programmation of the test further with something like |\@ifpackagelater|.
+% change the programmation of the test further with something like |\@ifpackagelater|.
 % 
 %    \begin{macrocode}
     \cs_if_exist:NTF \siunitx_cell_begin:w 
@@ -10552,6 +10625,18 @@
   }
 %    \end{macrocode}
 %
+% \bigskip
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_set_preamble:Nn #1 #2
+  {
+    \@temptokena { #2 }
+    \@tempswatrue
+    \@whilesw \if at tempswa \fi { \@tempswafalse \the \NC at list }
+    \tl_gclear:N \g_@@_preamble_tl 
+    \exp_after:wN \@@_patch_m_preamble:n \the \@temptokena \q_stop
+    \tl_set_eq:NN #1 \g_@@_preamble_tl 
+  }
+%    \end{macrocode}
 % 
 % \bigskip
 % \subsection*{The redefinition of \textbackslash multicolumn}
@@ -10771,29 +10856,13 @@
 %
 % 
 % After a specifier of column, we have to test whether there is one or several
-% |<{..}| because, after those potential |<{...}|, we have to insert
-% |!{\skip_horizontal:N ...}| when the key |vlines| is used.
+% |<{..}|.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_patch_m_preamble_x:n #1
   {
     \str_if_eq:nnTF { #1 } { < }
       \@@_patch_m_preamble_ix:n 
-      { 
-        \tl_if_eq:NnTF \l_@@_vlines_clist { all }
-          { 
-            \tl_gput_right:Nn \g_@@_preamble_tl 
-              { ! { \skip_horizontal:N \arrayrulewidth } }
-          } 
-          { 
-            \exp_args:NNx 
-            \clist_if_in:NnT \l_@@_vlines_clist { \int_eval:n { \c at jCol + 1 } } 
-              { 
-                \tl_gput_right:Nn \g_@@_preamble_tl 
-                  { ! { \skip_horizontal:N \arrayrulewidth } }
-              } 
-          }
-        \@@_patch_m_preamble:n { #1 }
-      }
+      { \@@_patch_m_preamble:n { #1 } }
   }
 %    \end{macrocode}
 % 
@@ -10896,7 +10965,7 @@
 % that's why we can't put |@{}| at the end of the preamble. That's why we remove
 % a |\arraycolsep| now.
 %    \begin{macrocode}
-    \bool_lazy_and:nnT \l_@@_Matrix_bool \l_@@_NiceArray_bool 
+    \bool_lazy_and:nnT \l_@@_Matrix_bool \g_@@_NiceArray_bool 
       {
         \box_set_wd:Nn \l_@@_the_array_box
           { \box_wd:N \l_@@_the_array_box - \arraycolsep }
@@ -11146,11 +11215,14 @@
       {
         \peek_meaning:NTF \end 
           \@@_analyze_end:Nn 
+          { 
+            \@@_transform_preamble:
 %    \end{macrocode}
-% Here is the call to |\array| (we have a dedicated macro |\@@_array:| because
+% Here is the call to |\array| (we have a dedicated macro |\@@_array:n| because
 % of compatibility with the classes \cls{revtex4-1} and \cls{revtex4-2}).
 %    \begin{macrocode}
-          { \exp_args:NV \@@_array: \g_@@_preamble_tl }
+            \@@_array:V \g_@@_preamble_tl 
+          }
       }
   }
   { 
@@ -11162,7 +11234,7 @@
 % 
 % \bigskip
 % When the key |light-syntax| is in force, we use an environment which takes its
-% whole body as an argument (with the specifier |b| of \pkg{xparse}). 
+% whole body as an argument (with the specifier |b|). 
 % % \label{code-light-syntax}
 %    \begin{macrocode}
 \NewDocumentEnvironment { @@-light-syntax } { b }
@@ -11189,19 +11261,26 @@
 % be set to \textsl{no-op} before the execution of
 % |\g_nicematrix_code_after_tl|.
 %    \begin{macrocode}
-    \@@_light_syntax_i #1 \CodeAfter \q_stop
+    \@@_light_syntax_i:w #1 \CodeAfter \q_stop
+%    \end{macrocode}
+% The command |\array| is hidden somewhere in |\@@_light_syntax_i:w|.
+%    \begin{macrocode}
   }
 %    \end{macrocode}
-% Now, the second part of the environment. It is empty. That's not surprising
-% because we have caught the whole body of the environment with the specifier
-% |b| provided by \pkg{xparse}.
+% Now, the second part of the environment. We must leave these lines in the
+% second part (and not put them in the first part even though we caught the
+% whole body of the environment with an argument of type |b|) in order to have
+% the columns |S| of \pkg{siunitx} working fine.
 %    \begin{macrocode}
-  { }
+  { 
+    \@@_create_col_nodes:
+    \endarray
+  }
 %    \end{macrocode}
 %
 % 
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_light_syntax_i #1\CodeAfter #2\q_stop 
+\cs_new_protected:Npn \@@_light_syntax_i:w #1\CodeAfter #2\q_stop 
   {
     \tl_gput_right:Nn \g_nicematrix_code_after_tl { #2 } 
 %    \end{macrocode}
@@ -11208,49 +11287,94 @@
 % The body of the array, which is stored in the argument |#1|, is now
 % splitted into items (and \emph{not} tokens).
 %    \begin{macrocode}
-    \seq_gclear_new:N \g_@@_rows_seq
+    \seq_clear_new:N \l_@@_rows_seq
+%    \end{macrocode}
+% We rescan the character of end of line in order to have the correct catcode.
+%    \begin{macrocode}
     \tl_set_rescan:Nno \l_@@_end_of_row_tl { } \l_@@_end_of_row_tl
-    \seq_gset_split:NVn \g_@@_rows_seq \l_@@_end_of_row_tl { #1 }
+    \seq_set_split:NVn \l_@@_rows_seq \l_@@_end_of_row_tl { #1 }
 %    \end{macrocode}
+% We delete the last row if it is empty.
+%    \begin{macrocode}
+    \seq_pop_right:NN \l_@@_rows_seq \l_tmpa_tl 
+    \tl_if_empty:NF \l_tmpa_tl 
+      { \seq_put_right:NV \l_@@_rows_seq \l_tmpa_tl }
+%    \end{macrocode}
 % If the environment uses the option |last-row| without value (i.e. without
-% saying the number of the rows), we have now the opportunity to know that
+% saying the number of the rows), we have now the opportunity to compute that
 % value. We do it, and so, if the token list |\l_@@_code_for_last_row_tl| is not
 % empty, we will use directly where it should be.
 %    \begin{macrocode}
     \int_compare:nNnT \l_@@_last_row_int = { -1 }
-      { \int_set:Nn \l_@@_last_row_int { \seq_count:N \g_@@_rows_seq } }
+      { \int_set:Nn \l_@@_last_row_int { \seq_count:N \l_@@_rows_seq } }
 %    \end{macrocode}
-% Here is the call to |\array| (we have a dedicated macro |\@@_array:| because
-% of compatibility with the classes \cls{revtex4-1} and \cls{revtex4-2}).
+%
+%
+% \bigskip
+% The new value of the body (that is to say after replacement of the separators
+% of rows and columns by |\\| and |&|) of the environment will be stored in 
+% |\l_@@_new_body_tl| (that part of the implementation has been changed in the
+% version 6.11 of \pkg{nicematrix} in order to allow the use of commands such as
+% |\hline| or |\hdottedline| with the key |light-syntax|).
 %    \begin{macrocode}
-    \exp_args:NV \@@_array: \g_@@_preamble_tl 
+    \tl_clear_new:N \l_@@_new_body_tl 
+    \int_zero_new:N \l_@@_nb_cols_int
 %    \end{macrocode}
-% We need a global affectation because, when executing |\l_tmpa_tl|, we will
-% exit the first cell of the array.
+% First, we treat the first row.
 %    \begin{macrocode}
-    \seq_gpop_left:NN \g_@@_rows_seq \l_tmpa_tl 
-    \@@_line_with_light_syntax_i:V \l_tmpa_tl
-    \seq_map_function:NN \g_@@_rows_seq \@@_line_with_light_syntax:n
-    \@@_create_col_nodes:
-    \endarray
-  }
+    \seq_pop_left:NN \l_@@_rows_seq \l_tmpa_tl
+    \@@_line_with_light_syntax:V \l_tmpa_tl
 %    \end{macrocode}
-% 
+% Now, the other rows (with the same treatment, excepted that we have to insert
+% |\\| between the rows).
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_line_with_light_syntax:n #1
-  { \tl_if_empty:nF { #1 } { \\ \@@_line_with_light_syntax_i:n { #1 } } } 
+    \seq_map_inline:Nn \l_@@_rows_seq 
+      { 
+        \tl_put_right:Nn \l_@@_new_body_tl { \\ } 
+        \@@_line_with_light_syntax:n { ##1 } 
+      }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_line_with_light_syntax_i:n #1
+    \int_compare:nNnT \l_@@_last_col_int = { -1 }
+      { 
+        \int_set:Nn \l_@@_last_col_int 
+          { \l_@@_nb_cols_int - 1 + \l_@@_first_col_int }
+      }
+%    \end{macrocode}
+%
+% Now, we can construct the preamble: if the user has used the key |last-col|,
+% we have the correct number of columns even though the user has used |last-col|
+% without value.
+%    \begin{macrocode}
+    \@@_transform_preamble:
+%    \end{macrocode}
+%
+% The call to |\array| is in the following command (we have a dedicated macro
+% |\@@_array:n| because of compatibility with the classes \cls{revtex4-1} and
+% \cls{revtex4-2}). 
+%    \begin{macrocode}
+    \@@_array:V \g_@@_preamble_tl \l_@@_new_body_tl
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_line_with_light_syntax:n #1
   {
-    \seq_gclear_new:N \g_@@_cells_seq
-    \seq_gset_split:Nnn \g_@@_cells_seq { ~ } { #1 }
-    \seq_gpop_left:NN \g_@@_cells_seq \l_tmpa_tl
-    \l_tmpa_tl
-    \seq_map_inline:Nn \g_@@_cells_seq { & ##1 }
+    \seq_clear_new:N \l_@@_cells_seq
+    \seq_set_split:Nnn \l_@@_cells_seq { ~ } { #1 }
+    \int_set:Nn \l_@@_nb_cols_int
+      {
+        \int_max:nn
+          \l_@@_nb_cols_int
+          { \seq_count:N \l_@@_cells_seq }
+      }
+    \seq_pop_left:NN \l_@@_cells_seq \l_tmpa_tl
+    \tl_put_right:NV \l_@@_new_body_tl \l_tmpa_tl
+    \seq_map_inline:Nn \l_@@_cells_seq 
+      { \tl_put_right:Nn \l_@@_new_body_tl { & ##1 } }
   }
-\cs_generate_variant:Nn \@@_line_with_light_syntax_i:n { V }
+\cs_generate_variant:Nn \@@_line_with_light_syntax:n { V }
 %    \end{macrocode}
 %
 %
@@ -11257,7 +11381,7 @@
 % \bigskip
 % The following command is used by the code which detects whether the
 % environment is empty (we raise a fatal error in this case: it's only a
-% security). 
+% security). When this command is used, |#1| is, in fact, always |\end|.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_analyze_end:Nn #1 #2
   {
@@ -11444,7 +11568,7 @@
         \int_gincr:N \g_tmpa_int 
         \bool_lazy_all:nT 
           { 
-            \l_@@_NiceArray_bool 
+            \g_@@_NiceArray_bool 
             { \bool_not_p:n \l_@@_NiceTabular_bool }
             { \clist_if_empty_p:N \l_@@_vlines_clist } 
             { \bool_not_p:n \l_@@_exterior_arraycolsep_bool }
@@ -11462,13 +11586,13 @@
 % that's why we can't put |@{}| at the end of the preamble. That's why we remove
 % a |\arraycolsep| now.
 %    \begin{macrocode}
-                \bool_lazy_and:nnT \l_@@_Matrix_bool \l_@@_NiceArray_bool
+                \bool_lazy_and:nnT \l_@@_Matrix_bool \g_@@_NiceArray_bool
                   { \skip_horizontal:N -\arraycolsep }
                 \pgfsys at markposition 
                   { \@@_env: - col - \int_eval:n {
                     \g_tmpa_int + 1 } } 
                 \skip_horizontal:N 0.5\arrayrulewidth 
-                \bool_lazy_and:nnT \l_@@_Matrix_bool \l_@@_NiceArray_bool
+                \bool_lazy_and:nnT \l_@@_Matrix_bool \g_@@_NiceArray_bool
                   { \skip_horizontal:N \arraycolsep }
               }
           }   
@@ -11476,7 +11600,7 @@
           \pgfrememberpicturepositiononpagetrue
           \pgfcoordinate { \@@_env: - col - \int_eval:n { \g_tmpa_int + 1 } } 
             { 
-              \bool_lazy_and:nnTF \l_@@_Matrix_bool \l_@@_NiceArray_bool
+              \bool_lazy_and:nnTF \l_@@_Matrix_bool \g_@@_NiceArray_bool
                 { 
                   \pgfpoint 
                     { - 0.5 \arrayrulewidth - \arraycolsep } 
@@ -11683,19 +11807,19 @@
 %
 % \interitem
 % The environment |{NiceArray}| is constructed upon the environment
-% |{NiceArrayWithDelims}| but, in fact, there is a flag |\l_@@_NiceArray_bool|.
+% |{NiceArrayWithDelims}| but, in fact, there is a flag |\g_@@_NiceArray_bool|.
 % In |{NiceArrayWithDelims}|, some special code will be executed if this flag is
 % raised. 
 %    \begin{macrocode}
 \NewDocumentEnvironment { NiceArray } { }
   { 
-    \bool_set_true:N \l_@@_NiceArray_bool
+    \bool_gset_true:N \g_@@_NiceArray_bool
     \str_if_empty:NT \g_@@_name_env_str 
       { \str_gset:Nn \g_@@_name_env_str { NiceArray } }  
 %    \end{macrocode}
 % We put . and . for the delimiters but, in fact, that doesn't matter because
 % these arguments won't be used in |{NiceArrayWithDelims}| (because the flag
-% |\l_@@_NiceArray_bool| is raised).
+% |\g_@@_NiceArray_bool| is raised).
 %    \begin{macrocode} 
     \NiceArrayWithDelims . . 
   }
@@ -11711,6 +11835,7 @@
   {
     \NewDocumentEnvironment { #1 NiceArray } { }
       {
+        \bool_gset_false:N \g_@@_NiceArray_bool
         \str_if_empty:NT \g_@@_name_env_str 
           { \str_gset:Nn \g_@@_name_env_str { #1 NiceArray } } 
         \@@_test_if_math_mode:
@@ -11732,7 +11857,7 @@
 % \bigskip
 % \subsection*{The environment \{NiceMatrix\} and its variants}
 %
-%
+% 
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_begin_of_NiceMatrix:nn #1 #2
   {
@@ -11745,21 +11870,24 @@
               \c at MaxMatrixCols
               { \int_eval:n { \l_@@_last_col_int - 1 } }
           } 
-          { > \@@_cell_begin:w #2 < \@@_cell_end: }
+          { #2 }
       } 
   }
-\cs_generate_variant:Nn \@@_begin_of_NiceMatrix:nn { n e }
 %    \end{macrocode}
 % 
 %    \begin{macrocode}
-\clist_map_inline:nn { { } , p , b , B , v , V }
+\cs_generate_variant:Nn \@@_begin_of_NiceMatrix:nn { n V }
+%    \end{macrocode}
+% 
+%    \begin{macrocode}
+\clist_map_inline:nn { p , b , B , v , V }
   {
     \NewDocumentEnvironment { #1 NiceMatrix } { ! O { } }
       {
+        \bool_gset_false:N \g_@@_NiceArray_bool 
         \str_gset:Nn \g_@@_name_env_str { #1 NiceMatrix } 
-        \tl_set:Nn \l_@@_type_of_col_tl c
         \keys_set:nn { NiceMatrix / NiceMatrix } { ##1 }
-        \@@_begin_of_NiceMatrix:ne { #1 } \l_@@_type_of_col_tl 
+        \@@_begin_of_NiceMatrix:nV { #1 } \l_@@_columns_type_tl 
       }
       { \use:c { end #1 NiceArray } }
   }
@@ -11766,6 +11894,19 @@
 %    \end{macrocode}
 %
 % \bigskip
+% We define also an environment |{NiceMatrix}|
+%    \begin{macrocode}
+\NewDocumentEnvironment { NiceMatrix } { ! O { } }
+  {
+    \bool_gset_false:N \g_@@_NiceArray_bool 
+    \str_gset:Nn \g_@@_name_env_str { NiceMatrix } 
+    \keys_set:nn { NiceMatrix / NiceMatrix } { #1 }
+    \@@_begin_of_NiceMatrix:nV { } \l_@@_columns_type_tl 
+  }
+  { \endNiceArray }
+%    \end{macrocode}
+% 
+% \bigskip
 % The following command will be linked to |\NotEmpty| in the environments of
 % \pkg{nicematrix}. 
 %    \begin{macrocode}
@@ -12569,7 +12710,7 @@
 % \medskip
 % |#1| and |#2| are the numbers of row and columns of the cell where the command
 % of dotted line (ex.: |\Vdots|) has been issued. |#3|, |#4|, |#5| and |#6| are
-% the specification (in $i$ and $j$) of the submatrix where are analysing.
+% the specification (in $i$ and $j$) of the submatrix we are analyzing.
 %    \begin{macrocode}
 \cs_set_protected:Npn \@@_adjust_to_submatrix:nnnnnn #1 #2 #3 #4 #5 #6
   {
@@ -14002,7 +14143,7 @@
         cell-space-top-limit = #1 ,
         cell-space-bottom-limit = #1 ,
       } ,
-    color .tl_set:N = \l_tmpa_tl ,
+    color .tl_set:N = \l_@@_color_tl ,
     color .value_required:n = true ,
     bold .bool_set:N = \l_tmpa_bool ,
     bold .default:n = true ,
@@ -14009,10 +14150,10 @@
     bold .initial:n = false ,
     nb-rows .code:n = 
       \str_if_eq:nnTF { #1 } { * } 
-        { \int_set_eq:NN \l_@@_key_nb_rows_int 500 } 
+        { \int_set:Nn \l_@@_key_nb_rows_int { 500 } } 
         { \int_set:Nn \l_@@_key_nb_rows_int { #1 } } ,
     nb-rows .value_required:n = true ,
-    rowcolor .tl_set:N = \l_@@_tmpc_tl ,
+    rowcolor .tl_set:N = \l_tmpa_tl ,
     rowcolor .value_required:n = true ,
     rowcolor .initial:n = ,
     unknown .code:n = \@@_error:n { Unknown~key~for~RowStyle } 
@@ -14023,22 +14164,25 @@
 %    \begin{macrocode}
 \NewDocumentCommand \@@_RowStyle:n { O { } m }
   { 
-    \tl_clear:N \l_tmpa_tl
+    \group_begin:
+    \tl_clear:N \l_@@_color_tl
     \int_set:Nn \l_@@_key_nb_rows_int 1
     \keys_set:nn { NiceMatrix / RowStyle } { #1 }
 %    \end{macrocode}
 % If the key |rowcolor| has been used.
 %    \begin{macrocode}
-    \tl_if_empty:NF \l_@@_tmpc_tl
-      {
+    \tl_if_empty:NF \l_tmpa_tl
+      { 
 %    \end{macrocode}
 % First, the end of the current row (we remind that |\RowStyle| applies to the
-% \emph{end} of the current row).
+% \emph{end} of the current row). 
 %    \begin{macrocode}
         \tl_gput_right:Nx \g_nicematrix_code_before_tl 
           { 
-            \@@_rectanglecolor 
-              { \l_@@_tmpc_tl } 
+%    \end{macrocode}
+% The command |\@@_exp_color_arg:NV| is \emph{fully expandable}.
+%    \begin{macrocode}
+            \@@_exp_color_arg:NV \@@_rectanglecolor \l_tmpa_tl 
               { \int_use:N \c at iRow - \int_use:N \c at jCol }
               { \int_use:N \c at iRow - * }
           }
@@ -14049,8 +14193,7 @@
           {
             \tl_gput_right:Nx \g_nicematrix_code_before_tl 
               { 
-                \@@_rowcolor 
-                  { \l_@@_tmpc_tl } 
+                \@@_exp_color_arg:NV \@@_rowcolor \l_tmpa_tl 
                   { 
                     \int_eval:n { \c at iRow + 1 }
                     - \int_eval:n { \c at iRow + \l_@@_key_nb_rows_int - 1 } 
@@ -14091,12 +14234,15 @@
           }
       }
 %    \end{macrocode}
-% |\l_tmpa_tl| is the value of the key |color| of |\RowStyle|.
+% |\l_@@_color_tl| is the value of the key |color| of |\RowStyle|.
 %    \begin{macrocode}
-    \tl_if_empty:NF \l_tmpa_tl
+    \tl_if_empty:NF \l_@@_color_tl
       {
         \tl_gput_right:Nx \g_@@_row_style_tl
-          { \mode_leave_vertical: \exp_not:N \color { \l_tmpa_tl } }
+          { 
+            \mode_leave_vertical: 
+            \@@_color:n { \l_@@_color_tl }
+          }
       }
 %    \end{macrocode}
 % |\l_tmpa_bool| is the value of the key |bold|.
@@ -14115,6 +14261,7 @@
           }
       }
     \tl_gput_right:Nn \g_@@_row_style_tl { \fi } 
+    \group_end:
     \g_@@_row_style_tl
     \ignorespaces
   }
@@ -14792,7 +14939,12 @@
     position .value_required:n = true ,
     start .int_set:N = \l_@@_start_int ,
     start .initial:n = 1 , 
-    end .int_set:N = \l_@@_end_int ,
+    end .code:n = 
+      \bool_lazy_or:nnTF
+        { \tl_if_empty_p:n { #1 } }
+        { \str_if_eq_p:nn { #1 } { last } }
+        { \int_set_eq:NN \l_@@_end_int \c at jCol }
+        { \int_set:Nn \l_@@_end_int { #1 } } 
   }
 %    \end{macrocode}
 %
@@ -14812,9 +14964,9 @@
     dotted .bool_set:N = \l_@@_dotted_bool ,
     dotted .initial:n = false , 
     dotted .default:n = true ,
-    color .code:n = \@@_set_CT at arc@: #1 \q_stop , 
+    color .code:n = \@@_set_CT at arc@:n { #1 } , 
     color .value_required:n = true ,
-    sep-color .code:n = \@@_set_CT at drsc@: #1 \q_stop ,
+    sep-color .code:n = \@@_set_CT at drsc@:n { #1 } ,
     sep-color .value_required:n = true ,
 %    \end{macrocode}
 % If the user uses the key |tikz|, the rule (or more precisely: the different
@@ -15073,11 +15225,11 @@
   {
     \int_step_inline:nnn 
       { 
-        \bool_if:nTF { \l_@@_NiceArray_bool && ! \l_@@_except_borders_bool }
+        \bool_if:nTF { \g_@@_NiceArray_bool && ! \l_@@_except_borders_bool }
           1 2 
       }
       { 
-        \bool_if:nTF { \l_@@_NiceArray_bool && ! \l_@@_except_borders_bool }
+        \bool_if:nTF { \g_@@_NiceArray_bool && ! \l_@@_except_borders_bool }
           { \int_eval:n { \c at jCol + 1 } } 
           \c at jCol 
       }
@@ -15330,7 +15482,7 @@
     \int_compare:nNnT \l_@@_local_start_int = 1 
       {
         \dim_sub:Nn \l_@@_x_initial_dim \l_@@_left_margin_dim 
-        \bool_if:NT \l_@@_NiceArray_bool 
+        \bool_if:NT \g_@@_NiceArray_bool 
           { \dim_sub:Nn \l_@@_x_initial_dim \arraycolsep }
 %    \end{macrocode}
 % For reasons purely aesthetic, we do an adjustment in the case of a rounded
@@ -15345,7 +15497,7 @@
     \int_compare:nNnT \l_@@_local_end_int = \c at jCol
       {
         \dim_add:Nn \l_@@_x_final_dim \l_@@_right_margin_dim 
-        \bool_if:NT \l_@@_NiceArray_bool 
+        \bool_if:NT \g_@@_NiceArray_bool 
           { \dim_add:Nn \l_@@_x_final_dim \arraycolsep }
         \tl_if_eq:NnF \g_@@_right_delim_tl ) 
           { \dim_gsub:Nn \l_@@_x_final_dim { 0.5 \l_@@_xdots_inter_dim } }
@@ -15389,11 +15541,11 @@
   {
     \int_step_inline:nnn 
       { 
-        \bool_if:nTF { \l_@@_NiceArray_bool && ! \l_@@_except_borders_bool }
+        \bool_if:nTF { \g_@@_NiceArray_bool && ! \l_@@_except_borders_bool }
           1 2 
       }
       { 
-        \bool_if:nTF { \l_@@_NiceArray_bool && ! \l_@@_except_borders_bool }
+        \bool_if:nTF { \g_@@_NiceArray_bool && ! \l_@@_except_borders_bool }
           { \int_eval:n { \c at iRow + 1 } } 
           \c at iRow
       }
@@ -15480,6 +15632,7 @@
 \cs_new_protected:Npn \@@_custom_line:n #1 
   {
     \str_clear_new:N \l_@@_command_str
+    \str_clear_new:N \l_@@_ccommand_str
     \str_clear_new:N \l_@@_letter_str
     \keys_set_known:nnN { NiceMatrix / custom-line } { #1 } \l_@@_other_keys_tl
 %    \end{macrocode}
@@ -15490,9 +15643,12 @@
 % course, a definition of custom lines with no letter and no command would be point-less.
 % 
 %    \begin{macrocode}
-    \bool_lazy_and:nnTF 
-      { \str_if_empty_p:N \l_@@_letter_str }
-      { \str_if_empty_p:N \l_@@_command_str }
+    \bool_lazy_all:nTF 
+      {
+        { \str_if_empty_p:N \l_@@_letter_str }
+        { \str_if_empty_p:N \l_@@_command_str }
+        { \str_if_empty_p:N \l_@@_ccommand_str }
+      }
       { \@@_error:n { No~letter~and~no~command } }
       { \exp_args:NV \@@_custom_line_i:n \l_@@_other_keys_tl }
   }
@@ -15499,7 +15655,6 @@
 %    \end{macrocode}
 % 
 % 
-% 
 %    \begin{macrocode}
 \keys_define:nn { NiceMatrix / custom-line }
   {
@@ -15506,9 +15661,10 @@
     % here, we will use change in the future to use .str_set:N 
     letter .code:n = \str_set:Nn \l_@@_letter_str { #1 } , 
     letter .value_required:n = true ,
-    % here, we will use change in the future to use .str_set:N 
     command .code:n = \str_set:Nn \l_@@_command_str { #1 } , 
     command .value_required:n = true ,
+    ccommand .code:n = \str_set:Nn \l_@@_ccommand_str { #1 } , 
+    ccommand .value_required:n = true ,
   }
 %    \end{macrocode}
 %
@@ -15566,6 +15722,7 @@
            }
        }
     \str_if_empty:NF \l_@@_command_str { \@@_h_custom_line:n { #1 } }
+    \str_if_empty:NF \l_@@_ccommand_str { \@@_c_custom_line:n { #1 } }
   } 
 %    \end{macrocode}
 %
@@ -15632,8 +15789,9 @@
 % 
 % \bigskip
 % The following command will create the command that the final user will use in
-% its array to draw an horizontal rule (hence the `|h|` in the name). |#1| is the
-% whole set of keys to pass to |\@@_line:n|.
+% its array to draw an horizontal rule (hence the `|h|` in the name) with the
+% full width of the array. |#1| is the whole set of keys to pass to the command
+% |\@@_hline:n| (which is in the internal |\CodeAfter|).
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_h_custom_line:n #1
   {
@@ -15662,6 +15820,59 @@
   }
 \cs_generate_variant:Nn \@@_h_custom_line:nn { n V }
 %    \end{macrocode}
+%
+% \bigskip
+% \bigskip
+% The following command will create the command that the final user will use in
+% its array to draw an horizontal rule on only some of the columns of the array
+% (hence the letter |c| as in |\cline|). |#1| is the whole set of keys to pass
+% to the command |\@@_hline:n| (which is in the internal |\CodeAfter|).
+%
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_c_custom_line:n #1
+  {
+%    \end{macrocode}
+% Here, we need an expandable command since it begins with an |\noalign|.
+%    \begin{macrocode}
+    \exp_args:Nc \NewExpandableDocumentCommand 
+      { nicematrix - \l_@@_ccommand_str } 
+      { O { } m }
+      { 
+        \noalign
+          {
+            \@@_compute_rule_width:n { #1 , ##1 }
+            \skip_vertical:n { \l_@@_rule_width_dim }
+            \clist_map_inline:nn
+              { ##2 }
+              { \@@_c_custom_line_i:nn { #1 , ##1 } { ####1 } }
+          }
+      }
+    \seq_put_left:NV \l_@@_custom_line_commands_seq \l_@@_ccommand_str
+  }
+%    \end{macrocode}
+% The first argument is the list of key-value pairs characteristic of the line.
+% The second argument is the specification of columns for the |\cline| with the
+% syntax $a$-$b$.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_c_custom_line_i:nn #1 #2
+  {
+    \str_if_in:nnTF { #2 } { - } 
+      { \@@_cut_on_hyphen:w #2 \q_stop }  
+      { \@@_cut_on_hyphen:w #2 - #2 \q_stop }  
+    \tl_gput_right:Nx \g_@@_internal_code_after_tl
+      { 
+        \@@_hline:n 
+          { 
+            #1 , 
+            start = \l_tmpa_tl , 
+            end = \l_tmpb_tl , 
+            position = \int_eval:n { \c at iRow + 1 } ,
+            total-width = \dim_use:N \l_@@_rule_width_dim
+          } 
+      }
+  }
+\cs_generate_variant:Nn \@@_c_custom_line:nn { n V }
+%    \end{macrocode}
 % 
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_compute_rule_width:n #1 
@@ -15711,7 +15922,8 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\@@_custom_line:n { letter = : , command = hdottedline , dotted }
+\@@_custom_line:n 
+  { letter = : , command = hdottedline , ccommand = cdottedline, dotted }
 %    \end{macrocode}
 %
 % \subsubsection*{The key hvlines}
@@ -16585,7 +16797,7 @@
 %    \begin{macrocode}
         \tl_if_empty:NTF \l_@@_color_tl
           { \int_compare:nNnT { #2 } = 1 \set at color }
-          { \color { \l_@@_color_tl } }
+          { \@@_color:V \l_@@_color_tl }
 %    \end{macrocode}
 % If the block is mono-row, we use |\g_@@_row_style_tl| even if it has yet been
 % used in the beginning of the cell where the command |\Block| has been issued
@@ -16806,7 +17018,9 @@
     draw .default:n = default ,
     rounded-corners .dim_set:N = \l_@@_rounded_corners_dim ,
     rounded-corners .default:n = 4 pt ,
-    color .code:n = \color { #1 } \tl_set:Nn \l_@@_draw_tl { #1 } ,
+    color .code:n = 
+      \@@_color:n { #1 }
+      \tl_set:Nn \l_@@_draw_tl { #1 } ,
     color .value_required:n = true ,
     borders .clist_set:N = \l_@@_borders_clist ,
     borders .value_required:n = true ,
@@ -16996,17 +17210,12 @@
 %    \begin{macrocode}
     \tl_if_empty:NF \l_@@_fill_tl
       {
-%    \end{macrocode}
-% The command |\@@_extract_brackets| will extract the potential specification of
-% color space at the beginning of |\l_@@_fill_tl| and store it in |\l_tmpa_tl|
-% and store the color itself in |\l_tmpb_tl|.
-%    \begin{macrocode}
-        \exp_last_unbraced:NV \@@_extract_brackets \l_@@_fill_tl \q_stop
         \tl_gput_right:Nx \g_nicematrix_code_before_tl
           { 
             \exp_not:N \roundedrectanglecolor 
-              [ \l_tmpa_tl ]
-              { \exp_not:V \l_tmpb_tl } 
+              \exp_args:NV \tl_if_head_eq_meaning:nNTF \l_@@_fill_tl [
+                { \l_@@_fill_tl }
+                { { \l_@@_fill_tl } }
               { #1 - #2 } 
               { \int_use:N \l_@@_last_row_int - \int_use:N \l_@@_last_col_int } 
               { \dim_use:N \l_@@_rounded_corners_dim }
@@ -17332,16 +17541,6 @@
   }
 %    \end{macrocode}
 %
-% \bigskip
-%    \begin{macrocode}
-\NewDocumentCommand \@@_extract_brackets { O { } }
-  {
-    \tl_set:Nn \l_tmpa_tl { #1 }
-    \@@_store_in_tmpb_tl 
-  }
-\cs_new_protected:Npn \@@_store_in_tmpb_tl #1 \q_stop 
-  { \tl_set:Nn \l_tmpb_tl { #1 } }
-%    \end{macrocode}
 % 
 % % \bigskip
 % The first argument of |\@@_stroke_block:nnn| is a list of options for the
@@ -17366,7 +17565,7 @@
 %    \begin{macrocode}
         \str_if_eq:VnTF \l_@@_draw_tl { default } 
           { \CT at arc@ }
-          { \exp_args:NV \pgfsetstrokecolor \l_@@_draw_tl }
+          { \@@_color:V \l_@@_draw_tl }
       }
     \pgfsetcornersarced
       { 
@@ -17670,14 +17869,16 @@
 %
 %
 % \bigskip
-% We will extract the potential keys |l|, |r| and |c| and pass the other keys to
-% the environment |{NiceArrayWithDelims}|.
+% We will extract the potential keys |columns-type|, |l|, |c|, |r| and pass
+% the other keys to the environment |{NiceArrayWithDelims}|.
 %    \begin{macrocode} 
 \keys_define:nn { NiceMatrix / Auto }
   {
-    l .code:n = \tl_set:Nn \l_@@_type_of_col_tl l ,
-    r .code:n = \tl_set:Nn \l_@@_type_of_col_tl r ,
-    c .code:n = \tl_set:Nn \l_@@_type_of_col_tl c 
+    columns-type .code:n = \@@_set_preamble:Nn \l_@@_columns_type_tl { #1 } ,
+    columns-type .value_required:n = true ,
+    l .meta:n = { columns-type = l } ,
+    r .meta:n = { columns-type = r } , 
+    c .meta:n = { columns-type = c } 
   }
 %    \end{macrocode}
 % 
@@ -17688,15 +17889,25 @@
     \int_zero_new:N \l_@@_nb_cols_int
     \@@_set_size:n #4 \q_stop
 %    \end{macrocode}
-% The group is for the protection of |\l_@@_type_of_col_tl|.
+% The group is for the protection of the keys.
 %    \begin{macrocode}
     \group_begin:
-    \tl_set:Nn \l_@@_type_of_col_tl c 
+    \bool_set_true:N \l_@@_Matrix_bool
     \keys_set_known:nnN { NiceMatrix / Auto } { #3, #5, #7 } \l_tmpa_tl
+%    \end{macrocode}
+% We nullify the command |\@@_transform_preamble:| because we will provide a
+% preamble which is yet transformed (by using |\l_@@_columns_type_tl| which is
+% yet nicematrix-ready).
+%
+%    \begin{macrocode}
+    \cs_set_eq:NN \@@_transform_preamble: \prg_do_nothing: 
     \use:x 
       {
         \exp_not:N \begin { NiceArrayWithDelims } { #1 } { #2 } 
-          { * { \int_use:N \l_@@_nb_cols_int } { \l_@@_type_of_col_tl } } 
+          { 
+            * { \int_use:N \l_@@_nb_cols_int } 
+              { \exp_not:V \l_@@_columns_type_tl } 
+          }  
           [ \exp_not:V \l_tmpa_tl ] 
       }
     \int_compare:nNnT \l_@@_first_row_int = 0
@@ -17733,6 +17944,7 @@
   { 
     \cs_set_protected:cpn { #1 AutoNiceMatrix }
       {
+        \bool_gset_false:N \g_@@_NiceArray_bool
         \str_gset:Nx \g_@@_name_env_str { #1 AutoNiceMatrix } 
         \AutoNiceMatrixWithDelims { #2 } { #3 }
       }  
@@ -17753,7 +17965,7 @@
 \NewDocumentCommand \AutoNiceMatrix { O { } m O { } m ! O { } } 
   {
     \group_begin:
-    \bool_set_true:N \l_@@_NiceArray_bool
+    \bool_gset_true:N \g_@@_NiceArray_bool
     \AutoNiceMatrixWithDelims . . { #2 } { #4 } [ #1 , #3 , #5 ] 
     \group_end:
   }
@@ -18051,8 +18263,7 @@
 %    \begin{macrocode}
         \nullfont
         \c_math_toggle_token
-        \tl_if_empty:NF \l_@@_delimiters_color_tl 
-          { \color { \l_@@_delimiters_color_tl } }
+        \@@_color:V \l_@@_delimiters_color_tl 
         \bool_if:nTF { #3 } { \left #1 } { \left . }
         \vcenter 
           { 
@@ -18150,21 +18361,37 @@
 \NewDocumentCommand \@@_SubMatrix_in_code_before { m m m m ! O { } }
   {
     \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 ] }
+        \@@_SubMatrix_in_code_before_i { #2 } { #3 }
       }
   }
 %    \end{macrocode}
+%    
+%    \begin{macrocode}
+\NewDocumentCommand \@@_SubMatrix_in_code_before_i 
+  { > { \SplitArgument { 1 } { - } } m > { \SplitArgument { 1 } { - } } m }
+  { \@@_SubMatrix_in_code_before_i:nnnn #1 #2 }
+%    \end{macrocode}
 %
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_SubMatrix_in_code_before_i:nnnn #1 #2 #3 #4
+  { 
+    \seq_gput_right:Nx \g_@@_submatrix_seq 
+      { 
+%    \end{macrocode}
+% We use |\str_if_eq:nnTF| because it is fully expandable.
+%    \begin{macrocode}
+        { \str_if_eq:nnTF { #1 } { last } { \int_use:N \c at iRow } { #1 } } 
+        { \str_if_eq:nnTF { #2 } { last } { \int_use:N \c at jCol } { #2 } } 
+        { \str_if_eq:nnTF { #3 } { last } { \int_use:N \c at iRow } { #3 } } 
+        { \str_if_eq:nnTF { #4 } { last } { \int_use:N \c at jCol } { #4 } } 
+      }
+  }
+%    \end{macrocode}
+% 
+%
 % \bigskip
 % In the internal |code-after| and in the |\CodeAfter| the following command
 % |\@@_SubMatrix| will be linked to |\SubMatrix|. 
@@ -18189,7 +18416,7 @@
         \peek_remove_spaces:n
           { 
             \@@_sub_matrix:nnnnnnn
-              { #1 } { #2 } { #3 } { #4 }  { #5 } { #6 } { #7 } 
+              { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } { #7 } 
           }
       }
   }
@@ -18200,26 +18427,26 @@
 % |\l_@@_last_i_tl| and |\l_@@_last_j_tl| from the arguments of the command as
 % provided by the user (for example |2-3| and |5-last|).
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_compute_i_j:nn #1 #2
+\NewDocumentCommand \@@_compute_i_j:nn 
+  { > { \SplitArgument { 1 } { - } } m > { \SplitArgument { 1 } { - } } m }
+  { \@@_compute_i_j:nnnn #1 #2 }
+%    \end{macrocode}
+% 
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_compute_i_j:nnnn #1 #2 #3 #4 
   {
-    \tl_clear_new:N \l_@@_first_i_tl
-    \tl_clear_new:N \l_@@_first_j_tl
-    \tl_clear_new:N \l_@@_last_i_tl
-    \tl_clear_new:N \l_@@_last_j_tl
-    \@@_cut_on_hyphen:w #1 \q_stop
-    \tl_if_eq:NnTF \l_tmpa_tl { last }
+    \tl_set:Nn \l_@@_first_i_tl { #1 }
+    \tl_set:Nn \l_@@_first_j_tl { #2 }
+    \tl_set:Nn \l_@@_last_i_tl { #3 }
+    \tl_set:Nn \l_@@_last_j_tl { #4 }
+    \tl_if_eq:NnT \l_@@_first_i_tl { last }
       { \tl_set:NV \l_@@_first_i_tl \c at iRow }
-      { \tl_set_eq:NN \l_@@_first_i_tl \l_tmpa_tl }
-    \tl_if_eq:NnTF \l_tmpb_tl { last }
+    \tl_if_eq:NnT \l_@@_first_j_tl { last }
       { \tl_set:NV \l_@@_first_j_tl \c at jCol }
-      { \tl_set_eq:NN \l_@@_first_j_tl \l_tmpb_tl }
-    \@@_cut_on_hyphen:w #2 \q_stop
-    \tl_if_eq:NnTF \l_tmpa_tl { last }
+    \tl_if_eq:NnT \l_@@_last_i_tl { last }
       { \tl_set:NV \l_@@_last_i_tl \c at iRow }
-      { \tl_set_eq:NN \l_@@_last_i_tl \l_tmpa_tl }
-    \tl_if_eq:NnTF \l_tmpb_tl { last }
+    \tl_if_eq:NnT \l_@@_last_j_tl { last }
       { \tl_set:NV \l_@@_last_j_tl \c at jCol }
-      { \tl_set_eq:NN \l_@@_last_j_tl \l_tmpb_tl }
   }
 %    \end{macrocode}
 % 
@@ -18321,8 +18548,7 @@
 %    \begin{macrocode}
     \group_begin:
     \pgfsetlinewidth { 1.1 \arrayrulewidth }
-    \tl_if_empty:NF \l_@@_rules_color_tl
-      { \exp_after:wN \@@_set_CT at arc@: \l_@@_rules_color_tl \q_stop }
+    \@@_set_CT at arc@:V \l_@@_rules_color_tl 
     \CT at arc@ 
 %    \end{macrocode}
 % Now, we draw the potential vertical rules specified in the preamble of the
@@ -18596,8 +18822,7 @@
       {
         \nullfont
         \c_math_toggle_token
-        \tl_if_empty:NF \l_@@_delimiters_color_tl 
-          { \color { \l_@@_delimiters_color_tl } }
+        \@@_color:V \l_@@_delimiters_color_tl 
         \left #1
         \vcenter 
           { 
@@ -18628,8 +18853,7 @@
       {
         \nullfont
         \c_math_toggle_token
-        \tl_if_empty:NF \l_@@_delimiters_color_tl 
-          { \color { \l_@@_delimiters_color_tl } }
+        \@@_color:V \l_@@_delimiters_color_tl 
         \left .
         \vcenter 
           { 
@@ -18923,12 +19147,6 @@
 % Of course, the command |\NiceMatrix| must be defined before such an
 % instruction is executed. 
 %
-% \medskip
-% The boolean |\c_@@_messages_for_Overleaf_bool| corresponds to the key
-% |messages-for-Overleaf|. 
-%    \begin{macrocode}
-\bool_new:N \c_@@_messages_for_Overleaf_bool
-%    \end{macrocode}
 % 
 % \medskip
 % The boolean |\g_@@_footnotehyper_bool| will indicate if the option
@@ -19137,7 +19355,7 @@
     you~try~to~use~more~columns~than~allowed~by~your~
     \@@_full_name_env:.\@@_message_hdotsfor:\ Recall~that~the~maximal~
     number~of~columns~for~a~matrix~is~fixed~by~the~LaTeX~counter~
-    'MaxMatrixCols'.~Its~actual~value~is~\int_use:N \c at MaxMatrixCols.~
+    'MaxMatrixCols'.~Its~current~value~is~\int_use:N \c at MaxMatrixCols.~
     This~error~is~fatal.
   }
 %    \end{macrocode}
@@ -19176,7 +19394,8 @@
     Columns~not~used.\\
     The~preamble~of~your~\@@_full_name_env:\ announces~\int_use:N
     \g_@@_static_num_of_col_int\ columns~but~you~use~only~\int_use:N \c at jCol.\\ 
-    The~columns~you~did~not~used~won't~be~created.
+    The~columns~you~did~not~used~won't~be~created.\\
+    We~won't~have~similar~error~till~the~end~of~the~document.
   }
 %    \end{macrocode}
 %
@@ -19242,8 +19461,17 @@
     is~'standard'.~That~key~will~be~ignored.
   }
 %    \end{macrocode}
-%
+% 
 %    \begin{macrocode}
+\@@_msg_new:nn { Unknown~key~for~rules }
+  {
+    Unknown~key.\\
+    There~is~only~two~keys~available~here:~width~and~color.\\
+    You~key~'\l_keys_key_str'~will~be~ignored.
+  }
+%    \end{macrocode}
+% 
+%    \begin{macrocode}
 \@@_msg_new:nnn { Unknown~key~for~custom-line }
   {
     Unknown~key.\\
@@ -19404,8 +19632,8 @@
   { 
     Erroneous~use.\\
     Your~use~of~'custom-line'~is~no-op~since~you~don't~have~used~the~
-    key~'letter'~(for~a~letter~for~vertical~rules)~nor~the~key~'command'~
-    (to~draw~horizontal~rules).\\
+    key~'letter'~(for~a~letter~for~vertical~rules)~nor~the~keys~'command'~or~
+    ~'ccommand'~(to~draw~horizontal~rules).\\
     However,~you~can~go~on.
   }
 %    \end{macrocode}
@@ -19723,7 +19951,8 @@
   {
     siunitx~too~old.\\
     You~can't~use~'S'~columns~because~your~version~of~'siunitx'~
-    is~too~old.~You~need~at~least~v~3.0.\\
+    is~too~old.~You~need~at~least~v~3.0~and~your~log~file~says:~"siunitx,~ 
+    \use:c { ver @ siunitx.sty }". \\
     This~error~is~fatal.
   }
 %    \end{macrocode}
@@ -19865,6 +20094,7 @@
     last-row,~
     left-margin,~
     light-syntax,~
+    matrix/columns-type,~
     notes~(several~subkeys),~
     nullify-dots,~
     renew-dots,~
@@ -19965,6 +20195,7 @@
     code-for-last-col,~
     code-for-last-row,~
     colortbl-like,~
+    columns-type,~
     columns-width,~
     corners,~
     create-extra-nodes,~
@@ -20669,7 +20900,14 @@
 % It's possible to use |\line| in the |\CodeAfter| between two blocks (and not
 % only two cells).
 %
+% \subsection*{Changes between version 6.10 and 6.11}
 %
+% New key |matrix/columns-type| to spcecify the type of columns of the matrices.
+%
+% New key |ccommand| in |custom-line| and new command |\cdotteline|.
+%
+% \subsection*{Changes between version 6.11 and 6.12}
+%
 % \PrintIndex
 % 
 % \tableofcontents

Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2022-07-16 19:53:10 UTC (rev 63911)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2022-07-16 19:53:27 UTC (rev 63912)
@@ -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.10a}
-\def\myfiledate{2022/06/26}
+\def\myfileversion{6.11}
+\def\myfiledate{2022/07/16}
 \RequirePackage{pgfcore}
 \usepgfmodule{shapes}
 \RequirePackage{l3keys2e}
@@ -43,11 +43,12 @@
       { \msg_new:nnn { nicematrix } { #1 } { #2 \\ #3 } }
       { \msg_new:nnnn { nicematrix } { #1 } { #2 } { #3 } }
   }
-
+\str_if_eq:VnT \c_sys_jobname_str { output }
+  { \bool_set_true:N \c__nicematrix_messages_for_Overleaf_bool }
 \cs_new_protected:Npn \__nicematrix_msg_redirect_name:nn
   { \msg_redirect_name:nnn { nicematrix } }
 \tl_new:N \l__nicematrix_argspec_tl
-\cs_generate_variant:Nn \seq_gset_split:Nnn { N V n }
+\cs_generate_variant:Nn \seq_set_split:Nnn { N V n }
 \cs_generate_variant:Nn \keys_define:nn { n x }
 \hook_gput_code:nnn { begindocument } { . }
   {
@@ -146,7 +147,7 @@
               { \cs_gset:Npn \CT at arc@ { \color #1 { #2 } } }
           }
         \cs_set:Npn \doublerulesepcolor #1 # { \CT at drs { #1 } }
-        \cs_set:Npn\CT at drs #1 #2
+        \cs_set:Npn \CT at drs #1 #2
           {
             \dim_compare:nNnT \baselineskip = \c_zero_dim \noalign
               { \cs_gset:Npn \CT at drsc@ { \color #1 { #2 } } }
@@ -206,18 +207,36 @@
 \cs_generate_variant:Nn \__nicematrix_cline_i:nn { e n }
 \cs_new:Npn \__nicematrix_math_toggle_token:
   { \bool_if:NF \l__nicematrix_NiceTabular_bool \c_math_toggle_token }
-\cs_new_protected:Npn \__nicematrix_set_CT at arc@:
-  { \peek_meaning:NTF [ \__nicematrix_set_CT at arc@_i: \__nicematrix_set_CT at arc@_ii: }
-\cs_new_protected:Npn \__nicematrix_set_CT at arc@_i: [ #1 ] #2 \q_stop
-  { \cs_set:Npn \CT at arc@ { \color [ #1 ] { #2 } } }
-\cs_new_protected:Npn \__nicematrix_set_CT at arc@_ii: #1 \q_stop
-  { \cs_set:Npn \CT at arc@ { \color { #1 } } }
-\cs_new_protected:Npn \__nicematrix_set_CT at drsc@:
-  { \peek_meaning:NTF [ \__nicematrix_set_CT at drsc@_i: \__nicematrix_set_CT at drsc@_ii: }
-\cs_new_protected:Npn \__nicematrix_set_CT at drsc@_i: [ #1 ] #2 \q_stop
-  { \cs_set:Npn \CT at drsc@ { \color [ #1 ] { #2 } } }
-\cs_new_protected:Npn \__nicematrix_set_CT at drsc@_ii: #1 \q_stop
-  { \cs_set:Npn \CT at drsc@ { \color { #1 } } }
+\cs_new_protected:Npn \__nicematrix_set_CT at arc@:n #1
+  {
+    \tl_if_blank:nF { #1 }
+      {
+        \tl_if_head_eq_meaning:nNTF { #1 } [
+          { \cs_set:Npn \CT at arc@ { \color #1 } }
+          { \cs_set:Npn \CT at arc@ { \color { #1 } } }
+      }
+  }
+\cs_generate_variant:Nn \__nicematrix_set_CT at arc@:n { V }
+\cs_new_protected:Npn \__nicematrix_set_CT at drsc@:n #1
+  {
+    \tl_if_head_eq_meaning:nNTF { #1 } [
+      { \cs_set:Npn \CT at drsc@ { \color #1 } }
+      { \cs_set:Npn \CT at drsc@ { \color { #1 } } }
+  }
+\cs_generate_variant:Nn \__nicematrix_set_CT at drsc@:n { V }
+\cs_new:Npn \__nicematrix_exp_color_arg:Nn #1 #2
+  {
+    \tl_if_head_eq_meaning:nNTF { #2 } [
+      { #1 #2 }
+      { #1 { #2 } }
+  }
+\cs_generate_variant:Nn \__nicematrix_exp_color_arg:Nn { N V }
+\cs_new_protected:Npn \__nicematrix_color:n #1
+  {
+    \tl_if_blank:nF { #1 }
+      { \__nicematrix_exp_color_arg:Nn \color { #1 } }
+  }
+\cs_generate_variant:Nn \__nicematrix_color:n { V }
 \cs_set_eq:NN \__nicematrix_old_pgfpointanchor \pgfpointanchor
 \bool_new:N \l__nicematrix_siunitx_loaded_bool
 \hook_gput_code:nnn { begindocument } { . }
@@ -266,7 +285,7 @@
 \bool_new:N \l__nicematrix_in_env_bool
 \bool_new:N \l__nicematrix_notes_detect_duplicates_bool
 \bool_set_true:N \l__nicematrix_notes_detect_duplicates_bool
-\bool_new:N \l__nicematrix_NiceArray_bool
+\bool_new:N \g__nicematrix_NiceArray_bool
 \bool_new:N \l__nicematrix_NiceTabular_bool
 \dim_new:N \l__nicematrix_tabular_width_dim
 \dim_new:N \l__nicematrix_rule_width_dim
@@ -274,6 +293,9 @@
 \bool_new:N \g__nicematrix_rotate_bool
 \bool_new:N \l__nicematrix_X_column_bool
 \tl_new:N \g__nicematrix_aux_tl
+\tl_new:N \l__nicematrix_columns_type_tl
+\hook_gput_code:nnn { begindocument } { . }
+  { \__nicematrix_set_preamble:Nn \l__nicematrix_columns_type_tl { c } }
 \cs_new_protected:Npn \__nicematrix_test_if_math_mode:
   {
     \if_mode_math: \else:
@@ -435,7 +457,7 @@
           }
         \NewDocumentCommand \tabularnote { m }
           {
-            \bool_if:nTF { ! \l__nicematrix_NiceArray_bool && \l__nicematrix_in_env_bool }
+            \bool_if:nTF { ! \g__nicematrix_NiceArray_bool && \l__nicematrix_in_env_bool }
               { \__nicematrix_error:n { tabularnote~forbidden } }
               {
                 \int_zero:N \l_tmpa_int
@@ -620,7 +642,8 @@
     color .tl_set:N = \l__nicematrix_rules_color_tl ,
     color .value_required:n = true ,
     width .dim_set:N = \arrayrulewidth ,
-    width .value_required:n = true
+    width .value_required:n = true ,
+    unknown .code:n = \__nicematrix_error:n { Unknown~key~for~rules }
   }
 \keys_define:nn { NiceMatrix / Global }
   {
@@ -855,9 +878,11 @@
     allow-duplicate-names .value_forbidden:n = true ,
     notes .code:n = \keys_set:nn { NiceMatrix / notes } { #1 } ,
     notes .value_required:n = true ,
-    sub-matrix .code:n =
-      \keys_set:nn { NiceMatrix / sub-matrix } { #1 } ,
+    sub-matrix .code:n = \keys_set:nn { NiceMatrix / sub-matrix } { #1 } ,
     sub-matrix .value_required:n = true ,
+    matrix / columns-type .code:n =
+      \__nicematrix_set_preamble:Nn \l__nicematrix_columns_type_tl { #1 },
+    matrix / columns-type .value_required:n = true ,
     unknown .code:n  = \__nicematrix_error:n { Unknown~key~for~NiceMatrixOptions }
   }
 \NewDocumentCommand \NiceMatrixOptions { m }
@@ -870,8 +895,10 @@
                            \int_set:Nn \l__nicematrix_last_col_int { -1 }
                          }
                          { \int_set:Nn \l__nicematrix_last_col_int { #1 } } ,
-    l .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl l ,
-    r .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl r ,
+    columns-type .code:n = \__nicematrix_set_preamble:Nn \l__nicematrix_columns_type_tl { #1 } ,
+    columns-type .value_required:n = true ,
+    l .meta:n = { columns-type = l } ,
+    r .meta:n = { columns-type = r } ,
     small .bool_set:N = \l__nicematrix_small_bool ,
     small .value_forbidden:n = true ,
     unknown .code:n = \__nicematrix_error:n { Unknown~key~for~NiceMatrix }
@@ -1118,7 +1145,7 @@
           { \exp_not:n { #3 } }
       }
   }
-\cs_new_protected:Npn \__nicematrix_array:
+\cs_new_protected:Npn \__nicematrix_array:n
   {
     \bool_if:NTF \l__nicematrix_NiceTabular_bool
       { \dim_set_eq:NN \col at sep \tabcolsep }
@@ -1129,6 +1156,7 @@
     \@tabarray
     [ \str_if_eq:VnTF \l__nicematrix_baseline_tl c c t ]
   }
+\cs_generate_variant:Nn \__nicematrix_array:n { V }
 \cs_set_eq:NN \__nicematrix_old_ialign: \ialign
 \cs_new_protected:Npn \__nicematrix_create_row_node:
   {
@@ -1348,10 +1376,9 @@
     \int_gset:Nn \g__nicematrix_last_row_node_int { -1 }
     \__nicematrix_pre_array_ii:
     \box_clear_new:N \l__nicematrix_the_array_box
-    \__nicematrix_construct_preamble:
     \dim_zero_new:N \l__nicematrix_left_delim_dim
     \dim_zero_new:N \l__nicematrix_right_delim_dim
-    \bool_if:NTF \l__nicematrix_NiceArray_bool
+    \bool_if:NTF \g__nicematrix_NiceArray_bool
       {
         \dim_gset:Nn \l__nicematrix_left_delim_dim { 2 \arraycolsep }
         \dim_gset:Nn \l__nicematrix_right_delim_dim { 2 \arraycolsep }
@@ -1591,12 +1618,11 @@
         \bool_set_true:N \l__nicematrix_code_before_bool
         \tl_put_right:NV \l__nicematrix_code_before_tl \g__nicematrix_code_before_tl
       }
-    \bool_if:NTF \l__nicematrix_NiceArray_bool
+    \bool_if:NTF \g__nicematrix_NiceArray_bool
       { \keys_set:nn { NiceMatrix / NiceArray } }
       { \keys_set:nn { NiceMatrix / pNiceArray } }
     { #3 , #5 }
-    \tl_if_empty:NF \l__nicematrix_rules_color_tl
-      { \exp_after:wN \__nicematrix_set_CT at arc@: \l__nicematrix_rules_color_tl \q_stop }
+    \__nicematrix_set_CT at arc@:V \l__nicematrix_rules_color_tl
     \IfBooleanTF { #6 } \__nicematrix_CodeBefore_Body:w \__nicematrix_pre_array:
   }
   {
@@ -1663,7 +1689,7 @@
         \skip_horizontal:N \col at sep
         \skip_horizontal:N \g__nicematrix_width_first_col_dim
       }
-    \bool_if:NTF \l__nicematrix_NiceArray_bool
+    \bool_if:NTF \g__nicematrix_NiceArray_bool
       {
         \str_case:VnF \l__nicematrix_baseline_tl
           {
@@ -1688,8 +1714,7 @@
         \hbox_set:Nn \l_tmpa_box
           {
             \c_math_toggle_token
-            \tl_if_empty:NF \l__nicematrix_delimiters_color_tl
-              { \color { \l__nicematrix_delimiters_color_tl } }
+            \__nicematrix_color:V \l__nicematrix_delimiters_color_tl
             \exp_after:wN \left \g__nicematrix_left_delim_tl
             \vcenter
               {
@@ -1706,8 +1731,7 @@
                   }
                 \skip_vertical:n { -\l_tmpb_dim + \arrayrulewidth }
               }
-            \tl_if_empty:NF \l__nicematrix_delimiters_color_tl
-              { \color { \l__nicematrix_delimiters_color_tl } }
+            \__nicematrix_color:V \l__nicematrix_delimiters_color_tl
             \exp_after:wN \right \g__nicematrix_right_delim_tl
             \c_math_toggle_token
           }
@@ -1726,12 +1750,14 @@
     \bool_if:NF \l__nicematrix_Matrix_bool
       {
         \int_compare:nNnT \c at jCol < \g__nicematrix_static_num_of_col_int
-          { \__nicematrix_error:n { columns~not~used } }
+          {
+            \__nicematrix_error:n { columns~not~used }
+            \group_begin:
+            \globaldefs = 1
+            \__nicematrix_msg_redirect_name:nn { columns~not~used } { none }
+            \group_end:
+          }
       }
-    \group_begin:
-    \globaldefs = 1
-    \__nicematrix_msg_redirect_name:nn { columns~not~used } { error }
-    \group_end:
     \__nicematrix_after_array:
     \egroup
     \iow_now:Nn \@mainaux { \ExplSyntaxOn }
@@ -1744,32 +1770,32 @@
     \iow_now:Nn \@mainaux { \ExplSyntaxOff }
     \bool_if:NT \c__nicematrix_footnote_bool \endsavenotes
   }
-\cs_new_protected:Npn \__nicematrix_construct_preamble:
+\cs_new_protected:Npn \__nicematrix_transform_preamble:
   {
     \group_begin:
     \bool_if:NF \l__nicematrix_Matrix_bool
-     {
-       \__nicematrix_newcolumntype w [ 2 ] { \__nicematrix_w: { ##1 } { ##2 } }
-       \__nicematrix_newcolumntype W [ 2 ] { \__nicematrix_W: { ##1 } { ##2 } }
-      \cs_if_exist:NT \NC at find@V { \__nicematrix_newcolumntype V { \__nicematrix_V: } }
-      \exp_args:NV \@temptokena \g__nicematrix_preamble_tl
-      \@tempswatrue
-      \@whilesw \if at tempswa \fi { \@tempswafalse \the \NC at list }
-      \int_gzero:N \c at jCol
-      \tl_gclear:N \g__nicematrix_preamble_tl
-      \bool_gset_false:N \g_tmpb_bool
-      \tl_if_eq:NnTF \l__nicematrix_vlines_clist { all }
-        {
-          \tl_gset:Nn \g__nicematrix_preamble_tl
-            { ! { \skip_horizontal:N \arrayrulewidth } }
-        }
-        {
-          \clist_if_in:NnT \l__nicematrix_vlines_clist 1
-            {
-              \tl_gset:Nn \g__nicematrix_preamble_tl
-                { ! { \skip_horizontal:N \arrayrulewidth } }
-            }
-        }
+      {
+        \__nicematrix_newcolumntype w [ 2 ] { \__nicematrix_w: { ##1 } { ##2 } }
+        \__nicematrix_newcolumntype W [ 2 ] { \__nicematrix_W: { ##1 } { ##2 } }
+        \cs_if_exist:NT \NC at find@V { \__nicematrix_newcolumntype V { \__nicematrix_V: } }
+        \exp_args:NV \@temptokena \g__nicematrix_preamble_tl
+        \@tempswatrue
+        \@whilesw \if at tempswa \fi { \@tempswafalse \the \NC at list }
+        \int_gzero:N \c at jCol
+        \tl_gclear:N \g__nicematrix_preamble_tl
+        \bool_gset_false:N \g_tmpb_bool
+        \tl_if_eq:NnTF \l__nicematrix_vlines_clist { all }
+          {
+            \tl_gset:Nn \g__nicematrix_preamble_tl
+              { ! { \skip_horizontal:N \arrayrulewidth } }
+          }
+          {
+            \clist_if_in:NnT \l__nicematrix_vlines_clist 1
+              {
+                \tl_gset:Nn \g__nicematrix_preamble_tl
+                  { ! { \skip_horizontal:N \arrayrulewidth } }
+              }
+          }
         \seq_clear:N \g__nicematrix_cols_vlism_seq
         \int_zero:N \l_tmpa_int
         \exp_after:wN \__nicematrix_patch_preamble:n \the \@temptokena \q_stop
@@ -1784,9 +1810,9 @@
       }
     \group_end:
     \bool_lazy_or:nnT
-      { ! \str_if_eq_p:Vn \g__nicematrix_left_delim_tl { . } }
-      { ! \str_if_eq_p:Vn \g__nicematrix_right_delim_tl { . } }
-      { \bool_set_false:N \l__nicematrix_NiceArray_bool }
+       { ! \str_if_eq_p:Vn \g__nicematrix_left_delim_tl { . } }
+       { ! \str_if_eq_p:Vn \g__nicematrix_right_delim_tl { . } }
+       { \bool_gset_false:N \g__nicematrix_NiceArray_bool }
     \bool_if:NT \g_tmpb_bool { \bool_set_true:N \l__nicematrix_bar_at_end_of_pream_bool }
     \int_compare:nNnTF \l__nicematrix_first_col_int = 0
       { \tl_gput_left:NV \g__nicematrix_preamble_tl \c__nicematrix_preamble_first_col_tl }
@@ -1793,7 +1819,7 @@
       {
         \bool_lazy_all:nT
           {
-            \l__nicematrix_NiceArray_bool
+            \g__nicematrix_NiceArray_bool
             { \bool_not_p:n \l__nicematrix_NiceTabular_bool }
             { \tl_if_empty_p:N \l__nicematrix_vlines_clist }
             { \bool_not_p:n \l__nicematrix_exterior_arraycolsep_bool }
@@ -1805,7 +1831,7 @@
       {
         \bool_lazy_all:nT
           {
-            \l__nicematrix_NiceArray_bool
+            \g__nicematrix_NiceArray_bool
             { \bool_not_p:n \l__nicematrix_NiceTabular_bool }
             { \tl_if_empty_p:N \l__nicematrix_vlines_clist }
             { \bool_not_p:n \l__nicematrix_exterior_arraycolsep_bool }
@@ -2270,6 +2296,15 @@
     \tl_gput_right:Nn \g__nicematrix_preamble_tl { < { #1 } }
     \__nicematrix_patch_preamble_xi:n
   }
+\cs_new_protected:Npn \__nicematrix_set_preamble:Nn #1 #2
+  {
+    \@temptokena { #2 }
+    \@tempswatrue
+    \@whilesw \if at tempswa \fi { \@tempswafalse \the \NC at list }
+    \tl_gclear:N \g__nicematrix_preamble_tl
+    \exp_after:wN \__nicematrix_patch_m_preamble:n \the \@temptokena \q_stop
+    \tl_set_eq:NN #1 \g__nicematrix_preamble_tl
+  }
 \cs_new:Npn \__nicematrix_multicolumn:nnn #1 #2 #3
   {
     \multispan { #1 }
@@ -2399,22 +2434,7 @@
   {
     \str_if_eq:nnTF { #1 } { < }
       \__nicematrix_patch_m_preamble_ix:n
-      {
-        \tl_if_eq:NnTF \l__nicematrix_vlines_clist { all }
-          {
-            \tl_gput_right:Nn \g__nicematrix_preamble_tl
-              { ! { \skip_horizontal:N \arrayrulewidth } }
-          }
-          {
-            \exp_args:NNx
-            \clist_if_in:NnT \l__nicematrix_vlines_clist { \int_eval:n { \c at jCol + 1 } }
-              {
-                \tl_gput_right:Nn \g__nicematrix_preamble_tl
-                  { ! { \skip_horizontal:N \arrayrulewidth } }
-              }
-          }
-        \__nicematrix_patch_m_preamble:n { #1 }
-      }
+      { \__nicematrix_patch_m_preamble:n { #1 } }
   }
 \cs_new_protected:Npn \__nicematrix_patch_m_preamble_ix:n #1
   {
@@ -2472,7 +2492,7 @@
   }
 \cs_new_protected:Npn \__nicematrix_use_arraybox_with_notes_c:
   {
-    \bool_lazy_and:nnT \l__nicematrix_Matrix_bool \l__nicematrix_NiceArray_bool
+    \bool_lazy_and:nnT \l__nicematrix_Matrix_bool \g__nicematrix_NiceArray_bool
       {
         \box_set_wd:Nn \l__nicematrix_the_array_box
           { \box_wd:N \l__nicematrix_the_array_box - \arraycolsep }
@@ -2624,7 +2644,10 @@
       {
         \peek_meaning:NTF \end
           \__nicematrix_analyze_end:Nn
-          { \exp_args:NV \__nicematrix_array: \g__nicematrix_preamble_tl }
+          {
+            \__nicematrix_transform_preamble:
+            \__nicematrix_array:V \g__nicematrix_preamble_tl
+          }
       }
   }
   {
@@ -2641,35 +2664,56 @@
         \str_if_eq:nnT { ##1 } { \\ }
           { \__nicematrix_fatal:n { double-backslash~in~light-syntax } }
       }
-    \__nicematrix_light_syntax_i #1 \CodeAfter \q_stop
+    \__nicematrix_light_syntax_i:w #1 \CodeAfter \q_stop
   }
-  { }
-\cs_new_protected:Npn \__nicematrix_light_syntax_i #1\CodeAfter #2\q_stop
   {
+    \__nicematrix_create_col_nodes:
+    \endarray
+  }
+\cs_new_protected:Npn \__nicematrix_light_syntax_i:w #1\CodeAfter #2\q_stop
+  {
     \tl_gput_right:Nn \g_nicematrix_code_after_tl { #2 }
-    \seq_gclear_new:N \g__nicematrix_rows_seq
+    \seq_clear_new:N \l__nicematrix_rows_seq
     \tl_set_rescan:Nno \l__nicematrix_end_of_row_tl { } \l__nicematrix_end_of_row_tl
-    \seq_gset_split:NVn \g__nicematrix_rows_seq \l__nicematrix_end_of_row_tl { #1 }
+    \seq_set_split:NVn \l__nicematrix_rows_seq \l__nicematrix_end_of_row_tl { #1 }
+    \seq_pop_right:NN \l__nicematrix_rows_seq \l_tmpa_tl
+    \tl_if_empty:NF \l_tmpa_tl
+      { \seq_put_right:NV \l__nicematrix_rows_seq \l_tmpa_tl }
     \int_compare:nNnT \l__nicematrix_last_row_int = { -1 }
-      { \int_set:Nn \l__nicematrix_last_row_int { \seq_count:N \g__nicematrix_rows_seq } }
-    \exp_args:NV \__nicematrix_array: \g__nicematrix_preamble_tl
-    \seq_gpop_left:NN \g__nicematrix_rows_seq \l_tmpa_tl
-    \__nicematrix_line_with_light_syntax_i:V \l_tmpa_tl
-    \seq_map_function:NN \g__nicematrix_rows_seq \__nicematrix_line_with_light_syntax:n
-    \__nicematrix_create_col_nodes:
-    \endarray
+      { \int_set:Nn \l__nicematrix_last_row_int { \seq_count:N \l__nicematrix_rows_seq } }
+    \tl_clear_new:N \l__nicematrix_new_body_tl
+    \int_zero_new:N \l__nicematrix_nb_cols_int
+    \seq_pop_left:NN \l__nicematrix_rows_seq \l_tmpa_tl
+    \__nicematrix_line_with_light_syntax:V \l_tmpa_tl
+    \seq_map_inline:Nn \l__nicematrix_rows_seq
+      {
+        \tl_put_right:Nn \l__nicematrix_new_body_tl { \\ }
+        \__nicematrix_line_with_light_syntax:n { ##1 }
+      }
+    \int_compare:nNnT \l__nicematrix_last_col_int = { -1 }
+      {
+        \int_set:Nn \l__nicematrix_last_col_int
+          { \l__nicematrix_nb_cols_int - 1 + \l__nicematrix_first_col_int }
+      }
+    \__nicematrix_transform_preamble:
+    \__nicematrix_array:V \g__nicematrix_preamble_tl \l__nicematrix_new_body_tl
   }
 \cs_new_protected:Npn \__nicematrix_line_with_light_syntax:n #1
-  { \tl_if_empty:nF { #1 } { \\ \__nicematrix_line_with_light_syntax_i:n { #1 } } }
-\cs_new_protected:Npn \__nicematrix_line_with_light_syntax_i:n #1
   {
-    \seq_gclear_new:N \g__nicematrix_cells_seq
-    \seq_gset_split:Nnn \g__nicematrix_cells_seq { ~ } { #1 }
-    \seq_gpop_left:NN \g__nicematrix_cells_seq \l_tmpa_tl
-    \l_tmpa_tl
-    \seq_map_inline:Nn \g__nicematrix_cells_seq { & ##1 }
+    \seq_clear_new:N \l__nicematrix_cells_seq
+    \seq_set_split:Nnn \l__nicematrix_cells_seq { ~ } { #1 }
+    \int_set:Nn \l__nicematrix_nb_cols_int
+      {
+        \int_max:nn
+          \l__nicematrix_nb_cols_int
+          { \seq_count:N \l__nicematrix_cells_seq }
+      }
+    \seq_pop_left:NN \l__nicematrix_cells_seq \l_tmpa_tl
+    \tl_put_right:NV \l__nicematrix_new_body_tl \l_tmpa_tl
+    \seq_map_inline:Nn \l__nicematrix_cells_seq
+      { \tl_put_right:Nn \l__nicematrix_new_body_tl { & ##1 } }
   }
-\cs_generate_variant:Nn \__nicematrix_line_with_light_syntax_i:n { V }
+\cs_generate_variant:Nn \__nicematrix_line_with_light_syntax:n { V }
 \cs_new_protected:Npn \__nicematrix_analyze_end:Nn #1 #2
   {
     \str_if_eq:VnT \g__nicematrix_name_env_str { #2 }
@@ -2806,7 +2850,7 @@
         \int_gincr:N \g_tmpa_int
         \bool_lazy_all:nT
           {
-            \l__nicematrix_NiceArray_bool
+            \g__nicematrix_NiceArray_bool
             { \bool_not_p:n \l__nicematrix_NiceTabular_bool }
             { \clist_if_empty_p:N \l__nicematrix_vlines_clist }
             { \bool_not_p:n \l__nicematrix_exterior_arraycolsep_bool }
@@ -2818,13 +2862,13 @@
             \hbox
               {
                 \skip_horizontal:N -0.5\arrayrulewidth
-                \bool_lazy_and:nnT \l__nicematrix_Matrix_bool \l__nicematrix_NiceArray_bool
+                \bool_lazy_and:nnT \l__nicematrix_Matrix_bool \g__nicematrix_NiceArray_bool
                   { \skip_horizontal:N -\arraycolsep }
                 \pgfsys at markposition
                   { \__nicematrix_env: - col - \int_eval:n {
                     \g_tmpa_int + 1 } }
                 \skip_horizontal:N 0.5\arrayrulewidth
-                \bool_lazy_and:nnT \l__nicematrix_Matrix_bool \l__nicematrix_NiceArray_bool
+                \bool_lazy_and:nnT \l__nicematrix_Matrix_bool \g__nicematrix_NiceArray_bool
                   { \skip_horizontal:N \arraycolsep }
               }
           }
@@ -2832,7 +2876,7 @@
           \pgfrememberpicturepositiononpagetrue
           \pgfcoordinate { \__nicematrix_env: - col - \int_eval:n { \g_tmpa_int + 1 } }
             {
-              \bool_lazy_and:nnTF \l__nicematrix_Matrix_bool \l__nicematrix_NiceArray_bool
+              \bool_lazy_and:nnTF \l__nicematrix_Matrix_bool \g__nicematrix_NiceArray_bool
                 {
                   \pgfpoint
                     { - 0.5 \arrayrulewidth - \arraycolsep }
@@ -2969,7 +3013,7 @@
   }
 \NewDocumentEnvironment { NiceArray } { }
   {
-    \bool_set_true:N \l__nicematrix_NiceArray_bool
+    \bool_gset_true:N \g__nicematrix_NiceArray_bool
     \str_if_empty:NT \g__nicematrix_name_env_str
       { \str_gset:Nn \g__nicematrix_name_env_str { NiceArray } }
     \NiceArrayWithDelims . .
@@ -2979,6 +3023,7 @@
   {
     \NewDocumentEnvironment { #1 NiceArray } { }
       {
+        \bool_gset_false:N \g__nicematrix_NiceArray_bool
         \str_if_empty:NT \g__nicematrix_name_env_str
           { \str_gset:Nn \g__nicematrix_name_env_str { #1 NiceArray } }
         \__nicematrix_test_if_math_mode:
@@ -3002,21 +3047,29 @@
               \c at MaxMatrixCols
               { \int_eval:n { \l__nicematrix_last_col_int - 1 } }
           }
-          { > \__nicematrix_cell_begin:w #2 < \__nicematrix_cell_end: }
+          { #2 }
       }
   }
-\cs_generate_variant:Nn \__nicematrix_begin_of_NiceMatrix:nn { n e }
-\clist_map_inline:nn { { } , p , b , B , v , V }
+\cs_generate_variant:Nn \__nicematrix_begin_of_NiceMatrix:nn { n V }
+\clist_map_inline:nn { p , b , B , v , V }
   {
     \NewDocumentEnvironment { #1 NiceMatrix } { ! O { } }
       {
+        \bool_gset_false:N \g__nicematrix_NiceArray_bool
         \str_gset:Nn \g__nicematrix_name_env_str { #1 NiceMatrix }
-        \tl_set:Nn \l__nicematrix_type_of_col_tl c
         \keys_set:nn { NiceMatrix / NiceMatrix } { ##1 }
-        \__nicematrix_begin_of_NiceMatrix:ne { #1 } \l__nicematrix_type_of_col_tl
+        \__nicematrix_begin_of_NiceMatrix:nV { #1 } \l__nicematrix_columns_type_tl
       }
       { \use:c { end #1 NiceArray } }
   }
+\NewDocumentEnvironment { NiceMatrix } { ! O { } }
+  {
+    \bool_gset_false:N \g__nicematrix_NiceArray_bool
+    \str_gset:Nn \g__nicematrix_name_env_str { NiceMatrix }
+    \keys_set:nn { NiceMatrix / NiceMatrix } { #1 }
+    \__nicematrix_begin_of_NiceMatrix:nV { } \l__nicematrix_columns_type_tl
+  }
+  { \endNiceArray }
 \cs_new_protected:Npn \__nicematrix_NotEmpty:
   { \bool_gset_true:N \g__nicematrix_not_empty_cell_bool }
 \NewDocumentEnvironment { NiceTabular } { O { } m ! O { } }
@@ -4384,7 +4437,7 @@
         cell-space-top-limit = #1 ,
         cell-space-bottom-limit = #1 ,
       } ,
-    color .tl_set:N = \l_tmpa_tl ,
+    color .tl_set:N = \l__nicematrix_color_tl ,
     color .value_required:n = true ,
     bold .bool_set:N = \l_tmpa_bool ,
     bold .default:n = true ,
@@ -4391,10 +4444,10 @@
     bold .initial:n = false ,
     nb-rows .code:n =
       \str_if_eq:nnTF { #1 } { * }
-        { \int_set_eq:NN \l__nicematrix_key_nb_rows_int 500 }
+        { \int_set:Nn \l__nicematrix_key_nb_rows_int { 500 } }
         { \int_set:Nn \l__nicematrix_key_nb_rows_int { #1 } } ,
     nb-rows .value_required:n = true ,
-    rowcolor .tl_set:N = \l__nicematrix_tmpc_tl ,
+    rowcolor .tl_set:N = \l_tmpa_tl ,
     rowcolor .value_required:n = true ,
     rowcolor .initial:n = ,
     unknown .code:n = \__nicematrix_error:n { Unknown~key~for~RowStyle }
@@ -4401,15 +4454,15 @@
   }
 \NewDocumentCommand \__nicematrix_RowStyle:n { O { } m }
   {
-    \tl_clear:N \l_tmpa_tl
+    \group_begin:
+    \tl_clear:N \l__nicematrix_color_tl
     \int_set:Nn \l__nicematrix_key_nb_rows_int 1
     \keys_set:nn { NiceMatrix / RowStyle } { #1 }
-    \tl_if_empty:NF \l__nicematrix_tmpc_tl
+    \tl_if_empty:NF \l_tmpa_tl
       {
         \tl_gput_right:Nx \g_nicematrix_code_before_tl
           {
-            \__nicematrix_rectanglecolor
-              { \l__nicematrix_tmpc_tl }
+            \__nicematrix_exp_color_arg:NV \__nicematrix_rectanglecolor \l_tmpa_tl
               { \int_use:N \c at iRow - \int_use:N \c at jCol }
               { \int_use:N \c at iRow - * }
           }
@@ -4417,8 +4470,7 @@
           {
             \tl_gput_right:Nx \g_nicematrix_code_before_tl
               {
-                \__nicematrix_rowcolor
-                  { \l__nicematrix_tmpc_tl }
+                \__nicematrix_exp_color_arg:NV \__nicematrix_rowcolor \l_tmpa_tl
                   {
                     \int_eval:n { \c at iRow + 1 }
                     - \int_eval:n { \c at iRow + \l__nicematrix_key_nb_rows_int - 1 }
@@ -4452,10 +4504,13 @@
               }
           }
       }
-    \tl_if_empty:NF \l_tmpa_tl
+    \tl_if_empty:NF \l__nicematrix_color_tl
       {
         \tl_gput_right:Nx \g__nicematrix_row_style_tl
-          { \mode_leave_vertical: \exp_not:N \color { \l_tmpa_tl } }
+          {
+            \mode_leave_vertical:
+            \__nicematrix_color:n { \l__nicematrix_color_tl }
+          }
       }
     \bool_if:NT \l_tmpa_bool
       {
@@ -4471,6 +4526,7 @@
           }
       }
     \tl_gput_right:Nn \g__nicematrix_row_style_tl { \fi }
+    \group_end:
     \g__nicematrix_row_style_tl
     \ignorespaces
   }
@@ -4827,7 +4883,12 @@
     position .value_required:n = true ,
     start .int_set:N = \l__nicematrix_start_int ,
     start .initial:n = 1 ,
-    end .int_set:N = \l__nicematrix_end_int ,
+    end .code:n =
+      \bool_lazy_or:nnTF
+        { \tl_if_empty_p:n { #1 } }
+        { \str_if_eq_p:nn { #1 } { last } }
+        { \int_set_eq:NN \l__nicematrix_end_int \c at jCol }
+        { \int_set:Nn \l__nicematrix_end_int { #1 } }
   }
 \keys_define:nn { NiceMatrix / RulesBis }
   {
@@ -4836,9 +4897,9 @@
     dotted .bool_set:N = \l__nicematrix_dotted_bool ,
     dotted .initial:n = false ,
     dotted .default:n = true ,
-    color .code:n = \__nicematrix_set_CT at arc@: #1 \q_stop ,
+    color .code:n = \__nicematrix_set_CT at arc@:n { #1 } ,
     color .value_required:n = true ,
-    sep-color .code:n = \__nicematrix_set_CT at drsc@: #1 \q_stop ,
+    sep-color .code:n = \__nicematrix_set_CT at drsc@:n { #1 } ,
     sep-color .value_required:n = true ,
     tikz .tl_set:N = \l__nicematrix_tikz_rule_tl ,
     tikz .value_required:n = true ,
@@ -5022,11 +5083,11 @@
   {
     \int_step_inline:nnn
       {
-        \bool_if:nTF { \l__nicematrix_NiceArray_bool && ! \l__nicematrix_except_borders_bool }
+        \bool_if:nTF { \g__nicematrix_NiceArray_bool && ! \l__nicematrix_except_borders_bool }
           1 2
       }
       {
-        \bool_if:nTF { \l__nicematrix_NiceArray_bool && ! \l__nicematrix_except_borders_bool }
+        \bool_if:nTF { \g__nicematrix_NiceArray_bool && ! \l__nicematrix_except_borders_bool }
           { \int_eval:n { \c at jCol + 1 } }
           \c at jCol
       }
@@ -5184,7 +5245,7 @@
     \int_compare:nNnT \l__nicematrix_local_start_int = 1
       {
         \dim_sub:Nn \l__nicematrix_x_initial_dim \l__nicematrix_left_margin_dim
-        \bool_if:NT \l__nicematrix_NiceArray_bool
+        \bool_if:NT \g__nicematrix_NiceArray_bool
           { \dim_sub:Nn \l__nicematrix_x_initial_dim \arraycolsep }
         \tl_if_eq:NnF \g__nicematrix_left_delim_tl (
           { \dim_add:Nn \l__nicematrix_x_initial_dim  { 0.5 \l__nicematrix_xdots_inter_dim } }
@@ -5194,7 +5255,7 @@
     \int_compare:nNnT \l__nicematrix_local_end_int = \c at jCol
       {
         \dim_add:Nn \l__nicematrix_x_final_dim \l__nicematrix_right_margin_dim
-        \bool_if:NT \l__nicematrix_NiceArray_bool
+        \bool_if:NT \g__nicematrix_NiceArray_bool
           { \dim_add:Nn \l__nicematrix_x_final_dim \arraycolsep }
         \tl_if_eq:NnF \g__nicematrix_right_delim_tl )
           { \dim_gsub:Nn \l__nicematrix_x_final_dim { 0.5 \l__nicematrix_xdots_inter_dim } }
@@ -5224,11 +5285,11 @@
   {
     \int_step_inline:nnn
       {
-        \bool_if:nTF { \l__nicematrix_NiceArray_bool && ! \l__nicematrix_except_borders_bool }
+        \bool_if:nTF { \g__nicematrix_NiceArray_bool && ! \l__nicematrix_except_borders_bool }
           1 2
       }
       {
-        \bool_if:nTF { \l__nicematrix_NiceArray_bool && ! \l__nicematrix_except_borders_bool }
+        \bool_if:nTF { \g__nicematrix_NiceArray_bool && ! \l__nicematrix_except_borders_bool }
           { \int_eval:n { \c at iRow + 1 } }
           \c at iRow
       }
@@ -5270,11 +5331,15 @@
 \cs_new_protected:Npn \__nicematrix_custom_line:n #1
   {
     \str_clear_new:N \l__nicematrix_command_str
+    \str_clear_new:N \l__nicematrix_ccommand_str
     \str_clear_new:N \l__nicematrix_letter_str
     \keys_set_known:nnN { NiceMatrix / custom-line } { #1 } \l__nicematrix_other_keys_tl
-    \bool_lazy_and:nnTF
-      { \str_if_empty_p:N \l__nicematrix_letter_str }
-      { \str_if_empty_p:N \l__nicematrix_command_str }
+    \bool_lazy_all:nTF
+      {
+        { \str_if_empty_p:N \l__nicematrix_letter_str }
+        { \str_if_empty_p:N \l__nicematrix_command_str }
+        { \str_if_empty_p:N \l__nicematrix_ccommand_str }
+      }
       { \__nicematrix_error:n { No~letter~and~no~command } }
       { \exp_args:NV \__nicematrix_custom_line_i:n \l__nicematrix_other_keys_tl }
   }
@@ -5283,9 +5348,10 @@
     % here, we will use change in the future to use .str_set:N
     letter .code:n = \str_set:Nn \l__nicematrix_letter_str { #1 } ,
     letter .value_required:n = true ,
-    % here, we will use change in the future to use .str_set:N
     command .code:n = \str_set:Nn \l__nicematrix_command_str { #1 } ,
     command .value_required:n = true ,
+    ccommand .code:n = \str_set:Nn \l__nicematrix_ccommand_str { #1 } ,
+    ccommand .value_required:n = true ,
   }
 \cs_new_protected:Npn \__nicematrix_custom_line_i:n #1
   {
@@ -5324,6 +5390,7 @@
            }
        }
     \str_if_empty:NF \l__nicematrix_command_str { \__nicematrix_h_custom_line:n { #1 } }
+    \str_if_empty:NF \l__nicematrix_ccommand_str { \__nicematrix_c_custom_line:n { #1 } }
   }
 \str_const:Nn \c__nicematrix_forbidden_letters_str { lcrpmbVX|()[]!@<> }
 \keys_define:nn { NiceMatrix / custom-line-bis }
@@ -5382,6 +5449,41 @@
     \seq_put_left:NV \l__nicematrix_custom_line_commands_seq \l__nicematrix_command_str
   }
 \cs_generate_variant:Nn \__nicematrix_h_custom_line:nn { n V }
+\cs_new_protected:Npn \__nicematrix_c_custom_line:n #1
+  {
+    \exp_args:Nc \NewExpandableDocumentCommand
+      { nicematrix - \l__nicematrix_ccommand_str }
+      { O { } m }
+      {
+        \noalign
+          {
+            \__nicematrix_compute_rule_width:n { #1 , ##1 }
+            \skip_vertical:n { \l__nicematrix_rule_width_dim }
+            \clist_map_inline:nn
+              { ##2 }
+              { \__nicematrix_c_custom_line_i:nn { #1 , ##1 } { ####1 } }
+          }
+      }
+    \seq_put_left:NV \l__nicematrix_custom_line_commands_seq \l__nicematrix_ccommand_str
+  }
+\cs_new_protected:Npn \__nicematrix_c_custom_line_i:nn #1 #2
+  {
+    \str_if_in:nnTF { #2 } { - }
+      { \__nicematrix_cut_on_hyphen:w #2 \q_stop }
+      { \__nicematrix_cut_on_hyphen:w #2 - #2 \q_stop }
+    \tl_gput_right:Nx \g__nicematrix_internal_code_after_tl
+      {
+        \__nicematrix_hline:n
+          {
+            #1 ,
+            start = \l_tmpa_tl ,
+            end = \l_tmpb_tl ,
+            position = \int_eval:n { \c at iRow + 1 } ,
+            total-width = \dim_use:N \l__nicematrix_rule_width_dim
+          }
+      }
+  }
+\cs_generate_variant:Nn \__nicematrix_c_custom_line:nn { n V }
 \cs_new_protected:Npn \__nicematrix_compute_rule_width:n #1
   {
     \bool_set_false:N \l__nicematrix_tikz_rule_bool
@@ -5419,7 +5521,8 @@
           }
       }
   }
-\__nicematrix_custom_line:n { letter = : , command = hdottedline , dotted }
+\__nicematrix_custom_line:n
+  { letter = : , command = hdottedline , ccommand = cdottedline, dotted }
 \cs_new_protected:Npn \__nicematrix_test_hline_in_block:nnnnn #1 #2 #3 #4 #5
   {
     \bool_lazy_all:nT
@@ -5904,7 +6007,7 @@
       {
         \tl_if_empty:NTF \l__nicematrix_color_tl
           { \int_compare:nNnT { #2 } = 1 \set at color }
-          { \color { \l__nicematrix_color_tl } }
+          { \__nicematrix_color:V \l__nicematrix_color_tl }
         \int_compare:nNnT { #1 } = 1 \g__nicematrix_row_style_tl
         \group_begin:
         \bool_if:NF \l__nicematrix_respect_arraystretch_bool
@@ -6068,7 +6171,9 @@
     draw .default:n = default ,
     rounded-corners .dim_set:N = \l__nicematrix_rounded_corners_dim ,
     rounded-corners .default:n = 4 pt ,
-    color .code:n = \color { #1 } \tl_set:Nn \l__nicematrix_draw_tl { #1 } ,
+    color .code:n =
+      \__nicematrix_color:n { #1 }
+      \tl_set:Nn \l__nicematrix_draw_tl { #1 } ,
     color .value_required:n = true ,
     borders .clist_set:N = \l__nicematrix_borders_clist ,
     borders .value_required:n = true ,
@@ -6205,12 +6310,12 @@
       }
     \tl_if_empty:NF \l__nicematrix_fill_tl
       {
-        \exp_last_unbraced:NV \__nicematrix_extract_brackets \l__nicematrix_fill_tl \q_stop
         \tl_gput_right:Nx \g_nicematrix_code_before_tl
           {
             \exp_not:N \roundedrectanglecolor
-              [ \l_tmpa_tl ]
-              { \exp_not:V \l_tmpb_tl }
+              \exp_args:NV \tl_if_head_eq_meaning:nNTF \l__nicematrix_fill_tl [
+                { \l__nicematrix_fill_tl }
+                { { \l__nicematrix_fill_tl } }
               { #1 - #2 }
               { \int_use:N \l__nicematrix_last_row_int - \int_use:N \l__nicematrix_last_col_int }
               { \dim_use:N \l__nicematrix_rounded_corners_dim }
@@ -6403,13 +6508,6 @@
     \endpgfpicture
     \group_end:
   }
-\NewDocumentCommand \__nicematrix_extract_brackets { O { } }
-  {
-    \tl_set:Nn \l_tmpa_tl { #1 }
-    \__nicematrix_store_in_tmpb_tl
-  }
-\cs_new_protected:Npn \__nicematrix_store_in_tmpb_tl #1 \q_stop
-  { \tl_set:Nn \l_tmpb_tl { #1 } }
 \cs_new_protected:Npn \__nicematrix_stroke_block:nnn #1 #2 #3
   {
     \group_begin:
@@ -6423,7 +6521,7 @@
       {
         \str_if_eq:VnTF \l__nicematrix_draw_tl { default }
           { \CT at arc@ }
-          { \exp_args:NV \pgfsetstrokecolor \l__nicematrix_draw_tl }
+          { \__nicematrix_color:V \l__nicematrix_draw_tl }
       }
     \pgfsetcornersarced
       {
@@ -6653,9 +6751,11 @@
   }
 \keys_define:nn { NiceMatrix / Auto }
   {
-    l .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl l ,
-    r .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl r ,
-    c .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl c
+    columns-type .code:n = \__nicematrix_set_preamble:Nn \l__nicematrix_columns_type_tl { #1 } ,
+    columns-type .value_required:n = true ,
+    l .meta:n = { columns-type = l } ,
+    r .meta:n = { columns-type = r } ,
+    c .meta:n = { columns-type = c }
   }
 \NewDocumentCommand \AutoNiceMatrixWithDelims { m m O { } m O { } m ! O { } }
   {
@@ -6663,12 +6763,16 @@
     \int_zero_new:N \l__nicematrix_nb_cols_int
     \__nicematrix_set_size:n #4 \q_stop
     \group_begin:
-    \tl_set:Nn \l__nicematrix_type_of_col_tl c
+    \bool_set_true:N \l__nicematrix_Matrix_bool
     \keys_set_known:nnN { NiceMatrix / Auto } { #3, #5, #7 } \l_tmpa_tl
+    \cs_set_eq:NN \__nicematrix_transform_preamble: \prg_do_nothing:
     \use:x
       {
         \exp_not:N \begin { NiceArrayWithDelims } { #1 } { #2 }
-          { * { \int_use:N \l__nicematrix_nb_cols_int } { \l__nicematrix_type_of_col_tl } }
+          {
+            * { \int_use:N \l__nicematrix_nb_cols_int }
+              { \exp_not:V \l__nicematrix_columns_type_tl }
+          }
           [ \exp_not:V \l_tmpa_tl ]
       }
     \int_compare:nNnT \l__nicematrix_first_row_int = 0
@@ -6696,6 +6800,7 @@
   {
     \cs_set_protected:cpn { #1 AutoNiceMatrix }
       {
+        \bool_gset_false:N \g__nicematrix_NiceArray_bool
         \str_gset:Nx \g__nicematrix_name_env_str { #1 AutoNiceMatrix }
         \AutoNiceMatrixWithDelims { #2 } { #3 }
       }
@@ -6708,7 +6813,7 @@
 \NewDocumentCommand \AutoNiceMatrix { O { } m O { } m ! O { } }
   {
     \group_begin:
-    \bool_set_true:N \l__nicematrix_NiceArray_bool
+    \bool_gset_true:N \g__nicematrix_NiceArray_bool
     \AutoNiceMatrixWithDelims . . { #2 } { #4 } [ #1 , #3 , #5 ]
     \group_end:
   }
@@ -6857,8 +6962,7 @@
       {
         \nullfont
         \c_math_toggle_token
-        \tl_if_empty:NF \l__nicematrix_delimiters_color_tl
-          { \color { \l__nicematrix_delimiters_color_tl } }
+        \__nicematrix_color:V \l__nicematrix_delimiters_color_tl
         \bool_if:nTF { #3 } { \left #1 } { \left . }
         \vcenter
           {
@@ -6941,18 +7045,24 @@
   {
     \peek_remove_spaces:n
       {
-        \__nicematrix_cut_on_hyphen:w #3 \q_stop
-        \tl_clear_new:N \l__nicematrix_tmpc_tl
-        \tl_clear_new:N \l__nicematrix_tmpd_tl
-        \tl_set_eq:NN \l__nicematrix_tmpc_tl \l_tmpa_tl
-        \tl_set_eq:NN \l__nicematrix_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__nicematrix_tmpc_tl } { \l__nicematrix_tmpd_tl } }
         \tl_gput_right:Nn \g__nicematrix_internal_code_after_tl
           { \SubMatrix { #1 } { #2 } { #3 } { #4 } [ #5 ] }
+        \__nicematrix_SubMatrix_in_code_before_i { #2 } { #3 }
       }
   }
+\NewDocumentCommand \__nicematrix_SubMatrix_in_code_before_i
+  { > { \SplitArgument { 1 } { - } } m > { \SplitArgument { 1 } { - } } m }
+  { \__nicematrix_SubMatrix_in_code_before_i:nnnn #1 #2 }
+\cs_new_protected:Npn \__nicematrix_SubMatrix_in_code_before_i:nnnn #1 #2 #3 #4
+  {
+    \seq_gput_right:Nx \g__nicematrix_submatrix_seq
+      {
+        { \str_if_eq:nnTF { #1 } { last } { \int_use:N \c at iRow } { #1 } }
+        { \str_if_eq:nnTF { #2 } { last } { \int_use:N \c at jCol } { #2 } }
+        { \str_if_eq:nnTF { #3 } { last } { \int_use:N \c at iRow } { #3 } }
+        { \str_if_eq:nnTF { #4 } { last } { \int_use:N \c at jCol } { #4 } }
+      }
+  }
 \hook_gput_code:nnn { begindocument } { . }
   {
     \tl_set:Nn \l__nicematrix_argspec_tl { m m m m O { } E { _ ^ } { { } { } } }
@@ -6962,30 +7072,27 @@
         \peek_remove_spaces:n
           {
             \__nicematrix_sub_matrix:nnnnnnn
-              { #1 } { #2 } { #3 } { #4 }  { #5 } { #6 } { #7 }
+              { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } { #7 }
           }
       }
   }
-\cs_new_protected:Npn \__nicematrix_compute_i_j:nn #1 #2
+\NewDocumentCommand \__nicematrix_compute_i_j:nn
+  { > { \SplitArgument { 1 } { - } } m > { \SplitArgument { 1 } { - } } m }
+  { \__nicematrix_compute_i_j:nnnn #1 #2 }
+\cs_new_protected:Npn \__nicematrix_compute_i_j:nnnn #1 #2 #3 #4
   {
-    \tl_clear_new:N \l__nicematrix_first_i_tl
-    \tl_clear_new:N \l__nicematrix_first_j_tl
-    \tl_clear_new:N \l__nicematrix_last_i_tl
-    \tl_clear_new:N \l__nicematrix_last_j_tl
-    \__nicematrix_cut_on_hyphen:w #1 \q_stop
-    \tl_if_eq:NnTF \l_tmpa_tl { last }
+    \tl_set:Nn \l__nicematrix_first_i_tl { #1 }
+    \tl_set:Nn \l__nicematrix_first_j_tl { #2 }
+    \tl_set:Nn \l__nicematrix_last_i_tl { #3 }
+    \tl_set:Nn \l__nicematrix_last_j_tl { #4 }
+    \tl_if_eq:NnT \l__nicematrix_first_i_tl { last }
       { \tl_set:NV \l__nicematrix_first_i_tl \c at iRow }
-      { \tl_set_eq:NN \l__nicematrix_first_i_tl \l_tmpa_tl }
-    \tl_if_eq:NnTF \l_tmpb_tl { last }
+    \tl_if_eq:NnT \l__nicematrix_first_j_tl { last }
       { \tl_set:NV \l__nicematrix_first_j_tl \c at jCol }
-      { \tl_set_eq:NN \l__nicematrix_first_j_tl \l_tmpb_tl }
-    \__nicematrix_cut_on_hyphen:w #2 \q_stop
-    \tl_if_eq:NnTF \l_tmpa_tl { last }
+    \tl_if_eq:NnT \l__nicematrix_last_i_tl { last }
       { \tl_set:NV \l__nicematrix_last_i_tl \c at iRow }
-      { \tl_set_eq:NN \l__nicematrix_last_i_tl \l_tmpa_tl }
-    \tl_if_eq:NnTF \l_tmpb_tl { last }
+    \tl_if_eq:NnT \l__nicematrix_last_j_tl { last }
       { \tl_set:NV \l__nicematrix_last_j_tl \c at jCol }
-      { \tl_set_eq:NN \l__nicematrix_last_j_tl \l_tmpb_tl }
   }
 \cs_new_protected:Npn \__nicematrix_sub_matrix:nnnnnnn #1 #2 #3 #4 #5 #6 #7
   {
@@ -7067,8 +7174,7 @@
     \dim_zero:N \nulldelimiterspace
     \group_begin:
     \pgfsetlinewidth { 1.1 \arrayrulewidth }
-    \tl_if_empty:NF \l__nicematrix_rules_color_tl
-      { \exp_after:wN \__nicematrix_set_CT at arc@: \l__nicematrix_rules_color_tl \q_stop }
+    \__nicematrix_set_CT at arc@:V \l__nicematrix_rules_color_tl
     \CT at arc@
     \seq_map_inline:Nn \g__nicematrix_cols_vlism_seq
       {
@@ -7220,8 +7326,7 @@
       {
         \nullfont
         \c_math_toggle_token
-        \tl_if_empty:NF \l__nicematrix_delimiters_color_tl
-          { \color { \l__nicematrix_delimiters_color_tl } }
+        \__nicematrix_color:V \l__nicematrix_delimiters_color_tl
         \left #1
         \vcenter
           {
@@ -7244,8 +7349,7 @@
       {
         \nullfont
         \c_math_toggle_token
-        \tl_if_empty:NF \l__nicematrix_delimiters_color_tl
-          { \color { \l__nicematrix_delimiters_color_tl } }
+        \__nicematrix_color:V \l__nicematrix_delimiters_color_tl
         \left .
         \vcenter
           {
@@ -7474,7 +7578,6 @@
          }
      }
  }
-\bool_new:N \c__nicematrix_messages_for_Overleaf_bool
 \bool_new:N \c__nicematrix_footnotehyper_bool
 \bool_new:N \c__nicematrix_footnote_bool
 \msg_new:nnnn { nicematrix } { Unknown~key~for~package }
@@ -7603,7 +7706,7 @@
     you~try~to~use~more~columns~than~allowed~by~your~
     \__nicematrix_full_name_env:.\__nicematrix_message_hdotsfor:\ Recall~that~the~maximal~
     number~of~columns~for~a~matrix~is~fixed~by~the~LaTeX~counter~
-    'MaxMatrixCols'.~Its~actual~value~is~\int_use:N \c at MaxMatrixCols.~
+    'MaxMatrixCols'.~Its~current~value~is~\int_use:N \c at MaxMatrixCols.~
     This~error~is~fatal.
   }
 \__nicematrix_msg_new:nn { too~much~cols~for~array }
@@ -7628,7 +7731,8 @@
     Columns~not~used.\\
     The~preamble~of~your~\__nicematrix_full_name_env:\ announces~\int_use:N
     \g__nicematrix_static_num_of_col_int\ columns~but~you~use~only~\int_use:N \c at jCol.\\
-    The~columns~you~did~not~used~won't~be~created.
+    The~columns~you~did~not~used~won't~be~created.\\
+    We~won't~have~similar~error~till~the~end~of~the~document.
   }
 \__nicematrix_msg_new:nn { in~first~col }
   {
@@ -7671,6 +7775,12 @@
     Since~you~haven't~loaded~Tikz,~the~only~value~you~can~give~to~'line-style'~
     is~'standard'.~That~key~will~be~ignored.
   }
+\__nicematrix_msg_new:nn { Unknown~key~for~rules }
+  {
+    Unknown~key.\\
+    There~is~only~two~keys~available~here:~width~and~color.\\
+    You~key~'\l_keys_key_str'~will~be~ignored.
+  }
 \__nicematrix_msg_new:nnn { Unknown~key~for~custom-line }
   {
     Unknown~key.\\
@@ -7786,8 +7896,8 @@
   {
     Erroneous~use.\\
     Your~use~of~'custom-line'~is~no-op~since~you~don't~have~used~the~
-    key~'letter'~(for~a~letter~for~vertical~rules)~nor~the~key~'command'~
-    (to~draw~horizontal~rules).\\
+    key~'letter'~(for~a~letter~for~vertical~rules)~nor~the~keys~'command'~or~
+    ~'ccommand'~(to~draw~horizontal~rules).\\
     However,~you~can~go~on.
   }
 \__nicematrix_msg_new:nn { Forbidden~letter }
@@ -8013,7 +8123,8 @@
   {
     siunitx~too~old.\\
     You~can't~use~'S'~columns~because~your~version~of~'siunitx'~
-    is~too~old.~You~need~at~least~v~3.0.\\
+    is~too~old.~You~need~at~least~v~3.0~and~your~log~file~says:~"siunitx,~
+    \use:c { ver @ siunitx.sty }". \\
     This~error~is~fatal.
   }
 \__nicematrix_msg_new:nnn { Unknown~key~for~Brace }
@@ -8136,6 +8247,7 @@
     last-row,~
     left-margin,~
     light-syntax,~
+    matrix/columns-type,~
     notes~(several~subkeys),~
     nullify-dots,~
     renew-dots,~
@@ -8226,6 +8338,7 @@
     code-for-last-col,~
     code-for-last-row,~
     colortbl-like,~
+    columns-type,~
     columns-width,~
     corners,~
     create-extra-nodes,~



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