texlive[67630] Master/texmf-dist: nicematrix (14jul23)

commits+karl at tug.org commits+karl at tug.org
Fri Jul 14 23:05:26 CEST 2023


Revision: 67630
          http://tug.org/svn/texlive?view=revision&revision=67630
Author:   karl
Date:     2023-07-14 23:05:26 +0200 (Fri, 14 Jul 2023)
Log Message:
-----------
nicematrix (14jul23)

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/doc/latex/nicematrix/nicematrix.tex
    trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
    trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins
    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	2023-07-14 21:05:11 UTC (rev 67629)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex	2023-07-14 21:05:26 UTC (rev 67630)
@@ -715,7 +715,7 @@
 |\Block| ou colorier le fond avec des bords arrondis avec les clés |fill| et
 |rounded-corners|.\footnote{Pour colorier simplement le fond d'une case, il n'y a pas besoin
   d'utiliser un bloc mono-case : on peut utiliser la commande |\cellcolor| si la
-  clé |colortbl-like| est utilisée : voir p.~\pageref{colortbl-like}.}
+  clé |color-inside| est utilisée : voir p.~\pageref{color-inside}.}
 
 \item On peut tracer une ou plusieurs bordures de la case avec la clé |borders|.
 \end{itemize}
@@ -1806,8 +1806,6 @@
 l'extension \pkg{xcolor} ;
 \item \index{opacity (clé des commandes comme\newline \texttt{\textbackslash
     rowcolor}, etc.)}
-\colorbox{yellow!50}{\textbf{Nouveau 6.18}}
-
 une spécification d'opacité selon la forme \texttt{opacity =
   \textsl{valeur}}.\footnote{Attention : cette fonctionnalité génère des instructions de
   transparence dans le \textsc{pdf} résultant et certains lecteurs de
@@ -2119,7 +2117,7 @@
 On peut aussi utiliser dans la commande |\rowlistcolors| une série de couleurs
 définie par la commande |\definecolorseries| de \pkg{xcolor} (et initialisée
 avec |\resetcolorseries|\footnote{Pour l'initialisation, on a
-  utilisé dans l'exemple qui suit le compteur |iRow| qui, quand il est utilisé
+  utilisé dans l'exemple qui suit le compteur LaTeX |iRow| qui, quand il est utilisé
   dans le |\CodeBefore| (ou le |\CodeAfter|) désigne le nombre de rangées du
   tableau : cf~p.~\pageref{iRow}. Cela permet un ajustement de la gradation des
   couleurs à la taille du tableau.}).
@@ -2258,10 +2256,10 @@
 On a utilisé le type de colonne |S| de \pkg{siunitx}.
 
 
-\subsection{Outils de coloriage avec la syntaxe de colortbl}
+\subsection{Outils de coloriage en tableau}
 
-\label{colortbl-like}
-\index{colortbl-like}
+\label{color-inside}
+\index{color-inside}
 \index{cellcolor@\texttt{\textbackslash cellcolor}!commande en tableau}
 \index{rowcolor@\texttt{\textbackslash rowcolor}!commande en tableau}
 \index{columncolor@\texttt{\textbackslash columncolor}!commande dans le
@@ -2269,11 +2267,13 @@
 
 On peut accéder aux outils de coloriage précédents avec une syntaxe proche de
 celle proposée par \pkg{colortbl} (même si \pkg{colortbl} n'est pas chargé). On
-doit pour cela utiliser la clé |colortbl-like| dans l'environnement
+doit pour cela utiliser la clé |color-inside|\footnote{Il existe un alias pour
+  cette clé : \texttt{colortbl-like}.} dans l'environnement
 concerné.\footnote{Pour le moment, cette clé n'est \emph{pas} disponible dans
   |\NiceMatrixOptions|.}
 
-On a alors accès aux trois commandes suivantes :
+On a alors accès aux commandes suivantes (les trois premières sont inspirées par
+\pkg{colortbl} mais sont indépendantes de \pkg{colortbl}) :
 \begin{itemize}
 \item |\cellcolor| qui colorie la case courante\footnote{Néanmoins, cette
   commande |\cellcolor| supprimera les espaces qui la suivent, ce que ne fait
@@ -2284,13 +2284,17 @@
 que la commande éponyme de \pkg{colortbl} (néanmoins, contrairement à la
 commande |\columncolor| de \pkg{colortbl}, celle de \pkg{nicematrix} peut
 apparaître à l'intérieur d'une autre commande, elle-même utilisée dans le
-préambule).
+préambule) ; 
+\item \colorbox{yellow!50}{\textbf{Nouveau 6.21}}\enskip |\rowcolors| qui prend pour arguments deux couleurs et colorie la suite du
+tableau avec ces deux couleurs ; 
+\item \colorbox{yellow!50}{\textbf{Nouveau 6.21}}\enskip |\rowlistcolors| qui prend pour argument une liste de couleurs et colorie
+la suite du tableau avec ces couleurs.
 \end{itemize}
 
 \medskip
 \begin{Verbatim}
 \NewDocumentCommand { \Blue } { } {~emphase#\columncolor{blue!15}@}
-\begin{NiceTabular}[colortbl-like]{>{\Blue}c>{\Blue}cc}
+\begin{NiceTabular}[color-inside]{>{\Blue}c>{\Blue}cc}
 \toprule
 ~emphase#\rowcolor{red!15}@
 Nom & Prénom & Année de naissance \\
@@ -2306,7 +2310,7 @@
 
 \begin{center}
 \NewDocumentCommand { \Blue } { } {\columncolor{blue!15}}
-\begin{NiceTabular}[colortbl-like]{>{\Blue}c>{\Blue}cc}
+\begin{NiceTabular}[color-inside]{>{\Blue}c>{\Blue}cc}
 \toprule
 \rowcolor{red!15}
 Nom & Prénom & Année de naissance \\
@@ -2350,7 +2354,7 @@
 couleur du texte.\footnote{La clé |color| utilise la commande |\color| mais
   insère aussi une instruction |\leavevmode| devant. Cela évite un espace
   vertical parasite dans les cases qui correspondent à des colonnes de type
-  |p|, |b|, |m|, |X| et |V| (qui débutent en mode vertical).}
+  |p|, |b|, |m|, |X| et |V| (qui débutent en mode vertical de LateX).}
 
 \item \index{bold (clé de \texttt{\textbackslash RowStyle})}
 La clé |bold| impose des caractères gras aux éléments de la rangée, qu'ils
@@ -4429,35 +4433,39 @@
 
 \section{Autres fonctionnalités}
 
-\subsection{La clé rounded-corners de \{NiceTabular\}}
+\subsection{La clé rounded-corners}
 
 \label{tabular-rounded-corners}
 \index{rounded-corners!clé de \texttt{\{NiceTabular\}}}
 \index{Coins arrondis!pour un tableau}
 
-\colorbox{yellow!50}{\textbf{Nouveau 6.18}}\par\nobreak
-
-\smallskip
 La clé |rounded-corners| que l'on décrit maintenant n'a pas de lien direct avec
 la clé |corners| (qui sert à spécifier les «coins vides») décrite à la
 partie~\ref{corners}, p.~\pageref{corners}.
 
 \smallskip
-L'environnement |{NiceTabular}| propose une clé |rounded-corners| qui spécifie
-que le tableau devra avoir des coins arrondis avec le rayon égal à la valeur
-de cette clé (la valeur par défaut est 4~pt\footnote{Cette valeur est la valeur
-  par défaut des «\texttt{rounded corners}» de PGF/Tikz.}). Plus précisément,
-cette clé a deux effets que l'on décrit maintenant.
+La clé |rounded-corners| spécifie que le tableau ou la matrice devra avoir des
+coins arrondis avec un rayon égal à la valeur de cette clé (la valeur par défaut est
+4~pt\footnote{Cette valeur est la valeur par défaut des «\texttt{rounded
+    corners}» de PGF/Tikz.}). Plus précisément, cette clé a deux effets que l'on
+décrit maintenant.
 \begin{itemize}
 \item Toutes les commandes de coloriage de cases, colonnes et rangées (que ce
 soit dans le |\CodeBefore| ou bien directement dans le tableau (quand la clé
-|colortbl-like| est utilisée) respectent ces coins arrondis pour le tableau.
+|color-inside| est utilisée) respectent ces coins arrondis pour le tableau.
 
 \item Quand la clé |hvlines| est utilisée, les filets extérieurs sont tracés
-avec des coins arrondis.
+avec des coins arrondis.\footnote{Bien sûr, lorsqu'il s'agit d'un environnement
+  avec des délimiteurs (|{pNiceArray}|, |{pNiceMatrix}|, etc.) la clé
+  |hvlines| ne trace pas les filets extérieurs.}
 \end{itemize}
 
 \bigskip
+\colorbox{yellow!50}{\textbf{Nouveau 6.21}} Cette clé est disponible dans tous
+les environnements et commandes de \pkg{nicematrix} (comme
+|\pAutoNiceMatrix|) et également dans |\NiceMatrixOptions|. 
+
+\bigskip
 \begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
 \begin{NiceTabular}{ccc}[hvlines,~emphase#rounded-corners@]
 \CodeBefore
@@ -4644,7 +4652,20 @@
 \end{pNiceMatrix}$
 \end{varwidth}
 
+\bigskip
+\colorbox{yellow!50}{\textbf{Nouveau 6.21}}\enskip La commande |\rotate| accepte
+une option |c| entre crochets : |\rotate[c]|. Quand cette clé est utilisée, le
+contenu, après rotation, est composé dans une |\vcenter|, ce qui fait que, le
+plus souvent, on obtiendra un centrage vertical.
 
+
+\medskip
+Attention : la commande |\rotate| est prévue pour être utilisée dans un |\Block|
+ou bien dans des colonnes de type |l|, |c|, |r|, |w| ou |W|; si elle est
+utilisée dans un autre type de colonne (commme |p{...}|), les résultats ne
+seront peut-être pas ceux attendus.
+
+
 \subsection{L'option small}
 
 \label{small}
@@ -4883,9 +4904,9 @@
 \indexcommand{OnlyMainNiceMatrix}
 
 La commande |\OnlyMainNiceMatrix| n'exécute son argument que si on se trouve
-dans le tableau principal, c'est-à-dire que l'on n'est pas dans les rangées
-extérieures. Si elle est utilisée hors d'un environnement de \pkg{nicematrix},
-elle est sans effet. 
+dans le tableau principal, c'est-à-dire que l'on est ni dans les rangées
+extérieures, ni dans les colonnes extérieures. Si elle est utilisée hors d'un
+environnement de \pkg{nicematrix}, elle est sans effet. 
 
 Pour un exemple d'utilisation, voir \url{tex.stackexchange.com/questions/488566} 
 
@@ -6657,14 +6678,14 @@
 \vspace{1cm}
 Il est possible de colorier une rangée avec |\rowcolor| dans le |\CodeBefore|
 (ou avec |\rowcolor| dans une case de la rangée si on utilise la clé
-|colortbl-like| − même si \pkg{colortbl} n'est pas chargé).
+|color-inside| − même si \pkg{colortbl} n'est pas chargé).
 
 
-\index{colortbl-like|textit}
+\index{color-inside|textit}
 \index{rowcolor@\texttt{\textbackslash rowcolor}!commande en tableau|textit}
 
 \begin{Verbatim}
-\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,colortbl-like]
+\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,color-inside]
   ~emphase#\rowcolor{red!15}@A_{11} & A_{12} & A_{13} & A_{14} \\
   A_{21} & ~emphase#\rowcolor{red!15}@A_{22} & A_{23} & A_{24} \\
   A_{31} & A_{32} & ~emphase#\rowcolor{red!15}@A_{33} & A_{34} \\
@@ -6674,7 +6695,7 @@
 
 
 
-\[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,colortbl-like]
+\[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,color-inside]
   \rowcolor{red!15}A_{11} & A_{12} & A_{13} & A_{14} \\
   A_{21} & \rowcolor{red!15}A_{22} & A_{23} & A_{24} \\
   A_{31} & A_{32} & \rowcolor{red!15}A_{33} & A_{34} \\

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

Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex	2023-07-14 21:05:11 UTC (rev 67629)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex	2023-07-14 21:05:26 UTC (rev 67630)
@@ -687,7 +687,7 @@
 command |\Block| and to fill the background with rounded corners with the keys
 |fill| and |rounded-corners|.\footnote{If one simply wishes to color the
 background of a unique cell, there is no point using the command |\Block|:
-it's possible to use the command |\cellcolor| (when the key |colortbl-like| is
+it's possible to use the command |\cellcolor| (when the key |color-inside| is
 used).}
 
 \item It's possible to draw one or several borders of the cell with the key |borders|.
@@ -1753,7 +1753,6 @@
 \item the colorimetric space (|RGB|, |rgb|, |HTML|, etc) as specified by the
 the extension \pkg{xcolor};
 \item \index{opacity (key of commands such as\newline \texttt{\textbackslash rowcolor}, etc.)}
-\colorbox{yellow!50}{\textbf{New 6.18}}\par\nobreak
 a specification of opacity of the form \texttt{opacity =
   \textsl{value}}.\footnote{Caution : that feature creates instructions of
   transparency in the \textsc{pdf} and some \textsc{pdr} don't support such instructions.}
@@ -2198,9 +2197,9 @@
 We have used the type of column |S| of \pkg{siunitx}.
 
 
-\subsection{Color tools with the syntax of colortbl}
+\subsection{Color tools to be used inside the tabular}
 
-\index{colortbl-like}
+\index{color-inside}
 \index{cellcolor@\texttt{\textbackslash cellcolor}!command in tabular}
 \index{rowcolor@\texttt{\textbackslash rowcolor}!command in tabular}
 \index{columncolor@\texttt{\textbackslash columncolor}!command in the preamble
@@ -2208,11 +2207,12 @@
 
 
 It's possible to access the preceding tools with a syntax close to the syntax
-of \pkg{colortbl}. For that, one must use the key |colortbl-like| in the
+of \pkg{colortbl}. For that, one must use the key |color-inside|\footnote{There
+  is an alias for that key : \texttt{colortbl-like}.} in the
 current environment.\footnote{Up to now, this key is \emph{not} available in |\NiceMatrixOptions|.}
 
-There are three commands available (they are inspired by \pkg{colortbl} but
-are \emph{independent} of \pkg{colortbl}):
+There are several commands available (the first three ones are inspired by
+\pkg{colortbl} but are \emph{independent} of \pkg{colortbl}):
 \begin{itemize}
 \item |\cellcolor| which colorizes a cell;\footnote{However, this command
 |\cellcolor| will delete the following spaces, which does not the command
@@ -2223,13 +2223,17 @@
 with the same syntax as the corresponding command of
 \pkg{colortbl} (however, unlike the command |\columncolor| of \pkg{colortbl},
 this command |\columncolor| can appear within another command, itself used in the
-preamble of the array). 
+preamble of the array);
+\item \colorbox{yellow!50}{\textbf{New 6.21}}\enskip |\rowcolors| which takes in as arguments two colors and color the rest of
+the tabular with those colors;
+\item \colorbox{yellow!50}{\textbf{New 6.21}}\enskip |\rowlistcolors| which takes in as argument a color and color the rest of
+the tabular with the colors of that list of colors. 
 \end{itemize}
 
 \smallskip
 \begin{Verbatim}
 \NewDocumentCommand { \Blue } { } { ~emphase#\columncolor{blue!15}@ }
-\begin{NiceTabular}[colortbl-like]{>{\Blue}c>{\Blue}cc} 
+\begin{NiceTabular}[color-inside]{>{\Blue}c>{\Blue}cc} 
 \toprule
 ~emphase#\rowcolor{red!15}@
 Last name & First name & Birth day \\
@@ -2245,7 +2249,7 @@
 
 \begin{center}
 \NewDocumentCommand { \Blue } { } { \columncolor{blue!15} }
-\begin{NiceTabular}[colortbl-like]{>{\Blue}c>{\Blue}cc} 
+\begin{NiceTabular}[color-inside]{>{\Blue}c>{\Blue}cc} 
 \toprule
 \rowcolor{red!15}
 Last name & First name & Birth day \\
@@ -2288,7 +2292,7 @@
 |\color| but inserts also an instruction |\leavevmode| before. This
 instruction prevents a extra vertical space in the cells which belong to
 columns of type |p|, |b|, |m|, |X| and |V| (which start in
-vertical mode).}
+vertical mode of LaTeX).}
 \item \index{bold (key of \texttt{\textbackslash RowStyle})} The key |bold|
 enforces bold characters for the cells of the row, both in math and text mode.
 \end{itemize}
@@ -4331,34 +4335,37 @@
 
 \section{Other features}
 
-\subsection{The key rounded-corners of \{NiceTabular\}}
+\subsection{The key rounded-corners}
 
 \label{tabular-rounded-corners}
 \index{rounded-corners!key of \texttt{\{NiceTabular\}}}
 \index{Corners (rounded ---)!for a tabular}
 
-\colorbox{yellow!50}{\textbf{New 6.18}}\par\nobreak
-
-\smallskip
 The key |rounded-corners| that we will describe now has no direct link with
 the key |corners| (which is used to specify ``empty corners'') described in
 the part~\ref{corners}, p.~\pageref{corners}.
 
 \smallskip
-The environment |{NiceTabular}| provides a key |rounded-corners| which specify
-that the tabular should have rounded corners with a radius equal to the value of
-that key (the default value is 4~pt\footnote{This value is the initial value of
-  the \emph{rounded corners} of Tikz.}). More precisely, that key has two
-effects that we describe now.
+The key |rounded-corners| specifies that the tabular should have rounded corners
+with a radius equal to the value of that key (the default value is
+4~pt\footnote{This value is the initial value of the \emph{rounded corners} of
+  Tikz.}). More precisely, that key has two effects that we describe now.
 \begin{itemize}
 \item All the commands for coloring the cells, columns and rows (in the
-|\CodeBefore| but also directly in the array when the key |colortbl-like| is
+|\CodeBefore| but also directly in the array when the key |color-inside| is
 used) will respect those rounded corners.
 
 \item When the key |hvlines| is used, the exterior rules will be drawn with
-rounded corners.
+rounded corners.\footnote{Of course, when used in an environment with delimiters
+(|{pNiceMatrix}|, |{bNiceArray}|, etc.), the key |hvlines| does not draw the
+exterior rules.}
 \end{itemize}
 
+
+\colorbox{yellow!50}{New 6.21}\enskip That key is available in all
+the environments and commands (e.g. |\pAutoNiceMatrix|) of \pkg{nicematrix} and also
+in the command |\NiceMatrixOptions|.
+
 \bigskip
 \begin{BVerbatim}[baseline=c,boxwidth=9cm]
 \begin{NiceTabular}
@@ -4549,8 +4556,19 @@
 \end{pNiceMatrix}$
 \end{varwidth}
 
+\bigskip
+\colorbox{yellow!50}{\textbf{New 6.21}}\enskip The command |\tabular| has a key
+|c|: |\tabular[c]|. When that key is used, the content is composed in a
+|\vcenter| and, therefore, in most cases, we will have a vertical alignment.
 
 
+
+\bigskip
+Caution: the command |\rotate| is designed to be used in a |\Block| or in
+columns of type |l|, |r|, |c|, |w| ou |W|; if it is used in other column types
+(such as |p{...}|), the result will maybe differ from what is expected. 
+
+
 \subsection{The option small}
 
 \label{small}
@@ -4788,8 +4806,8 @@
 
 The command |\OnlyMainNiceMatrix| executes its argument only when it is in the
 main part of the array, that is to say when it is not in one of the exterior
-rows. If it is used outside an environment of \pkg{nicematrix}, that command is
-no-op.
+rows or one of the exterior columns. If it is used outside an environment of
+\pkg{nicematrix}, that command is no-op.
 
 For an example of utilisation, see \url{tex.stackexchange.com/questions/488566}
 
@@ -6561,16 +6579,16 @@
 
 \vspace{1cm}
 It's possible to color a row with |\rowcolor| in the |code-before| (or with
-|\rowcolor| in the first cell of the row if the key |colortbl-like| is
+|\rowcolor| in the first cell of the row if the key |color-inside| is
 used−even when \pkg{colortbl} is not loaded).
 
-\index{colortbl-like|textit}
+\index{color-inside|textit}
 \index{rowcolor@\texttt{\textbackslash rowcolor}!command in tabular|textit}
 
 
 \medskip
 \begin{Verbatim}
-\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,colortbl-like]
+\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,color-inside]
   ~emphase#\rowcolor{red!15}@A_{11} & A_{12} & A_{13} & A_{14} \\
   A_{21} & ~emphase#\rowcolor{red!15}@A_{22} & A_{23} & A_{24} \\
   A_{31} & A_{32} & ~emphase#\rowcolor{red!15}@A_{33} & A_{34} \\
@@ -6580,7 +6598,7 @@
 
 
 
-\[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,colortbl-like]
+\[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,color-inside]
   \rowcolor{red!15}A_{11} & A_{12} & A_{13} & A_{14} \\
   A_{21} & \rowcolor{red!15}A_{22} & A_{23} & A_{24} \\
   A_{31} & A_{32} & \rowcolor{red!15}A_{33} & A_{34} \\
@@ -6885,6 +6903,15 @@
 \nolinkurl{https:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty}
 }
 
+\subsection*{Changes between version 6.20a and 6.21}
+
+Key |c| for the command |\tabularnote|.
+
+New commands |\rowcolors| and |\rowlistcolors| available in the array itself
+(previously, there were only two commands |\rowcolors| and |\rowlistcolors|
+avaailable in the |\CodeBefore|.
+
+
 \subsection*{Changes between version 6.20 and 6.20a}
 
 The value of the key |name| of an environment of \pkg{nicematrix} is expanded

Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx	2023-07-14 21:05:11 UTC (rev 67629)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx	2023-07-14 21:05:26 UTC (rev 67630)
@@ -17,8 +17,8 @@
 %
 % \fi
 % \iffalse
-\def\myfileversion{6.20a}
-\def\myfiledate{2023/06/30}
+\def\myfileversion{6.21}
+\def\myfiledate{2023/07/14}
 %
 %
 %<*batchfile>
@@ -384,7 +384,7 @@
 %
 % \bigskip
 % The following regex will be used to modify the preamble of the array when the
-% key |colortbl-like| is used.
+% key |color-inside| is used.
 %    \begin{macrocode}
 \regex_const:Nn \c_@@_columncolor_regex { \c { columncolor } } 
 %    \end{macrocode}
@@ -598,7 +598,7 @@
 % The following command is a small shortcut.
 %    \begin{macrocode}
 \cs_new:Npn \@@_math_toggle_token:
-  { \bool_if:NF \l_@@_NiceTabular_bool \c_math_toggle_token }
+  { \bool_if:NF \l_@@_tabular_bool \c_math_toggle_token }
 %    \end{macrocode}
 %
 % \bigskip
@@ -737,8 +737,41 @@
 \cs_new_protected:Npn \@@_qpoint:n #1 
   { \pgfpointanchor { \@@_env: - #1 } { center } } 
 %    \end{macrocode}
-% 
+%
 % \bigskip
+% If the user uses |{NiceTabular}|, |{NiceTabular*}| or |{NiceTabularX}|, we
+% will raise the following flag. 
+%    \begin{macrocode}
+\bool_new:N \l_@@_tabular_bool
+%    \end{macrocode}
+%
+% \bigskip
+% |\g_@@_delims_bool| will be true for the environments with delimiters (ex. :
+% |{pNiceMatrix}|, |{pNiceArray}|, |\pAutoNiceMatrix|, etc.).
+%    \begin{macrocode}
+\bool_new:N \g_@@_delims_bool
+\bool_gset_true:N \g_@@_delims_bool
+%    \end{macrocode}
+% In fact, if there is delimiters in the preamble of |{NiceArray}| (eg:
+% |[cccc]|), this boolean will be set to false.
+%
+% \medskip
+% The following boolean will be equal to |true| in the environments which have
+% an environment (provided by the final user): |{NiceTabular}|, |{NiceArray}|,
+% |{pNiceArray}|, etc. 
+%    \begin{macrocode}
+\bool_new:N \l_@@_preamble_bool
+\bool_set_true:N \l_@@_preamble_bool
+%    \end{macrocode}
+%
+% \medskip
+% We need a special treatment for |{NiceMatrix}| when |vlines| is not used, in
+% order to retrieve |\arraycolsep| on both sides.
+%    \begin{macrocode}
+\bool_new:N \l_@@_NiceMatrix_without_vlines_bool
+%    \end{macrocode}
+%
+% \bigskip
 % The following counter will count the environments |{NiceMatrixBlock}|.
 %    \begin{macrocode}
 \int_new:N \g_@@_NiceMatrixBlock_int
@@ -861,22 +894,6 @@
 \bool_new:N \l_@@_notes_detect_duplicates_bool
 \bool_set_true:N \l_@@_notes_detect_duplicates_bool
 %    \end{macrocode}
-% 
-% \bigskip
-% If the user uses |{NiceArray}| or |{NiceTabular}| the flag
-% |\g_@@_NiceArray_bool| will be raised. 
-%    \begin{macrocode}
-\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.
-% 
-% \bigskip
-% If the user uses |{NiceTabular}|, |{NiceTabular*}| or |{NiceTabularX}|, we
-% will raise the following flag. 
-%    \begin{macrocode}
-\bool_new:N \l_@@_NiceTabular_bool
-%    \end{macrocode}
 %
 % \bigskip
 % If the user uses |{NiceTabular*}|, the width of the tabular (in the first
@@ -894,13 +911,6 @@
 %    \end{macrocode}
 % 
 % \bigskip
-% If the user uses an environment without preamble, we will raise the following
-% flag.
-%    \begin{macrocode}
-\bool_new:N \l_@@_Matrix_bool
-%    \end{macrocode}
-% 
-% \bigskip
 % The following boolean will be raised when the command |\rotate| is used.
 %    \begin{macrocode}
 \bool_new:N \g_@@_rotate_bool
@@ -907,6 +917,13 @@
 %    \end{macrocode}
 %
 % \bigskip
+% The following boolean will be raise then the command |\rotate| is used with
+% the key |c|.
+%    \begin{macrocode}
+\bool_new:N \g_@@_rotate_c_bool
+%    \end{macrocode}
+% 
+% \bigskip
 % In a cell, it will be possible to know whether we are in a cell of a column of
 % type |X| thanks to that flag.
 %    \begin{macrocode}
@@ -1002,14 +1019,6 @@
   }
 %    \end{macrocode}
 % 
-% \bigskip
-% The following token list corresponds to the option |code-after| (it's also
-% possible to set the value of that parameter with the keyword |\CodeAfter|).
-% That parameter is \emph{public}.
-%    \begin{macrocode}
-\tl_new:N \g_nicematrix_code_after_tl
-\bool_new:N \l_@@_in_code_after_bool
-%    \end{macrocode}
 % 
 % \bigskip
 % For the key |code| of the command |\SubMatrix| (itself in the main
@@ -1032,17 +1041,34 @@
 % |\g_@@_pre_code_after_tl| because we must take care of the order in which
 % instructions stored in that parameters are executed.
 %    \begin{macrocode}
-\tl_new:N \g_@@_pre_code_after_tl
+
 %    \end{macrocode}
 %
 % \bigskip
+% The so-called `\CodeBefore` is splitted in two parts because we want to control
+% the order of execution of some instructions.
+%    \begin{macrocode} 
+\tl_new:N \g_@@_pre_code_before_tl
+\tl_new:N \g_nicematrix_code_before_tl
+%    \end{macrocode}
 % The value of the key |code-before| will be added to the left of
 % |\g_@@_pre_code_before_tl|. Idem for the code between |\CodeBefore| and
 % |\Body|. 
-%    \begin{macrocode} 
-\tl_new:N \g_nicematrix_code_before_tl
-\tl_new:N \g_@@_pre_code_before_tl
+% 
+% \bigskip
+% The so-called `\CodeAfter` is splitted in two parts because we want to control
+% the order of execution of some instructions.
+%    \begin{macrocode}
+\tl_new:N \g_@@_pre_code_after_tl
+\tl_new:N \g_nicematrix_code_after_tl
 %    \end{macrocode}
+% The `\CodeAfter` provided by the final user (with the key |code-after| or the
+% keyword |\CodeAfter|) will be stored in the second token list.
+%
+% \bigskip
+%    \begin{macrocode}
+\bool_new:N \l_@@_in_code_after_bool
+%    \end{macrocode}
 % 
 % \bigskip
 % The counters |\l_@@_old_iRow_int| and |\l_@@_old_jCol_int| will be used to
@@ -1353,7 +1379,6 @@
 %    \begin{macrocode}
 \bool_new:N \l_@@_draw_first_bool
 %    \end{macrocode}
-% 
 %
 % \medskip
 % The following flag corresponds to the keys |vlines| and |hlines| of the
@@ -1496,6 +1521,13 @@
 \bool_new:N \g_@@_last_col_found_bool
 %    \end{macrocode}
 % This boolean is set to |false| at the end of |\@@_pre_array_ii:|.
+%
+% \medskip
+% In the last column, we will raise the following flag (it will be used by
+% |\OnlyMainNiceMatrix|). 
+%    \begin{macrocode}
+\bool_new:N \l_@@_in_last_col_bool
+%    \end{macrocode}
 % \end{itemize}
 %
 % \bigskip 
@@ -1536,7 +1568,8 @@
       }
   }
 %    \end{macrocode}
-% 
+%
+%
 % \bigskip
 % \section{The command \textbackslash tabularnote}
 %
@@ -1694,7 +1727,7 @@
           {
             \bool_if:nT { \cs_if_exist_p:N \@captype || \l_@@_in_env_bool }
               { 
-                \bool_if:nTF { ! \l_@@_NiceTabular_bool && \l_@@_in_env_bool }
+                \bool_if:nTF { ! \l_@@_tabular_bool && \l_@@_in_env_bool }
                   { \@@_error:n { tabularnote~forbidden } }
                   {
                     \bool_if:NTF \l_@@_in_caption_bool
@@ -1981,10 +2014,10 @@
 % \bigskip
 % By default, the commands |\cellcolor| and |\rowcolor| are available for the
 % user in the cells of the tabular (the user may use the commands provided by
-% |\colortbl|). However, if the key |colortbl-like| is used, these
+% |\colortbl|). However, if the key |color-inside| is used, these
 % commands are available.
 %    \begin{macrocode}
-\bool_new:N \l_@@_colortbl_like_bool
+\bool_new:N \l_@@_color_inside_bool
 %    \end{macrocode}
 % 
 % \bigskip
@@ -2308,6 +2341,8 @@
 %    \begin{macrocode}
 \keys_define:nn { NiceMatrix / Global }
   {
+    rounded-corners .dim_set:N = \l_@@_tab_rounded_corners_dim ,
+    rounded-corners .default:n = 4 pt ,
     custom-line .code:n = \@@_custom_line:n { #1 } ,
     rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
     rules .value_required:n = true ,
@@ -2446,10 +2481,11 @@
     name .value_required:n = true ,
     code-after .tl_gset:N = \g_nicematrix_code_after_tl ,
     code-after .value_required:n = true ,
-    colortbl-like .code:n = 
-      \bool_set_true:N \l_@@_colortbl_like_bool 
+    color-inside .code:n = 
+      \bool_set_true:N \l_@@_color_inside_bool 
       \bool_set_true:N \l_@@_code_before_bool ,
-    colortbl-like .value_forbidden:n = true
+    color-inside .value_forbidden:n = true , 
+    colortbl-like .meta:n = color-inside
   }
 %    \end{macrocode}
 %
@@ -2734,8 +2770,6 @@
     width .code:n = \dim_set:Nn \l_@@_width_dim { #1 } 
                     \bool_set_true:N \l_@@_width_used_bool ,
     width .value_required:n = true ,
-    rounded-corners .dim_set:N = \l_@@_tab_rounded_corners_dim ,
-    rounded-corners .default:n = 4 pt ,
     notes .code:n = \keys_set:nn { NiceMatrix / notes } { #1 } , 
     tabularnote .tl_gset:N = \g_@@_tabularnote_tl ,
     tabularnote .value_required:n = true ,
@@ -2794,7 +2828,7 @@
 % |\@@_cell_end:| (and the potential |\c_math_toggle_token| also).
 %    \begin{macrocode}
     \hbox_set:Nw \l_@@_cell_box 
-    \bool_if:NF \l_@@_NiceTabular_bool 
+    \bool_if:NF \l_@@_tabular_bool 
       { 
         \c_math_toggle_token
         \bool_if:NT \l_@@_small_bool \scriptstyle 
@@ -2888,16 +2922,28 @@
 \cs_new_protected:Npn \@@_rotate_cell_box:
   {
     \box_rotate:Nn \l_@@_cell_box { 90 } 
-    \int_compare:nNnT \c at iRow = \l_@@_last_row_int 
-      { 
-        \vbox_set_top:Nn \l_@@_cell_box 
+    \bool_if:NTF \g_@@_rotate_c_bool
+      {
+        \hbox_set:Nn \l_@@_cell_box
           { 
-            \vbox_to_zero:n { }
-            \skip_vertical:n { - \box_ht:N \@arstrutbox + 0.8 ex } 
-            \box_use:N \l_@@_cell_box 
+            \c_math_toggle_token 
+            \vcenter { \box_use:N \l_@@_cell_box } 
+            \c_math_toggle_token 
           } 
-      } 
+      }
+      {
+        \int_compare:nNnT \c at iRow = \l_@@_last_row_int 
+          { 
+            \vbox_set_top:Nn \l_@@_cell_box 
+              { 
+                \vbox_to_zero:n { }
+                \skip_vertical:n { - \box_ht:N \@arstrutbox + 0.8 ex } 
+                \box_use:N \l_@@_cell_box 
+              } 
+          } 
+       }
     \bool_gset_false:N \g_@@_rotate_bool
+    \bool_gset_false:N \g_@@_rotate_c_bool
   }
 %    \end{macrocode}
 %
@@ -3179,7 +3225,7 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_array:n
   {
-    \bool_if:NTF \l_@@_NiceTabular_bool
+    \bool_if:NTF \l_@@_tabular_bool
       { \dim_set_eq:NN \col at sep \tabcolsep }
       { \dim_set_eq:NN \col at sep \arraycolsep }
     \dim_compare:nNnTF \l_@@_tabular_width_dim = \c_zero_dim
@@ -3339,7 +3385,7 @@
 %    \end{macrocode}
 %
 % \bigskip
-% When the key |colortbl-like| is used, the following code will be executed.
+% When the key |color-inside| is used, the following code will be executed.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_colortbl_like:
   {
@@ -3346,6 +3392,8 @@
     \cs_set_eq:NN \cellcolor \@@_cellcolor_tabular
     \cs_set_eq:NN \rowcolor \@@_rowcolor_tabular
     \cs_set_eq:NN \columncolor \@@_columncolor_preamble
+    \cs_set_eq:NN \rowcolors \@@_rowcolors_tabular
+    \cs_set_eq:NN \rowlistcolors \@@_rowlistcolors_tabular
   }
 %    \end{macrocode}
 % 
@@ -3494,7 +3542,7 @@
     \cs_set_eq:NN \RowStyle \@@_RowStyle:n
     \seq_map_inline:Nn \l_@@_custom_line_commands_seq
       { \cs_set_eq:cc { ##1 } { nicematrix - ##1 } } 
-    \bool_if:NT \l_@@_colortbl_like_bool \@@_colortbl_like:
+    \bool_if:NT \l_@@_color_inside_bool \@@_colortbl_like:
     \bool_if:NT \l_@@_renew_dots_bool \@@_renew_dots:
 %    \end{macrocode}
 % We redefine |\multicolumn| and, since we want |\multicolumn| to be available
@@ -3596,9 +3644,6 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_pre_array:
   {
-%    \end{macrocode}
-% 
-%    \begin{macrocode}
     \cs_if_exist:NT \theiRow { \int_set_eq:NN \l_@@_old_iRow_int \c at iRow }
     \int_gzero_new:N \c at iRow
     \cs_if_exist:NT \thejCol { \int_set_eq:NN \l_@@_old_jCol_int \c at jCol }
@@ -3703,12 +3748,8 @@
 %    \begin{macrocode}
     \dim_zero_new:N \l_@@_left_delim_dim
     \dim_zero_new:N \l_@@_right_delim_dim
-    \bool_if:NTF \g_@@_NiceArray_bool
+    \bool_if:NTF \g_@@_delims_bool
       { 
-        \dim_gset:Nn \l_@@_left_delim_dim { 2 \arraycolsep }
-        \dim_gset:Nn \l_@@_right_delim_dim { 2 \arraycolsep }
-      }
-      { 
 %    \end{macrocode}
 % The command |\bBigg@| is a command of \pkg{amsmath}.
 %    \begin{macrocode}
@@ -3717,6 +3758,10 @@
         \hbox_set:Nn \l_tmpa_box { $ \bBigg@ 5 \g_@@_right_delim_tl $ }
         \dim_set:Nn \l_@@_right_delim_dim { \box_wd:N \l_tmpa_box }
       }
+      { 
+        \dim_gset:Nn \l_@@_left_delim_dim { 2 \arraycolsep }
+        \dim_gset:Nn \l_@@_right_delim_dim { 2 \arraycolsep }
+      }
 %    \end{macrocode}
 % 
 % \bigskip
@@ -3759,7 +3804,8 @@
 % \bigskip
 % \section{The \textbackslash CodeBefore}
 % 
-% The following command will be executed if the |\CodeBefore| has to be actually executed.
+% The following command will be executed if the |\CodeBefore| has to be actually
+% executed (that commmand will be used only once and is present only for legibility).
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_pre_code_before:
   {
@@ -3861,7 +3907,7 @@
 % We compose the |\CodeBefore| in math mode in order to nullify the spaces put
 % by the user between instructions in the |\CodeBefore|.
 %    \begin{macrocode}
-    \bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token
+    \bool_if:NT \l_@@_tabular_bool \c_math_toggle_token
 %    \end{macrocode}
 %
 % \bigskip
@@ -3895,7 +3941,7 @@
       \@@_actually_color:
       \l_@@_code_before_tl 
       \q_stop 
-    \bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token
+    \bool_if:NT \l_@@_tabular_bool \c_math_toggle_token
     \group_end:
     \bool_if:NT \g_@@_recreate_cell_nodes_bool
       { \tl_put_left:Nn \@@_node_for_cell: \@@_patch_node_for_cell: } 
@@ -3927,7 +3973,7 @@
 %
 % We have extracted the options of the keyword |\CodeBefore| in order to see
 % whether the key |create-cell-nodes| has been used. Now, you can execute the
-% rest of the |\CodeAfter|, excepted, of course, if we are in the first
+% rest of the |\CodeBefore|, excepted, of course, if we are in the first
 % compilation. 
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_CodeBefore:w #1 \q_stop
@@ -3940,9 +3986,7 @@
   }
 %    \end{macrocode}
 %
-% \bigskip
 %
-%
 % \bigskip
 % By default, if the user uses the |\CodeBefore|, only the |col| nodes, |row|
 % nodes and |diag| nodes are available in that |\CodeBefore|. With the key
@@ -4094,7 +4138,7 @@
     \bool_gset_false:N \g_@@_row_of_col_done_bool
     \str_if_empty:NT \g_@@_name_env_str 
       { \str_gset:Nn \g_@@_name_env_str { NiceArrayWithDelims } } 
-    \bool_if:NTF \l_@@_NiceTabular_bool 
+    \bool_if:NTF \l_@@_tabular_bool 
       \mode_leave_vertical:
       \@@_test_if_math_mode:
     \bool_if:NT \l_@@_in_env_bool { \@@_fatal:n { Yet~in~env } } 
@@ -4182,9 +4226,9 @@
 % of |{NiceArray}| (|{pNiceArray}|, |{bNiceArray}|, etc.) because, for
 % |{NiceArray}|, we have the options |t|, |c|, |b| and |baseline|.
 %    \begin{macrocode}
-    \bool_if:NTF \g_@@_NiceArray_bool 
+    \bool_if:NTF \g_@@_delims_bool 
+      { \keys_set:nn { NiceMatrix / pNiceArray } }
       { \keys_set:nn { NiceMatrix / NiceArray } }
-      { \keys_set:nn { NiceMatrix / pNiceArray } }
     { #3 , #5 } 
 %    \end{macrocode}
 %
@@ -4319,13 +4363,10 @@
       }
 %    \end{macrocode}
 %
-% 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. 
-%
+% The construction of the real box is different whether we have delimiters to
+% put.
 %    \begin{macrocode}
-    \bool_if:NTF \g_@@_NiceArray_bool
+    \bool_if:nTF { ! \g_@@_delims_bool }
       { 
         \str_case:VnF \l_@@_baseline_tl 
           { 
@@ -4336,9 +4377,9 @@
       } 
 %    \end{macrocode}
 %
-% Now, in the case of an environment |{pNiceArray}|, |{bNiceArray}|, etc. We
-% compute |\l_tmpa_dim| which is the total height of the ``first row'' above the
-% array (when the key |first-row| is used).
+% Now, in the case of an environment with delimiters. We compute |\l_tmpa_dim|
+% which is the total height of the ``first row'' above the array (when the key
+% |first-row| is used).
 %    \begin{macrocode}
       {
         \int_compare:nNnTF \l_@@_first_row_int = 0
@@ -4379,11 +4420,11 @@
                 \skip_vertical:n { -\l_tmpa_dim - \arrayrulewidth }
                 \hbox
                   {
-                    \bool_if:NTF \l_@@_NiceTabular_bool
+                    \bool_if:NTF \l_@@_tabular_bool
                       { \skip_horizontal:N -\tabcolsep }
                       { \skip_horizontal:N -\arraycolsep }
                     \@@_use_arraybox_with_notes_c:
-                    \bool_if:NTF \l_@@_NiceTabular_bool
+                    \bool_if:NTF \l_@@_tabular_bool
                       { \skip_horizontal:N -\tabcolsep }
                       { \skip_horizontal:N -\arraycolsep }
                   }
@@ -4427,8 +4468,8 @@
         \skip_horizontal:N \g_@@_width_last_col_dim 
         \skip_horizontal:N \col at sep 
       }
-    \bool_if:NF \l_@@_Matrix_bool
-      {    
+    \bool_if:NT \l_@@_preamble_bool
+      {
         \int_compare:nNnT \c at jCol < \g_@@_static_num_of_col_int 
           { \@@_warning_gredirect_none:n  { columns~not~used } }
       }
@@ -4468,18 +4509,25 @@
 % \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
+% by-side effects, for example, the boolean |\g_@@_delims_bool| will be set
+% to |true| 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
 % version will be stored in |\g_@@_preamble_tl| also.
-%
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_transform_preamble:
   {
+    \bool_if:NT \l_@@_preamble_bool \@@_transform_preamble_i:
+    \@@_transform_preamble_ii:
+  }
 %    \end{macrocode}
+% 
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_transform_preamble_i:
+  {
+%    \end{macrocode}
 % First, we will do an ``expansion'' of the preamble with the tools of the
 % package \pkg{array} itself. This ``expansion'' will expand all the constructions
 % with |*| and all column types (defined by the user or by various packages
@@ -4499,74 +4547,54 @@
 % That's why we do those redefinitions in a TeX group.
 %   \begin{macrocode}
     \group_begin:
+    \@@_newcolumntype w [ 2 ] { \@@_w: { ##1 } { ##2 } }
+    \@@_newcolumntype W [ 2 ] { \@@_W: { ##1 } { ##2 } }
 %    \end{macrocode}
-% 
-% If we are in an environment without explicit preamble, we have nothing to do
-% (excepted the treatment on both sides of the preamble which will be done at
-% the end).
-%    \begin{macrocode}
-    \bool_if:NF \l_@@_Matrix_bool
-      {
-        \@@_newcolumntype w [ 2 ] { \@@_w: { ##1 } { ##2 } }
-        \@@_newcolumntype W [ 2 ] { \@@_W: { ##1 } { ##2 } }
-%    \end{macrocode}
 %
 % \bigskip
 % 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 }
+    \int_gzero:N \c at jCol
+    \tl_gclear:N \g_@@_preamble_tl 
 %    \end{macrocode}
-%
-% 
-% \bigskip
-% Now, we have to ``patch'' that preamble by transforming some columns. 
-% We will insert in the TeX flow the preamble in its actual form (that is to say
-% after the ``expansion'') following by a marker |\q_stop| and we will consume
-% these tokens constructing the (new form of the) preamble in
-% |\g_@@_preamble_tl|. This is done recursively with the command
-% |\@@_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 
-%    \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 } 
+    \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 } }
           }
-          {
-            \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
 % (hence the name |vlism|). 
 %    \begin{macrocode}
-        \seq_clear:N \g_@@_cols_vlism_seq 
+    \seq_clear:N \g_@@_cols_vlism_seq 
 %    \end{macrocode}
 %
 % \bigskip
@@ -4573,26 +4601,28 @@
 % The following sequence will store the arguments of the successive |>| in the
 % preamble. 
 %    \begin{macrocode}
-        \tl_gclear_new:N \g_@@_pre_cell_tl
+    \tl_gclear_new:N \g_@@_pre_cell_tl
 %    \end{macrocode}
 %
 % The counter |\l_tmpa_int| will count the number of consecutive occurrences
 % of the symbol \verb+|+.
 %    \begin{macrocode}
-        \int_zero:N \l_tmpa_int
+    \int_zero:N \l_tmpa_int
 %    \end{macrocode}
 % Now, we actually patch the preamble (and it is constructed in
 % |\g_@@_preamble_tl|). 
 %    \begin{macrocode}
-        \exp_after:wN \@@_patch_preamble:n \the \@temptokena \q_stop
-        \int_gset_eq:NN \g_@@_static_num_of_col_int \c at jCol
-      }
+    \exp_after:wN \@@_patch_preamble:n \the \@temptokena \q_stop
+    \int_gset_eq:NN \g_@@_static_num_of_col_int \c at jCol
 %    \end{macrocode}
+% Remark that |\g_@@_static_num_of_col_int| will stay equel to zero in the
+% environments without preamble since we are in a code that is executed only
+% in the environments \emph{with} preamble.
 %
 % \medskip
 % Now, we replace |\columncolor| by |\@@_columncolor_preamble|.
 %    \begin{macrocode}
-    \bool_if:NT \l_@@_colortbl_like_bool
+    \bool_if:NT \l_@@_color_inside_bool
       {
         \regex_replace_all:NnN 
           \c_@@_columncolor_regex
@@ -4606,8 +4636,23 @@
 % the columns of type |w| and~|W|. 
 %    \begin{macrocode}
     \group_end:
+  }
 %    \end{macrocode}
+% 
 %
+% 
+% \bigskip
+% Now, we have to ``patch'' that preamble by transforming some columns. 
+% We will insert in the TeX flow the preamble in its actual form (that is to say
+% after the ``expansion'') following by a marker |\q_stop| and we will consume
+% these tokens constructing the (new form of the) preamble in
+% |\g_@@_preamble_tl|. This is done recursively with the command
+% |\@@_patch_preamble:n|. In the same time, we will count the columns with the
+% counter |\c at jCol|.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_transform_preamble_ii:
+  {
+%
 % \medskip
 % If there was delimiters at the beginning or at the end of the preamble, the
 % environment |{NiceArray}| is transformed into an environment |{xNiceMatrix}|.
@@ -4615,7 +4660,7 @@
     \bool_lazy_or:nnT 
        { ! \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 } 
+       { \bool_gset_true:N \g_@@_delims_bool } 
 %    \end{macrocode}
 %
 % \medskip
@@ -4632,8 +4677,8 @@
       {
         \bool_lazy_all:nT 
           { 
-            \g_@@_NiceArray_bool 
-            { \bool_not_p:n \l_@@_NiceTabular_bool }
+            { \bool_not_p:n \g_@@_delims_bool }
+            { \bool_not_p:n \l_@@_tabular_bool }
             { \tl_if_empty_p:N \l_@@_vlines_clist } 
             { \bool_not_p:n \l_@@_exterior_arraycolsep_bool }
           }
@@ -4644,8 +4689,8 @@
       { 
         \bool_lazy_all:nT
           { 
-            \g_@@_NiceArray_bool 
-            { \bool_not_p:n \l_@@_NiceTabular_bool }
+            { \bool_not_p:n \g_@@_delims_bool }
+            { \bool_not_p:n \l_@@_tabular_bool }
             { \tl_if_empty_p:N \l_@@_vlines_clist } 
             { \bool_not_p:n \l_@@_exterior_arraycolsep_bool }
           }
@@ -5268,8 +5313,6 @@
         < {
             \@@_cell_end:
             \hbox_set_end: 
-            % The following line is probably pointless
-            % \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box:
             #1
             \@@_adjust_size_box:
             \makebox [ #4 ] [ #3 ] { \box_use_drop:N \l_@@_cell_box }  
@@ -5985,7 +6028,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 \g_@@_NiceArray_bool 
+    \bool_if:NT \l_@@_NiceMatrix_without_vlines_bool
       {
         \box_set_wd:Nn \l_@@_the_array_box
           { \box_wd:N \l_@@_the_array_box - \arraycolsep }
@@ -6492,6 +6535,8 @@
     \@@_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}). 
@@ -6710,8 +6755,8 @@
         \int_gincr:N \g_tmpa_int 
         \bool_lazy_all:nT 
           { 
-            \g_@@_NiceArray_bool 
-            { \bool_not_p:n \l_@@_NiceTabular_bool }
+            { \bool_not_p:n \g_@@_delims_bool }
+            { \bool_not_p:n \l_@@_tabular_bool }
             { \clist_if_empty_p:N \l_@@_vlines_clist } 
             { \bool_not_p:n \l_@@_exterior_arraycolsep_bool }
             { ! \l_@@_bar_at_end_of_pream_bool }
@@ -6728,13 +6773,12 @@
 % 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 \g_@@_NiceArray_bool
+                \bool_if:NT \l_@@_NiceMatrix_without_vlines_bool
                   { \skip_horizontal:N -\arraycolsep }
                 \pgfsys at markposition 
-                  { \@@_env: - col - \int_eval:n {
-                    \g_tmpa_int + 1 } } 
+                  { \@@_env: - col - \int_eval:n { \g_tmpa_int + 1 } } 
                 \skip_horizontal:N 0.5\arrayrulewidth 
-                \bool_lazy_and:nnT \l_@@_Matrix_bool \g_@@_NiceArray_bool
+                \bool_if:NT \l_@@_NiceMatrix_without_vlines_bool
                   { \skip_horizontal:N \arraycolsep }
               }
           }   
@@ -6742,7 +6786,7 @@
           \pgfrememberpicturepositiononpagetrue
           \pgfcoordinate { \@@_env: - col - \int_eval:n { \g_tmpa_int + 1 } } 
             { 
-              \bool_lazy_and:nnTF \l_@@_Matrix_bool \g_@@_NiceArray_bool
+              \bool_if:NT \l_@@_NiceMatrix_without_vlines_bool
                 { 
                   \pgfpoint 
                     { - 0.5 \arrayrulewidth - \arraycolsep } 
@@ -6877,6 +6921,7 @@
   {
     > 
       { 
+        \bool_set_true:N \l_@@_in_last_col_bool
 %    \end{macrocode}
 % At the beginning of the cell, we link |\CodeAfter| to a command which 
 % begins with |\\| (whereas the standard version of |\CodeAfter| begins does
@@ -6949,19 +6994,17 @@
 %
 % \interitem
 % The environment |{NiceArray}| is constructed upon the environment
-% |{NiceArrayWithDelims}| but, in fact, there is a flag |\g_@@_NiceArray_bool|.
-% In |{NiceArrayWithDelims}|, some special code will be executed if this flag is
-% raised. 
+% |{NiceArrayWithDelims}|.
 %    \begin{macrocode}
 \NewDocumentEnvironment { NiceArray } { }
   { 
-    \bool_gset_true:N \g_@@_NiceArray_bool
+    \bool_gset_false:N \g_@@_delims_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
-% |\g_@@_NiceArray_bool| is raised).
+% |\g_@@_delims_bool| is set to false).
 %    \begin{macrocode} 
     \NiceArrayWithDelims . . 
   }
@@ -6977,7 +7020,7 @@
   {
     \NewDocumentEnvironment { #1 NiceArray } { }
       {
-        \bool_gset_false:N \g_@@_NiceArray_bool 
+        \bool_gset_true:N \g_@@_delims_bool 
         \str_if_empty:NT \g_@@_name_env_str 
           { \str_gset:Nn \g_@@_name_env_str { #1 NiceArray } } 
         \@@_test_if_math_mode:
@@ -7003,9 +7046,12 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_begin_of_NiceMatrix:nn #1 #2
   {
-    \bool_set_true:N \l_@@_Matrix_bool
-    \use:c { #1 NiceArray } 
-      { 
+    \bool_set_false:N \l_@@_preamble_bool 
+    \tl_clear:N \l_tmpa_tl 
+    \bool_if:NT \l_@@_NiceMatrix_without_vlines_bool 
+      { \tl_set:Nn \l_tmpa_tl { @ { } } }    
+    \tl_put_right:Nn \l_tmpa_tl
+      {  
         * 
           { 
             \int_case:nnF \l_@@_last_col_int 
@@ -7021,6 +7067,8 @@
           } 
           { #2 }
       } 
+    \tl_set:Nn \l_tmpb_tl { \use:c { #1 NiceArray } }
+    \exp_args:NV \l_tmpb_tl \l_tmpa_tl    
   }
 %    \end{macrocode}
 % 
@@ -7033,7 +7081,7 @@
   {
     \NewDocumentEnvironment { #1 NiceMatrix } { ! O { } }
       {
-        \bool_gset_false:N \g_@@_NiceArray_bool 
+        \bool_gset_true:N \g_@@_delims_bool 
         \str_gset:Nn \g_@@_name_env_str { #1 NiceMatrix } 
         \keys_set:nn { NiceMatrix / NiceMatrix } { ##1 }
         \@@_begin_of_NiceMatrix:nV { #1 } \l_@@_columns_type_tl 
@@ -7047,9 +7095,12 @@
 %    \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 }
+    \bool_lazy_or:nnT
+      { \clist_if_empty_p:N \l_@@_vlines_clist }
+      { \l_@@_except_borders_bool }
+      { \bool_set_true:N \l_@@_NiceMatrix_without_vlines_bool }
     \@@_begin_of_NiceMatrix:nV { } \l_@@_columns_type_tl 
   }
   { \endNiceArray }
@@ -7077,36 +7128,6 @@
       { \dim_set_eq:NN \l_@@_width_dim \linewidth }
     \str_gset:Nn \g_@@_name_env_str { NiceTabular }
     \keys_set:nn { NiceMatrix / NiceTabular } { #1 , #3 }
-    \int_compare:nNnT \l_@@_tab_rounded_corners_dim > \c_zero_dim
-      {
-        \bool_if:NT \l_@@_hvlines_bool
-          {
-            \bool_set_true:N \l_@@_except_borders_bool
-            % we should try to be more efficient in the number of lines of code here
-            \tl_if_empty:NTF \l_@@_rules_color_tl
-              {
-                \tl_gput_right:Nn \g_@@_pre_code_after_tl
-                  { 
-                    \@@_stroke_block:nnn 
-                      { rounded-corners = \dim_use:N \l_@@_tab_rounded_corners_dim }
-                      { 1-1 }
-                      { \int_use:N \c at iRow - \int_use:N \c at jCol }
-                  }
-              }
-              {
-                \tl_gput_right:Nn \g_@@_pre_code_after_tl
-                  { 
-                    \@@_stroke_block:nnn 
-                      { 
-                        rounded-corners = \dim_use:N \l_@@_tab_rounded_corners_dim ,
-                        draw = \l_@@_rules_color_tl
-                      }
-                      { 1-1 }
-                      { \int_use:N \c at iRow - \int_use:N \c at jCol }
-                  }
-              }
-          }
-      }
     \tl_if_empty:NF \l_@@_short_caption_tl
       {
         \tl_if_empty:NT \l_@@_caption_tl
@@ -7131,7 +7152,7 @@
           }
       }
       { }
-    \bool_set_true:N \l_@@_NiceTabular_bool 
+    \bool_set_true:N \l_@@_tabular_bool 
     \NiceArray { #2 }
   }
   { \endNiceArray }
@@ -7166,7 +7187,7 @@
     \dim_zero_new:N \l_@@_width_dim 
     \dim_set:Nn \l_@@_width_dim { #1 }
     \keys_set:nn { NiceMatrix / NiceTabular } { #2 , #4 }
-    \bool_set_true:N \l_@@_NiceTabular_bool 
+    \bool_set_true:N \l_@@_tabular_bool 
     \NiceArray { #3 }
   }
   { \endNiceArray }
@@ -7179,7 +7200,7 @@
     \str_gset:Nn \g_@@_name_env_str { NiceTabular* }
     \dim_set:Nn \l_@@_tabular_width_dim { #1 }
     \keys_set:nn { NiceMatrix / NiceTabular } { #2 , #4 }
-    \bool_set_true:N \l_@@_NiceTabular_bool 
+    \bool_set_true:N \l_@@_tabular_bool 
     \NiceArray { #3 }
   }
   { \endNiceArray }
@@ -7189,6 +7210,33 @@
 % \bigskip
 % \section{After the construction of the array}
 %
+%  \bigskip
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_deal_with_rounded_corners:
+  {
+    \bool_lazy_all:nT 
+      {
+        { \int_compare_p:nNn \l_@@_tab_rounded_corners_dim > \c_zero_dim }
+        \l_@@_hvlines_bool
+        { ! \g_@@_delims_bool }
+        { ! \l_@@_except_borders_bool }  
+      }
+      {
+        \bool_set_true:N \l_@@_except_borders_bool
+        \tl_gput_right:Nn \g_@@_pre_code_after_tl
+          {
+            \_@@_stroke_block:nnn
+              {
+                rounded-corners = \dim_use:N \l_@@_tab_rounded_corners_dim ,
+                draw = \l_@@_rules_color_tl
+              }
+              { 1-1 }
+              { \int_use:N \c at iRow - \int_use:N \c at jCol }
+          }
+      }
+  }
+% 
+%
 % \medskip 
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_after_array:
@@ -7383,6 +7431,7 @@
 %    \end{macrocode}
 % 
 %    \begin{macrocode}
+    \@@_deal_with_rounded_corners:
     \tl_if_empty:NF \l_@@_hlines_clist \@@_draw_hlines: 
     \tl_if_empty:NF \l_@@_vlines_clist \@@_draw_vlines: 
 %    \end{macrocode}
@@ -7450,7 +7499,7 @@
 % 
 % \medskip
 % |\g_@@_pre_code_before_tl| is for instructions in the cells of the array such as
-% |\rowcolor| and |\cellcolor| (when the key |colortbl-like| is in
+% |\rowcolor| and |\cellcolor| (when the key |color-inside| is in
 % force). These instructions will be written on the |aux| file to be added to
 % the |code-before| in the next run.
 %    \begin{macrocode}
@@ -9258,10 +9307,24 @@
 % The command |\@@_rotate:| will be linked to |\rotate| in
 % |{NiceArrayWithDelims}|.  
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_rotate: { \bool_gset_true:N \g_@@_rotate_bool }
+\NewDocumentCommand \@@_rotate: { O { } }
+  { 
+    \bool_gset_true:N \g_@@_rotate_bool 
+    \keys_set:nn { NiceMatrix / rotate } { #1 }
+  }
 %    \end{macrocode}
 %
 % \bigskip
+%    \begin{macrocode}
+\keys_define:nn { NiceMatrix / rotate }
+  {
+    c .code:n = \bool_gset_true:N \g_@@_rotate_c_bool ,
+    c .value_forbidden:n = true ,
+    unknown .code:n = \@@_error:n { Unknown~key~for~rotate } 
+  }
+%    \end{macrocode}
+% 
+% \bigskip
 % \section{The command \textbackslash line accessible in code-after}
 %
 % In the |\CodeAfter|, the command |\@@_line:nn| will be linked to |\line|. This
@@ -9858,6 +9921,9 @@
 % However, the command |\rowcolors| of \pkg{nicematrix} has \emph{not} the
 % optional argument of the command |\rowcolors| of \pkg{xcolor}. Here is an
 % example: |\rowcolors{1}{blue!10}{}[respect-blocks]|.
+%
+% In \pkg{nicematrix}, the commmand |\@@_rowcolors| apperas as a special case of
+% |\@@_rowlistcolors|. 
 % 
 % |#1| (optional) is the color space ;
 % |#2| is a list of intervals of rows ;
@@ -9909,9 +9975,8 @@
 % index of the loop over the rows.
 %    \begin{macrocode}
         \int_set:Nn \l_tmpa_int \l_tmpa_tl
-        \bool_if:NTF \l_@@_rowcolors_restart_bool
-          { \int_set:Nn \l_@@_color_int 1 }
-          { \int_set:Nn \l_@@_color_int \l_tmpa_tl } 
+        \int_set:Nn \l_@@_color_int 
+          { \bool_if:NTF \l_@@_rowcolors_restart_bool 1 \l_tmpa_tl }
         \int_zero_new:N \l_@@_tmpc_int
         \int_set:Nn \l_@@_tmpc_int \l_tmpb_tl
         \int_do_until:nNnn \l_tmpa_int > \l_@@_tmpc_int
@@ -9979,10 +10044,11 @@
 % 
 % \bigskip
 % The command |\rowcolors| (available in the |\CodeBefore|) is a specialisation
-% of the most general command |\rowlistcolors|.
+% of the most general command |\rowlistcolors|. The last argument, which is a
+% optional argument between square brackets is provided by curryfication.
 %    \begin{macrocode}
-\NewDocumentCommand \@@_rowcolors { O { } m m m O { } }
-  { \@@_rowlistcolors [ #1 ] { #2 } { { #3 } , { #4 } } [ #5 ] }
+\NewDocumentCommand \@@_rowcolors { O { } m m m }
+  { \@@_rowlistcolors [ #1 ] { #2 } { { #3 } , { #4 } } }
 %    \end{macrocode}
 % 
 % \bigskip 
@@ -10155,7 +10221,7 @@
 %    \end{macrocode}
 % 
 % \bigskip
-% When the user uses the key |colortbl-like|, the following command will
+% When the user uses the key |color-inside|, the following command will
 % be linked to |\cellcolor| in the tabular.
 %    \begin{macrocode}
 \NewDocumentCommand \@@_cellcolor_tabular { O { } m }
@@ -10175,7 +10241,7 @@
 %    \end{macrocode}
 % 
 % \bigskip
-% When the user uses the key |colortbl-like|, the following command will
+% When the user uses the key |color-inside|, the following command will
 % be linked to |\rowcolor| in the tabular.
 %    \begin{macrocode}
 \NewDocumentCommand \@@_rowcolor_tabular { O { } m }
@@ -10190,9 +10256,34 @@
   }
 %    \end{macrocode}
 %
+% \bigskip
+% When the user uses the key |color-inside|, the following command will
+% be linked to |\rowcolors| in the tabular. The last argument (an optional
+% argument between square brackets is taken by curryfication).
+%    \begin{macrocode}
+\NewDocumentCommand { \@@_rowcolors_tabular } { O { } m m }
+  { \@@_rowlistcolors_tabular [ #1 ] { #2 , #3 } }
+%    \end{macrocode}
 %
 % \bigskip
+% When the user uses the key |color-inside|, the following command will
+% be linked to |\rowlistcolors| in the tabular.
 %    \begin{macrocode}
+\NewDocumentCommand { \@@_rowlistcolors_tabular } { O { } m O { } }
+  {
+    \peek_remove_spaces:n 
+      {
+        \tl_gput_right:Nx \g__nicematrix_pre_code_before_tl 
+          { 
+            \@@_rowlistcolors 
+               [ #1 ] { \int_use:N \c at iRow } { #2 } [ restart, #3 ] 
+          }
+      }
+  }
+%    \end{macrocode}
+%
+% \bigskip
+%    \begin{macrocode}
 \NewDocumentCommand \@@_columncolor_preamble { O { } m }
   { 
 %    \end{macrocode}
@@ -10272,7 +10363,13 @@
 \cs_new_protected:Npn \@@_OnlyMainNiceMatrix_i:n #1
   {
     \int_compare:nNnF \c at iRow = 0
-      { \int_compare:nNnF \c at iRow = \l_@@_last_row_int { #1 } }
+      { 
+        \int_compare:nNnF \c at iRow = \l_@@_last_row_int 
+          { 
+            \int_compare:nNnT \c at jCol > \c_zero_int 
+              { \bool_if:NF \l_@@_in_last_col_bool { #1 } }
+          } 
+      }
   }
 %    \end{macrocode}
 % Remember that |\c at iRow| is not always inferior to |\l_@@_last_row_int| because
@@ -10582,11 +10679,11 @@
   {
     \int_step_inline:nnn 
       { 
-        \bool_if:nTF { \g_@@_NiceArray_bool && ! \l_@@_except_borders_bool }
+        \bool_if:nTF { ! \g_@@_delims_bool && ! \l_@@_except_borders_bool }
           1 2 
       }
       { 
-        \bool_if:nTF { \g_@@_NiceArray_bool && ! \l_@@_except_borders_bool }
+        \bool_if:nTF { ! \g_@@_delims_bool && ! \l_@@_except_borders_bool }
           { \int_eval:n { \c at jCol + 1 } } 
           \c at jCol 
       }
@@ -10839,7 +10936,7 @@
     \int_compare:nNnT \l_@@_local_start_int = 1 
       {
         \dim_sub:Nn \l_@@_x_initial_dim \l_@@_left_margin_dim 
-        \bool_if:NT \g_@@_NiceArray_bool 
+        \bool_if:NF \g_@@_delims_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
@@ -10854,7 +10951,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 \g_@@_NiceArray_bool 
+        \bool_if:NF \g_@@_delims_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 } }
@@ -10898,11 +10995,11 @@
   {
     \int_step_inline:nnn 
       { 
-        \bool_if:nTF { \g_@@_NiceArray_bool && ! \l_@@_except_borders_bool }
+        \bool_if:nTF { ! \g_@@_delims_bool && ! \l_@@_except_borders_bool }
           1 2 
       }
       { 
-        \bool_if:nTF { \g_@@_NiceArray_bool && ! \l_@@_except_borders_bool }
+        \bool_if:nTF { ! \g_@@_delims_bool && ! \l_@@_except_borders_bool }
           { \int_eval:n { \c at iRow + 1 } } 
           \c at iRow
       }
@@ -12007,8 +12104,23 @@
 % |\NewExpandableDocumentCommand| because it has an optional argument between
 % |<| and |>|. It's mandatory to use an expandable command.
 %
+%
 %    \begin{macrocode}
-\NewExpandableDocumentCommand \@@_Block: { O { } m D < > { } +m }
+\cs_new_protected:Npn \@@_block:n #1
+  {
+    \peek_meaning:NTF [ 
+      { \@@_block_i:n { #1 } }
+      { \@@_Block_i:[#1] }
+  }
+
+\cs_new_protected:Npn \@@_block_i:n #1[#2] { \@@_block:n {#1,#2} }
+
+\cs_new_protected:Npn \@@_Block: { \@@_block:n { } }
+%    \end{macrocode}
+%
+% \bigskip
+%    \begin{macrocode}
+\NewExpandableDocumentCommand \@@_Block_i: { O { } m D < > { } +m }
   { 
 %    \end{macrocode}
 % If the first mandatory argument of the command (which is the size of the block
@@ -12210,8 +12322,8 @@
 % the tabular is the same as the external alignment of the tabular (that is to
 % say the position of the block in its zone of merged cells).
 %    \begin{macrocode}
-        \bool_if:NT \g_@@_rotate_bool { \str_set:Nn \l_@@_hpos_block_str c }  
-        \bool_if:NTF \l_@@_NiceTabular_bool
+        \bool_if:NT \g_@@_rotate_bool { \str_set:Nn \l_@@_hpos_block_str c }   
+        \bool_if:NTF \l_@@_tabular_bool
           { 
             \bool_lazy_all:nTF
               {
@@ -12268,6 +12380,20 @@
         \box_grotate:cn  
           { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
           { 90 } 
+        \bool_if:NT \g_@@_rotate_c_bool
+          {
+            \hbox_gset:cn
+              { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
+              {
+                \c_math_toggle_token
+                \vcenter 
+                  { 
+                    \box_use:c
+                    { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
+                  } 
+                \c_math_toggle_token
+              }
+          } 
         \bool_gset_false:N \g_@@_rotate_bool
       }
 %    \end{macrocode}
@@ -12321,12 +12447,17 @@
 % alignment and that's why we put a key corresponding to the value of
 % |\l_@@_hpos_block_str|, which is fixed by the type of current column.
 %    \begin{macrocode}
-        { \exp_not:n { #3 } , \l_@@_hpos_block_str }
         { 
+          \exp_not:n { #3 } , 
+          \l_@@_hpos_block_str ,
+          \bool_if:NT \g_@@_rotate_c_bool { v-center }
+        }
+        { 
           \box_use_drop:c 
             { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } 
         }
       } 
+    \bool_set_false:N \g_@@_rotate_c_bool
   }
 %    \end{macrocode}
 % 
@@ -12343,7 +12474,7 @@
         \l_tmpa_tl
         { \exp_not:n { #3 } }
         {
-          \bool_if:NTF \l_@@_NiceTabular_bool
+          \bool_if:NTF \l_@@_tabular_bool
             { 
               \group_begin:
               \bool_if:NF \l_@@_respect_arraystretch_bool 
@@ -12539,6 +12670,7 @@
 % 
 %
 % \medskip
+% The following command |\@@_Block_v:nnnnnn| will actually draw the block.
 % |#1| is the first row of the block;
 % |#2| is the first column of the block;
 % |#3| is the last row of the block;
@@ -13061,7 +13193,8 @@
 \keys_define:nn { NiceMatrix / BlockStroke }
   {
     color .tl_set:N = \l_@@_draw_tl ,
-    draw .tl_set:N = \l_@@_draw_tl ,
+    draw .code:n = 
+      \exp_args:Nx \tl_if_empty:nF { #1 } { \tl_set:Nn \l_@@_draw_tl { #1 } } ,
     draw .default:n = default ,
     line-width .dim_set:N = \l_@@_line_width_dim ,
     rounded-corners .dim_set:N = \l_@@_rounded_corners_dim ,
@@ -13328,6 +13461,8 @@
     delimiters / max-width .default:n = true ,
     delimiters .code:n = \keys_set:nn { NiceMatrix / delimiters } { #1 } , 
     delimiters .value_required:n = true , 
+    rounded-corners .dim_set:N = \l_@@_tab_rounded_corners_dim ,
+    rounded-corners .default:n = 4 pt 
   }
 %    \end{macrocode}
 % 
@@ -13345,20 +13480,13 @@
 % The group is for the protection of the keys.
 %    \begin{macrocode}
     \group_begin:
-    \bool_set_true:N \l_@@_Matrix_bool
-    \str_if_eq:nnT { #1 } { . }
-      {
-        \str_if_eq:nnT { #2 } { . }
-          { \bool_set_false:N \l_@@_Matrix_bool }
-      }
     \keys_set_known:nnN { NiceMatrix / Auto } { #6 } \l_tmpa_tl
 %    \end{macrocode}
-% We nullify the command |\@@_transform_preamble:| because we will provide a
+% We nullify the command |\@@_transform_preamble_i:| 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: 
+    \bool_set_false:N \l_@@_preamble_bool 
     \use:x 
       {
         \exp_not:N \begin { NiceArrayWithDelims } { #1 } { #2 } 
@@ -13394,13 +13522,12 @@
   }
 %    \end{macrocode}
 %
-% 
 %    \begin{macrocode}
 \cs_set_protected:Npn \@@_define_com:nnn #1 #2 #3
   { 
     \cs_set_protected:cpn { #1 AutoNiceMatrix }
       {
-        \bool_gset_false:N \g_@@_NiceArray_bool 
+        \bool_gset_true:N \g_@@_delims_bool 
         \str_gset:Nx \g_@@_name_env_str { #1 AutoNiceMatrix } 
         \AutoNiceMatrixWithDelims { #2 } { #3 }
       }  
@@ -13421,8 +13548,7 @@
 \NewDocumentCommand \AutoNiceMatrix { O { } m O { } m ! O { } } 
   { 
     \group_begin:
-    \bool_gset_true:N \g_@@_NiceArray_bool 
-    % \bool_set_true:N \l_@@_Matrix_bool
+    \bool_gset_false:N \g_@@_delims_bool 
     \AutoNiceMatrixWithDelims . . { #2 } { #4 } [ #1 , #3 , #5 ] 
     \group_end:
   }
@@ -14817,7 +14943,7 @@
 % The class \cls{beamer} has its own system to extract footnotes and that's why
 % we have nothing to do if \cls{beamer} is used. 
 %    \begin{macrocode}
-    \IfClassLoadeTF { beamer }
+    \IfClassLoadedTF { beamer }
       { \bool_set_false:N \c_@@_footnote_bool }
       { 
         \IfPackageLoadedTF { footnotehyper }
@@ -15146,9 +15272,18 @@
   {
     Unknown~key.\\
     There~is~only~two~keys~available~here:~width~and~color.\\
-    You~key~'\l_keys_key_str'~will~be~ignored.
+    Your~key~'\l_keys_key_str'~will~be~ignored.
   }
 %    \end{macrocode}
+%
+%    \begin{macrocode}
+\@@_msg_new:nn { Unknown~key~for~rotate }
+  {
+    Unknown~key.\\
+    The~only~key~available~here~is~'c'.\\
+    Your~key~'\l_keys_key_str'~will~be~ignored.
+  }
+%    \end{macrocode}
 % 
 %    \begin{macrocode}
 \@@_msg_new:nnn { Unknown~key~for~custom-line }
@@ -15887,6 +16022,7 @@
     renew-dots,~
     renew-matrix,~
     respect-arraystretch,~
+    rounded-corners,~
     right-margin,~
     rules~(with~the~subkeys~'color'~and~'width'),~
     small,~
@@ -15920,7 +16056,7 @@
     code-for-first-row,~
     code-for-last-col,~
     code-for-last-row,~
-    colortbl-like,~
+    color-inside,~
     columns-width,~
     corners,~
     create-extra-nodes,~
@@ -15943,6 +16079,7 @@
     renew-dots,~
     respect-arraystretch,~
     right-margin,~
+    rounded-corners,~
     rules~(with~the~subkeys~'color'~and~'width'),~
     small,~
     t,~
@@ -15981,7 +16118,7 @@
     code-for-first-row,~
     code-for-last-col,~
     code-for-last-row,~
-    colortbl-like,~
+    color-inside,~
     columns-type,~
     columns-width,~
     corners,~
@@ -16007,6 +16144,7 @@
     renew-dots,~
     respect-arraystretch,~
     right-margin,~
+    rounded-corners,~
     rules~(with~the~subkeys~'color'~and~'width'),~
     small,~
     t,~
@@ -16042,7 +16180,7 @@
     code-for-first-row,~
     code-for-last-col,~
     code-for-last-row,~
-    colortbl-like,~
+    color-inside,~
     columns-width,~
     corners,~
     custom-line,~

Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins	2023-07-14 21:05:11 UTC (rev 67629)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins	2023-07-14 21:05:26 UTC (rev 67630)
@@ -1,5 +1,5 @@
 %%
-%% Copyright (C) 2018-2022 by F. Pantigny
+%% Copyright (C) 2018-2023 by F. Pantigny
 %%
 %%
 %% This file may be distributed and/or modified under the

Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2023-07-14 21:05:11 UTC (rev 67629)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2023-07-14 21:05:26 UTC (rev 67630)
@@ -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.20a}
-\def\myfiledate{2023/06/30}
+\def\myfileversion{6.21}
+\def\myfiledate{2023/07/14}
 \RequirePackage{pgfcore}
 \usepgfmodule{shapes}
 \RequirePackage{l3keys2e}
@@ -255,7 +255,7 @@
   }
 \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 }
+  { \bool_if:NF \l__nicematrix_tabular_bool \c_math_toggle_token }
 \cs_new_protected:Npn \__nicematrix_set_CT at arc@:n #1
   {
     \tl_if_blank:nF { #1 }
@@ -323,6 +323,12 @@
   { \int_use:N \g__nicematrix_env_int }
 \cs_new_protected:Npn \__nicematrix_qpoint:n #1
   { \pgfpointanchor { \__nicematrix_env: - #1 } { center } }
+\bool_new:N \l__nicematrix_tabular_bool
+\bool_new:N \g__nicematrix_delims_bool
+\bool_gset_true:N \g__nicematrix_delims_bool
+\bool_new:N \l__nicematrix_preamble_bool
+\bool_set_true:N \l__nicematrix_preamble_bool
+\bool_new:N \l__nicematrix_NiceMatrix_without_vlines_bool
 \int_new:N \g__nicematrix_NiceMatrixBlock_int
 \int_new:N \g__nicematrix_notes_caption_int
 \dim_new:N \l__nicematrix_columns_width_dim
@@ -343,12 +349,10 @@
 \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 \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
-\bool_new:N \l__nicematrix_Matrix_bool
 \bool_new:N \g__nicematrix_rotate_bool
+\bool_new:N \g__nicematrix_rotate_c_bool
 \bool_new:N \l__nicematrix_X_column_bool
 \bool_new:N \g__nicematrix_caption_finished_bool
 \tl_new:N \g__nicematrix_aux_tl
@@ -374,13 +378,14 @@
       { command \space \c_backslash_str \g__nicematrix_name_env_str }
       { environment \space \{ \g__nicematrix_name_env_str \} }
   }
-\tl_new:N \g_nicematrix_code_after_tl
-\bool_new:N \l__nicematrix_in_code_after_bool
 \tl_new:N \l__nicematrix_code_tl
 \tl_new:N \l__nicematrix_pgf_node_code_tl
+
+\tl_new:N \g__nicematrix_pre_code_before_tl
+\tl_new:N \g_nicematrix_code_before_tl
 \tl_new:N \g__nicematrix_pre_code_after_tl
-\tl_new:N \g_nicematrix_code_before_tl
-\tl_new:N \g__nicematrix_pre_code_before_tl
+\tl_new:N \g_nicematrix_code_after_tl
+\bool_new:N \l__nicematrix_in_code_after_bool
 \int_new:N \l__nicematrix_old_iRow_int
 \int_new:N \l__nicematrix_old_jCol_int
 \seq_new:N \l__nicematrix_custom_line_commands_seq
@@ -456,6 +461,7 @@
 \int_new:N \l__nicematrix_last_col_int
 \int_set:Nn \l__nicematrix_last_col_int { -2 }
 \bool_new:N \g__nicematrix_last_col_found_bool
+\bool_new:N \l__nicematrix_in_last_col_bool
 \cs_set_protected:Npn \__nicematrix_cut_on_hyphen:w #1-#2\q_stop
   {
     \tl_set:Nn \l_tmpa_tl { #1 }
@@ -522,7 +528,7 @@
           {
             \bool_if:nT { \cs_if_exist_p:N \@captype || \l__nicematrix_in_env_bool }
               {
-                \bool_if:nTF { ! \l__nicematrix_NiceTabular_bool && \l__nicematrix_in_env_bool }
+                \bool_if:nTF { ! \l__nicematrix_tabular_bool && \l__nicematrix_in_env_bool }
                   { \__nicematrix_error:n { tabularnote~forbidden } }
                   {
                     \bool_if:NTF \l__nicematrix_in_caption_bool
@@ -691,7 +697,7 @@
 \tl_new:N \l__nicematrix_short_caption_tl
 \tl_new:N \l__nicematrix_label_tl
 \bool_new:N \l__nicematrix_caption_above_bool
-\bool_new:N \l__nicematrix_colortbl_like_bool
+\bool_new:N \l__nicematrix_color_inside_bool
 \bool_new:N \l__nicematrix_standard_cline_bool
 \dim_new:N \l__nicematrix_cell_space_top_limit_dim
 \dim_new:N \l__nicematrix_cell_space_bottom_limit_dim
@@ -792,6 +798,8 @@
   }
 \keys_define:nn { NiceMatrix / Global }
   {
+    rounded-corners .dim_set:N = \l__nicematrix_tab_rounded_corners_dim ,
+    rounded-corners .default:n = 4 pt ,
     custom-line .code:n = \__nicematrix_custom_line:n { #1 } ,
     rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
     rules .value_required:n = true ,
@@ -907,10 +915,11 @@
     name .value_required:n = true ,
     code-after .tl_gset:N = \g_nicematrix_code_after_tl ,
     code-after .value_required:n = true ,
-    colortbl-like .code:n =
-      \bool_set_true:N \l__nicematrix_colortbl_like_bool
+    color-inside .code:n =
+      \bool_set_true:N \l__nicematrix_color_inside_bool
       \bool_set_true:N \l__nicematrix_code_before_bool ,
-    colortbl-like .value_forbidden:n = true
+    color-inside .value_forbidden:n = true ,
+    colortbl-like .meta:n = color-inside
   }
 \keys_define:nn { NiceMatrix / notes }
   {
@@ -1098,8 +1107,6 @@
     width .code:n = \dim_set:Nn \l__nicematrix_width_dim { #1 }
                     \bool_set_true:N \l__nicematrix_width_used_bool ,
     width .value_required:n = true ,
-    rounded-corners .dim_set:N = \l__nicematrix_tab_rounded_corners_dim ,
-    rounded-corners .default:n = 4 pt ,
     notes .code:n = \keys_set:nn { NiceMatrix / notes } { #1 } ,
     tabularnote .tl_gset:N = \g__nicematrix_tabularnote_tl ,
     tabularnote .value_required:n = true ,
@@ -1124,7 +1131,7 @@
     \int_compare:nNnT \c at jCol = 1
       { \int_compare:nNnT \l__nicematrix_first_col_int = 1 \__nicematrix_begin_of_row: }
     \hbox_set:Nw \l__nicematrix_cell_box
-    \bool_if:NF \l__nicematrix_NiceTabular_bool
+    \bool_if:NF \l__nicematrix_tabular_bool
       {
         \c_math_toggle_token
         \bool_if:NT \l__nicematrix_small_bool \scriptstyle
@@ -1185,16 +1192,28 @@
 \cs_new_protected:Npn \__nicematrix_rotate_cell_box:
   {
     \box_rotate:Nn \l__nicematrix_cell_box { 90 }
-    \int_compare:nNnT \c at iRow = \l__nicematrix_last_row_int
+    \bool_if:NTF \g__nicematrix_rotate_c_bool
       {
-        \vbox_set_top:Nn \l__nicematrix_cell_box
+        \hbox_set:Nn \l__nicematrix_cell_box
           {
-            \vbox_to_zero:n { }
-            \skip_vertical:n { - \box_ht:N \@arstrutbox + 0.8 ex }
-            \box_use:N \l__nicematrix_cell_box
+            \c_math_toggle_token
+            \vcenter { \box_use:N \l__nicematrix_cell_box }
+            \c_math_toggle_token
           }
       }
+      {
+        \int_compare:nNnT \c at iRow = \l__nicematrix_last_row_int
+          {
+            \vbox_set_top:Nn \l__nicematrix_cell_box
+              {
+                \vbox_to_zero:n { }
+                \skip_vertical:n { - \box_ht:N \@arstrutbox + 0.8 ex }
+                \box_use:N \l__nicematrix_cell_box
+              }
+          }
+       }
     \bool_gset_false:N \g__nicematrix_rotate_bool
+    \bool_gset_false:N \g__nicematrix_rotate_c_bool
   }
 \cs_new_protected:Npn \__nicematrix_adjust_size_box:
   {
@@ -1336,7 +1355,7 @@
   }
 \cs_new_protected:Npn \__nicematrix_array:n
   {
-    \bool_if:NTF \l__nicematrix_NiceTabular_bool
+    \bool_if:NTF \l__nicematrix_tabular_bool
       { \dim_set_eq:NN \col at sep \tabcolsep }
       { \dim_set_eq:NN \col at sep \arraycolsep }
     \dim_compare:nNnTF \l__nicematrix_tabular_width_dim = \c_zero_dim
@@ -1431,6 +1450,8 @@
     \cs_set_eq:NN \cellcolor \__nicematrix_cellcolor_tabular
     \cs_set_eq:NN \rowcolor \__nicematrix_rowcolor_tabular
     \cs_set_eq:NN \columncolor \__nicematrix_columncolor_preamble
+    \cs_set_eq:NN \rowcolors \__nicematrix_rowcolors_tabular
+    \cs_set_eq:NN \rowlistcolors \__nicematrix_rowlistcolors_tabular
   }
 \cs_new_protected:Npn \__nicematrix_pre_array_ii:
   {
@@ -1508,7 +1529,7 @@
     \cs_set_eq:NN \RowStyle \__nicematrix_RowStyle:n
     \seq_map_inline:Nn \l__nicematrix_custom_line_commands_seq
       { \cs_set_eq:cc { ##1 } { nicematrix - ##1 } }
-    \bool_if:NT \l__nicematrix_colortbl_like_bool \__nicematrix_colortbl_like:
+    \bool_if:NT \l__nicematrix_color_inside_bool \__nicematrix_colortbl_like:
     \bool_if:NT \l__nicematrix_renew_dots_bool \__nicematrix_renew_dots:
     \cs_set_eq:NN \multicolumn \__nicematrix_multicolumn:nnn
     \hook_gput_code:nnn { env / tabular / begin } { . }
@@ -1576,17 +1597,17 @@
     \box_clear_new:N \l__nicematrix_the_array_box
     \dim_zero_new:N \l__nicematrix_left_delim_dim
     \dim_zero_new:N \l__nicematrix_right_delim_dim
-    \bool_if:NTF \g__nicematrix_NiceArray_bool
+    \bool_if:NTF \g__nicematrix_delims_bool
       {
-        \dim_gset:Nn \l__nicematrix_left_delim_dim { 2 \arraycolsep }
-        \dim_gset:Nn \l__nicematrix_right_delim_dim { 2 \arraycolsep }
-      }
-      {
         \hbox_set:Nn \l_tmpa_box { $ \bBigg@ 5 \g__nicematrix_left_delim_tl $ }
         \dim_set:Nn \l__nicematrix_left_delim_dim { \box_wd:N \l_tmpa_box }
         \hbox_set:Nn \l_tmpa_box { $ \bBigg@ 5 \g__nicematrix_right_delim_tl $ }
         \dim_set:Nn \l__nicematrix_right_delim_dim { \box_wd:N \l_tmpa_box }
       }
+      {
+        \dim_gset:Nn \l__nicematrix_left_delim_dim { 2 \arraycolsep }
+        \dim_gset:Nn \l__nicematrix_right_delim_dim { 2 \arraycolsep }
+      }
     \hbox_set:Nw \l__nicematrix_the_array_box
     \skip_horizontal:N \l__nicematrix_left_margin_dim
     \skip_horizontal:N \l__nicematrix_extra_left_margin_dim
@@ -1653,7 +1674,7 @@
     \seq_gclear_new:N \g__nicematrix_colors_seq
     \bool_gset_false:N \g__nicematrix_recreate_cell_nodes_bool
     \group_begin:
-    \bool_if:NT \l__nicematrix_NiceTabular_bool \c_math_toggle_token
+    \bool_if:NT \l__nicematrix_tabular_bool \c_math_toggle_token
         \int_compare:nNnT { \char_value_catcode:n { 60 } } = { 13 }
           {
             \__nicematrix_rescan_for_spanish:N \g__nicematrix_pre_code_before_tl
@@ -1664,7 +1685,7 @@
       \__nicematrix_actually_color:
       \l__nicematrix_code_before_tl
       \q_stop
-    \bool_if:NT \l__nicematrix_NiceTabular_bool \c_math_toggle_token
+    \bool_if:NT \l__nicematrix_tabular_bool \c_math_toggle_token
     \group_end:
     \bool_if:NT \g__nicematrix_recreate_cell_nodes_bool
       { \tl_put_left:Nn \__nicematrix_node_for_cell: \__nicematrix_patch_node_for_cell: }
@@ -1792,7 +1813,7 @@
     \bool_gset_false:N \g__nicematrix_row_of_col_done_bool
     \str_if_empty:NT \g__nicematrix_name_env_str
       { \str_gset:Nn \g__nicematrix_name_env_str { NiceArrayWithDelims } }
-    \bool_if:NTF \l__nicematrix_NiceTabular_bool
+    \bool_if:NTF \l__nicematrix_tabular_bool
       \mode_leave_vertical:
       \__nicematrix_test_if_math_mode:
     \bool_if:NT \l__nicematrix_in_env_bool { \__nicematrix_fatal:n { Yet~in~env } }
@@ -1827,9 +1848,9 @@
       }
     \tl_if_empty:NF \g__nicematrix_pre_code_before_tl
       { \bool_set_true:N \l__nicematrix_code_before_bool }
-    \bool_if:NTF \g__nicematrix_NiceArray_bool
+    \bool_if:NTF \g__nicematrix_delims_bool
+      { \keys_set:nn { NiceMatrix / pNiceArray } }
       { \keys_set:nn { NiceMatrix / NiceArray } }
-      { \keys_set:nn { NiceMatrix / pNiceArray } }
     { #3 , #5 }
     \__nicematrix_set_CT at arc@:V \l__nicematrix_rules_color_tl
     \IfBooleanTF { #6 } \__nicematrix_CodeBefore_Body:w \__nicematrix_pre_array:
@@ -1898,7 +1919,7 @@
         \skip_horizontal:N \col at sep
         \skip_horizontal:N \g__nicematrix_width_first_col_dim
       }
-    \bool_if:NTF \g__nicematrix_NiceArray_bool
+    \bool_if:nTF { ! \g__nicematrix_delims_bool }
       {
         \str_case:VnF \l__nicematrix_baseline_tl
           {
@@ -1930,11 +1951,11 @@
                 \skip_vertical:n { -\l_tmpa_dim - \arrayrulewidth }
                 \hbox
                   {
-                    \bool_if:NTF \l__nicematrix_NiceTabular_bool
+                    \bool_if:NTF \l__nicematrix_tabular_bool
                       { \skip_horizontal:N -\tabcolsep }
                       { \skip_horizontal:N -\arraycolsep }
                     \__nicematrix_use_arraybox_with_notes_c:
-                    \bool_if:NTF \l__nicematrix_NiceTabular_bool
+                    \bool_if:NTF \l__nicematrix_tabular_bool
                       { \skip_horizontal:N -\tabcolsep }
                       { \skip_horizontal:N -\arraycolsep }
                   }
@@ -1956,7 +1977,7 @@
         \skip_horizontal:N \g__nicematrix_width_last_col_dim
         \skip_horizontal:N \col at sep
       }
-    \bool_if:NF \l__nicematrix_Matrix_bool
+    \bool_if:NT \l__nicematrix_preamble_bool
       {
         \int_compare:nNnT \c at jCol < \g__nicematrix_static_num_of_col_int
           { \__nicematrix_warning_gredirect_none:n  { columns~not~used } }
@@ -1975,37 +1996,39 @@
   }
 \cs_new_protected:Npn \__nicematrix_transform_preamble:
   {
+    \bool_if:NT \l__nicematrix_preamble_bool \__nicematrix_transform_preamble_i:
+    \__nicematrix_transform_preamble_ii:
+  }
+\cs_new_protected:Npn \__nicematrix_transform_preamble_i:
+  {
     \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 }
       {
-        \__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 } }
           }
-          {
-            \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
-        \tl_gclear_new:N \g__nicematrix_pre_cell_tl
-        \int_zero:N \l_tmpa_int
-        \exp_after:wN \__nicematrix_patch_preamble:n \the \@temptokena \q_stop
-        \int_gset_eq:NN \g__nicematrix_static_num_of_col_int \c at jCol
       }
-    \bool_if:NT \l__nicematrix_colortbl_like_bool
+    \seq_clear:N \g__nicematrix_cols_vlism_seq
+    \tl_gclear_new:N \g__nicematrix_pre_cell_tl
+    \int_zero:N \l_tmpa_int
+    \exp_after:wN \__nicematrix_patch_preamble:n \the \@temptokena \q_stop
+    \int_gset_eq:NN \g__nicematrix_static_num_of_col_int \c at jCol
+    \bool_if:NT \l__nicematrix_color_inside_bool
       {
         \regex_replace_all:NnN
           \c__nicematrix_columncolor_regex
@@ -2013,10 +2036,13 @@
           \g__nicematrix_preamble_tl
       }
     \group_end:
+  }
+\cs_new_protected:Npn \__nicematrix_transform_preamble_ii:
+  {
     \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_gset_false:N \g__nicematrix_NiceArray_bool }
+       { \bool_gset_true:N \g__nicematrix_delims_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 }
@@ -2023,8 +2049,8 @@
       {
         \bool_lazy_all:nT
           {
-            \g__nicematrix_NiceArray_bool
-            { \bool_not_p:n \l__nicematrix_NiceTabular_bool }
+            { \bool_not_p:n \g__nicematrix_delims_bool }
+            { \bool_not_p:n \l__nicematrix_tabular_bool }
             { \tl_if_empty_p:N \l__nicematrix_vlines_clist }
             { \bool_not_p:n \l__nicematrix_exterior_arraycolsep_bool }
           }
@@ -2035,8 +2061,8 @@
       {
         \bool_lazy_all:nT
           {
-            \g__nicematrix_NiceArray_bool
-            { \bool_not_p:n \l__nicematrix_NiceTabular_bool }
+            { \bool_not_p:n \g__nicematrix_delims_bool }
+            { \bool_not_p:n \l__nicematrix_tabular_bool }
             { \tl_if_empty_p:N \l__nicematrix_vlines_clist }
             { \bool_not_p:n \l__nicematrix_exterior_arraycolsep_bool }
           }
@@ -2407,8 +2433,6 @@
         < {
             \__nicematrix_cell_end:
             \hbox_set_end:
-            % The following line is probably pointless
-            % \bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
             #1
             \__nicematrix_adjust_size_box:
             \makebox [ #4 ] [ #3 ] { \box_use_drop:N \l__nicematrix_cell_box }
@@ -2840,7 +2864,7 @@
   }
 \cs_new_protected:Npn \__nicematrix_use_arraybox_with_notes_c:
   {
-    \bool_lazy_and:nnT \l__nicematrix_Matrix_bool \g__nicematrix_NiceArray_bool
+    \bool_if:NT \l__nicematrix_NiceMatrix_without_vlines_bool
       {
         \box_set_wd:Nn \l__nicematrix_the_array_box
           { \box_wd:N \l__nicematrix_the_array_box - \arraycolsep }
@@ -3272,8 +3296,8 @@
         \int_gincr:N \g_tmpa_int
         \bool_lazy_all:nT
           {
-            \g__nicematrix_NiceArray_bool
-            { \bool_not_p:n \l__nicematrix_NiceTabular_bool }
+            { \bool_not_p:n \g__nicematrix_delims_bool }
+            { \bool_not_p:n \l__nicematrix_tabular_bool }
             { \clist_if_empty_p:N \l__nicematrix_vlines_clist }
             { \bool_not_p:n \l__nicematrix_exterior_arraycolsep_bool }
             { ! \l__nicematrix_bar_at_end_of_pream_bool }
@@ -3284,13 +3308,12 @@
             \hbox
               {
                 \skip_horizontal:N -0.5\arrayrulewidth
-                \bool_lazy_and:nnT \l__nicematrix_Matrix_bool \g__nicematrix_NiceArray_bool
+                \bool_if:NT \l__nicematrix_NiceMatrix_without_vlines_bool
                   { \skip_horizontal:N -\arraycolsep }
                 \pgfsys at markposition
-                  { \__nicematrix_env: - col - \int_eval:n {
-                    \g_tmpa_int + 1 } }
+                  { \__nicematrix_env: - col - \int_eval:n { \g_tmpa_int + 1 } }
                 \skip_horizontal:N 0.5\arrayrulewidth
-                \bool_lazy_and:nnT \l__nicematrix_Matrix_bool \g__nicematrix_NiceArray_bool
+                \bool_if:NT \l__nicematrix_NiceMatrix_without_vlines_bool
                   { \skip_horizontal:N \arraycolsep }
               }
           }
@@ -3298,7 +3321,7 @@
           \pgfrememberpicturepositiononpagetrue
           \pgfcoordinate { \__nicematrix_env: - col - \int_eval:n { \g_tmpa_int + 1 } }
             {
-              \bool_lazy_and:nnTF \l__nicematrix_Matrix_bool \g__nicematrix_NiceArray_bool
+              \bool_if:NT \l__nicematrix_NiceMatrix_without_vlines_bool
                 {
                   \pgfpoint
                     { - 0.5 \arrayrulewidth - \arraycolsep }
@@ -3391,6 +3414,7 @@
   {
     >
       {
+        \bool_set_true:N \l__nicematrix_in_last_col_bool
         \cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter_i:
         \bool_gset_true:N \g__nicematrix_last_col_found_bool
         \int_gincr:N \c at jCol
@@ -3435,7 +3459,7 @@
   }
 \NewDocumentEnvironment { NiceArray } { }
   {
-    \bool_gset_true:N \g__nicematrix_NiceArray_bool
+    \bool_gset_false:N \g__nicematrix_delims_bool
     \str_if_empty:NT \g__nicematrix_name_env_str
       { \str_gset:Nn \g__nicematrix_name_env_str { NiceArray } }
     \NiceArrayWithDelims . .
@@ -3445,7 +3469,7 @@
   {
     \NewDocumentEnvironment { #1 NiceArray } { }
       {
-        \bool_gset_false:N \g__nicematrix_NiceArray_bool
+        \bool_gset_true:N \g__nicematrix_delims_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:
@@ -3460,8 +3484,11 @@
 \__nicematrix_def_env:nnn V \| \|
 \cs_new_protected:Npn \__nicematrix_begin_of_NiceMatrix:nn #1 #2
   {
-    \bool_set_true:N \l__nicematrix_Matrix_bool
-    \use:c { #1 NiceArray }
+    \bool_set_false:N \l__nicematrix_preamble_bool
+    \tl_clear:N \l_tmpa_tl
+    \bool_if:NT \l__nicematrix_NiceMatrix_without_vlines_bool
+      { \tl_set:Nn \l_tmpa_tl { @ { } } }
+    \tl_put_right:Nn \l_tmpa_tl
       {
         *
           {
@@ -3474,6 +3501,8 @@
           }
           { #2 }
       }
+    \tl_set:Nn \l_tmpb_tl { \use:c { #1 NiceArray } }
+    \exp_args:NV \l_tmpb_tl \l_tmpa_tl
   }
 \cs_generate_variant:Nn \__nicematrix_begin_of_NiceMatrix:nn { n V }
 \clist_map_inline:nn { p , b , B , v , V }
@@ -3480,7 +3509,7 @@
   {
     \NewDocumentEnvironment { #1 NiceMatrix } { ! O { } }
       {
-        \bool_gset_false:N \g__nicematrix_NiceArray_bool
+        \bool_gset_true:N \g__nicematrix_delims_bool
         \str_gset:Nn \g__nicematrix_name_env_str { #1 NiceMatrix }
         \keys_set:nn { NiceMatrix / NiceMatrix } { ##1 }
         \__nicematrix_begin_of_NiceMatrix:nV { #1 } \l__nicematrix_columns_type_tl
@@ -3489,9 +3518,12 @@
   }
 \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 }
+    \bool_lazy_or:nnT
+      { \clist_if_empty_p:N \l__nicematrix_vlines_clist }
+      { \l__nicematrix_except_borders_bool }
+      { \bool_set_true:N \l__nicematrix_NiceMatrix_without_vlines_bool }
     \__nicematrix_begin_of_NiceMatrix:nV { } \l__nicematrix_columns_type_tl
   }
   { \endNiceArray }
@@ -3503,36 +3535,6 @@
       { \dim_set_eq:NN \l__nicematrix_width_dim \linewidth }
     \str_gset:Nn \g__nicematrix_name_env_str { NiceTabular }
     \keys_set:nn { NiceMatrix / NiceTabular } { #1 , #3 }
-    \int_compare:nNnT \l__nicematrix_tab_rounded_corners_dim > \c_zero_dim
-      {
-        \bool_if:NT \l__nicematrix_hvlines_bool
-          {
-            \bool_set_true:N \l__nicematrix_except_borders_bool
-            % we should try to be more efficient in the number of lines of code here
-            \tl_if_empty:NTF \l__nicematrix_rules_color_tl
-              {
-                \tl_gput_right:Nn \g__nicematrix_pre_code_after_tl
-                  {
-                    \__nicematrix_stroke_block:nnn
-                      { rounded-corners = \dim_use:N \l__nicematrix_tab_rounded_corners_dim }
-                      { 1-1 }
-                      { \int_use:N \c at iRow - \int_use:N \c at jCol }
-                  }
-              }
-              {
-                \tl_gput_right:Nn \g__nicematrix_pre_code_after_tl
-                  {
-                    \__nicematrix_stroke_block:nnn
-                      {
-                        rounded-corners = \dim_use:N \l__nicematrix_tab_rounded_corners_dim ,
-                        draw = \l__nicematrix_rules_color_tl
-                      }
-                      { 1-1 }
-                      { \int_use:N \c at iRow - \int_use:N \c at jCol }
-                  }
-              }
-          }
-      }
     \tl_if_empty:NF \l__nicematrix_short_caption_tl
       {
         \tl_if_empty:NT \l__nicematrix_caption_tl
@@ -3557,7 +3559,7 @@
           }
       }
       { }
-    \bool_set_true:N \l__nicematrix_NiceTabular_bool
+    \bool_set_true:N \l__nicematrix_tabular_bool
     \NiceArray { #2 }
   }
   { \endNiceArray }
@@ -3579,7 +3581,7 @@
     \dim_zero_new:N \l__nicematrix_width_dim
     \dim_set:Nn \l__nicematrix_width_dim { #1 }
     \keys_set:nn { NiceMatrix / NiceTabular } { #2 , #4 }
-    \bool_set_true:N \l__nicematrix_NiceTabular_bool
+    \bool_set_true:N \l__nicematrix_tabular_bool
     \NiceArray { #3 }
   }
   { \endNiceArray }
@@ -3588,10 +3590,33 @@
     \str_gset:Nn \g__nicematrix_name_env_str { NiceTabular* }
     \dim_set:Nn \l__nicematrix_tabular_width_dim { #1 }
     \keys_set:nn { NiceMatrix / NiceTabular } { #2 , #4 }
-    \bool_set_true:N \l__nicematrix_NiceTabular_bool
+    \bool_set_true:N \l__nicematrix_tabular_bool
     \NiceArray { #3 }
   }
   { \endNiceArray }
+\cs_new_protected:Npn \__nicematrix_deal_with_rounded_corners:
+  {
+    \bool_lazy_all:nT
+      {
+        { \int_compare_p:nNn \l__nicematrix_tab_rounded_corners_dim > \c_zero_dim }
+        \l__nicematrix_hvlines_bool
+        { ! \g__nicematrix_delims_bool }
+        { ! \l__nicematrix_except_borders_bool }
+      }
+      {
+        \bool_set_true:N \l__nicematrix_except_borders_bool
+        \tl_gput_right:Nn \g__nicematrix_pre_code_after_tl
+          {
+            \__nicematrix_stroke_block:nnn
+              {
+                rounded-corners = \dim_use:N \l__nicematrix_tab_rounded_corners_dim ,
+                draw = \l__nicematrix_rules_color_tl
+              }
+              { 1-1 }
+              { \int_use:N \c at iRow - \int_use:N \c at jCol }
+          }
+      }
+  }
 \cs_new_protected:Npn \__nicematrix_after_array:
   {
     \group_begin:
@@ -3688,6 +3713,7 @@
     \__nicematrix_draw_dotted_lines:
     \__nicematrix_compute_corners:
     \__nicematrix_adjust_pos_of_blocks_seq:
+    \__nicematrix_deal_with_rounded_corners:
     \tl_if_empty:NF \l__nicematrix_hlines_clist \__nicematrix_draw_hlines:
     \tl_if_empty:NF \l__nicematrix_vlines_clist \__nicematrix_draw_vlines:
     \IfPackageLoadedTF { tikz }
@@ -4890,7 +4916,17 @@
     \int_step_inline:nnn { #1 } { #1 + #3 - 1 }
       { \cs_set:cpn { __nicematrix _ dotted _ ##1 - #2 } { } }
   }
-\cs_new_protected:Npn \__nicematrix_rotate: { \bool_gset_true:N \g__nicematrix_rotate_bool }
+\NewDocumentCommand \__nicematrix_rotate: { O { } }
+  {
+    \bool_gset_true:N \g__nicematrix_rotate_bool
+    \keys_set:nn { NiceMatrix / rotate } { #1 }
+  }
+\keys_define:nn { NiceMatrix / rotate }
+  {
+    c .code:n = \bool_gset_true:N \g__nicematrix_rotate_c_bool ,
+    c .value_forbidden:n = true ,
+    unknown .code:n = \__nicematrix_error:n { Unknown~key~for~rotate }
+  }
 \cs_new:Npn \__nicematrix_double_int_eval:n #1-#2 \q_stop
   {
     \tl_if_empty:nTF { #2 }
@@ -5262,9 +5298,8 @@
           { \__nicematrix_cut_on_hyphen:w ##1 \q_stop }
           { \tl_set:Nx \l_tmpb_tl { \int_use:N \c at iRow } }
         \int_set:Nn \l_tmpa_int \l_tmpa_tl
-        \bool_if:NTF \l__nicematrix_rowcolors_restart_bool
-          { \int_set:Nn \l__nicematrix_color_int 1 }
-          { \int_set:Nn \l__nicematrix_color_int \l_tmpa_tl }
+        \int_set:Nn \l__nicematrix_color_int
+          { \bool_if:NTF \l__nicematrix_rowcolors_restart_bool 1 \l_tmpa_tl }
         \int_zero_new:N \l__nicematrix_tmpc_int
         \int_set:Nn \l__nicematrix_tmpc_int \l_tmpb_tl
         \int_do_until:nNnn \l_tmpa_int > \l__nicematrix_tmpc_int
@@ -5308,8 +5343,8 @@
       { \__nicematrix_color_index:n { #1 - 1 } }
       { \seq_item:Nn \l__nicematrix_colors_seq { #1 } }
   }
-\NewDocumentCommand \__nicematrix_rowcolors { O { } m m m O { } }
-  { \__nicematrix_rowlistcolors [ #1 ] { #2 } { { #3 } , { #4 } } [ #5 ] }
+\NewDocumentCommand \__nicematrix_rowcolors { O { } m m m }
+  { \__nicematrix_rowlistcolors [ #1 ] { #2 } { { #3 } , { #4 } } }
 \cs_new_protected:Npn \__nicematrix_rowcolors_i:nnnnn #1 #2 #3 #4 #5
   {
     \int_compare:nNnT { #3 } > \l_tmpb_int
@@ -5436,6 +5471,19 @@
       }
     \ignorespaces
   }
+\NewDocumentCommand { \__nicematrix_rowcolors_tabular } { O { } m m }
+  { \__nicematrix_rowlistcolors_tabular [ #1 ] { #2 , #3 } }
+\NewDocumentCommand { \__nicematrix_rowlistcolors_tabular } { O { } m O { } }
+  {
+    \peek_remove_spaces:n
+      {
+        \tl_gput_right:Nx \g__nicematrix_pre_code_before_tl
+          {
+            \__nicematrix_rowlistcolors
+               [ #1 ] { \int_use:N \c at iRow } { #2 } [ restart, #3 ]
+          }
+      }
+  }
 \NewDocumentCommand \__nicematrix_columncolor_preamble { O { } m }
   {
     \int_compare:nNnT \c at jCol > \g__nicematrix_col_total_int
@@ -5464,7 +5512,13 @@
 \cs_new_protected:Npn \__nicematrix_OnlyMainNiceMatrix_i:n #1
   {
     \int_compare:nNnF \c at iRow = 0
-      { \int_compare:nNnF \c at iRow = \l__nicematrix_last_row_int { #1 } }
+      {
+        \int_compare:nNnF \c at iRow = \l__nicematrix_last_row_int
+          {
+            \int_compare:nNnT \c at jCol > \c_zero_int
+              { \bool_if:NF \l__nicematrix_in_last_col_bool { #1 } }
+          }
+      }
   }
 \keys_define:nn { NiceMatrix / Rules }
   {
@@ -5672,11 +5726,11 @@
   {
     \int_step_inline:nnn
       {
-        \bool_if:nTF { \g__nicematrix_NiceArray_bool && ! \l__nicematrix_except_borders_bool }
+        \bool_if:nTF { ! \g__nicematrix_delims_bool && ! \l__nicematrix_except_borders_bool }
           1 2
       }
       {
-        \bool_if:nTF { \g__nicematrix_NiceArray_bool && ! \l__nicematrix_except_borders_bool }
+        \bool_if:nTF { ! \g__nicematrix_delims_bool && ! \l__nicematrix_except_borders_bool }
           { \int_eval:n { \c at jCol + 1 } }
           \c at jCol
       }
@@ -5834,7 +5888,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 \g__nicematrix_NiceArray_bool
+        \bool_if:NF \g__nicematrix_delims_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 } }
@@ -5844,7 +5898,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 \g__nicematrix_NiceArray_bool
+        \bool_if:NF \g__nicematrix_delims_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 } }
@@ -5874,11 +5928,11 @@
   {
     \int_step_inline:nnn
       {
-        \bool_if:nTF { \g__nicematrix_NiceArray_bool && ! \l__nicematrix_except_borders_bool }
+        \bool_if:nTF { ! \g__nicematrix_delims_bool && ! \l__nicematrix_except_borders_bool }
           1 2
       }
       {
-        \bool_if:nTF { \g__nicematrix_NiceArray_bool && ! \l__nicematrix_except_borders_bool }
+        \bool_if:nTF { ! \g__nicematrix_delims_bool && ! \l__nicematrix_except_borders_bool }
           { \int_eval:n { \c at iRow + 1 } }
           \c at iRow
       }
@@ -6533,8 +6587,18 @@
     respect-arraystretch .bool_set:N = \l__nicematrix_respect_arraystretch_bool ,
     respect-arraystretch .default:n = true ,
   }
-\NewExpandableDocumentCommand \__nicematrix_Block: { O { } m D < > { } +m }
+\cs_new_protected:Npn \__nicematrix_block:n #1
   {
+    \peek_meaning:NTF [
+      { \__nicematrix_block_i:n { #1 } }
+      { \__nicematrix_Block_i:[#1] }
+  }
+
+\cs_new_protected:Npn \__nicematrix_block_i:n #1[#2] { \__nicematrix_block:n {#1,#2} }
+
+\cs_new_protected:Npn \__nicematrix_Block: { \__nicematrix_block:n { } }
+\NewExpandableDocumentCommand \__nicematrix_Block_i: { O { } m D < > { } +m }
+  {
     \peek_remove_spaces:n
       {
         \tl_if_blank:nTF { #2 }
@@ -6632,7 +6696,7 @@
         \dim_zero:N \extrarowheight
         #4
         \bool_if:NT \g__nicematrix_rotate_bool { \str_set:Nn \l__nicematrix_hpos_block_str c }
-        \bool_if:NTF \l__nicematrix_NiceTabular_bool
+        \bool_if:NTF \l__nicematrix_tabular_bool
           {
             \bool_lazy_all:nTF
               {
@@ -6686,6 +6750,20 @@
         \box_grotate:cn
           { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
           { 90 }
+        \bool_if:NT \g__nicematrix_rotate_c_bool
+          {
+            \hbox_gset:cn
+              { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
+              {
+                \c_math_toggle_token
+                \vcenter
+                  {
+                    \box_use:c
+                    { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
+                  }
+                \c_math_toggle_token
+              }
+          }
         \bool_gset_false:N \g__nicematrix_rotate_bool
       }
     \int_compare:nNnT { #2 } = 1
@@ -6724,12 +6802,17 @@
     \seq_gput_right:Nx \g__nicematrix_blocks_seq
       {
         \l_tmpa_tl
-        { \exp_not:n { #3 } , \l__nicematrix_hpos_block_str }
         {
+          \exp_not:n { #3 } ,
+          \l__nicematrix_hpos_block_str ,
+          \bool_if:NT \g__nicematrix_rotate_c_bool { v-center }
+        }
+        {
           \box_use_drop:c
             { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
         }
       }
+    \bool_set_false:N \g__nicematrix_rotate_c_bool
   }
 \cs_new_protected:Npn \__nicematrix_Block_v:nnnnn #1 #2 #3 #4 #5
   {
@@ -6738,7 +6821,7 @@
         \l_tmpa_tl
         { \exp_not:n { #3 } }
         {
-          \bool_if:NTF \l__nicematrix_NiceTabular_bool
+          \bool_if:NTF \l__nicematrix_tabular_bool
             {
               \group_begin:
               \bool_if:NF \l__nicematrix_respect_arraystretch_bool
@@ -7231,7 +7314,8 @@
 \keys_define:nn { NiceMatrix / BlockStroke }
   {
     color .tl_set:N = \l__nicematrix_draw_tl ,
-    draw .tl_set:N = \l__nicematrix_draw_tl ,
+    draw .code:n =
+      \exp_args:Nx \tl_if_empty:nF { #1 } { \tl_set:Nn \l__nicematrix_draw_tl { #1 } } ,
     draw .default:n = default ,
     line-width .dim_set:N = \l__nicematrix_line_width_dim ,
     rounded-corners .dim_set:N = \l__nicematrix_rounded_corners_dim ,
@@ -7430,6 +7514,8 @@
     delimiters / max-width .default:n = true ,
     delimiters .code:n = \keys_set:nn { NiceMatrix / delimiters } { #1 } ,
     delimiters .value_required:n = true ,
+    rounded-corners .dim_set:N = \l__nicematrix_tab_rounded_corners_dim ,
+    rounded-corners .default:n = 4 pt
   }
 \NewDocumentCommand \AutoNiceMatrixWithDelims
   { m m O { } > { \SplitArgument { 1 } { - } } m O { } m ! O { } }
@@ -7437,14 +7523,8 @@
 \cs_new_protected:Npn \__nicematrix_auto_nice_matrix:nnnnnn #1 #2 #3 #4 #5 #6
   {
     \group_begin:
-    \bool_set_true:N \l__nicematrix_Matrix_bool
-    \str_if_eq:nnT { #1 } { . }
-      {
-        \str_if_eq:nnT { #2 } { . }
-          { \bool_set_false:N \l__nicematrix_Matrix_bool }
-      }
     \keys_set_known:nnN { NiceMatrix / Auto } { #6 } \l_tmpa_tl
-    \cs_set_eq:NN \__nicematrix_transform_preamble: \prg_do_nothing:
+    \bool_set_false:N \l__nicematrix_preamble_bool
     \use:x
       {
         \exp_not:N \begin { NiceArrayWithDelims } { #1 } { #2 }
@@ -7476,7 +7556,7 @@
   {
     \cs_set_protected:cpn { #1 AutoNiceMatrix }
       {
-        \bool_gset_false:N \g__nicematrix_NiceArray_bool
+        \bool_gset_true:N \g__nicematrix_delims_bool
         \str_gset:Nx \g__nicematrix_name_env_str { #1 AutoNiceMatrix }
         \AutoNiceMatrixWithDelims { #2 } { #3 }
       }
@@ -7489,8 +7569,7 @@
 \NewDocumentCommand \AutoNiceMatrix { O { } m O { } m ! O { } }
   {
     \group_begin:
-    \bool_gset_true:N \g__nicematrix_NiceArray_bool
-    % \bool_set_true:N \l__nicematrix_Matrix_bool
+    \bool_gset_false:N \g__nicematrix_delims_bool
     \AutoNiceMatrixWithDelims . . { #2 } { #4 } [ #1 , #3 , #5 ]
     \group_end:
   }
@@ -8432,7 +8511,7 @@
   }
 \bool_if:NT \c__nicematrix_footnote_bool
   {
-    \IfClassLoadeTF { beamer }
+    \IfClassLoadedTF { beamer }
       { \bool_set_false:N \c__nicematrix_footnote_bool }
       {
         \IfPackageLoadedTF { footnotehyper }
@@ -8653,8 +8732,14 @@
   {
     Unknown~key.\\
     There~is~only~two~keys~available~here:~width~and~color.\\
-    You~key~'\l_keys_key_str'~will~be~ignored.
+    Your~key~'\l_keys_key_str'~will~be~ignored.
   }
+\__nicematrix_msg_new:nn { Unknown~key~for~rotate }
+  {
+    Unknown~key.\\
+    The~only~key~available~here~is~'c'.\\
+    Your~key~'\l_keys_key_str'~will~be~ignored.
+  }
 \__nicematrix_msg_new:nnn { Unknown~key~for~custom-line }
   {
     Unknown~key.\\
@@ -9210,6 +9295,7 @@
     renew-dots,~
     renew-matrix,~
     respect-arraystretch,~
+    rounded-corners,~
     right-margin,~
     rules~(with~the~subkeys~'color'~and~'width'),~
     small,~
@@ -9238,7 +9324,7 @@
     code-for-first-row,~
     code-for-last-col,~
     code-for-last-row,~
-    colortbl-like,~
+    color-inside,~
     columns-width,~
     corners,~
     create-extra-nodes,~
@@ -9261,6 +9347,7 @@
     renew-dots,~
     respect-arraystretch,~
     right-margin,~
+    rounded-corners,~
     rules~(with~the~subkeys~'color'~and~'width'),~
     small,~
     t,~
@@ -9292,7 +9379,7 @@
     code-for-first-row,~
     code-for-last-col,~
     code-for-last-row,~
-    colortbl-like,~
+    color-inside,~
     columns-type,~
     columns-width,~
     corners,~
@@ -9318,6 +9405,7 @@
     renew-dots,~
     respect-arraystretch,~
     right-margin,~
+    rounded-corners,~
     rules~(with~the~subkeys~'color'~and~'width'),~
     small,~
     t,~
@@ -9350,7 +9438,7 @@
     code-for-first-row,~
     code-for-last-col,~
     code-for-last-row,~
-    colortbl-like,~
+    color-inside,~
     columns-width,~
     corners,~
     custom-line,~



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