texlive[60509] Master/texmf-dist: nicematrix (14sep21)

commits+karl at tug.org commits+karl at tug.org
Tue Sep 14 22:25:23 CEST 2021


Revision: 60509
          http://tug.org/svn/texlive?view=revision&revision=60509
Author:   karl
Date:     2021-09-14 22:25:23 +0200 (Tue, 14 Sep 2021)
Log Message:
-----------
nicematrix (14sep21)

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

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

Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex	2021-09-14 20:25:06 UTC (rev 60508)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex	2021-09-14 20:25:23 UTC (rev 60509)
@@ -865,7 +865,7 @@
 \begin{BVerbatim}[baseline=c,boxwidth=10cm]
 \setlength{\arrayrulewidth}{2pt}
 \begin{NiceTabular}{cccc} \hline
-A&B&C&D \\ ~emphase#\cline{2-2}@
+A&B&C&D \\ ~emphase#\cline{2}@
 A&B&C&D \\ \hline
 \end{NiceTabular}
 \end{BVerbatim}
@@ -875,13 +875,18 @@
 \begin{NiceTabular}[c]{cccc}
 \hline
 A&B&C&D \\
-\cline{2-2}
+\cline{2}
 A&B&C&D \\
 \hline
 \end{NiceTabular}
 \end{scope}
 
+\medskip
+\colorbox{yellow!50}{\textbf{Nouveau 6.2}}\enskip 
 
+Dans les environnements de
+\pkg{nicematrix}, une instruction |\cline{|\textsl{\texttt{i}}|}| est
+équivalente à |\cline{|\textsl{\texttt{i}}|-|\textsl{\texttt{i}}|}|.
 
 \subsection{L'épaisseur et la couleur des filets}
 
@@ -1971,8 +1976,12 @@
 
 Pour se rapprocher davantage de l'environnement |{tabularx}|, \pkg{nicematrix}
 propose aussi un environnement |{NiceTabularX}| qui prend en premier argument
-(obligatoire) la largeur voulue pour le tableau.
+(obligatoire) la largeur voulue pour le tableau.\footnote{Si \pkg{tabularx} est
+  chargé, on doit obligatoirement utiliser |{NiceTabularX}| pour utiliser les
+  colonnes `X` (ceci est dû à un problème de conflit de définition des
+  spécificateurs de colonne `X`).}
 
+
 Comme avec les extensions \pkg{tabu} et \pkg{tabularray}, le spécificateur |X|
 accepte entre crochets un argument optionnel qui est une liste de clés.
 \begin{itemize}
@@ -4407,11 +4416,6 @@
 \end{Verbatim}
 
 \bigskip
-L'extension \pkg{nicematrix} n'est pas compatible avec la classe \cls{aastex63}.
-Si vous souhaitez utiliser \pkg{nicematrix} with \cls{aastex63}, envoyez-moi un
-courrier électronique et j'essaierai de résoudre les incompatibilités.
-
-\bigskip
 L'extension \pkg{nicematrix} n'est pas compatible avec la classe \cls{ieeeaccess}
 (car cette classe n'est pas compatible avec PGF/Tikz).
 
@@ -4421,8 +4425,17 @@
 
 \label{tikz-key-examples}
 
+La clé |tikz| de la commande |\Block| n'est disponible que lorsque Tikz est
+chargé.\footnote{Par défaut, \pkg{nicematrix} ne charge que \textsc{pgf}, qui
+  est une sous-couche de Tikz}
 
+Pour l'exemple suivant, la bibliothèque \tikz{patterns} de Tikz doit aussi être chargée.
+
 \begin{Verbatim}
+\usetikzlibrary{patterns}
+\end{Verbatim}
+
+\begin{Verbatim}
 \ttfamily \small
 \begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt]
   \Block[~emphase#tikz={pattern=grid,pattern color=lightgray}@]{}
@@ -4921,7 +4934,85 @@
 \end{NiceMatrix}\]
 \end{scope}
 
+\bigskip
+Dans ce tableau, les instructions |\SubMatrix| sont exécutés après la
+composition du tableau et les traits verticaux sont donc tracés sans espacer les
+colonnes. 
 
+
+\bigskip
+\colorbox{yellow!50}{\textbf{Nouveau 6.2}}\enskip En fait, on peut avec la clé
+|vlines-in-sub-matrix| choisir un spécificateur dans le préambule du tableau
+pour indiquer des filets verticaux qui seront tracés dans les |\SubMatrix|
+uniquement (en espaçant les colonnes).
+
+\medskip
+\begin{Verbatim}
+\setlength{\extrarowheight}{1mm}
+\[\begin{NiceArray}
+   [ 
+     ~emphase#vlines-in-sub-matrix=I@,
+     last-col, 
+     code-for-last-col = \scriptstyle \color{blue} 
+   ]
+  {rrrrIr}
+12 &  -8  &  7 & 5 &  3 \\
+ 3 & -18  & 12 & 1 &  4 \\
+-3 & -46  & 29 &-2 &-15 \\
+ 9 & 10   &-5  &4  & 7 \\[1mm]
+12 & -8   & 7  &5  & 3 \\
+0  & 64   &-41 & 1 & 19 & L_2 \gets L_1-4L_2  \\
+0  & -192 &123 &-3 &-57 & L_3 \gets L_1+4L_3  \\
+0  & -64  & 41 &-1 &-19 & L_4 \gets 3L_1-4L_4 \\[1mm]
+12 & -8   &7   &5  & 3 \\
+0  & 64   &-41 &1  &19 \\
+0  &  0   &0   &0  & 0 & L_3 \gets 3L_2+L_3 \\[1mm]
+12 & -8   &7   &5  & 3 \\
+0  & 64   &-41 & 1 & 19 \\
+\CodeAfter 
+   \SubMatrix({1-1}{4-5})
+   \SubMatrix({5-1}{8-5})
+   \SubMatrix({9-1}{11-5})
+   \SubMatrix({12-1}{13-5})
+\end{NiceArray}\]
+\end{Verbatim}
+
+
+
+\medskip
+\begin{scope}
+\setlength{\extrarowheight}{1mm}
+\[\begin{NiceArray}
+   [ 
+     vlines-in-sub-matrix=I,
+     last-col, 
+     code-for-last-col = \scriptstyle \color{blue} 
+   ]
+  {rrrrIr}
+12 &  -8  &  7 & 5 &  3 \\
+ 3 & -18  & 12 & 1 &  4 \\
+-3 & -46  & 29 &-2 &-15 \\
+ 9 & 10   &-5  &4  & 7 \\[1mm]
+12 & -8   & 7  &5  & 3 \\
+0  & 64   &-41 & 1 & 19 & L_2 \gets L_1-4L_2  \\
+0  & -192 &123 &-3 &-57 & L_3 \gets L_1+4L_3  \\
+0  & -64  & 41 &-1 &-19 & L_4 \gets 3L_1-4L_4 \\[1mm]
+12 & -8   &7   &5  & 3 \\
+0  & 64   &-41 &1  &19 \\
+0  &  0   &0   &0  & 0 & L_3 \gets 3L_2+L_3 \\[1mm]
+12 & -8   &7   &5  & 3 \\
+0  & 64   &-41 & 1 & 19 \\
+\CodeAfter 
+   \SubMatrix({1-1}{4-5})
+   \SubMatrix({5-1}{8-5})
+   \SubMatrix({9-1}{11-5})
+   \SubMatrix({12-1}{13-5})
+\end{NiceArray}\]
+\end{scope}
+
+
+
+
 \subsection{Comment surligner les cases d'une matrice}
 
 \label{highlight}

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

Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx	2021-09-14 20:25:06 UTC (rev 60508)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx	2021-09-14 20:25:23 UTC (rev 60509)
@@ -15,8 +15,8 @@
 %
 % \fi
 % \iffalse
-\def\myfileversion{6.1}
-\def\myfiledate{2021/08/20}
+\def\myfileversion{6.2}
+\def\myfiledate{2021/09/09}
 %
 %
 %<*batchfile>
@@ -65,7 +65,7 @@
 \usepackage{titlesec}
 \titlespacing*{\section}{0pt}{6.5ex plus 1ex minus .2ex}{4.3ex plus .2ex}
 \titlespacing*{\subsection}{0pt}{4.5ex plus 1ex minus .2ex}{2ex plus .2ex}
-\usepackage[hyperfootnotes=false]{footnotehyper}
+\usepackage{footnotehyper}
 \usepackage{varwidth}
 \def\LetterAt{@}
 \parindent 0pt
@@ -223,9 +223,7 @@
 % \end{tabular}
 % \end{ttfamily}
 %
-%
-% 
-%
+% %
 % \medskip
 % The environments |{NiceArray}|, |{NiceTabular}| and |{NiceTabular*}| are
 % similar to the environments |{array}|, |{tabular}| and |{tabular*}| of the
@@ -893,7 +891,7 @@
 % \begin{BVerbatim}[baseline=c,boxwidth=10cm]
 % \setlength{\arrayrulewidth}{2pt}
 % \begin{NiceTabular}{cccc} \hline
-% A&B&C&D \\ ~emphase#\cline{2-2}@
+% A&B&C&D \\ ~emphase#\cline{2}@
 % A&B&C&D \\ \hline
 % \end{NiceTabular}
 % \end{BVerbatim}
@@ -902,12 +900,18 @@
 % \begin{NiceTabular}[c]{cccc}
 % \hline
 % A&B&C&D \\
-% \cline{2-2}
+% \cline{2}
 % A&B&C&D \\
 % \hline
 % \end{NiceTabular}
 % \end{scope}
 %
+% \medskip
+% \colorbox{yellow!50}{\textbf{New 6.2}}
+%
+% In the environments of \pkg{nicematrix}, an instruction |\cline{|\textsl{\texttt{i}}|}| 
+% is equivalent to |\cline{|\textsl{\texttt{i}}|-|\textsl{\texttt{i}}|}|.
+%
 % 
 % \subsection{The thickness and the color of the rules}
 % 
@@ -1953,7 +1957,10 @@
 %
 % For sake of similarity with the environment |{tabularx}|, \pkg{nicematrix}
 % also provides an environment |{NiceTabularX}| with a first mandatory argument
-% which is the width of the tabular.
+% which is the width of the tabular.\footnote{If \pkg{tabularx} is loaded, one
+% must use |{NiceTabularX}| (and not |{NiceTabular}|) in order to use the
+% columns `X` (this point comes from a conflict in the definitions of the
+% specifier `X`).}
 %
 % As with the packages \pkg{tabu} and \pkg{tabularray}, the specifier |X| takes
 % in an optional argument (between square brackets) which is a list of keys.
@@ -4335,11 +4342,6 @@
 % \NiceMatrixOptions{letter-for-dotted-lines=;}
 % \end{Verbatim}
 %
-% \bigskip
-% Up to now, the package \pkg{nicematrix} is not compatible with
-% \cls{aastex63}. If you want to use \pkg{nicematrix} with \cls{aastex63}, send
-% me an email and I will try to solve the incompatibilies.
-% 
 %
 % \bigskip
 % The package \pkg{nicematrix} is not compatible with the class \cls{ieeeaccess}
@@ -4351,7 +4353,18 @@
 %\label{tikz-key-examples}
 %
 %
+% The key |tikz| of the command |\Block| is available only when Tikz is
+% loaded.\footnote{By default, \pkg{nicematrix} only loads \textsc{pgf}, which is
+% a sub-layer of Tikz.}
+%
+% For the following example, you need also the Tikz library |patterns|
+%
 % \begin{Verbatim}
+% \usetikzlibrary{patterns}
+% \end{Verbatim}
+%
+%
+% \begin{Verbatim}
 % \ttfamily \small
 % \begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt]
 %   \Block[~emphase#tikz={pattern=grid,pattern color=lightgray}@]{}
@@ -4843,7 +4856,84 @@
 % \end{NiceMatrix}\]
 % \end{scope}
 %
+% \bigskip
+% In this tabular, the instructions |\SubMatrix| are executed after the
+% composition of the tabular and, thus, the vertical rules are drawn without
+% adding space between the columns.
 %
+%
+%\bigskip
+% \colorbox{yellow!50}{\textbf{New 6.2}}\enskip In fact, it's possible, with the
+% key |vlines-in-sub-matrix|, to choice a letter in the preamble of the
+% array to specify vertical rules which will be drawn in the |\SubMatrix| only
+% (by adding space between the columns).
+%
+% \medskip
+% \begin{Verbatim}
+% \setlength{\extrarowheight}{1mm}
+% \[\begin{NiceArray}
+%    [ 
+%      ~emphase#vlines-in-sub-matrix=I@,
+%      last-col, 
+%      code-for-last-col = \scriptstyle \color{blue} 
+%    ]
+%   {rrrrIr}
+% 12 &  -8  &  7 & 5 &  3 \\
+%  3 & -18  & 12 & 1 &  4 \\
+% -3 & -46  & 29 &-2 &-15 \\
+%  9 & 10   &-5  &4  & 7 \\[1mm]
+% 12 & -8   & 7  &5  & 3 \\
+% 0  & 64   &-41 & 1 & 19 & L_2 \gets L_1-4L_2  \\
+% 0  & -192 &123 &-3 &-57 & L_3 \gets L_1+4L_3  \\
+% 0  & -64  & 41 &-1 &-19 & L_4 \gets 3L_1-4L_4 \\[1mm]
+% 12 & -8   &7   &5  & 3 \\
+% 0  & 64   &-41 &1  &19 \\
+% 0  &  0   &0   &0  & 0 & L_3 \gets 3L_2+L_3 \\[1mm]
+% 12 & -8   &7   &5  & 3 \\
+% 0  & 64   &-41 & 1 & 19 \\
+% \CodeAfter 
+%    \SubMatrix({1-1}{4-5})
+%    \SubMatrix({5-1}{8-5})
+%    \SubMatrix({9-1}{11-5})
+%    \SubMatrix({12-1}{13-5})
+% \end{NiceArray}\]
+% \end{Verbatim}
+%
+%
+% \medskip
+% \begin{scope}
+% \setlength{\extrarowheight}{1mm}
+% \[\begin{NiceArray}
+%    [ 
+%      vlines-in-sub-matrix=I,
+%      last-col, 
+%      code-for-last-col = \scriptstyle \color{blue} 
+%    ]
+%   {rrrrIr}
+% 12 &  -8  &  7 & 5 &  3 \\
+%  3 & -18  & 12 & 1 &  4 \\
+% -3 & -46  & 29 &-2 &-15 \\
+%  9 & 10   &-5  &4  & 7 \\[1mm]
+% 12 & -8   & 7  &5  & 3 \\
+% 0  & 64   &-41 & 1 & 19 & L_2 \gets L_1-4L_2  \\
+% 0  & -192 &123 &-3 &-57 & L_3 \gets L_1+4L_3  \\
+% 0  & -64  & 41 &-1 &-19 & L_4 \gets 3L_1-4L_4 \\[1mm]
+% 12 & -8   &7   &5  & 3 \\
+% 0  & 64   &-41 &1  &19 \\
+% 0  &  0   &0   &0  & 0 & L_3 \gets 3L_2+L_3 \\[1mm]
+% 12 & -8   &7   &5  & 3 \\
+% 0  & 64   &-41 & 1 & 19 \\
+% \CodeAfter 
+%    \SubMatrix({1-1}{4-5})
+%    \SubMatrix({5-1}{8-5})
+%    \SubMatrix({9-1}{11-5})
+%    \SubMatrix({12-1}{13-5})
+% \end{NiceArray}\]
+% \end{scope}
+%
+%
+%
+%
 % 
 % \subsection{How to highlight cells of a matrix}
 %
@@ -5210,6 +5300,7 @@
 \bool_new:N \c_@@_arydshln_loaded_bool
 \bool_new:N \c_@@_booktabs_loaded_bool
 \bool_new:N \c_@@_enumitem_loaded_bool
+\bool_new:N \c_@@_tabularx_loaded_bool
 \bool_new:N \c_@@_tikz_loaded_bool
 \AtBeginDocument
   {
@@ -5222,6 +5313,9 @@
     \@ifpackageloaded { enumitem }
       { \bool_set_true:N \c_@@_enumitem_loaded_bool }
       { }
+    \@ifpackageloaded { tabularx }
+      { \bool_set_true:N \c_@@_tabularx_loaded_bool }
+      { }
     \@ifpackageloaded { tikz }
       { 
 %    \end{macrocode}
@@ -5459,11 +5553,20 @@
 %    \end{macrocode}
 % The command |\cline_i:nn| has two arguments. The first is the number of the
 % current column (it \emph{must} be used in that column). The second is a
-% standard argument of |\cline| of the form \textsl{i}-\textsl{j}.
+% standard argument of |\cline| of the form \textsl{i}-\textsl{j} or the form
+% \textsl{i}. 
 %    \begin{macrocode}
-\cs_set:Npn \@@_cline_i:nn #1 #2 { \@@_cline_i:w #1-#2 \q_stop }
-\cs_set:Npn \@@_cline_i:w #1-#2-#3 \q_stop
+\cs_set:Npn \@@_cline_i:nn #1 #2 { \@@_cline_i:w #1|#2- \q_stop }
+\cs_set:Npn \@@_cline_i:w #1|#2-#3 \q_stop
   {
+    \tl_if_empty:nTF { #3 } 
+      { \@@_cline_iii:w #1|#2-#2 \q_stop }
+      { \@@_cline_ii:w #1|#2-#3 \q_stop }
+  }
+\cs_set:Npn \@@_cline_ii:w #1|#2-#3-\q_stop
+  { \@@_cline_iii:w #1|#2-#3 \q_stop }
+\cs_set:Npn \@@_cline_iii:w #1|#2-#3 \q_stop
+  {
 %    \end{macrocode}
 % Now, |#1| is the number of the current column and we have to draw a line from
 % the column |#2| to the column |#3| (both included).
@@ -5934,7 +6037,7 @@
 %    \end{macrocode} 
 %
 % \bigskip
-% The following token list will contain ce code inserted in each cell of the
+% The following token list will contain the code inserted in each cell of the
 % current row (this token list will be cleared at the beginning of each row).
 %    \begin{macrocode}
 \tl_new:N \g_@@_row_style_tl
@@ -6167,6 +6270,18 @@
 %    \end{macrocode}
 %
 %
+% \bigskip
+% The following flag will be used by (for instance) |\@@_vline_ii:nnnn|.
+% When |\l_@@_dotted_bool| is |true|, a dotted line (with our system) will be drawn.
+%    \begin{macrocode}
+\bool_new:N \l_@@_dotted_bool
+%    \end{macrocode}
+%
+% \bigskip
+% The following dimension will be used to trim the rules drawn in the array.
+%    \begin{macrocode}
+\dim_new:N \l_@@_trim_dim 
+%    \end{macrocode}
 % 
 % \bigskip
 % \textbf{Variables for the exterior rows and columns}\par\nobreak
@@ -7323,6 +7438,21 @@
       }
 %    \end{macrocode}
 % 
+% \bigskip
+% For unexplained reason, with XeTeX (and not with the other engines), the
+% environments of \pkg{nicematrix} were all composed in black and do not take
+% into account the color of the encompassing text. As a workaround, you peek the
+% color in force at the beginning of the environment and we use it now (in each
+% cell of the array).
+%    \begin{macrocode}
+    \color { nicematrix } 
+%    \end{macrocode}
+%
+% 
+%    \begin{macrocode}
+    \g_@@_row_style_tl
+%    \end{macrocode}
+% 
 % We will call \emph{corners} of the matrix the cases which are at the
 % intersection of the exterior rows and exterior columns (of course, the four
 % corners doesn't always exist simultaneously). 
@@ -7330,7 +7460,6 @@
 % The codes |\l_@@_code_for_first_row_tl| and \emph{al} don't apply in the
 % corners of the matrix.
 %    \begin{macrocode}
-    \g_@@_row_style_tl
     \int_compare:nNnTF \c at iRow = 0 
       { 
         \int_compare:nNnT \c at jCol > 0 
@@ -7449,7 +7578,7 @@
 \cs_new_protected:Npn \@@_cell_end:
   { 
     \@@_math_toggle_token: 
-    \hbox_set_end:
+    \hbox_set_end: 
 %    \end{macrocode}
 % The token list |\g_@@_post_action_cell_tl| is (potentially) set during the 
 % composition of the box |\l_@@_cell_box| and is used now \emph{after} the
@@ -7651,42 +7780,21 @@
   }  
 %    \end{macrocode}
 %
-%  
-% \bigskip
-% We want to use |\array| of \pkg{array}. However, if the class used is
-% \cls{revtex4-1} or \cls{revtex4-2}, we have to do some tuning and use the
-% command |\@array at array| instead of |\array| because these classes do a
-% redefinition of |\array| incompatible with our use of |\array|. 
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_revtex_array:
-  {
-    \cs_set_eq:NN \@acoll \@arrayacol 
-    \cs_set_eq:NN \@acolr \@arrayacol 
-    \cs_set_eq:NN \@acol \@arrayacol 
-    \cs_set_nopar:Npn \@halignto { }
-    \@array at array
-  }
-%    \end{macrocode}
-%
-%    \begin{macrocode}
 \cs_new_protected:Npn \@@_array:
   {
-    \bool_if:NTF \c_@@_revtex_bool
-      \@@_revtex_array:
-      { 
-        \bool_if:NTF \l_@@_NiceTabular_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
-          { \cs_set_nopar:Npn \@halignto { } }
-          { \cs_set_nopar:Npx \@halignto { to \dim_use:N \l_@@_tabular_width_dim } }
+    \bool_if:NTF \l_@@_NiceTabular_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
+      { \cs_set_nopar:Npn \@halignto { } }
+      { \cs_set_nopar:Npx \@halignto { to \dim_use:N \l_@@_tabular_width_dim } }
 %    \end{macrocode}
 % It \pkg{colortbl} is loaded, |\@tabarray| has been redefined to incorporate
 % |\CT at start|. 
 %    \begin{macrocode}
-        \@tabarray 
-      }
+    \@tabarray 
 %    \end{macrocode}
 % |\l_@@_baseline_tl| may have the value |t|, |c| or |b|. However, if the value
 % is |b|, we compose the |\array| (of \pkg{array}) with the option |t| and the
@@ -7840,7 +7948,14 @@
 %
 %   \begin{macrocode}
 \cs_new_protected:Npn \@@_pre_array_ii:
-  {
+  { 
+%   \end{macrocode}
+% For unexplained reason, with XeTeX (and not with the other engines), the
+% environments of \pkg{nicematrix} were all composed in black and do not take
+% into account the color of the encompassing text. As a workaround, you peek the
+% color in force at the beginning of the environment and we will it in each cell.
+%    \begin{macrocode}
+        \xglobal \colorlet { nicematrix } { . } 
 %    \end{macrocode}
 % The number of letters |X| in the preamble of the array.
 %    \begin{macrocode}
@@ -8109,6 +8224,7 @@
 %
 % \bigskip
 %    \begin{macrocode}
+    \seq_gclear:N \g_@@_cols_vlism_seq
     \seq_gclear:N \g_@@_submatrix_seq
 %    \end{macrocode}
 % 
@@ -8460,7 +8576,25 @@
   }
 %    \end{macrocode}
 %
-% 
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_for_revtex:
+  {
+    \cs_set_eq:NN \@addamp \@addamp at LaTeX
+    \cs_set_eq:NN \insert at column \insert at column@array
+    \cs_set_eq:NN \@classx \@classx at array
+    \cs_set_eq:NN \@xarraycr \@xarraycr at array
+    \cs_set_eq:NN \@arraycr \@arraycr at array
+    \cs_set_eq:NN \@xargarraycr \@xargarraycr at array
+    \cs_set_eq:NN \array \array at array
+    \cs_set_eq:NN \@array \@array at array
+    \cs_set_eq:NN \@tabular \@tabular at array
+    \cs_set_eq:NN \@mkpream \@mkpream at array
+    \cs_set_eq:NN \endarray \endarray at array
+    \cs_set:Npn \@tabarray { \@ifnextchar [ { \@array } { \@array [ c ] } }
+    \cs_set:Npn \endtabular { \endarray $\egroup} % $
+  }
+%    \end{macrocode}
+%
 % \bigskip
 % \subsection*{The environment \{NiceArrayWithDelims\}}
 %
@@ -8468,6 +8602,7 @@
 \NewDocumentEnvironment { NiceArrayWithDelims } 
   { m m O { } m ! O { } t \CodeBefore }
   { 
+     \bool_if:NT \c_@@_revtex_bool \@@_patch_for_revtex:
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -9084,6 +9219,12 @@
         ]  { \@@_patch_preamble_viii:nn #1 }       
         \} { \@@_patch_preamble_viii:nn #1 }       
         X  { \@@_patch_preamble_ix:n }
+%    \end{macrocode}
+% When \pkg{tabularx} is loaded, a local redefinition of the specifier `X` is
+% done to replace `X` by `\@@_X`. Thus, our column type `X` will be used in the
+% `{NiceTabularX}`. 
+%    \begin{macrocode}
+        \@@_X  { \@@_patch_preamble_ix:n }
         \q_stop { }
       }
       { 
@@ -10134,7 +10275,7 @@
 % We need a |{minipage}| because we will insert a LaTeX list for the tabular
 % notes (that means that a |\vtop{\hsize=...}| is not enough).
 %    \begin{macrocode}
-    \begin { minipage } [ t ] { \box_wd:N \l_@@_the_array_box }
+    \begin { minipage } [ t ] { \box_wd:N \l_@@_the_array_box } 
 %    \end{macrocode}
 % The |\hbox| avoids that the |pgfpicture| inside |\@@_draw_blocks| adds a extra
 % vertical space before the notes.
@@ -11007,8 +11148,28 @@
 %
 % \bigskip
 %    \begin{macrocode}
+\cs_set_protected:Npn \@@_newcolumntype #1
+  {
+    \cs_if_free:cT { NC @ find @ #1 }
+      { \NC at list \expandafter { \the \NC at list \NC at do #1 } }
+    \cs_set:cpn {NC @ find @ #1 } ##1 #1 { \NC@ { ##1 } }
+    \peek_meaning:NTF [ 
+      { \newcol@ #1 }
+      { \newcol@ #1 [ 0 ] }
+  }
+%    \end{macrocode}
+%
+% \bigskip
+%    \begin{macrocode}
 \NewDocumentEnvironment { NiceTabularX } { m O { } m ! O { } }
   { 
+%    \end{macrocode}
+% The following code prevents the expansion of the `X` columns with the
+% definition of that columns in \pkg{tabularx} (this would result in an error in
+% |{NiceTabularX}|). 
+%    \begin{macrocode}
+    \bool_if:NT \c_@@_tabularx_loaded_bool
+      { \newcolumntype { X } { \@@_X } }
     \str_gset:Nn \g_@@_name_env_str { NiceTabularX }
     \dim_zero_new:N \l_@@_width_dim 
     \dim_set:Nn \l_@@_width_dim { #1 }
@@ -11151,7 +11312,7 @@
 %
 % If the option |small| is used, the values |\l_@@_radius_dim| and
 % |\l_@@_inter_dots_dim| (used to draw the dotted lines created by
-% |\hdottedline| and |\vdotteline| and also for all the other dotted lines when
+% |\hdottedline| and |\vdottedline| and also for all the other dotted lines when
 % |line-style| is equal to |standard|, which is the initial value) are changed.
 %    \begin{macrocode}     
     \bool_if:NT \l_@@_small_bool 
@@ -11190,24 +11351,7 @@
     \@@_adjust_pos_of_blocks_seq:
 %    \end{macrocode}
 % 
-% \bigskip
-% The following code is only for efficiency. We determine whether the potential
-% horizontal and vertical rules are ``complete'', that is to say drawn in the
-% whole array. We are sure that all the rules will be complete when there is no
-% block, no virtual block (determined by a command such as |\Cdots|, |\Vdots|,
-% etc.) and no corners. In that case, we switch to a shortcut version of
-% |\@@_vline_i:nn| and |\@@_hline:nn|.
 %    \begin{macrocode}
-    % \bool_lazy_all:nT
-    %   { 
-    %     { \seq_if_empty_p:N \g_@@_pos_of_blocks_seq }
-    %     { \seq_if_empty_p:N \g_@@_pos_of_xdots_seq }
-    %     { \seq_if_empty_p:N \l_@@_corners_cells_seq }
-    %   }
-    %   { 
-    %     \cs_set_eq:NN \@@_vline_i:nn \@@_vline_i_complete:nn 
-    %     \cs_set_eq:NN \@@_hline_i:nn \@@_hline_i_complete:nn 
-    %   }
     \tl_if_empty:NF \l_@@_hlines_clist \@@_draw_hlines: 
     \tl_if_empty:NF \l_@@_vlines_clist \@@_draw_vlines: 
 %    \end{macrocode}
@@ -11757,9 +11901,13 @@
     \seq_gput_right:Nx \g_@@_pos_of_xdots_seq
       { 
         { \int_use:N \l_@@_initial_i_int }
-        { \int_use:N \l_@@_initial_j_int }
+%    \end{macrocode}
+% Be careful: with |\Iddots|, |\l_@@_final_j_int| is inferior to
+% |\l_@@_initial_j_int|. That's why we use |\int_min:nn| and |\int_max:nn|.
+%    \begin{macrocode}
+        { \int_min:nn \l_@@_initial_j_int \l_@@_final_j_int }
         { \int_use:N \l_@@_final_i_int }
-        { \int_use:N \l_@@_final_j_int }
+        { \int_max:nn \l_@@_initial_j_int \l_@@_final_j_int }
       }
   } 
 %    \end{macrocode}
@@ -12422,7 +12570,7 @@
     \pgf at relevantforpicturesizefalse
     \tl_if_eq:NNTF \l_@@_xdots_line_style_tl \c_@@_standard_tl
       \@@_draw_standard_dotted_line:
-      \@@_draw_non_standard_dotted_line:
+      \@@_draw_unstandard_dotted_line:
   }
 %    \end{macrocode}
 % 
@@ -12430,10 +12578,10 @@
 % We have to do a special construction with |\exp_args:NV| to be able to put in
 % the list of options in the correct place in the Tikz instruction.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_draw_non_standard_dotted_line:
+\cs_new_protected:Npn \@@_draw_unstandard_dotted_line:
   { 
     \begin { scope }
-    \exp_args:No \@@_draw_non_standard_dotted_line:n 
+    \exp_args:No \@@_draw_unstandard_dotted_line:n 
       { \l_@@_xdots_line_style_tl , \l_@@_xdots_color_tl } 
   }
 %    \end{macrocode}
@@ -12441,11 +12589,11 @@
 % in a list of options (that's why we have put diredtly |\l_@@_xdots_color_tl|).
 %
 % \smallskip
-% The argument of |\@@_draw_non_standard_dotted_line:n| is, in fact, the list of options.
+% The argument of |\@@_draw_unstandard_dotted_line:n| is, in fact, the list of options.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_draw_non_standard_dotted_line:n #1
+\cs_new_protected:Npn \@@_draw_unstandard_dotted_line:n #1
   {
-    \@@_draw_non_standard_dotted_line:nVV 
+    \@@_draw_unstandard_dotted_line:nVV 
       { #1 } 
       \l_@@_xdots_up_tl
       \l_@@_xdots_down_tl
@@ -12453,7 +12601,7 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_draw_non_standard_dotted_line:nnn #1 #2 #3
+\cs_new_protected:Npn \@@_draw_unstandard_dotted_line:nnn #1 #2 #3
   {
     \draw 
       [ 
@@ -12472,7 +12620,7 @@
           ( \l_@@_x_final_dim , \l_@@_y_final_dim ) ;
     \end { scope }
   }
-\cs_generate_variant:Nn \@@_draw_non_standard_dotted_line:nnn { n V V }
+\cs_generate_variant:Nn \@@_draw_unstandard_dotted_line:nnn { n V V }
 %    \end{macrocode}
 % 
 % \bigskip
@@ -13848,7 +13996,7 @@
 % \smallskip
 % The command |\@@_OnlyMainNiceMatrix_i:n| is only a short-cut which is used
 % twice in the above command. This command must \emph{not} be protected.
-% %    \begin{macrocode}
+%    \begin{macrocode}
 \cs_new_protected:Npn \@@_OnlyMainNiceMatrix_i:n #1
   {
     \int_compare:nNnF \c at iRow = 0
@@ -13864,8 +14012,8 @@
 % The following command will be executed in the |internal-code-after|. The rule
 % will be drawn \emph{before} the column |#1| (that is to say on the left side).
 % |#2| is the number of consecutive occurrences of \verb+|+. |#3| and |#4| are
-% numbers of rows that define the delimitation of the horizontal rule that we
-% have to draw. If |#4| is empty, that means that the rule extends until the
+% the numbers of rows that define the delimitation of the horizontal rule that
+% we have to draw. If |#4| is empty, that means that the rule extends until the
 % last row.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_vline:nnnn #1 #2 #3 #4 
@@ -13974,7 +14122,7 @@
        }
    }
 %    \end{macrocode}
-% 
+%
 % \bigskip
 % |#1| is the number of the column; |#2| is the number of vertical rules to
 % draw (with potentially a color between); |#3| and |#4| are the numbers of the
@@ -13982,6 +14130,22 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_vline_ii:nnnn #1 #2 #3 #4
   {
+    \bool_if:NTF \l_@@_dotted_bool
+      { \@@_vline_iv:nnn { #1 } { #3 } { #4 } }
+      { \@@_vline_iii:nnnn { #1 } { #2 } { #3 } { #4 } }
+  }
+%    \end{macrocode}
+% 
+% \bigskip
+% The following code is for the standard case (the rule which is drawn is a
+% solid rule).
+% 
+% |#1| is the number of the column; |#2| is the number of vertical rules to
+% draw (with potentially a color between); |#3| and |#4| are the numbers of the
+% rows between which the rule has to be drawn.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_vline_iii:nnnn #1 #2 #3 #4
+  {
     \pgfrememberpicturepositiononpagetrue
     \pgf at relevantforpicturesizefalse
     \@@_qpoint:n { row - #3 }
@@ -13993,7 +14157,7 @@
     \bool_lazy_all:nT
       {
         { \int_compare_p:nNn { #2 } > 1 }
-        { \cs_if_exist_p:N \CT at drsc@ } % condition added in version 5.18a
+        { \cs_if_exist_p:N \CT at drsc@ } 
         { ! \tl_if_blank_p:V \CT at drsc@ }
       }
       {
@@ -14025,16 +14189,29 @@
   }
 %    \end{macrocode}
 %
+%
 % \bigskip
-% The following command draws a complete vertical rule in the column |#1| (|#2|
-% is the number of consecutive rules specified by the number of \verb+|+ in the
-% preamble). This command will be used if there is no block in the array (and
-% the key |corners| is not used).
+% The following code is for the case of a dotted rule (with our system).
+% 
+% |#1| is the number of the column; |#2| and |#3| are the numbers of the
+% rows between which the rule has to be drawn.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_vline_i_complete:nn #1 #2
-  { \@@_vline_ii:nnnn { #1 } { #2 } 1 { \int_use:N \c at iRow } }
+\cs_new_protected:Npn \@@_vline_iv:nnn #1 #2 #3 
+  {
+    \pgfrememberpicturepositiononpagetrue
+    \pgf at relevantforpicturesizefalse
+    \@@_qpoint:n { col - #1 }
+    \dim_set_eq:NN \l_@@_x_initial_dim \pgf at x 
+    \dim_set_eq:NN \l_@@_x_final_dim \pgf at x 
+    \@@_qpoint:n { row - #2 }
+    \dim_set_eq:NN \l_@@_y_initial_dim \pgf at y
+    \@@_qpoint:n { row - \@@_succ:n { #3 } }
+    \dim_set_eq:NN \l_@@_y_final_dim \pgf at y
+    \@@_draw_line:
+  }
 %    \end{macrocode}
 %
+%
 % \bigskip
 % The command |\@@_draw_vlines:| draws all the vertical rules excepted in the
 % blocks, in the virtual blocks (determined by a command such as |\Cdots|) and in
@@ -14169,13 +14346,23 @@
        }
    }
 %    \end{macrocode}
-% 
+%
+% \bigskip 
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_hline_ii:nnnn #1 #2 #3 #4
+  {
+    \bool_if:NTF \l_@@_dotted_bool
+      { \@@_hline_iv:nnn { #1 } { #3 } { #4 } }
+      { \@@_hline_iii:nnnn { #1 } { #2 } { #3 } { #4 } }
+  }
+%    \end{macrocode}
+%
 % \bigskip
 % |#1| is the number of the row; |#2| is the number of horizontal rules to
 % draw (with potentially a color between); |#3| and |#4| are the number of the
 % columns between which the rule has to be drawn.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_hline_ii:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_hline_iii:nnnn #1 #2 #3 #4
   {
     \pgfrememberpicturepositiononpagetrue
     \pgf at relevantforpicturesizefalse
@@ -14188,7 +14375,7 @@
     \bool_lazy_all:nT
       { 
         { \int_compare_p:nNn { #2 } > 1 }
-        { \cs_if_exist_p:N \CT at drsc@ } % condition added in version 6.0
+        { \cs_if_exist_p:N \CT at drsc@ } 
         { ! \tl_if_blank_p:V \CT at drsc@ }
       }
       {
@@ -14219,14 +14406,92 @@
 %    \end{macrocode}
 %
 % \bigskip
+% The following code is for the case of a dotted rule (with our system of
+% rounded dots).
+% The aim is that, by standard the dotted line fits between square brackets
+% (|\hline| doesn't).
+%
+% \smallskip
+% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
+% \begin{bNiceMatrix}
+% 1 & 2 & 3 & 4 \\
+% \hline 
+% 1 & 2 & 3 & 4 \\
+% \hdottedline 
+% 1 & 2 & 3 & 4 
+% \end{bNiceMatrix}
+% \end{BVerbatim}
+% $\begin{bNiceMatrix}
+% 1 & 2 & 3 & 4 \\
+% \hline 
+% 1 & 2 & 3 & 4 \\
+% \hdottedline 
+% 1 & 2 & 3 & 4 
+% \end{bNiceMatrix}$
+%
+% \smallskip
+% But, if the user uses |margin|, the dotted line extends to have the same width
+% as a |\hline|.
+% 
+% \smallskip
+% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
+% \begin{bNiceMatrix}[margin]
+% 1 & 2 & 3 & 4 \\
+% \hline 
+% 1 & 2 & 3 & 4 \\
+% \hdottedline 
+% 1 & 2 & 3 & 4 
+% \end{bNiceMatrix}
+% \end{BVerbatim}
+% $\begin{bNiceMatrix}[margin]
+% 1 & 2 & 3 & 4 \\
+% \hline 
+% 1 & 2 & 3 & 4 \\
+% \hdottedline 
+% 1 & 2 & 3 & 4 
+% \end{bNiceMatrix}$
+%
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_hline_i_complete:nn #1 #2
-  { \@@_hline_ii:nnnn { #1 } { #2 } 1 { \int_use:N \c at jCol } }
+\cs_new_protected:Npn \@@_hline_iv:nnn #1 #2 #3
+  {
+    \pgfrememberpicturepositiononpagetrue
+    \pgf at relevantforpicturesizefalse
+    \@@_qpoint:n { row - #1 }
+    \dim_set_eq:NN \l_@@_y_initial_dim \pgf at y
+    \dim_set_eq:NN \l_@@_y_final_dim \pgf at y 
+    \@@_qpoint:n { col - #2 }
+    \dim_set_eq:NN \l_@@_x_initial_dim \pgf at x
+    \int_compare:nNnT { #2 } = 1 
+      {
+        \dim_sub:Nn \l_@@_x_initial_dim \l_@@_left_margin_dim 
+        \bool_if:NT \l_@@_NiceArray_bool 
+          { \dim_sub:Nn \l_@@_x_initial_dim \arraycolsep }
 %    \end{macrocode}
-% 
+% For reasons purely aesthetic, we do an adjustment in the case of a rounded
+% bracket. The correction by |0.5 \l_@@_inter_dots_dim| is \emph{ad hoc} for a
+% better result.
+%    \begin{macrocode}
+        \tl_if_eq:NnF \g_@@_left_delim_tl ( 
+          { \dim_add:Nn \l_@@_x_initial_dim  { 0.5 \l_@@_inter_dots_dim } }
+      }        
+    \@@_qpoint:n { col - \@@_succ:n { #3 } }
+    \dim_set_eq:NN \l_@@_x_final_dim \pgf at x
+    \int_compare:nNnT { #3 } = \c at jCol
+      {
+        \dim_add:Nn \l_@@_x_final_dim \l_@@_right_margin_dim 
+        \bool_if:NT \l_@@_NiceArray_bool 
+          { \dim_add:Nn \l_@@_x_final_dim \arraycolsep }
+        \tl_if_eq:NnF \g_@@_right_delim_tl ) 
+          { \dim_gsub:Nn \l_@@_x_final_dim { 0.5 \l_@@_inter_dots_dim } }
+      }
+    \@@_draw_line:
+  }
+%    \end{macrocode}
+%
+%
 % \bigskip
 % The command |\@@_draw_hlines:| draws all the horizontal rules excepted in the
-% blocks (even the virtual drawn determined by commands such as |\Cdots| and in
+% blocks (even the virtual blocks determined by commands such as |\Cdots| and in
 % the corners (if the key |corners| is used).
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_draw_hlines:
@@ -14578,134 +14843,17 @@
 % that will actually draw the dotted line. Its argument is the number of the row
 % \emph{before} which we will draw the row.
 %    \begin{macrocode}
-\AtBeginDocument
+\cs_new_protected:Npn \@@_hdottedline:n #1
   {
-%    \end{macrocode}
-% We recall that, when externalization is used, |\tikzpicture| and
-% |\endtikzpicture| (or |\pgfpicture| and |\endpgfpicture|) must be directly
-% ``visible''. That's why we construct now a version of |\@@_hdottedline:n| with
-% the right environment (|\begin{pgfpicture}\end{pgfpicture}| or
-% |\begin{tikzpiture}...\end{tikzpicture}|). 
-%    \begin{macrocode}
-    \cs_new_protected:Npx \@@_hdottedline:n #1
-      {
-        \bool_set_true:N \exp_not:N \l_@@_initial_open_bool 
-        \bool_set_true:N \exp_not:N \l_@@_final_open_bool 
-        \c_@@_pgfortikzpicture_tl
-        \@@_hdottedline_i:n { #1 }
-        \c_@@_endpgfortikzpicture_tl
-      }
+    \group_begin:
+    \bool_set_true:N \l_@@_dotted_bool 
+    \@@_hline:nnnn { #1 } { 1 } { 1 } { \int_use:N \c at jCol }
+    \group_end:
   }
 %    \end{macrocode}
-% 
-% The following command \emph{must} be protected since it is used in the
-% construction of |\@@_hdottedline:n|.
-%    \begin{macrocode}
-\cs_new_protected:Npn \@@_hdottedline_i:n #1
-  {
-    \pgfrememberpicturepositiononpagetrue
-    \@@_qpoint:n { row - #1 } 
-%    \end{macrocode}
-% We do a translation par |-\l_@@_radius_dim| because we want the dotted line to
-% have exactly the same position as a vertical rule drawn by ``"|"''
-% (considering the rule having a width equal to the diameter of the dots).
-%    \begin{macrocode}
-    \dim_set_eq:NN \l_@@_y_initial_dim \pgf at y 
-    \dim_sub:Nn \l_@@_y_initial_dim \l_@@_radius_dim 
-    \dim_set_eq:NN \l_@@_y_final_dim \l_@@_y_initial_dim
-%    \end{macrocode}
-% 
-% \medskip
-% The dotted line will be extended if the user uses |margin| (or |left-margin|
-% and |right-margin|).
 %
-% \smallskip
-% The aim is that, by standard the dotted line fits between square brackets
-% (|\hline| doesn't).
 %
-% \smallskip
-% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
-% \begin{bNiceMatrix}
-% 1 & 2 & 3 & 4 \\
-% \hline 
-% 1 & 2 & 3 & 4 \\
-% \hdottedline 
-% 1 & 2 & 3 & 4 
-% \end{bNiceMatrix}
-% \end{BVerbatim}
-% $\begin{bNiceMatrix}
-% 1 & 2 & 3 & 4 \\
-% \hline 
-% 1 & 2 & 3 & 4 \\
-% \hdottedline 
-% 1 & 2 & 3 & 4 
-% \end{bNiceMatrix}$
 %
-% \smallskip
-% But, if the user uses |margin|, the dotted line extends to have the same width
-% as a |\hline|.
-% 
-% \smallskip
-% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
-% \begin{bNiceMatrix}[margin]
-% 1 & 2 & 3 & 4 \\
-% \hline 
-% 1 & 2 & 3 & 4 \\
-% \hdottedline 
-% 1 & 2 & 3 & 4 
-% \end{bNiceMatrix}
-% \end{BVerbatim}
-% $\begin{bNiceMatrix}[margin]
-% 1 & 2 & 3 & 4 \\
-% \hline 
-% 1 & 2 & 3 & 4 \\
-% \hdottedline 
-% 1 & 2 & 3 & 4 
-% \end{bNiceMatrix}$
-%
-% \medskip
-%    \begin{macrocode}
-    \@@_qpoint:n { col - 1 } 
-    \dim_set:Nn \l_@@_x_initial_dim 
-      { 
-        \pgf at x + 
-%    \end{macrocode}
-% We do a reduction by |\arraycolsep| for the environments with delimiters (and
-% not for the other).
-%    \begin{macrocode}
-        \bool_if:NTF \l_@@_NiceArray_bool \c_zero_dim \arraycolsep 
-        - \l_@@_left_margin_dim 
-      } 
-    \@@_qpoint:n { col - \@@_succ:n \c at jCol } 
-    \dim_set:Nn \l_@@_x_final_dim 
-      {            
-        \pgf at x - 
-        \bool_if:NTF \l_@@_NiceArray_bool \c_zero_dim \arraycolsep 
-        + \l_@@_right_margin_dim 
-      }
-%    \end{macrocode}
-% For reasons purely aesthetic, we do an adjustment in the case of a rounded
-% bracket. The correction by |0.5 \l_@@_inter_dots_dim| is \emph{ad hoc} for a
-% better result.
-%    \begin{macrocode}
-    \tl_if_eq:NnF \g_@@_left_delim_tl ( 
-      { \dim_gadd:Nn \l_@@_x_initial_dim  { 0.5 \l_@@_inter_dots_dim } }
-    \tl_if_eq:NnF \g_@@_right_delim_tl ) 
-      { \dim_gsub:Nn \l_@@_x_final_dim { 0.5 \l_@@_inter_dots_dim } }
-%    \end{macrocode}
-%
-% \medskip
-% Up to now, we have no option to control the style of the lines drawn by
-% |\hdottedline| and the specifier ``|:|'' in the preamble. That's why we impose
-% the style |standard|.
-%    \begin{macrocode}
-    \tl_set_eq:NN \l_@@_xdots_line_style_tl \c_@@_standard_tl
-    \@@_draw_line:
-  }
-%    \end{macrocode}
-%
-%
-%
 % \bigskip
 % \textbf{Vertical dotted lines}\par\nobreak
 %
@@ -14713,66 +14861,13 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_vdottedline:n #1
   {
-    \bool_set_true:N \l_@@_initial_open_bool 
-    \bool_set_true:N \l_@@_final_open_bool 
-%    \end{macrocode}
-% We recall that, when externalization is used, |\tikzpicture| and
-% |\endtikzpicture| (or |\pgfpicture| and |\endpgfpicture|) must be directly
-% ``visible''. 
-%    \begin{macrocode}
-    \bool_if:NTF \c_@@_tikz_loaded_bool
-      {
-        \tikzpicture
-        \@@_vdottedline_i:n { #1 }
-        \endtikzpicture
-      }
-      {
-        \pgfpicture
-        \@@_vdottedline_i:n { #1 }
-        \endpgfpicture
-      }
+    \group_begin:
+    \bool_set_true:N \l_@@_dotted_bool 
+    \@@_vline:nnnn { \int_eval:n { #1 + 1 } } { 1 } { 1 } { \int_use:N \c at iRow }
+    \group_end:
   }
 %    \end{macrocode}
-%
-% \medskip
-%    \begin{macrocode}
-\cs_new_protected:Npn \@@_vdottedline_i:n #1
-  {
-%    \end{macrocode}
-% The command |\CT at arc@| is a command of \pkg{colortbl} which sets the color of
-% the rules in the array. The package \pkg{nicematrix} uses it even if \pkg{colortbl} is not
-% loaded.
-%    \begin{macrocode}
-    \CT at arc@
-    \pgfrememberpicturepositiononpagetrue
-    \@@_qpoint:n { col - \int_eval:n { #1 + 1 } } 
-%    \end{macrocode}
-% We do a translation par |-\l_@@_radius_dim| because we want the dotted line to
-% have exactly the same position as a vertical rule drawn by ``"|"''
-% (considering the rule having a width equal to the diameter of the dots).
-%    \begin{macrocode}
-    \dim_set:Nn \l_@@_x_initial_dim { \pgf at x - \l_@@_radius_dim }
-    \dim_set:Nn \l_@@_x_final_dim { \pgf at x - \l_@@_radius_dim }
-    \@@_qpoint:n { row - 1 } 
-%    \end{macrocode}
-% We arbitrary decrease the height of the dotted line by a quantity equal to
-% |\l_@@_inter_dots_dim| in order to improve the visual impact.
-%    \begin{macrocode}
-    \dim_set:Nn \l_@@_y_initial_dim { \pgf at y - 0.5 \l_@@_inter_dots_dim }  
-    \@@_qpoint:n { row - \@@_succ:n \c at iRow } 
-    \dim_set:Nn \l_@@_y_final_dim { \pgf at y + 0.5 \l_@@_inter_dots_dim } 
-%    \end{macrocode}
-% Up to now, we have no option to control the style of the lines drawn by
-% |\hdottedline| and the specifier ``|:|'' in the preamble. That's why we impose
-% the style |standard|.
-%    \begin{macrocode}
-    \tl_set_eq:NN \l_@@_xdots_line_style_tl \c_@@_standard_tl
-    \@@_draw_line:
-  }
-%    \end{macrocode}
 % 
-% 
-% 
 % \bigskip 
 % \subsection*{The environment \{NiceMatrixBlock\}}
 %
@@ -15233,7 +15328,7 @@
 % |<| and |>|. It's mandatory to use an expandable command.
 %
 %    \begin{macrocode}
-\NewExpandableDocumentCommand \@@_Block: { O { } m D < > { } m }
+\NewExpandableDocumentCommand \@@_Block: { O { } m D < > { } +m }
   { 
 %    \end{macrocode}
 % If the first mandatory argument of the command (which is the size of the block
@@ -15399,7 +15494,7 @@
         \int_compare:nNnT { #1 } = 1 \g_@@_row_style_tl
         \group_begin:
         \cs_set:Npn \arraystretch { 1 }
-        \dim_set_eq:NN \extrarowheight \c_zero_dim 
+        \dim_zero:N \extrarowheight 
         #4
 %    \end{macrocode}
 % If the box is rotated (the key |\rotate| may be in the previous |#4|), the
@@ -15419,7 +15514,7 @@
 % When the block is mono-column in a column with a fixed width (eg |p{3cm}|).
 %    \begin{macrocode}
               {
-                \begin { minipage } [ l_@@_vpos_of_block_tl ]
+                \begin { minipage } [ \l_@@_vpos_of_block_tl ] 
                   { \l_@@_col_width_dim }
                   \str_case:Vn \l_@@_hpos_block_str
                     {
@@ -15539,7 +15634,7 @@
                 { 
                   \group_begin:
                   \cs_set:Npn \arraystretch { 1 }
-                  \dim_set_eq:NN \extrarowheight \c_zero_dim 
+                  \dim_zero:N \extrarowheight 
                   #4
 %    \end{macrocode}
 % If the box is rotated (the key |\rotate| may be in the previous |#4|), the
@@ -15563,7 +15658,7 @@
                 { 
                   \group_begin:
                   \cs_set:Npn \arraystretch { 1 }
-                  \dim_set_eq:NN \extrarowheight \c_zero_dim 
+                  \dim_zero:N \extrarowheight 
                   #4 
                   \bool_if:NT \g_@@_rotate_bool
                     { \str_set:Nn \l_@@_hpos_block_str c }
@@ -16949,7 +17044,7 @@
         \l_@@_y_initial_dim - \l_@@_y_final_dim +
         \l_@@_submatrix_extra_height_dim - \arrayrulewidth 
       }
-    \dim_set_eq:NN \nulldelimiterspace \c_zero_dim
+    \dim_zero:N \nulldelimiterspace 
 %    \end{macrocode}
 %
 % \bigskip

Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2021-09-14 20:25:06 UTC (rev 60508)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2021-09-14 20:25:23 UTC (rev 60509)
@@ -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.1}
-\def\myfiledate{2021/08/20}
+\def\myfileversion{6.2}
+\def\myfiledate{2021/09/09}
 \RequirePackage{pgfcore}
 \usepgfmodule{shapes}
 \RequirePackage{l3keys2e}
@@ -46,6 +46,7 @@
 \bool_new:N \c__nicematrix_arydshln_loaded_bool
 \bool_new:N \c__nicematrix_booktabs_loaded_bool
 \bool_new:N \c__nicematrix_enumitem_loaded_bool
+\bool_new:N \c__nicematrix_tabularx_loaded_bool
 \bool_new:N \c__nicematrix_tikz_loaded_bool
 \AtBeginDocument
   {
@@ -58,6 +59,9 @@
     \@ifpackageloaded { enumitem }
       { \bool_set_true:N \c__nicematrix_enumitem_loaded_bool }
       { }
+    \@ifpackageloaded { tabularx }
+      { \bool_set_true:N \c__nicematrix_tabularx_loaded_bool }
+      { }
     \@ifpackageloaded { tikz }
       {
         \bool_set_true:N \c__nicematrix_tikz_loaded_bool
@@ -168,9 +172,17 @@
   }
 \cs_set:Npn \__nicematrix_cline
   { \__nicematrix_cline_i:en \l__nicematrix_first_col_int }
-\cs_set:Npn \__nicematrix_cline_i:nn #1 #2 { \__nicematrix_cline_i:w #1-#2 \q_stop }
-\cs_set:Npn \__nicematrix_cline_i:w #1-#2-#3 \q_stop
+\cs_set:Npn \__nicematrix_cline_i:nn #1 #2 { \__nicematrix_cline_i:w #1|#2- \q_stop }
+\cs_set:Npn \__nicematrix_cline_i:w #1|#2-#3 \q_stop
   {
+    \tl_if_empty:nTF { #3 }
+      { \__nicematrix_cline_iii:w #1|#2-#2 \q_stop }
+      { \__nicematrix_cline_ii:w #1|#2-#3 \q_stop }
+  }
+\cs_set:Npn \__nicematrix_cline_ii:w #1|#2-#3-\q_stop
+  { \__nicematrix_cline_iii:w #1|#2-#3 \q_stop }
+\cs_set:Npn \__nicematrix_cline_iii:w #1|#2-#3 \q_stop
+  {
     \int_compare:nNnT { #1 } < { #2 }
       { \multispan { \int_eval:n { #2 - #1 } } & }
     \multispan { \int_eval:n { #3 - #2 + 1 } }
@@ -347,6 +359,8 @@
 \clist_new:N \l__nicematrix_vlines_clist
 \clist_new:N \l__nicematrix_submatrix_hlines_clist
 \clist_new:N \l__nicematrix_submatrix_vlines_clist
+\bool_new:N \l__nicematrix_dotted_bool
+\dim_new:N \l__nicematrix_trim_dim
 \int_new:N \l__nicematrix_first_row_int
 \int_set:Nn \l__nicematrix_first_row_int 1
 \int_new:N \l__nicematrix_first_col_int
@@ -884,6 +898,7 @@
         \c_math_toggle_token
         \bool_if:NT \l__nicematrix_small_bool \scriptstyle
       }
+    \color { nicematrix }
     \g__nicematrix_row_style_tl
     \int_compare:nNnTF \c at iRow = 0
       {
@@ -1065,27 +1080,15 @@
           { \exp_not:n { #3 } }
       }
   }
-\cs_new_protected:Npn \__nicematrix_revtex_array:
-  {
-    \cs_set_eq:NN \@acoll \@arrayacol
-    \cs_set_eq:NN \@acolr \@arrayacol
-    \cs_set_eq:NN \@acol \@arrayacol
-    \cs_set_nopar:Npn \@halignto { }
-    \@array at array
-  }
 \cs_new_protected:Npn \__nicematrix_array:
   {
-    \bool_if:NTF \c__nicematrix_revtex_bool
-      \__nicematrix_revtex_array:
-      {
-        \bool_if:NTF \l__nicematrix_NiceTabular_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
-          { \cs_set_nopar:Npn \@halignto { } }
-          { \cs_set_nopar:Npx \@halignto { to \dim_use:N \l__nicematrix_tabular_width_dim } }
-        \@tabarray
-      }
+    \bool_if:NTF \l__nicematrix_NiceTabular_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
+      { \cs_set_nopar:Npn \@halignto { } }
+      { \cs_set_nopar:Npx \@halignto { to \dim_use:N \l__nicematrix_tabular_width_dim } }
+    \@tabarray
     [ \str_if_eq:VnTF \l__nicematrix_baseline_tl c c t ]
   }
 \cs_set_eq:NN \__nicematrix_old_ialign: \ialign
@@ -1167,6 +1170,7 @@
   }
 \cs_new_protected:Npn \__nicematrix_pre_array_ii:
   {
+        \xglobal \colorlet { nicematrix } { . }
         \int_gzero:N \g__nicematrix_total_X_weight_int
     \bool_if:NT \c__nicematrix_booktabs_loaded_bool
       { \tl_put_left:Nn \@BTnormal \__nicematrix_create_row_node: }
@@ -1285,6 +1289,7 @@
               { \dim_max:nn \g__nicematrix_dp_last_row_dim { \box_dp:N \l__nicematrix_cell_box } }
           }
       }
+    \seq_gclear:N \g__nicematrix_cols_vlism_seq
     \seq_gclear:N \g__nicematrix_submatrix_seq
     \bool_if:NT \l__nicematrix_code_before_bool \__nicematrix_exec_code_before:
     \seq_gclear:N \g__nicematrix_pos_of_blocks_seq
@@ -1468,9 +1473,26 @@
       }
     \__nicematrix_create_extra_nodes:
   }
+\cs_new_protected:Npn \__nicematrix_patch_for_revtex:
+  {
+    \cs_set_eq:NN \@addamp \@addamp at LaTeX
+    \cs_set_eq:NN \insert at column \insert at column@array
+    \cs_set_eq:NN \@classx \@classx at array
+    \cs_set_eq:NN \@xarraycr \@xarraycr at array
+    \cs_set_eq:NN \@arraycr \@arraycr at array
+    \cs_set_eq:NN \@xargarraycr \@xargarraycr at array
+    \cs_set_eq:NN \array \array at array
+    \cs_set_eq:NN \@array \@array at array
+    \cs_set_eq:NN \@tabular \@tabular at array
+    \cs_set_eq:NN \@mkpream \@mkpream at array
+    \cs_set_eq:NN \endarray \endarray at array
+    \cs_set:Npn \@tabarray { \@ifnextchar [ { \@array } { \@array [ c ] } }
+    \cs_set:Npn \endtabular { \endarray $\egroup} % $
+  }
 \NewDocumentEnvironment { NiceArrayWithDelims }
   { m m O { } m ! O { } t \CodeBefore }
   {
+     \bool_if:NT \c__nicematrix_revtex_bool \__nicematrix_patch_for_revtex:
     \__nicematrix_provide_pgfsyspdfmark:
     \bool_if:NT \c__nicematrix_footnote_bool \savenotes
     \bgroup
@@ -1767,6 +1789,7 @@
         ]  { \__nicematrix_patch_preamble_viii:nn #1 }
         \} { \__nicematrix_patch_preamble_viii:nn #1 }
         X  { \__nicematrix_patch_preamble_ix:n }
+        \__nicematrix_X  { \__nicematrix_patch_preamble_ix:n }
         \q_stop { }
       }
       {
@@ -2920,8 +2943,19 @@
     \NiceArray { #2 }
   }
   { \endNiceArray }
+\cs_set_protected:Npn \__nicematrix_newcolumntype #1
+  {
+    \cs_if_free:cT { NC @ find @ #1 }
+      { \NC at list \expandafter { \the \NC at list \NC at do #1 } }
+    \cs_set:cpn {NC @ find @ #1 } ##1 #1 { \NC@ { ##1 } }
+    \peek_meaning:NTF [
+      { \newcol@ #1 }
+      { \newcol@ #1 [ 0 ] }
+  }
 \NewDocumentEnvironment { NiceTabularX } { m O { } m ! O { } }
   {
+    \bool_if:NT \c__nicematrix_tabularx_loaded_bool
+      { \newcolumntype { X } { \__nicematrix_X } }
     \str_gset:Nn \g__nicematrix_name_env_str { NiceTabularX }
     \dim_zero_new:N \l__nicematrix_width_dim
     \dim_set:Nn \l__nicematrix_width_dim { #1 }
@@ -3003,16 +3037,6 @@
     \__nicematrix_draw_dotted_lines:
     \__nicematrix_compute_corners:
     \__nicematrix_adjust_pos_of_blocks_seq:
-    % \bool_lazy_all:nT
-    %   {
-    %     { \seq_if_empty_p:N \g__nicematrix_pos_of_blocks_seq }
-    %     { \seq_if_empty_p:N \g__nicematrix_pos_of_xdots_seq }
-    %     { \seq_if_empty_p:N \l__nicematrix_corners_cells_seq }
-    %   }
-    %   {
-    %     \cs_set_eq:NN \__nicematrix_vline_i:nn \__nicematrix_vline_i_complete:nn
-    %     \cs_set_eq:NN \__nicematrix_hline_i:nn \__nicematrix_hline_i_complete:nn
-    %   }
     \tl_if_empty:NF \l__nicematrix_hlines_clist \__nicematrix_draw_hlines:
     \tl_if_empty:NF \l__nicematrix_vlines_clist \__nicematrix_draw_vlines:
     \cs_set_eq:NN \SubMatrix \__nicematrix_SubMatrix
@@ -3342,9 +3366,9 @@
     \seq_gput_right:Nx \g__nicematrix_pos_of_xdots_seq
       {
         { \int_use:N \l__nicematrix_initial_i_int }
-        { \int_use:N \l__nicematrix_initial_j_int }
+        { \int_min:nn \l__nicematrix_initial_j_int \l__nicematrix_final_j_int }
         { \int_use:N \l__nicematrix_final_i_int }
-        { \int_use:N \l__nicematrix_final_j_int }
+        { \int_max:nn \l__nicematrix_initial_j_int \l__nicematrix_final_j_int }
       }
   }
 \cs_new_protected:Npn \__nicematrix_adjust_to_submatrix:nn #1 #2
@@ -3749,22 +3773,22 @@
     \pgf at relevantforpicturesizefalse
     \tl_if_eq:NNTF \l__nicematrix_xdots_line_style_tl \c__nicematrix_standard_tl
       \__nicematrix_draw_standard_dotted_line:
-      \__nicematrix_draw_non_standard_dotted_line:
+      \__nicematrix_draw_unstandard_dotted_line:
   }
-\cs_new_protected:Npn \__nicematrix_draw_non_standard_dotted_line:
+\cs_new_protected:Npn \__nicematrix_draw_unstandard_dotted_line:
   {
     \begin { scope }
-    \exp_args:No \__nicematrix_draw_non_standard_dotted_line:n
+    \exp_args:No \__nicematrix_draw_unstandard_dotted_line:n
       { \l__nicematrix_xdots_line_style_tl , \l__nicematrix_xdots_color_tl }
   }
-\cs_new_protected:Npn \__nicematrix_draw_non_standard_dotted_line:n #1
+\cs_new_protected:Npn \__nicematrix_draw_unstandard_dotted_line:n #1
   {
-    \__nicematrix_draw_non_standard_dotted_line:nVV
+    \__nicematrix_draw_unstandard_dotted_line:nVV
       { #1 }
       \l__nicematrix_xdots_up_tl
       \l__nicematrix_xdots_down_tl
   }
-\cs_new_protected:Npn \__nicematrix_draw_non_standard_dotted_line:nnn #1 #2 #3
+\cs_new_protected:Npn \__nicematrix_draw_unstandard_dotted_line:nnn #1 #2 #3
   {
     \draw
       [
@@ -3778,7 +3802,7 @@
           ( \l__nicematrix_x_final_dim , \l__nicematrix_y_final_dim ) ;
     \end { scope }
   }
-\cs_generate_variant:Nn \__nicematrix_draw_non_standard_dotted_line:nnn { n V V }
+\cs_generate_variant:Nn \__nicematrix_draw_unstandard_dotted_line:nnn { n V V }
 \cs_new_protected:Npn \__nicematrix_draw_standard_dotted_line:
   {
     \bool_lazy_and:nnF
@@ -4699,6 +4723,12 @@
    }
 \cs_new_protected:Npn \__nicematrix_vline_ii:nnnn #1 #2 #3 #4
   {
+    \bool_if:NTF \l__nicematrix_dotted_bool
+      { \__nicematrix_vline_iv:nnn { #1 } { #3 } { #4 } }
+      { \__nicematrix_vline_iii:nnnn { #1 } { #2 } { #3 } { #4 } }
+  }
+\cs_new_protected:Npn \__nicematrix_vline_iii:nnnn #1 #2 #3 #4
+  {
     \pgfrememberpicturepositiononpagetrue
     \pgf at relevantforpicturesizefalse
     \__nicematrix_qpoint:n { row - #3 }
@@ -4710,7 +4740,7 @@
     \bool_lazy_all:nT
       {
         { \int_compare_p:nNn { #2 } > 1 }
-        { \cs_if_exist_p:N \CT at drsc@ } % condition added in version 5.18a
+        { \cs_if_exist_p:N \CT at drsc@ }
         { ! \tl_if_blank_p:V \CT at drsc@ }
       }
       {
@@ -4740,8 +4770,19 @@
     \pgfsetrectcap
     \pgfusepathqstroke
   }
-\cs_new_protected:Npn \__nicematrix_vline_i_complete:nn #1 #2
-  { \__nicematrix_vline_ii:nnnn { #1 } { #2 } 1 { \int_use:N \c at iRow } }
+\cs_new_protected:Npn \__nicematrix_vline_iv:nnn #1 #2 #3
+  {
+    \pgfrememberpicturepositiononpagetrue
+    \pgf at relevantforpicturesizefalse
+    \__nicematrix_qpoint:n { col - #1 }
+    \dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf at x
+    \dim_set_eq:NN \l__nicematrix_x_final_dim \pgf at x
+    \__nicematrix_qpoint:n { row - #2 }
+    \dim_set_eq:NN \l__nicematrix_y_initial_dim \pgf at y
+    \__nicematrix_qpoint:n { row - \__nicematrix_succ:n { #3 } }
+    \dim_set_eq:NN \l__nicematrix_y_final_dim \pgf at y
+    \__nicematrix_draw_line:
+  }
 \cs_new_protected:Npn \__nicematrix_draw_vlines:
   {
     \int_step_inline:nnn
@@ -4837,6 +4878,12 @@
    }
 \cs_new_protected:Npn \__nicematrix_hline_ii:nnnn #1 #2 #3 #4
   {
+    \bool_if:NTF \l__nicematrix_dotted_bool
+      { \__nicematrix_hline_iv:nnn { #1 } { #3 } { #4 } }
+      { \__nicematrix_hline_iii:nnnn { #1 } { #2 } { #3 } { #4 } }
+  }
+\cs_new_protected:Npn \__nicematrix_hline_iii:nnnn #1 #2 #3 #4
+  {
     \pgfrememberpicturepositiononpagetrue
     \pgf at relevantforpicturesizefalse
     \__nicematrix_qpoint:n { col - #3 }
@@ -4848,7 +4895,7 @@
     \bool_lazy_all:nT
       {
         { \int_compare_p:nNn { #2 } > 1 }
-        { \cs_if_exist_p:N \CT at drsc@ } % condition added in version 6.0
+        { \cs_if_exist_p:N \CT at drsc@ }
         { ! \tl_if_blank_p:V \CT at drsc@ }
       }
       {
@@ -4876,8 +4923,35 @@
     \pgfsetrectcap
     \pgfusepathqstroke
   }
-\cs_new_protected:Npn \__nicematrix_hline_i_complete:nn #1 #2
-  { \__nicematrix_hline_ii:nnnn { #1 } { #2 } 1 { \int_use:N \c at jCol } }
+\cs_new_protected:Npn \__nicematrix_hline_iv:nnn #1 #2 #3
+  {
+    \pgfrememberpicturepositiononpagetrue
+    \pgf at relevantforpicturesizefalse
+    \__nicematrix_qpoint:n { row - #1 }
+    \dim_set_eq:NN \l__nicematrix_y_initial_dim \pgf at y
+    \dim_set_eq:NN \l__nicematrix_y_final_dim \pgf at y
+    \__nicematrix_qpoint:n { col - #2 }
+    \dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf at x
+    \int_compare:nNnT { #2 } = 1
+      {
+        \dim_sub:Nn \l__nicematrix_x_initial_dim \l__nicematrix_left_margin_dim
+        \bool_if:NT \l__nicematrix_NiceArray_bool
+          { \dim_sub:Nn \l__nicematrix_x_initial_dim \arraycolsep }
+        \tl_if_eq:NnF \g__nicematrix_left_delim_tl (
+          { \dim_add:Nn \l__nicematrix_x_initial_dim  { 0.5 \l__nicematrix_inter_dots_dim } }
+      }
+    \__nicematrix_qpoint:n { col - \__nicematrix_succ:n { #3 } }
+    \dim_set_eq:NN \l__nicematrix_x_final_dim \pgf at x
+    \int_compare:nNnT { #3 } = \c at jCol
+      {
+        \dim_add:Nn \l__nicematrix_x_final_dim \l__nicematrix_right_margin_dim
+        \bool_if:NT \l__nicematrix_NiceArray_bool
+          { \dim_add:Nn \l__nicematrix_x_final_dim \arraycolsep }
+        \tl_if_eq:NnF \g__nicematrix_right_delim_tl )
+          { \dim_gsub:Nn \l__nicematrix_x_final_dim { 0.5 \l__nicematrix_inter_dots_dim } }
+      }
+    \__nicematrix_draw_line:
+  }
 \cs_new_protected:Npn \__nicematrix_draw_hlines:
   {
     \int_step_inline:nnn
@@ -5081,75 +5155,20 @@
     \tl_gput_right:Nx \g__nicematrix_internal_code_after_tl
       { \__nicematrix_hdottedline:n { \int_use:N \c at iRow } }
   }
-\AtBeginDocument
+\cs_new_protected:Npn \__nicematrix_hdottedline:n #1
   {
-    \cs_new_protected:Npx \__nicematrix_hdottedline:n #1
-      {
-        \bool_set_true:N \exp_not:N \l__nicematrix_initial_open_bool
-        \bool_set_true:N \exp_not:N \l__nicematrix_final_open_bool
-        \c__nicematrix_pgfortikzpicture_tl
-        \__nicematrix_hdottedline_i:n { #1 }
-        \c__nicematrix_endpgfortikzpicture_tl
-      }
+    \group_begin:
+    \bool_set_true:N \l__nicematrix_dotted_bool
+    \__nicematrix_hline:nnnn { #1 } { 1 } { 1 } { \int_use:N \c at jCol }
+    \group_end:
   }
-\cs_new_protected:Npn \__nicematrix_hdottedline_i:n #1
-  {
-    \pgfrememberpicturepositiononpagetrue
-    \__nicematrix_qpoint:n { row - #1 }
-    \dim_set_eq:NN \l__nicematrix_y_initial_dim \pgf at y
-    \dim_sub:Nn \l__nicematrix_y_initial_dim \l__nicematrix_radius_dim
-    \dim_set_eq:NN \l__nicematrix_y_final_dim \l__nicematrix_y_initial_dim
-    \__nicematrix_qpoint:n { col - 1 }
-    \dim_set:Nn \l__nicematrix_x_initial_dim
-      {
-        \pgf at x +
-        \bool_if:NTF \l__nicematrix_NiceArray_bool \c_zero_dim \arraycolsep
-        - \l__nicematrix_left_margin_dim
-      }
-    \__nicematrix_qpoint:n { col - \__nicematrix_succ:n \c at jCol }
-    \dim_set:Nn \l__nicematrix_x_final_dim
-      {
-        \pgf at x -
-        \bool_if:NTF \l__nicematrix_NiceArray_bool \c_zero_dim \arraycolsep
-        + \l__nicematrix_right_margin_dim
-      }
-    \tl_if_eq:NnF \g__nicematrix_left_delim_tl (
-      { \dim_gadd:Nn \l__nicematrix_x_initial_dim  { 0.5 \l__nicematrix_inter_dots_dim } }
-    \tl_if_eq:NnF \g__nicematrix_right_delim_tl )
-      { \dim_gsub:Nn \l__nicematrix_x_final_dim { 0.5 \l__nicematrix_inter_dots_dim } }
-    \tl_set_eq:NN \l__nicematrix_xdots_line_style_tl \c__nicematrix_standard_tl
-    \__nicematrix_draw_line:
-  }
 \cs_new_protected:Npn \__nicematrix_vdottedline:n #1
   {
-    \bool_set_true:N \l__nicematrix_initial_open_bool
-    \bool_set_true:N \l__nicematrix_final_open_bool
-    \bool_if:NTF \c__nicematrix_tikz_loaded_bool
-      {
-        \tikzpicture
-        \__nicematrix_vdottedline_i:n { #1 }
-        \endtikzpicture
-      }
-      {
-        \pgfpicture
-        \__nicematrix_vdottedline_i:n { #1 }
-        \endpgfpicture
-      }
+    \group_begin:
+    \bool_set_true:N \l__nicematrix_dotted_bool
+    \__nicematrix_vline:nnnn { \int_eval:n { #1 + 1 } } { 1 } { 1 } { \int_use:N \c at iRow }
+    \group_end:
   }
-\cs_new_protected:Npn \__nicematrix_vdottedline_i:n #1
-  {
-    \CT at arc@
-    \pgfrememberpicturepositiononpagetrue
-    \__nicematrix_qpoint:n { col - \int_eval:n { #1 + 1 } }
-    \dim_set:Nn \l__nicematrix_x_initial_dim { \pgf at x - \l__nicematrix_radius_dim }
-    \dim_set:Nn \l__nicematrix_x_final_dim { \pgf at x - \l__nicematrix_radius_dim }
-    \__nicematrix_qpoint:n { row - 1 }
-    \dim_set:Nn \l__nicematrix_y_initial_dim { \pgf at y - 0.5 \l__nicematrix_inter_dots_dim }
-    \__nicematrix_qpoint:n { row - \__nicematrix_succ:n \c at iRow }
-    \dim_set:Nn \l__nicematrix_y_final_dim { \pgf at y + 0.5 \l__nicematrix_inter_dots_dim }
-    \tl_set_eq:NN \l__nicematrix_xdots_line_style_tl \c__nicematrix_standard_tl
-    \__nicematrix_draw_line:
-  }
 \bool_new:N \l__nicematrix_block_auto_columns_width_bool
 \keys_define:nn { NiceMatrix / NiceMatrixBlock }
   {
@@ -5402,7 +5421,7 @@
     color .tl_set:N = \l__nicematrix_color_tl ,
     color .value_required:n = true
   }
-\NewExpandableDocumentCommand \__nicematrix_Block: { O { } m D < > { } m }
+\NewExpandableDocumentCommand \__nicematrix_Block: { O { } m D < > { } +m }
   {
     \peek_remove_spaces:n
       {
@@ -5480,7 +5499,7 @@
         \int_compare:nNnT { #1 } = 1 \g__nicematrix_row_style_tl
         \group_begin:
         \cs_set:Npn \arraystretch { 1 }
-        \dim_set_eq:NN \extrarowheight \c_zero_dim
+        \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
@@ -5489,7 +5508,7 @@
               { \int_compare_p:nNn { #2 } = 1 }
               { \dim_compare_p:n { \l__nicematrix_col_width_dim >= \c_zero_dim } }
               {
-                \begin { minipage } [ l__nicematrix_vpos_of_block_tl ]
+                \begin { minipage } [ \l__nicematrix_vpos_of_block_tl ]
                   { \l__nicematrix_col_width_dim }
                   \str_case:Vn \l__nicematrix_hpos_block_str
                     {
@@ -5586,7 +5605,7 @@
                 {
                   \group_begin:
                   \cs_set:Npn \arraystretch { 1 }
-                  \dim_set_eq:NN \extrarowheight \c_zero_dim
+                  \dim_zero:N \extrarowheight
                   #4
                   \bool_if:NT \g__nicematrix_rotate_bool
                     { \str_set:Nn \l__nicematrix_hpos_block_str c }
@@ -5602,7 +5621,7 @@
                 {
                   \group_begin:
                   \cs_set:Npn \arraystretch { 1 }
-                  \dim_set_eq:NN \extrarowheight \c_zero_dim
+                  \dim_zero:N \extrarowheight
                   #4
                   \bool_if:NT \g__nicematrix_rotate_bool
                     { \str_set:Nn \l__nicematrix_hpos_block_str c }
@@ -6492,7 +6511,7 @@
         \l__nicematrix_y_initial_dim - \l__nicematrix_y_final_dim +
         \l__nicematrix_submatrix_extra_height_dim - \arrayrulewidth
       }
-    \dim_set_eq:NN \nulldelimiterspace \c_zero_dim
+    \dim_zero:N \nulldelimiterspace
     \group_begin:
     \pgfsetlinewidth { 1.1 \arrayrulewidth }
     \tl_if_empty:NF \l__nicematrix_rules_color_tl



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