texlive[56717] Master/texmf-dist: nicematrix (20oct20)

commits+karl at tug.org commits+karl at tug.org
Tue Oct 20 22:40:24 CEST 2020


Revision: 56717
          http://tug.org/svn/texlive?view=revision&revision=56717
Author:   karl
Date:     2020-10-20 22:40:24 +0200 (Tue, 20 Oct 2020)
Log Message:
-----------
nicematrix (20oct20)

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	2020-10-20 20:40:07 UTC (rev 56716)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex	2020-10-20 20:40:24 UTC (rev 56717)
@@ -369,10 +369,10 @@
 
 
 \bigskip
-\colorbox{yellow!30}{\textbf{Nouveau 5.2}}\enskip On peut aussi utiliser la clé
-|baseline| pour aligner une matrice sur un filet horizontal (tracé par
-|\hline|). On doit pour cela donner la valeur |line-|\textsl{i} où \textsl{i}
-est le numéro de la rangée qui suit ce filet horizontal.
+On peut aussi utiliser la clé |baseline| pour aligner une matrice sur un filet
+horizontal (tracé par |\hline|). On doit pour cela donner la valeur
+|line-|\textsl{i} où \textsl{i} est le numéro de la rangée qui suit ce filet
+horizontal.
 
 \smallskip
 \begin{Verbatim}
@@ -469,8 +469,8 @@
 
 
 \bigskip
-On peut régler le positionnement horizontal du bloc avec l'une des clés |l|, |c|
-et |r|.
+\colorbox{yellow!30}{Nouveau 5.3}\enskip On peut régler le positionnement
+horizontal du bloc avec l'une des clés |l|, |c| et |r|.
 
 
 \medskip
@@ -526,7 +526,7 @@
 
 \subsection{Les blocs mono-colonne}
 
-\colorbox{yellow!50}{\textbf{Nouveau 5.4}}\enskip Les blocs mono-colonne ont un
+\colorbox{yellow!30}{Nouveau 5.4}\enskip Les blocs mono-colonne ont un
 comportement spécial. 
 \begin{itemize}
 \item La largeur naturelle du contenu de ces blocs est prise en compte pour la
@@ -546,7 +546,7 @@
 \begin{scope}
 \hfuzz=10cm
 \begin{BVerbatim}[baseline=c,boxwidth=12cm]
-\begin{NiceTabular}{~LetterAt{}>{\bfseries}lr~LetterAt{}} \hline
+\begin{NiceTabular}{~LetterAt{}>{\color{blue}}lr~LetterAt{}} \hline
 \Block{2-1}{Pierre}    & 12 \\
                        & 13 \\ \hline
 Jacques                &  8 \\ \hline
@@ -559,7 +559,7 @@
                        & 19 \\ \hline
 \end{NiceTabular}
 \end{BVerbatim}
-\begin{NiceTabular}{@{}>{\bfseries}lr@{}} \hline
+\begin{NiceTabular}{@{}>{\color{blue}}lr@{}} \hline
 \Block{2-1}{Pierre}    & 12 \\
                        & 13 \\ \hline
 Jacques                &  8 \\ \hline
@@ -653,8 +653,7 @@
 
 
 \bigskip
-\colorbox{yellow!30}{\textbf{Nouveau 5.2}}\enskip En revanche, les filets
-verticaux ne sont pas tracés à l'intérieur des blocs.
+En revanche, les filets verticaux ne sont pas tracés à l'intérieur des blocs.
 
 
 \bigskip
@@ -899,10 +898,9 @@
 rectangles vides partant de la case située exactement dans le coin.
 
 \bigskip
-\colorbox{yellow!30}{\textbf{Nouveau 5.2}}\enskip On peut passer en argument de
-|\hvlines-except-corners| une liste de coins à prendre en considération. Les
-coins étant désignés par |NW|, |SW|, |NE| et |SE| (\emph{north west},
-\emph{south west}, \emph{north east} et \emph{south east}).
+On peut passer en argument de |\hvlines-except-corners| une liste de coins à
+prendre en considération. Les coins étant désignés par |NW|, |SW|, |NE| et |SE|
+(\emph{north west}, \emph{south west}, \emph{north east} et \emph{south east}).
 
 \medskip
 \begin{BVerbatim}[boxwidth=11cm,baseline=c]
@@ -1224,10 +1222,9 @@
 \end{scope}
 
 \bigskip
-\colorbox{yellow!30}{\textbf{Nouveau 5.2}}\enskip Il existe une option |respect-blocks|
-pour la commande |\rowcolors|. Avec cette option, les ``rangées'' colorées
-alternativement peuvent s'étendre sur plusieurs rangées réelles du tableau pour
-englober les blocs.
+Il existe une option |respect-blocks| pour la commande |\rowcolors|. Avec cette
+option, les ``rangées'' colorées alternativement peuvent s'étendre sur plusieurs
+rangées réelles du tableau pour englober les blocs.
 
 \medskip
 \begin{scope}
@@ -2266,9 +2263,13 @@
 peut spécifier les instructions du |code-after| à la fin de l'environnement,
 après le mot-clé |\CodeAfter|\footnote{Dans certaines circonstances, on doit
   mettre |\omit \CodeAfter|, |\omit| étant un mot-clé de TeX qui annule le motif
-  de la cellule courante.}. Pour un exemple, voir page
-\pageref{exemple-CodeAfter}.
+  de la cellule courante.} (pour un exemple, voir page
+\pageref{exemple-CodeAfter}). \colorbox{yellow!50}{\textbf{Nouveau 5.5}}\enskip
+Avant la version 5.5, il fallait parfois mettre le mot-clé |\omit| devant
+|\CodeAfter| dans certains circonstances. Depuis la version 5.5, on ne doit
+\emph{jamais} mettre |\omit|.
 
+
 \section{Les notes dans les tableaux}
 
 \label{s:notes}
@@ -2393,7 +2394,7 @@
 \item Si la clé |notes/para| est utilisée, les notes sont composées à la fin du
 tableau en un seul paragraphe.
 
-\item \colorbox{yellow!50}{\textbf{Nouveau 5.4}}\enskip
+\item \colorbox{yellow!30}{Nouveau 5.4}\enskip
 Il existe une clé |tabularnote| qui permet d'insérer du texte dans la zone
 des notes avant les notes numérotées.
 
@@ -2594,16 +2595,15 @@
 
 Si vous souhaitez utiliser l'environnement |{NiceTabular}| ou |{NiceTAbular*}|
 dans un environnement |{threeparttable}| de l'extension éponyme, vous devez
-patcher |{threeparttable}| avec le code suivant.
+patcher |{threeparttable}| avec le code suivant (avec une version de LaTeX
+postérieure à 2020/10/01).
 \begin{Verbatim}[commandchars=\~\#\!]
 \makeatletter
-\AtBeginEnvironment{threeparttable}
+\AddToHook{env/threeparttable/begin}
   {\TPT at hookin{NiceTabular}\TPT at hookin{NiceTabular*}}
 \makeatother
 \end{Verbatim}
 
-La commande |\AtBeginEnvironment| est une commande de l'extension \pkg{etoolbox}
-qui doit donc avoir été chargée au préalable.
 
 
 \section{Autres fonctionnalités}
@@ -3097,7 +3097,7 @@
 utilisé les options |left-margin| et |right-margin|.\footnote{Les options
   |left-margin| et |right-margin| prennent des dimensions comme valeurs mais, si
   aucune valeur n'est donnée, c'est la valeur par défaut qui est utilisée et
-  elle est égale à |\arraycolsep| (valeur initial : 5~pt). Il existe aussi une
+  elle est égale à |\arraycolsep| (valeur initiale : 5~pt). Il existe aussi une
   option |margin| pour fixer à la fois |left-margin| et |right-margin|.}
 \[\begin{pNiceMatrix}[
  create-large-nodes,left-margin,right-margin,
@@ -3307,7 +3307,7 @@
   publique alors que toute variable dont le nom débute par |\g__nicematrix| ou
   par |\l__nicematrix| est privée.} :
 \begin{itemize}
-\item \colorbox{yellow!30}{\textbf{Nouveau 5.2}}\enskip |\g_nicematrix_code_before_tl| ;
+\item |\g_nicematrix_code_before_tl| ;
 \item |\g_nicematrix_code_after_tl|.
 \end{itemize}
 
@@ -3527,7 +3527,7 @@
 \end{scope}
 
 \bigskip
-\colorbox{yellow!50}{\textbf{Nouveau 5.3}}\enskip On peut choisir l'instruction
+\colorbox{yellow!30}{Nouveau 5.3}\enskip On peut choisir l'instruction
   |\Ddots| qui sera tracée en premier (et qui servira pour tracer les suivantes
   quand la parallélisation est activée) avec la clé |draw-first| :
   |\Ddots[draw-first]|\rlap{.} 
@@ -4023,7 +4023,7 @@
   a_{11} & a_{12} & a_{13} & a_{14} \\
   a_{21} & a_{22} & a_{23} & a_{24} \\
   a_{31} & a_{32} & a_{33} & a_{34} \\
-  a_{41} & a_{42} & a_{43} & a_{44} 
+  a_{41} & a_{42} & a_{43} & a_{44} \\
 \CodeAfter
   \begin{tikzpicture}[~emphase#name suffix = -large@,
                       every node/.style = {draw,~emphase#inner sep = 0 pt@}]
@@ -4039,7 +4039,7 @@
 a_{11} & a_{12} & a_{13} & a_{14} \\
 a_{21} & a_{22} & a_{23} & a_{24} \\
 a_{31} & a_{32} & a_{33} & a_{34} \\
-a_{41} & a_{42} & a_{43} & a_{44} 
+a_{41} & a_{42} & a_{43} & a_{44} \\
 \CodeAfter
 \begin{tikzpicture}[name suffix = -large,
                     every node/.style = {draw,inner sep = 0 pt}]
@@ -4058,8 +4058,8 @@
   p.~\pageref{remark-cline}.}
 
 \vspace{1cm} Il est possible de colorier une rangée avec |\rowcolor| dans le
-|code-before| (ou avec |\rowcolor| de \pkg{colortbl} dans la première case de la
-rangée ). Les possibilités de réglages sont néanmoins limitées. C'est pourquoi
+|code-before| (ou avec |\rowcolor| dans la première case de la
+rangée). Les possibilités de réglages sont néanmoins limitées. C'est pourquoi
 nous présentons ici une autre méthode pour surligner une rangée de la matrice.
 Nous créons un nœud Tikz rectangulaire qui englobe les nœuds de la deuxième
 rangée en utilisant les outils de la bibliothèque Tikz \pkg{fit}. Ce nœud est
@@ -4098,29 +4098,7 @@
 \end{bNiceMatrix}\]
 
 
-\bigskip
-Ce code échoue avec |latex|-|dvips|-|ps2pdf| parce que Tikz pour |dvips|, pour
-le moment, ne prend pas en charge les \emph{blend modes}. Néanmoins, le code
-suivant, dans le préambule du document LaTeX, devrait activer les \emph{blend
-  modes} pour ce mode de compilation.
 
-
-\begin{scope} \small
-|\ExplSyntaxOn|
-
-|\makeatletter|
-
-|\tl_set:Nn \l_tmpa_tl {pgfsys-dvips.def}|
-
-|\tl_if_eq:NNT \l_tmpa_tl \pgfsysdriver|
-
-|  {\cs_set:Npn\pgfsys at blend@mode#1{\special{ps:~/\tl_upper_case:n #1~.setblendmode}}}|
-
-|\makeatother|
-
-|\ExplSyntaxOff|
-\end{scope}
-
 \vspace{1cm} On rappelle que dans le cas d'un ensemble de cases fusionnées (avec
 la commande |\Block|), un nœud Tikz est créé pour l'ensemble des cases avec pour
 nom $i$|-|$j$|-block| où $i$ et $j$ sont les numéros de ligne et de colonne de
@@ -4128,8 +4106,28 @@
 demandé la création des nœuds |medium|, alors un nœud de ce type est aussi créé
 pour ce bloc avec un nom suffixé par |-medium|.
 
+\medskip
+\begin{BVerbatim}[baseline=c,boxwidth=11.6cm]
+$\begin{pNiceMatrix}[margin,create-medium-nodes]
+  \Block{3-3}<\Large>{A} & & & 0 \\
+  & \hspace*{1cm} & & \Vdots \\
+  & & & 0 \\
+  0 & \Cdots& 0 & 0
+\CodeAfter
+  \tikz \node [~emphase#highlight = (1-1-block-medium)@] {} ;
+\end{pNiceMatrix}$
+\end{BVerbatim}
+$\begin{pNiceMatrix}[margin,create-medium-nodes]
+\Block{3-3}<\Large>{A} & & & 0 \\
+& \hspace*{1cm} & & \Vdots \\
+& & & 0 \\
+0 & \Cdots& 0 & 0
+\CodeAfter
+\tikz \node [highlight = (1-1-block-medium)] {} ;
+\end{pNiceMatrix}$
 
 
+
 \vspace{1cm}
 On considère maintenant la matrice suivante que l'on a appelée |exemple|.
 

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	2020-10-20 20:40:07 UTC (rev 56716)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx	2020-10-20 20:40:24 UTC (rev 56717)
@@ -15,8 +15,8 @@
 %
 % \fi
 % \iffalse
-\def\myfileversion{5.4}
-\def\myfiledate{2020/10/06}
+\def\myfileversion{5.5}
+\def\myfiledate{2020/10/20}
 %
 %
 %<*batchfile>
@@ -410,10 +410,10 @@
 % \end{minipage}
 % 
 % \bigskip
-% \colorbox{yellow!30}{\textbf{New 5.2}}\enskip It's also possible to use the
-% key |baseline| to align a matrix on an horizontal rule (drawn by |\hline|). In
-% this aim, one should give the value |line-|\textsl{i} where \textsl{i} is the
-% number of the row following the horizontal rule.
+% It's also possible to use the key |baseline| to align a matrix on an
+% horizontal rule (drawn by |\hline|). In this aim, one should give the value
+% |line-|\textsl{i} where \textsl{i} is the number of the row following the
+% horizontal rule.
 %
 % \smallskip
 % \begin{Verbatim}
@@ -510,7 +510,7 @@
 % \end{scope}
 %
 % \medskip
-% \colorbox{yellow!50}{\textbf{New 5.3}}\enskip It's possible to set the
+% \colorbox{yellow!30}{New 5.3}\enskip It's possible to set the
 % horizontal position of the block with one of the keys |l|, |c| and |r|.
 %
 %
@@ -565,7 +565,7 @@
 %
 % \subsection{The mono-column blocks}
 %
-% % \colorbox{yellow!50}{\textbf{New 5.4}}\enskip The mono-column blocks have a
+% % \colorbox{yellow!30}{New 5.4}\enskip The mono-column blocks have a
 % special behaviour.
 %
 % \begin{itemize}
@@ -691,8 +691,7 @@
 %
 %
 % \bigskip
-% \colorbox{yellow!30}{\textbf{New 5.2}}\enskip However, the vertical rules are
-% not drawn in the blocks.
+% However, the vertical rules are not drawn in the blocks.
 %
 % \bigskip
 % If you use \pkg{booktabs} (which provides |\toprule|, |\midrule|,
@@ -925,11 +924,10 @@
 % rectangles starting from the cell actually in the corner of the array.
 %
 % \bigskip
-% \colorbox{yellow!30}{\textbf{New 5.2}}\enskip It's possible to give as value to the
-% key |\hvlines-except-corners| a list of the corners to take into
-% consideration. The corners are designed by |NW|, |SW|, |NE| and |SE|
-% (\emph{north west}, \emph{south west}, \emph{north east} and \emph{south
-% east}).
+% It's possible to give as value to the key |\hvlines-except-corners| a list of
+% the corners to take into consideration. The corners are designed by |NW|,
+% |SW|, |NE| and |SE| (\emph{north west}, \emph{south west}, \emph{north east}
+% and \emph{south east}).
 %
 % \bigskip
 % \begin{BVerbatim}[boxwidth=11cm,baseline=c]
@@ -1243,9 +1241,9 @@
 % \end{scope}
 %
 % \bigskip
-% \colorbox{yellow!30}{\textbf{New 5.2}}\enskip There is a key |respect-blocks|
-% for the instruction |\rowcolors|. With that key, the ``rows'' alternately
-% colored may extend over several rows if they have to incorporate blocks.
+% There is a key |respect-blocks| for the instruction |\rowcolors|. With that
+% key, the ``rows'' alternately colored may extend over several rows if they
+% have to incorporate blocks.
 %
 % \medskip
 % \begin{scope}
@@ -2255,10 +2253,10 @@
 % \medskip
 % For the legibility of the code, an alternative syntax is provided: it's
 % possible to give the instructions of the |\code-after| at the end of the
-% environment, after the keyword |\CodeAfter|\footnote{In some circonstancies,
-% one must put |\omit \CodeAfter|. |\omit| is a keyword of TeX which cancels
-% the pattern of the current cell.}. For an example, cf.
-% p.~\pageref{example-CodeAfter}. 
+% environment, after the keyword |\CodeAfter| (for an example, cf.
+% p.~\pageref{example-CodeAfter}). \colorbox{yellow!50}{\textbf{New 5.5}}\enskip
+% Before the version 5.5, it was necessary, in some circonstancies, to put the
+% keyword |\omit| before |\CodeAfter|. Since version~5.5, one must never put~|\omit|.
 %
 % 
 % 
@@ -2358,8 +2356,8 @@
 % \item If the key |notes/para| is used, the notes are composed at the end of
 % the array in a single paragraph (as with the key |para| of \pkg{threeparttable}).
 %
-% \item \colorbox{yellow!50}{\textbf{New 5.4}}\enskip There is a key
-% |tabularnote| which provides a way to insert some texte in the zone of the
+% \item \colorbox{yellow!30}{New 5.4}\enskip There is a key
+% |tabularnote| which provides a way to insert some text in the zone of the
 % notes before the numbered tabular notes.
 %
 % \item If the package \pkg{booktabs} has been loaded (before or after
@@ -2580,16 +2578,15 @@
 %
 % If you wish to use the environment |{NiceTabular}| or |{NiceTabular*}| in an
 % environment |{threeparttable}| of the eponymous package, you have to patch the
-% environment |{threeparttable}| with the following code:
+% environment |{threeparttable}| with the following code (with a version of
+% LaTeX at least 2020/10/01).
 % \begin{Verbatim}[commandchars=\~\#\!]
 % \makeatletter
-% \AtBeginEnvironment{threeparttable}
+% \AddToHook{env/threeparttable/begin}
 %   {\TPT at hookin{NiceTabular}\TPT at hookin{NiceTabular*}}
 % \makeatother
 % \end{Verbatim}
 %
-% The command |\AtBeginEnvironment| is a command of the package \pkg{etoolbox}
-% which must have been loaded previously.
 %
 %
 % \section{Other features}
@@ -3286,7 +3283,7 @@
 % public and each variable with name beginning with |\g__nicematrix| or
 % |\l__nicematrix| is private.}: 
 % \begin{itemize}
-% \item \colorbox{yellow!30}{\textbf{New 5.2}}\enskip |\g_nicematrix_code_before_tl| ;
+% \item |\g_nicematrix_code_before_tl| ;
 % \item |\g_nicematrix_code_after_tl|.
 % \end{itemize}
 % 
@@ -3500,9 +3497,9 @@
 %
 % \end{scope}
 %
-% \colorbox{yellow!50}{\textbf{New 5.3}}\enskip It's possible to specify the
+% \colorbox{yellow!30}{New 5.3}\enskip It's possible to specify the
 % instruction |\Ddots| which will be drawn first (and which will be used to draw
-% the other diagonal dotted line when the parallelization is in force) with the
+% the other diagonal dotted lines when the parallelization is in force) with the
 % key |draw-first|: |\Ddots[draw-first]|.
 %
 % \subsection{The ``empty'' cells}
@@ -3990,7 +3987,7 @@
 %   a_{11} & a_{12} & a_{13} & a_{14} \\
 %   a_{21} & a_{22} & a_{23} & a_{24} \\
 %   a_{31} & a_{32} & a_{33} & a_{34} \\
-%   a_{41} & a_{42} & a_{43} & a_{44} 
+%   a_{41} & a_{42} & a_{43} & a_{44} \\
 % \CodeAfter
 %   \begin{tikzpicture}[~emphase#name suffix = -large@,
 %                       every node/.style = {draw,~emphase#inner sep = 0 pt@}]
@@ -4006,7 +4003,7 @@
 %   a_{11} & a_{12} & a_{13} & a_{14} \\
 %   a_{21} & a_{22} & a_{23} & a_{24} \\
 %   a_{31} & a_{32} & a_{33} & a_{34} \\
-%   a_{41} & a_{42} & a_{43} & a_{44} 
+%   a_{41} & a_{42} & a_{43} & a_{44} \\
 % \CodeAfter
 %   \begin{tikzpicture}[name suffix = -large,
 %                       every node/.style = {draw,inner sep = 0 pt}]
@@ -4066,28 +4063,7 @@
 % \end{bNiceMatrix}\]
 % 
 %
-% \bigskip
-% This code fails with |latex|-|dvips|-|ps2pdf| because Tikz for |dvips|, as for
-% now, doesn't support blend modes. However, the following code, in the
-% preamble, should activate blend modes in this way of compilation. 
 %
-%
-% \begin{scope} \small
-% |\ExplSyntaxOn|
-%
-% |\makeatletter|
-%
-% |\tl_set:Nn \l_tmpa_tl {pgfsys-dvips.def}|
-%
-% |\tl_if_eq:NNT \l_tmpa_tl \pgfsysdriver|
-%
-% |  {\cs_set:Npn\pgfsys at blend@mode#1{\special{ps:~/\tl_upper_case:n #1~.setblendmode}}}|
-%
-% |\makeatother|
-%
-% |\ExplSyntaxOff|
-% \end{scope}
-%
 % \vspace{1cm} 
 % We recall that, for a rectangle of merged cells (with the command |\Block|), a
 % Tikz node is created for the set of merged cells with the name
@@ -4431,21 +4407,6 @@
 \RequirePackage { xparse }
 %    \end{macrocode}
 %
-%    \begin{macrocode}
-\cs_set_eq:NN \box_use_drop_i:N \box_use_drop:N 
-\cs_set_eq:NN \box_use_drop_ii:N \box_use_drop:N 
-\cs_set_eq:NN \box_use_drop_iii:N \box_use_drop:N 
-\cs_set_eq:NN \box_use_drop_iv:N \box_use_drop:N 
-\cs_set_eq:NN \box_use_drop_v:N \box_use_drop:N 
-\cs_set_eq:NN \box_use_drop_vi:N \box_use_drop:N 
-\cs_set_eq:NN \box_use_drop_vii:N \box_use_drop:N 
-\cs_set_eq:NN \box_use_drop_viii:N \box_use_drop:N 
-\cs_set_eq:NN \box_use_drop_ix:N \box_use_drop:N 
-\cs_set_eq:NN \box_use_drop_x:N \box_use_drop:N 
-\cs_set_eq:NN \box_use_drop_xi:N \box_use_drop:N 
-\cs_set_eq:NN \box_use_drop_xii:N \box_use_drop:N 
-%    \end{macrocode}
-%
 % \bigskip
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_error:n { \msg_error:nn { nicematrix } }
@@ -6284,6 +6245,12 @@
 \cs_new_protected:Npn \@@_Cell:
   { 
 %    \end{macrocode}
+% At the beginning of the cell, we link |\CodeAfter| to a command which do
+% \emph{not} begin with |\omit| (whereas the standard version of |\CodeAfter|
+% begins with |\omit|).
+%    \begin{macrocode}
+    \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i:n
+%    \end{macrocode}
 % We increment |\c at jCol|, which is the counter of the columns. 
 %    \begin{macrocode}
     \int_gincr:N \c at jCol
@@ -6469,11 +6436,11 @@
 % \end{itemize}
 %    \begin{macrocode}
     \bool_if:NTF \g_@@_empty_cell_bool
-      { \box_use_drop_i:N \l_@@_cell_box }
+      { \box_use_drop:N \l_@@_cell_box }
       {
         \dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > \c_zero_dim
           \@@_node_for_the_cell:
-          { \box_use_drop_ii:N \l_@@_cell_box }
+          { \box_use_drop:N \l_@@_cell_box }
       }
     \bool_gset_false:N \g_@@_empty_cell_bool
   } 
@@ -6496,7 +6463,7 @@
     \pgfnode 
       { rectangle } 
       { base } 
-      { \box_use_drop_iii:N \l_@@_cell_box }
+      { \box_use_drop:N \l_@@_cell_box }
       { \@@_env: - \int_use:N \c at iRow - \int_use:N \c at jCol }
       { }
     \str_if_empty:NF \l_@@_name_str
@@ -6863,7 +6830,7 @@
     \cs_set_eq:NN \rotate \@@_rotate:
     \cs_set_eq:NN \OnlyMainNiceMatrix \@@_OnlyMainNiceMatrix:n
     \cs_set_eq:NN \dotfill \@@_old_dotfill:
-    \cs_set_eq:NN \CodeAfter \@@_CodeAfter:n
+    \cs_set_eq:NN \CodeAfter \@@_CodeAfter:
     \cs_set_eq:NN \diagbox \@@_diagbox:nn
     \bool_if:NT \l_@@_colortbl_like_bool \@@_colortbl_like:
     \bool_if:NT \l_@@_renew_dots_bool \@@_renew_dots:
@@ -7334,27 +7301,16 @@
     \int_compare:nNnT \l_@@_first_col_int = 0
       { 
         \skip_horizontal:N \col at sep
-        \dim_if_exist:cTF { g_@@_ block _ width _col _ 0 _ dim } 
-           {
-             \skip_horizontal:n
-               {
-                 \dim_max:nn
-                   { 
-                     \dim_use:c { g_@@_ block _ width _col _ 0 _ dim } 
-                     - 2 \col at sep
-                   }
-                 \g_@@_width_first_col_dim  
-               } 
-             \dim_gzero:c { g_@@_ block _ width _col _ 0 _ dim } 
-           }
-           { \skip_horizontal:N \g_@@_width_first_col_dim }
+        \skip_horizontal:N \g_@@_width_first_col_dim
       }
 %    \end{macrocode}
 %
 % The construction of the real box is different when |\l_@@_NiceArray_bool| is
 % true (|{NiceArray}| or |{NiceTabular}|) and in the other environments because,
-% in |{NiceArray}| or |{NiceTabular}|, we have no delimiter to put. We begin
-% with this case. 
+% in |{NiceArray}| or |{NiceTabular}|, we have no delimiter to put (but we have
+% tabular notes to put). We begin with this case. 
+%
+% Remark that, in all cases, |@@_use_arraybox_with_notes_c:| is used.
 %    \begin{macrocode}
     \bool_if:NTF \l_@@_NiceArray_bool
       { 
@@ -7447,29 +7403,15 @@
 %    \begin{macrocode}           
     \bool_if:NT \g_@@_last_col_found_bool 
       { 
-        \dim_if_exist:cTF 
-          { g_@@_ block _ width _col _  \int_use:N \g_@@_col_total_int _ dim } 
-          {
-            \skip_horizontal:n
-              {
-                \dim_max:nn
-                  { 
-                    \dim_use:c 
-                      { 
-                        g_@@_ block _ width _col _ 
-                        \int_use:N \g_@@_col_total_int  
-                        _ dim 
-                      } 
-                  }
-                  { \g_@@_width_first_col_dim + \col at sep }
-              } 
-          }
-          { 
-            \skip_horizontal:N \g_@@_width_last_col_dim 
-            \skip_horizontal:N \col at sep 
-          }
+        \skip_horizontal:N \g_@@_width_last_col_dim 
+        \skip_horizontal:N \col at sep 
       }
     \@@_after_array:
+%    \end{macrocode}
+% The aim of the following |\egroup| (the corresponding |\bgroup| is, of course,
+% at the beginning of the environment) is to be able to put an exposant to a matrix in
+% a mathematical formula.
+%    \begin{macrocode}
     \egroup 
     \bool_if:NT \c_@@_footnote_bool \endsavenotes 
   }
@@ -7476,7 +7418,7 @@
 %    \end{macrocode}
 % This is the end of the environment |{NiceArrayWithDelims}|.
 %
-%
+% \vspace{1cm}
 % \subsection*{We construct the preamble of the array}
 %
 % The transformation of the preamble is an operation in several steps.
@@ -7773,7 +7715,7 @@
             \hbox_set_end: 
             \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box:
             \@@_adjust_width_box:
-            \makebox [ #4 ] [ #3 ] { \box_use_drop_iv:N \l_@@_cell_box }   
+            \makebox [ #4 ] [ #3 ] { \box_use_drop:N \l_@@_cell_box }   
           }
       }
 %    \end{macrocode}
@@ -7855,7 +7797,7 @@
     \box_set_ht:Nn \l_tmpa_box { \box_ht:N \l_tmpa_box + \l_tmpa_dim } 
     \box_set_dp:Nn \l_tmpa_box { \box_dp:N \l_tmpa_box + \l_tmpb_dim } 
     \str_if_eq:VnTF \l_@@_baseline_str { c }
-      { \box_use_drop_v:N \l_tmpa_box } 
+      { \box_use_drop:N \l_tmpa_box } 
       \@@_put_box_in_flow_i:
   }
 %    \end{macrocode}
@@ -7913,78 +7855,98 @@
 % Now, |\g_tmpa_dim| contains the value of the $y$ translation we have to to.
 %    \begin{macrocode}
     \endpgfpicture
-    \box_move_up:nn \g_tmpa_dim { \box_use_drop_vi:N \l_tmpa_box } 
-    \box_use_drop_vii:N \l_tmpa_box 
+    \box_move_up:nn \g_tmpa_dim { \box_use_drop:N \l_tmpa_box } 
+    \box_use_drop:N \l_tmpa_box 
   }
 %    \end{macrocode}
 %
 % \bigskip
+% The following command is \emph{always} used by |{NiceArrayWithDelims}| (even
+% if, in fact, there is no tabular notes: in fact, it's not possible to know
+% whether there is or not before the composition of the blocks).
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_use_arraybox_with_notes_c:
   {
-    \bool_lazy_and:nnTF 
-      { \int_compare_p:nNn \c at tabularnote = 0 }
-      { \tl_if_empty_p:V \l_@@_tabularnote_tl }
-      { \box_use_drop_viii:N \l_@@_the_array_box }
-      {
-        \begin { minipage } { \box_wd:N \l_@@_the_array_box }
-        \box_use_drop_ix:N \l_@@_the_array_box
-        \skip_vertical:N 0.65ex 
 %    \end{macrocode}
+% 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 }
+    \box_use_drop:N \l_@@_the_array_box 
+%    \end{macrocode}
+% We have to draw the blocks right now because there may be tabular notes in
+% some blocks (which are not mono-column: the blocks which are mono-column
+% have been composed in boxes yet)... and we have to create (potentially) the
+% extra nodes before creating the blocks since there are |medium| nodes to create
+% for the blocks.
+%    \begin{macrocode}
+    \@@_create_extra_nodes:
+    \seq_if_empty:NF \g_@@_blocks_seq \@@_draw_blocks: 
+    \bool_lazy_or:nnT
+      { \int_compare_p:nNn \c at tabularnote > 0 }
+      { ! \tl_if_empty_p:V \l_@@_tabularnote_tl }
+      \@@_insert_tabularnotes:
+    \end { minipage }
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_insert_tabularnotes:
+  {
+    \skip_vertical:N 0.65ex 
+%    \end{macrocode}
 % The TeX group is for potential specifications in the
 % |\l_@@_notes_code_before_tl|. 
 %    \begin{macrocode}
-        \group_begin:
-        \l_@@_notes_code_before_tl
-        \tl_if_empty:NF \l_@@_tabularnote_tl { \l_@@_tabularnote_tl \par }
+    \group_begin:
+    \l_@@_notes_code_before_tl
+    \tl_if_empty:NF \l_@@_tabularnote_tl { \l_@@_tabularnote_tl \par }
 %    \end{macrocode}
 % We compose the tabular notes with a list of \pkg{enumitem}. The |\strut| and
 % the |\unskip| are designed to give the ability to put a |\bottomrule| at the
 % end of the notes with a good vertical space.
 %    \begin{macrocode}
-        \int_compare:nNnF \c at tabularnote = 0 
+    \int_compare:nNnT \c at tabularnote > 0 
+      {
+        \bool_if:NTF \l_@@_notes_para_bool
           {
-            \bool_if:NTF \l_@@_notes_para_bool
-              {
-                \begin { tabularnotes* }
-                  \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut 
-                \end { tabularnotes* }
+            \begin { tabularnotes* }
+              \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut 
+            \end { tabularnotes* }
 %    \end{macrocode}
 % The following |\par| is mandatory for the event that the user has put
 % |\footnotesize| (for example) in the |notes/code-before|.
 %    \begin{macrocode}
-                \par
-              }
-              {
-                \tabularnotes 
-                  \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut 
-                \endtabularnotes
-              }
+            \par
           }
-        \unskip
-        \group_end:
-        \bool_if:NT \l_@@_notes_bottomrule_bool
           {
-            \bool_if:NTF \c_@@_booktabs_loaded_bool
-              {
+            \tabularnotes 
+              \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut 
+            \endtabularnotes
+          }
+      }
+    \unskip
+    \group_end:
+    \bool_if:NT \l_@@_notes_bottomrule_bool
+      {
+        \bool_if:NTF \c_@@_booktabs_loaded_bool
+          {
 %    \end{macrocode}
 % The two dimensions |\aboverulesep| et |\heavyrulewidth| are parameters defined
 % by \pkg{booktabs}. 
 %    \begin{macrocode}
-                \skip_vertical:N \aboverulesep 
+            \skip_vertical:N \aboverulesep 
 %    \end{macrocode}
 % |\CT at arc@| is the specification of color defined by \pkg{colortbl} but you use it
 % even if \pkg{colortbl} is not loaded.
 %    \begin{macrocode}
-                { \CT at arc@ \hrule height \heavyrulewidth } 
-              }
-              { \@@_error:n { bottomule~without~booktabs } }
+            { \CT at arc@ \hrule height \heavyrulewidth } 
           }
-        \l_@@_notes_code_after_tl
-        \end { minipage }
-        \seq_gclear:N \g_@@_tabularnotes_seq
-        \int_gzero:N \c at tabularnote
+          { \@@_error:n { bottomule~without~booktabs } }
       }
+    \l_@@_notes_code_after_tl
+    \seq_gclear:N \g_@@_tabularnotes_seq
+    \int_gzero:N \c at tabularnote
   }
 %    \end{macrocode}
 % 
@@ -8007,12 +7969,12 @@
         \dim_gadd:Nn \g_tmpa_dim \g_@@_ht_row_zero_dim 
         \dim_gadd:Nn \g_tmpa_dim \g_@@_dp_row_zero_dim 
       }
-    \box_move_up:nn \g_tmpa_dim { \@@_use_arraybox_with_notes_c: } 
+    \box_move_up:nn \g_tmpa_dim { \hbox { \@@_use_arraybox_with_notes_c: } }
   }
 %    \end{macrocode}  
 %
 % \medskip
-% Now, the general case (hence the |g| in the name).
+% Now, the general case.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_use_arraybox_with_notes:
   {
@@ -8058,7 +8020,7 @@
         \dim_gadd:Nn \g_tmpa_dim \g_@@_ht_row_zero_dim 
         \dim_gadd:Nn \g_tmpa_dim \g_@@_dp_row_zero_dim 
       }
-    \box_move_up:nn \g_tmpa_dim { \@@_use_arraybox_with_notes_c: }  
+    \box_move_up:nn \g_tmpa_dim { \hbox { \@@_use_arraybox_with_notes_c: } }  
   }
 %    \end{macrocode}
 % 
@@ -8499,7 +8461,7 @@
           { 
             \dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > \c_zero_dim
               \@@_node_for_the_cell:
-              { \box_use_drop_x:N \l_@@_cell_box }
+              { \box_use_drop:N \l_@@_cell_box }
             \skip_horizontal:N \l_@@_left_delim_dim
             \skip_horizontal:N \l_@@_left_margin_dim 
             \skip_horizontal:N \l_@@_extra_left_margin_dim
@@ -8844,13 +8806,6 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-    \bool_if:nTF \l_@@_medium_nodes_bool
-      { 
-        \bool_if:NTF \l_@@_large_nodes_bool
-          \@@_create_medium_and_large_nodes:
-          \@@_create_medium_nodes:
-      }
-      { \bool_if:NT \l_@@_large_nodes_bool \@@_create_large_nodes: }
     \int_zero_new:N \l_@@_initial_i_int
     \int_zero_new:N \l_@@_initial_j_int
     \int_zero_new:N \l_@@_final_i_int
@@ -8913,15 +8868,7 @@
     \bool_if:NT \l_@@_vlines_bool \@@_draw_vlines: 
 %    \end{macrocode}
 %
-% \bigskip
-% We draw the blocks. We have to revert to a clean version of |\ialign| because
-% there may be tabulars in the |\Block| instructions that will be composed now. 
 %    \begin{macrocode}
-    \cs_set_eq:NN \ialign \@@_old_ialign:
-    \seq_if_empty:NF \g_@@_blocks_seq \@@_draw_blocks: 
-%    \end{macrocode}
-%   
-%    \begin{macrocode}
     \g_@@_internal_code_after_tl
     \tl_gclear:N \g_@@_internal_code_after_tl
 %    \end{macrocode}
@@ -9003,6 +8950,7 @@
 %    \end{macrocode}
 %
 % 
+% 
 % \bigskip
 % We recall that, when externalization is used, |\tikzpicture| and
 % |\endtikzpicture| (or |\pgfpicture| and |\endpgfpicture|) must be directly
@@ -11953,7 +11901,27 @@
 \cs_generate_variant:Nn \dim_max:nn { v n }
 %    \end{macrocode}
 %
+% 
 % \bigskip
+% The following command is called in |\@@_use_arraybox_with_notes_c:| just
+% before the construction of the blocks (if the creation of medium nodes is
+% required, medium nodes are also created for the blocks dans that construction
+% uses the standard medium nodes).
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_create_extra_nodes:
+  {
+    \bool_if:nTF \l_@@_medium_nodes_bool
+      { 
+        \bool_if:NTF \l_@@_large_nodes_bool
+          \@@_create_medium_and_large_nodes:
+          \@@_create_medium_nodes:
+      }
+      { \bool_if:NT \l_@@_large_nodes_bool \@@_create_large_nodes: }
+  }
+%    \end{macrocode}
+%
+%
+% \bigskip
 % We have three macros of creation of nodes: |\@@_create_medium_nodes:|,
 % |\@@_create_large_nodes:| and |\@@_create_medium_and_large_nodes:|. 
 %
@@ -12387,11 +12355,12 @@
           { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
           { 
 %    \end{macrocode}
-% The main aim of the following |\color_ensure_current:| is to retrieve in the
-% box a color specified for that column in the preamble (e.g. something like
-% |>{\color{red}}|). 
+% If the user has specified a color for the column in the preamble of the array,
+% we want to fix that color in the box we construct. We do that with 
+% |\set at color| and not |\color_ensure_current:| because that command seems to be
+% bugged: it doesn't work in XeLaTeX when \pkg{fontspec} is loaded.
 %    \begin{macrocode}
-            \color_ensure_current: 
+            \set at color
             \bool_if:NTF \l_@@_NiceTabular_bool
               { 
                 \group_begin:
@@ -12541,10 +12510,15 @@
 %
 % \bigskip
 % The command |\@@_draw_blocks:| will draw all the blocks. This command is used
-% after the construction of the array.
+% after the construction of the array. We have to revert to a clean version of
+% |\ialign| because there may be tabulars in the |\Block| instructions that will
+% be composed now.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_draw_blocks:
-  { \seq_map_inline:Nn \g_@@_blocks_seq { \@@_Block_iii:nnnnnn ##1 } }
+  { 
+    \cs_set_eq:NN \ialign \@@_old_ialign:
+    \seq_map_inline:Nn \g_@@_blocks_seq { \@@_Block_iii:nnnnnn ##1 } 
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -12787,7 +12761,7 @@
                     r { base~east } 
                   } 
               } 
-              { \box_use_drop_xi:N \l_@@_cell_box } { } { }
+              { \box_use_drop:N \l_@@_cell_box } { } { }
           }
 %    \end{macrocode}
 %
@@ -12828,7 +12802,7 @@
                     r { east } 
                   }
               } 
-              { \box_use_drop_xii:N \l_@@_cell_box } { } { }
+              { \box_use_drop:N \l_@@_cell_box } { } { }
           }   
         \endpgfpicture
       }
@@ -13060,21 +13034,34 @@
 % definition of the environment |{@@-light-syntax}| on
 % p.~\pageref{code-light-syntax}. 
 % 
-% The command |\CodeAfter| catches everything until the end of the current
-% environment (of \pkg{nicematrix}).
+% \medskip
+% In the environments of \pkg{nicematrix}, |\CodeAfter| will be linked to the
+% following command |\@@_CodeAfter:|. That macro must \emph{not} be protected
+% since it begins with |\omit|.
+%    \begin{macrocode}
+\cs_new:Npn \@@_CodeAfter: { \omit \@@_CodeAfter_i:n }
+%    \end{macrocode}
 %
-% First, we go until the next command |\end|. 
+% \medskip
+% However, in each cell of the environment, the command |\CodeAfter| will be
+% linked to the following command |\@@_CodeAfter_i:n| which do \emph{not} begins
+% with |\omit| (and thus, the user will be able to use |\CodeAfter| without
+% error and without the need to prefix by |\omit|.
+%
+% \smallskip
+% We have to catch everything until the end of the current environment (of
+% \pkg{nicematrix}). First, we go until the next command |\end|. 
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_CodeAfter:n #1 \end
+\cs_new_protected:Npn \@@_CodeAfter_i:n #1 \end
   {
     \tl_gput_right:Nn \g_nicematrix_code_after_tl { #1 }
-    \@@_CodeAfter_i:n
+    \@@_CodeAfter_ii:n
   }
 %    \end{macrocode}
 %
 % We catch the argument of the command |\end| (in |#1|).
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_CodeAfter_i:n #1
+\cs_new_protected:Npn \@@_CodeAfter_ii:n #1
   {
 %    \end{macrocode}
 % If this is really the end of the current environment (of \pkg{nicematrix}), we
@@ -13089,7 +13076,7 @@
 %    \begin{macrocode}
       { 
         \tl_gput_right:Nn \g_nicematrix_code_after_tl { \end { #1 } } 
-        \@@_CodeAfter:n
+        \@@_CodeAfter_i:n
       } 
   }
 %    \end{macrocode}
@@ -14217,7 +14204,14 @@
 % Key |tabularnote|.
 %
 % Different behaviour for the mono-column blocks.
-% 
+%
+% \subsection*{Changes between versions 5.3 and 5.4}
+%
+% The user must never put |\omit| before |\CodeAfter|.
+%
+% Correction of a bug: the tabular notes |\tabularnotes| were not composed when
+% present in a block (except a mono-column block).
+%  
 % \PrintIndex
 % 
 % \tableofcontents

Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2020-10-20 20:40:07 UTC (rev 56716)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2020-10-20 20:40:24 UTC (rev 56717)
@@ -18,8 +18,8 @@
 %% and version 1.3 or later is part of all distributions of
 %% LaTeX version 2005/12/01 or later.
 %% 
-\def\myfileversion{5.4}
-\def\myfiledate{2020/10/06}
+\def\myfileversion{5.5}
+\def\myfiledate{2020/10/20}
 
 \RequirePackage{pgfcore}
 \usepgfmodule{shapes}
@@ -32,18 +32,6 @@
 \RequirePackage { array }
 \RequirePackage { amsmath }
 \RequirePackage { xparse }
-\cs_set_eq:NN \box_use_drop_i:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_ii:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_iii:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_iv:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_v:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_vi:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_vii:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_viii:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_ix:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_x:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_xi:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_xii:N \box_use_drop:N
 \cs_new_protected:Npn \__nicematrix_error:n { \msg_error:nn { nicematrix } }
 \cs_new_protected:Npn \__nicematrix_error:nn { \msg_error:nnn { nicematrix } }
 \cs_new_protected:Npn \__nicematrix_error:nnn { \msg_error:nnnn { nicematrix } }
@@ -783,6 +771,7 @@
   }
 \cs_new_protected:Npn \__nicematrix_Cell:
   {
+    \cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter_i:n
     \int_gincr:N \c at jCol
     \int_compare:nNnT \c at jCol = 1
       { \int_compare:nNnT \l__nicematrix_first_col_int = 1 \__nicematrix_begin_of_row: }
@@ -882,11 +871,11 @@
       { \dim_max:nn \g__nicematrix_max_cell_width_dim { \box_wd:N \l__nicematrix_cell_box } }
     \__nicematrix_update_for_first_and_last_row:
     \bool_if:NTF \g__nicematrix_empty_cell_bool
-      { \box_use_drop_i:N \l__nicematrix_cell_box }
+      { \box_use_drop:N \l__nicematrix_cell_box }
       {
         \dim_compare:nNnTF { \box_wd:N \l__nicematrix_cell_box } > \c_zero_dim
           \__nicematrix_node_for_the_cell:
-          { \box_use_drop_ii:N \l__nicematrix_cell_box }
+          { \box_use_drop:N \l__nicematrix_cell_box }
       }
     \bool_gset_false:N \g__nicematrix_empty_cell_bool
   }
@@ -903,7 +892,7 @@
     \pgfnode
       { rectangle }
       { base }
-      { \box_use_drop_iii:N \l__nicematrix_cell_box }
+      { \box_use_drop:N \l__nicematrix_cell_box }
       { \__nicematrix_env: - \int_use:N \c at iRow - \int_use:N \c at jCol }
       { }
     \str_if_empty:NF \l__nicematrix_name_str
@@ -1081,7 +1070,7 @@
     \cs_set_eq:NN \rotate \__nicematrix_rotate:
     \cs_set_eq:NN \OnlyMainNiceMatrix \__nicematrix_OnlyMainNiceMatrix:n
     \cs_set_eq:NN \dotfill \__nicematrix_old_dotfill:
-    \cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter:n
+    \cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter:
     \cs_set_eq:NN \diagbox \__nicematrix_diagbox:nn
     \bool_if:NT \l__nicematrix_colortbl_like_bool \__nicematrix_colortbl_like:
     \bool_if:NT \l__nicematrix_renew_dots_bool \__nicematrix_renew_dots:
@@ -1308,20 +1297,7 @@
     \int_compare:nNnT \l__nicematrix_first_col_int = 0
       {
         \skip_horizontal:N \col at sep
-        \dim_if_exist:cTF { g__nicematrix_ block _ width _col _ 0 _ dim }
-           {
-             \skip_horizontal:n
-               {
-                 \dim_max:nn
-                   {
-                     \dim_use:c { g__nicematrix_ block _ width _col _ 0 _ dim }
-                     - 2 \col at sep
-                   }
-                 \g__nicematrix_width_first_col_dim
-               }
-             \dim_gzero:c { g__nicematrix_ block _ width _col _ 0 _ dim }
-           }
-           { \skip_horizontal:N \g__nicematrix_width_first_col_dim }
+        \skip_horizontal:N \g__nicematrix_width_first_col_dim
       }
     \bool_if:NTF \l__nicematrix_NiceArray_bool
       {
@@ -1375,27 +1351,8 @@
       }
     \bool_if:NT \g__nicematrix_last_col_found_bool
       {
-        \dim_if_exist:cTF
-          { g__nicematrix_ block _ width _col _  \int_use:N \g__nicematrix_col_total_int _ dim }
-          {
-            \skip_horizontal:n
-              {
-                \dim_max:nn
-                  {
-                    \dim_use:c
-                      {
-                        g__nicematrix_ block _ width _col _
-                        \int_use:N \g__nicematrix_col_total_int
-                        _ dim
-                      }
-                  }
-                  { \g__nicematrix_width_first_col_dim + \col at sep }
-              }
-          }
-          {
-            \skip_horizontal:N \g__nicematrix_width_last_col_dim
-            \skip_horizontal:N \col at sep
-          }
+        \skip_horizontal:N \g__nicematrix_width_last_col_dim
+        \skip_horizontal:N \col at sep
       }
     \__nicematrix_after_array:
     \egroup
@@ -1565,7 +1522,7 @@
             \hbox_set_end:
             \bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
             \__nicematrix_adjust_width_box:
-            \makebox [ #4 ] [ #3 ] { \box_use_drop_iv:N \l__nicematrix_cell_box }
+            \makebox [ #4 ] [ #3 ] { \box_use_drop:N \l__nicematrix_cell_box }
           }
       }
     \int_gincr:N \c at jCol
@@ -1608,7 +1565,7 @@
     \box_set_ht:Nn \l_tmpa_box { \box_ht:N \l_tmpa_box + \l_tmpa_dim }
     \box_set_dp:Nn \l_tmpa_box { \box_dp:N \l_tmpa_box + \l_tmpb_dim }
     \str_if_eq:VnTF \l__nicematrix_baseline_str { c }
-      { \box_use_drop_v:N \l_tmpa_box }
+      { \box_use_drop:N \l_tmpa_box }
       \__nicematrix_put_box_in_flow_i:
   }
 \cs_new_protected:Npn \__nicematrix_put_box_in_flow_i:
@@ -1649,53 +1606,56 @@
         }
       \dim_gsub:Nn \g_tmpa_dim \pgf at y
     \endpgfpicture
-    \box_move_up:nn \g_tmpa_dim { \box_use_drop_vi:N \l_tmpa_box }
-    \box_use_drop_vii:N \l_tmpa_box
+    \box_move_up:nn \g_tmpa_dim { \box_use_drop:N \l_tmpa_box }
+    \box_use_drop:N \l_tmpa_box
   }
 \cs_new_protected:Npn \__nicematrix_use_arraybox_with_notes_c:
   {
-    \bool_lazy_and:nnTF
-      { \int_compare_p:nNn \c at tabularnote = 0 }
-      { \tl_if_empty_p:V \l__nicematrix_tabularnote_tl }
-      { \box_use_drop_viii:N \l__nicematrix_the_array_box }
+    \begin { minipage } [ t ] { \box_wd:N \l__nicematrix_the_array_box }
+    \box_use_drop:N \l__nicematrix_the_array_box
+    \__nicematrix_create_extra_nodes:
+    \seq_if_empty:NF \g__nicematrix_blocks_seq \__nicematrix_draw_blocks:
+    \bool_lazy_or:nnT
+      { \int_compare_p:nNn \c at tabularnote > 0 }
+      { ! \tl_if_empty_p:V \l__nicematrix_tabularnote_tl }
+      \__nicematrix_insert_tabularnotes:
+    \end { minipage }
+  }
+\cs_new_protected:Npn \__nicematrix_insert_tabularnotes:
+  {
+    \skip_vertical:N 0.65ex
+    \group_begin:
+    \l__nicematrix_notes_code_before_tl
+    \tl_if_empty:NF \l__nicematrix_tabularnote_tl { \l__nicematrix_tabularnote_tl \par }
+    \int_compare:nNnT \c at tabularnote > 0
       {
-        \begin { minipage } { \box_wd:N \l__nicematrix_the_array_box }
-        \box_use_drop_ix:N \l__nicematrix_the_array_box
-        \skip_vertical:N 0.65ex
-        \group_begin:
-        \l__nicematrix_notes_code_before_tl
-        \tl_if_empty:NF \l__nicematrix_tabularnote_tl { \l__nicematrix_tabularnote_tl \par }
-        \int_compare:nNnF \c at tabularnote = 0
+        \bool_if:NTF \l__nicematrix_notes_para_bool
           {
-            \bool_if:NTF \l__nicematrix_notes_para_bool
-              {
-                \begin { tabularnotes* }
-                  \seq_map_inline:Nn \g__nicematrix_tabularnotes_seq { \item ##1 } \strut
-                \end { tabularnotes* }
-                \par
-              }
-              {
-                \tabularnotes
-                  \seq_map_inline:Nn \g__nicematrix_tabularnotes_seq { \item ##1 } \strut
-                \endtabularnotes
-              }
+            \begin { tabularnotes* }
+              \seq_map_inline:Nn \g__nicematrix_tabularnotes_seq { \item ##1 } \strut
+            \end { tabularnotes* }
+            \par
           }
-        \unskip
-        \group_end:
-        \bool_if:NT \l__nicematrix_notes_bottomrule_bool
           {
-            \bool_if:NTF \c__nicematrix_booktabs_loaded_bool
-              {
-                \skip_vertical:N \aboverulesep
-                { \CT at arc@ \hrule height \heavyrulewidth }
-              }
-              { \__nicematrix_error:n { bottomule~without~booktabs } }
+            \tabularnotes
+              \seq_map_inline:Nn \g__nicematrix_tabularnotes_seq { \item ##1 } \strut
+            \endtabularnotes
           }
-        \l__nicematrix_notes_code_after_tl
-        \end { minipage }
-        \seq_gclear:N \g__nicematrix_tabularnotes_seq
-        \int_gzero:N \c at tabularnote
       }
+    \unskip
+    \group_end:
+    \bool_if:NT \l__nicematrix_notes_bottomrule_bool
+      {
+        \bool_if:NTF \c__nicematrix_booktabs_loaded_bool
+          {
+            \skip_vertical:N \aboverulesep
+            { \CT at arc@ \hrule height \heavyrulewidth }
+          }
+          { \__nicematrix_error:n { bottomule~without~booktabs } }
+      }
+    \l__nicematrix_notes_code_after_tl
+    \seq_gclear:N \g__nicematrix_tabularnotes_seq
+    \int_gzero:N \c at tabularnote
   }
 \cs_new_protected:Npn \__nicematrix_use_arraybox_with_notes_b:
   {
@@ -1711,7 +1671,7 @@
         \dim_gadd:Nn \g_tmpa_dim \g__nicematrix_ht_row_zero_dim
         \dim_gadd:Nn \g_tmpa_dim \g__nicematrix_dp_row_zero_dim
       }
-    \box_move_up:nn \g_tmpa_dim { \__nicematrix_use_arraybox_with_notes_c: }
+    \box_move_up:nn \g_tmpa_dim { \hbox { \__nicematrix_use_arraybox_with_notes_c: } }
   }
 \cs_new_protected:Npn \__nicematrix_use_arraybox_with_notes:
   {
@@ -1750,7 +1710,7 @@
         \dim_gadd:Nn \g_tmpa_dim \g__nicematrix_ht_row_zero_dim
         \dim_gadd:Nn \g_tmpa_dim \g__nicematrix_dp_row_zero_dim
       }
-    \box_move_up:nn \g_tmpa_dim { \__nicematrix_use_arraybox_with_notes_c: }
+    \box_move_up:nn \g_tmpa_dim { \hbox { \__nicematrix_use_arraybox_with_notes_c: } }
   }
 \cs_new_protected:Npn \__nicematrix_put_box_in_flow_bis:nn #1 #2
   {
@@ -2023,7 +1983,7 @@
           {
             \dim_compare:nNnTF { \box_wd:N \l__nicematrix_cell_box } > \c_zero_dim
               \__nicematrix_node_for_the_cell:
-              { \box_use_drop_x:N \l__nicematrix_cell_box }
+              { \box_use_drop:N \l__nicematrix_cell_box }
             \skip_horizontal:N \l__nicematrix_left_delim_dim
             \skip_horizontal:N \l__nicematrix_left_margin_dim
             \skip_horizontal:N \l__nicematrix_extra_left_margin_dim
@@ -2223,13 +2183,6 @@
         \dim_gzero_new:N \g__nicematrix_delta_x_two_dim
         \dim_gzero_new:N \g__nicematrix_delta_y_two_dim
       }
-    \bool_if:nTF \l__nicematrix_medium_nodes_bool
-      {
-        \bool_if:NTF \l__nicematrix_large_nodes_bool
-          \__nicematrix_create_medium_and_large_nodes:
-          \__nicematrix_create_medium_nodes:
-      }
-      { \bool_if:NT \l__nicematrix_large_nodes_bool \__nicematrix_create_large_nodes: }
     \int_zero_new:N \l__nicematrix_initial_i_int
     \int_zero_new:N \l__nicematrix_initial_j_int
     \int_zero_new:N \l__nicematrix_final_i_int
@@ -2256,8 +2209,6 @@
       }
     \bool_if:NT \l__nicematrix_hlines_bool \__nicematrix_draw_hlines:
     \bool_if:NT \l__nicematrix_vlines_bool \__nicematrix_draw_vlines:
-    \cs_set_eq:NN \ialign \__nicematrix_old_ialign:
-    \seq_if_empty:NF \g__nicematrix_blocks_seq \__nicematrix_draw_blocks:
     \g__nicematrix_internal_code_after_tl
     \tl_gclear:N \g__nicematrix_internal_code_after_tl
     \bool_if:NT \c__nicematrix_tikz_loaded_bool
@@ -4108,6 +4059,16 @@
   }
 \cs_generate_variant:Nn \dim_min:nn { v n }
 \cs_generate_variant:Nn \dim_max:nn { v n }
+\cs_new_protected:Npn \__nicematrix_create_extra_nodes:
+  {
+    \bool_if:nTF \l__nicematrix_medium_nodes_bool
+      {
+        \bool_if:NTF \l__nicematrix_large_nodes_bool
+          \__nicematrix_create_medium_and_large_nodes:
+          \__nicematrix_create_medium_nodes:
+      }
+      { \bool_if:NT \l__nicematrix_large_nodes_bool \__nicematrix_create_large_nodes: }
+  }
 \cs_new_protected:Npn \__nicematrix_computations_for_medium_nodes:
   {
     \int_step_variable:nnNn \l__nicematrix_first_row_int \g__nicematrix_row_total_int \__nicematrix_i:
@@ -4336,7 +4297,7 @@
         \hbox_gset:cn
           { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
           {
-            \color_ensure_current:
+            \set at color
             \bool_if:NTF \l__nicematrix_NiceTabular_bool
               {
                 \group_begin:
@@ -4448,7 +4409,10 @@
     unknown .code:n = \__nicematrix_error:n { Unknown~key~for~Block }
   }
 \cs_new_protected:Npn \__nicematrix_draw_blocks:
-  { \seq_map_inline:Nn \g__nicematrix_blocks_seq { \__nicematrix_Block_iii:nnnnnn ##1 } }
+  {
+    \cs_set_eq:NN \ialign \__nicematrix_old_ialign:
+    \seq_map_inline:Nn \g__nicematrix_blocks_seq { \__nicematrix_Block_iii:nnnnnn ##1 }
+  }
 \cs_new_protected:Npn \__nicematrix_Block_iii:nnnnnn #1 #2 #3 #4 #5 #6
   {
     \group_begin:
@@ -4573,7 +4537,7 @@
                     r { base~east }
                   }
               }
-              { \box_use_drop_xi:N \l__nicematrix_cell_box } { } { }
+              { \box_use_drop:N \l__nicematrix_cell_box } { } { }
           }
           {
             \int_compare:nNnT \c at jCol = 0
@@ -4604,7 +4568,7 @@
                     r { east }
                   }
               }
-              { \box_use_drop_xii:N \l__nicematrix_cell_box } { } { }
+              { \box_use_drop:N \l__nicematrix_cell_box } { } { }
           }
         \endpgfpicture
       }
@@ -4743,18 +4707,19 @@
       { \__nicematrix_math_toggle_token: #6 \__nicematrix_math_toggle_token: } { } { }
     \endpgfpicture
   }
-\cs_new_protected:Npn \__nicematrix_CodeAfter:n #1 \end
+\cs_new:Npn \__nicematrix_CodeAfter: { \omit \__nicematrix_CodeAfter_i:n }
+\cs_new_protected:Npn \__nicematrix_CodeAfter_i:n #1 \end
   {
     \tl_gput_right:Nn \g_nicematrix_code_after_tl { #1 }
-    \__nicematrix_CodeAfter_i:n
+    \__nicematrix_CodeAfter_ii:n
   }
-\cs_new_protected:Npn \__nicematrix_CodeAfter_i:n #1
+\cs_new_protected:Npn \__nicematrix_CodeAfter_ii:n #1
   {
     \str_if_eq:eeTF \@currenvir { #1 }
       { \end { #1 } }
       {
         \tl_gput_right:Nn \g_nicematrix_code_after_tl { \end { #1 } }
-        \__nicematrix_CodeAfter:n
+        \__nicematrix_CodeAfter_i:n
       }
   }
 %% \medskip



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