texlive[55851] Master/texmf-dist: nicematrix (16jul20)

commits+karl at tug.org commits+karl at tug.org
Fri Jul 17 00:02:56 CEST 2020


Revision: 55851
          http://tug.org/svn/texlive?view=revision&revision=55851
Author:   karl
Date:     2020-07-17 00:02:56 +0200 (Fri, 17 Jul 2020)
Log Message:
-----------
nicematrix (16jul20)

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/source/latex/nicematrix/nicematrix.ins
    trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty

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

Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex	2020-07-16 22:02:41 UTC (rev 55850)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex	2020-07-16 22:02:56 UTC (rev 55851)
@@ -39,7 +39,6 @@
 \usepackage{footnote}
 \usepackage{booktabs}
 \usepackage{varwidth}
-
 \usepackage[hyperfootnotes = false]{hyperref}
 
 \hypersetup
@@ -66,7 +65,7 @@
 \VerbatimFootnotes
 
 \title{L'extension \pkg{nicematrix}
-       \thanks{Ce document correspond à la version~\myfileversion\space of \pkg{nicematrix},
+       \thanks{Ce document correspond à la version~\myfileversion\space de \pkg{nicematrix},
                en date du~\myfiledate.}} 
 \author{F. Pantigny \\ \texttt{fpantigny at wanadoo.fr}}
 
@@ -83,7 +82,7 @@
 \vspace{1cm}
 
 \hspace{1cm}
-$\begin{bNiceArray}{CCCC}[first-row,first-col,
+$\begin{bNiceArray}{cccc}[first-row,first-col,
                           code-for-first-col=\color{blue}\scriptstyle,
                           code-for-first-row=\color{blue}\scriptstyle,
                           columns-width = auto]
@@ -94,10 +93,10 @@
 L_n    & a_{n1}  & a_{n2}  & \Cdots  & a_{nn} 
 \end{bNiceArray}$
 \hspace{2cm}
-\begin{NiceTabular}[c]{LSSSS}%
+\begin{NiceTabular}[c]{lSSSS}%
 [code-before = \rowcolor{red!15}{1-2} \rowcolors{3}{blue!15}{}]
 \toprule
-\Block{2-1}{Produit} & \multicolumn{3}{C}{dimensions (cm)} & \Block{2-1}{\rotate Prix} \\
+\Block{2-1}{Produit} & \multicolumn{3}{c}{dimensions (cm)} & \Block{2-1}{\rotate Prix} \\
 \cmidrule(rl){2-4} 
  & L & l & h \\
 \midrule
@@ -144,6 +143,21 @@
 commande est le groupe TeX courant : elles sont semi-globales).
 
 
+\bigskip
+{\bfseries \color{red} Important
+
+Dans cette version 5.0 de \pkg{nicematrix}, on doit utiliser les lettres |l|, |c| et
+|r| dans les préambules des environnements et non plus les lettres |L|, |C| et
+|R|.
+
+Pour assurer la compatibilité avec les versions précédentes, \pkg{nicematrix}
+doit être chargée avec l'option |define-L-C-R|.
+\begin{Verbatim}
+\usepackage[define-L-C-R]{nicematrix}
+\end{Verbatim}
+}
+
+
 \newpage
 
 \section{Les environnements de cette extension} 
@@ -169,18 +183,10 @@
 l'extension \pkg{array} (qui est chargée par \pkg{nicematrix}).
 
 \medskip
-Il y a néanmoins quelques différences :
-\begin{itemize}
-\item Pour des raisons techniques, dans le préambule de ces environnements, l'utilisateur doit utiliser les lettres
-|L|, |C| et~|R|\footnote{Les types de colonnes |L|, |C| et |R| sont définis localement à l'intérieur de
-  |{NiceTabular}| ou |{NiceArray}| avec la commande |\newcolumntype| de \pkg{array}. Cette définition masque une
-  éventuelle définition précédente.} au lieu de |l|, |c| et |r|, y compris dans les commandes |\multicolumn| et
-dans les types de colonnes définis par |\newcolumntype|.
+Néanmoins, dans |{NiceArray}| (et ses variantes), les colonnes de type |w| (ex. : |wc{1cm}|) sont composées en mode
+mathématique alors que dans |{array}| de \pkg{array}, elles sont composées en
+mode texte.
 
-\item Dans |{NiceArray}| (et ses variantes), les colonnes de type |w| (ex. : |wc{1cm}|) sont composées en mode
-mathématique alors que dans |{array}| de \pkg{array}, elles sont composées en mode texte.
-\end{itemize}
-
 \medskip
 Les environnements |{pNiceArray}|, |{bNiceArray}|, etc. n'ont pas d'équivalents dans \pkg{array}.
 
@@ -193,8 +199,20 @@
 de la forme \textsl{clé=valeur}. {\bfseries Il doit n'y avoir aucun espace devant le crochet ouvrant (|[|) de cette
 liste d'options.}
 
+\bigskip
+\textbf{Important}
 
+Avant la version 5.0, il fallait, pour des raisons techniques, utiliser les
+lettres |L|, |C| et |R| au lieu de |l|, |c| et |r| dans les préambules des
+environnements de \pkg{nicematrix}.
 
+Pour pouvoir continuer à utiliser ces lettres |L|, |C| et |R|, \pkg{nicematrix}
+doit être chargé avec l'option |define-L-C-R|.
+\begin{Verbatim}
+\usepackage[define-L-C-R]{nicematrix}
+\end{Verbatim}
+
+
 \section{L'espace vertical entre les rangées}
 
 Il est bien connu que certaines rangées des tableaux créés par défault avec LaTeX sont trop proches l'une de
@@ -217,8 +235,9 @@
 clés |cell-space-top-limit| et |cell-space-bottom-limit| qui sont similaires aux deux paramètres
 |\cellspacetoplimit| et |\cellspacebottomlimit| proposés par \pkg{cellspace}. La valeur initiale de ces paramètres
 est $0$~pt pour que les environnements de \pkg{nicematrix} aient par défaut le même comportement que ceux de
-\pkg{array} et de l'\pkg{amsmth} mais une valeur de $1$~pt serait un bon choix. On conseille de régler leurs
-valeurs avec la commande |\NiceMatrixOptions|.
+\pkg{array} et de l'\pkg{amsmath} mais une valeur de $1$~pt serait un bon choix. On conseille de régler leurs
+valeurs avec la commande |\NiceMatrixOptions|.\footnote{On remarquera que ces paramètres s'appliquent aussi aux
+  colonnes de type |S| de \pkg{siunitx} alors que \pkg{cellspace} n'est pas utilisable avec ces colonnes.}
 
 \medskip
 \begin{Verbatim}
@@ -283,7 +302,7 @@
 \item un item
 \smallskip
 \item \renewcommand{\arraystretch}{1.2}
-$\begin{NiceArray}[t]{LCCCCCC}
+$\begin{NiceArray}[t]{lcccccc}
 \hline
 n   & 0 & 1 & 2 & 3 & 4  & 5 \\
 u_n & 1 & 2 & 4 & 8 & 16 & 32 
@@ -297,7 +316,7 @@
 \item un item
 \smallskip
 \item \renewcommand{\arraystretch}{1.2}
-$\begin{NiceArray}[t]{LCCCCCC}
+$\begin{NiceArray}[t]{lcccccc}
 \hline
 n   & 0 & 1 & 2 & 3 & 4  & 5  \\
 u_n & 1 & 2 & 4 & 8 & 16 & 32 \\
@@ -317,7 +336,7 @@
 \item an item
 \smallskip
 \item 
-$\begin{NiceArray}[t]{LCCCCCC}
+$\begin{NiceArray}[t]{lcccccc}
 ~emphase#\toprule@
 n   & 0 & 1 & 2 & 3 & 4  & 5 \\
 ~emphase#\midrule@
@@ -331,7 +350,7 @@
 \item an item
 \smallskip
 \item 
-$\begin{NiceArray}[t]{LCCCCCC}
+$\begin{NiceArray}[t]{lcccccc}
 \toprule
 n   & 0 & 1 & 2 & 3 & 4  & 5  \\
 \midrule
@@ -358,7 +377,7 @@
 
 \medskip
 \begin{BVerbatim}
-\begin{NiceTabular}{CCCC}
+\begin{NiceTabular}{cccc}
 rose      & tulipe & marguerite & dahlia \\
 violette  & ~emphase#\Block{2-2}{\LARGE\color{blue} fleurs}@  & & souci \\
 pervenche & & & lys \\
@@ -369,7 +388,7 @@
 
 \medskip
 \begin{center}
-\begin{NiceTabular}{CCCC}
+\begin{NiceTabular}{cccc}
 rose      & tulipe & marguerite & dahlia \\
 violette  & \Block{2-2}{\LARGE\color{blue} fleurs}  & & souci \\
 pervenche & & & lys \\
@@ -379,16 +398,17 @@
 
 
 \interitem
-On remarquera que les centrage horizontal du contenu des blocs est correct même si un espacement des colonnes a été
+On remarquera que le centrage horizontal du contenu des blocs est correct même si un espacement des colonnes a été
 demandé par une instruction comme |!{\qquad}| dans le préambule (ce n'est pas le cas avec |\multicolumn|). Dans
 l'exemple suivant, l'en-tête «Premier groupe» est correctement centré.
 
 \medskip
 \begin{center}
+\fvset{commandchars=\~\#\+}
 \begin{BVerbatim}
-\begin{NiceTabular}{C!{\qquad}CCC~emphase#!{\qquad}@CCC}
+\begin{NiceTabular}{@{}c!{\qquad}ccc~emphase#!{\qquad}+ccc~@{}}
 \toprule
-& ~emphase#\Block{1-3}{Premier groupe}@ & & & \Block{1-3}{Deuxième groupe} \\
+& ~emphase#\Block{1-3}{Premier groupe}+ & & & \Block{1-3}{Deuxième groupe} \\
 Rang & 1A & 1B & 1C & 2A & 2B & 2C \\
 \midrule
  1 & 0.657 & 0.913 & 0.733 & 0.830 & 0.387 & 0.893\\
@@ -402,7 +422,7 @@
 
 \bigskip
 \begin{center}
-\begin{NiceTabular}{C!{\qquad}CCC!{\qquad}CCC}
+\begin{NiceTabular}{@{}c!{\qquad}ccc!{\qquad}ccc@{}}
 \toprule
 & \Block{1-3}{Premier groupe} & & & \Block{1-3}{Deuxième groupe} \\
 Rang & 1A & 1B & 1C & 2A & 2B & 2C \\
@@ -421,7 +441,7 @@
 
 \medskip
 \begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-$\begin{bNiceArray}{CCC|C}[margin]
+$\begin{bNiceArray}{ccc|c}[margin]
 ~emphase#\Block{3-3}{A}@ & & & 0 \\
 & \hspace*{1cm} & & \Vdots \\
 & & & 0 \\
@@ -429,7 +449,7 @@
 0 & \Cdots& 0 & 0
 \end{bNiceArray}$
 \end{BVerbatim}
-$\begin{bNiceArray}{CCC|C}[margin]
+$\begin{bNiceArray}{ccc|c}[margin]
 \Block{3-3}{A} & & & 0 \\
 & \hspace*{1cm} & & \Vdots \\
 & & & 0 \\
@@ -445,7 +465,7 @@
 
 \medskip
 \begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-$\begin{bNiceArray}{CCC|C}[margin]
+$\begin{bNiceArray}{ccc|c}[margin]
 \Block{3-3}~emphase#<\LARGE>@{A} & & & 0 \\
 & \hspace*{1cm} & & \Vdots \\
 & & & 0 \\
@@ -453,7 +473,7 @@
 0 & \Cdots& 0 & 0
 \end{bNiceArray}$
 \end{BVerbatim}
-$\begin{bNiceArray}{CCC|C}[margin]
+$\begin{bNiceArray}{ccc|c}[margin]
 \Block{3-3}<\LARGE>{A} & & & 0 \\
 & \hspace*{1cm} & & \Vdots \\
 & & & 0 \\
@@ -484,7 +504,7 @@
 \begin{scope}
 \hfuzz=10cm
 \begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
-\begin{NiceTabular}{|CCC|}[~emphase#rules/color=[gray]{0.9},rules/width=1pt@]
+\begin{NiceTabular}{|ccc|}[~emphase#rules/color=[gray]{0.9},rules/width=1pt@]
 \hline
 rose & tulipe & lys \\
 arum & iris & violette \\
@@ -492,7 +512,7 @@
 \hline
 \end{NiceTabular}
 \end{BVerbatim}
-\begin{NiceTabular}{|CCC|}[rules/color=[gray]{0.9},rules/width=1pt]
+\begin{NiceTabular}{|ccc|}[rules/color=[gray]{0.9},rules/width=1pt]
 \hline
 rose & tulipe & lys \\
 arum & iris & violette \\
@@ -546,7 +566,7 @@
 \medskip
 \begin{BVerbatim}[baseline=c,boxwidth=10cm]
 \setlength{\arrayrulewidth}{2pt}
-\begin{NiceTabular}{CCCC} \hline
+\begin{NiceTabular}{cccc} \hline
 A&B&C&D \\ ~emphase#\cline{2-2}@
 A&B&C&D \\ \hline
 \end{NiceTabular}
@@ -554,7 +574,7 @@
 %
 \begin{scope}
 \setlength{\arrayrulewidth}{2pt}
-\begin{NiceTabular}[c]{CCCC}
+\begin{NiceTabular}[c]{cccc}
 \hline
 A&B&C&D \\
 \cline{2-2}
@@ -645,7 +665,7 @@
 
 \medskip
 \begin{Verbatim}
-\begin{NiceTabular}{CCCC}[~emphase#hvlines@,rules/color=blue,rules/width=1pt]
+\begin{NiceTabular}{cccc}[~emphase#hvlines@,rules/color=blue,rules/width=1pt]
 rose      & tulipe & marguerite & dahlia \\
 violette  & \Block{2-2}{\LARGE\color{blue} fleurs}  & & souci \\
 pervenche & & & lys \\
@@ -654,7 +674,7 @@
 \end{Verbatim}
 %
 \begin{center}
-\begin{NiceTabular}{CCCC}[hvlines,rules/color=blue,rules/width=1pt]
+\begin{NiceTabular}{cccc}[hvlines,rules/color=blue,rules/width=1pt]
 rose      & tulipe & marguerite & dahlia \\
 violette  & \Block{2-2}{\LARGE\color{blue} fleurs}  & & souci \\
 pervenche & & & lys \\
@@ -670,7 +690,7 @@
 
 \medskip
 \begin{Verbatim}
-\begin{NiceTabular}{*{6}{C}}[~emphase#hvlines-except-corners@,cell-space-top-limit=3pt]
+\begin{NiceTabular}{*{6}{c}}[~emphase#hvlines-except-corners@,cell-space-top-limit=3pt]
   &   &   &   & A \\
   &   & A & A & A \\
   &   &   & A \\
@@ -684,7 +704,7 @@
 \end{Verbatim}
 %
 \begin{center}
-\begin{NiceTabular}{*{6}{C}}[hvlines-except-corners,cell-space-top-limit=3pt]
+\begin{NiceTabular}{*{6}{c}}[hvlines-except-corners,cell-space-top-limit=3pt]
   &   &   &   & A \\
   &   & A & A & A \\
   &   &   & A \\
@@ -702,7 +722,7 @@
 
 \bigskip
 \begin{BVerbatim}[boxwidth=11cm,baseline=c]
-\begin{NiceTabular}{*{6}{C}}%
+\begin{NiceTabular}{*{6}{c}}%
   [~emphase#hvlines-except-corners@,cell-space-top-limit=3pt]
 1\\
 1&1\\
@@ -712,7 +732,7 @@
 1&5&10&10&5&1
 \end{NiceTabular}
 \end{BVerbatim}
-\begin{NiceTabular}{*{6}{C}}%
+\begin{NiceTabular}{*{6}{c}}%
   [c,hvlines-except-corners,cell-space-top-limit=3pt]
 1\\
 1&1\\
@@ -732,7 +752,7 @@
 
 \medskip
 \begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$\begin{NiceArray}{*{5}{C}}[hvlines]
+$\begin{NiceArray}{*{5}{c}}[hvlines]
 ~emphase#\diagbox{x}{y}@  & e & a & b & c \\
 e & e & a & b & c \\
 a & a & e & c & b \\
@@ -740,7 +760,7 @@
 c & c & b & a & e 
 \end{NiceArray}$
 \end{BVerbatim}
-$\begin{NiceArray}{*{5}{C}}[hvlines]
+$\begin{NiceArray}{*{5}{c}}[hvlines]
 \diagbox{x}{y}  & e & a & b & c \\
 e & e & a & b & c \\
 a & a & e & c & b \\
@@ -748,10 +768,11 @@
 c & c & b & a & e 
 \end{NiceArray}$
 
+\medskip
+Cette commande |\diagbox| peut aussi être utilisée dans un |\Block|.
 
 
 
-
 \subsection{Filets en pointillés}
 
 
@@ -782,13 +803,13 @@
 
 \medskip
 \begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
-\begin{pNiceArray}{CCCC~emphase#:@C}
+\begin{pNiceArray}{cccc~emphase#:@c}
 1 & 2 & 3 & 4 & 5 \\
 6 & 7 & 8 & 9 & 10 \\
 11 & 12 & 13 & 14 & 15 
 \end{pNiceArray}
 \end{BVerbatim}
-$\begin{pNiceArray}{CCCC:C}
+$\begin{pNiceArray}{cccc:c}
 1 & 2 & 3 & 4 & 5 \\
 6 & 7 & 8 & 9 & 10 \\
 11 & 12 & 13 & 14 & 15 
@@ -841,7 +862,7 @@
 \begin{scope}
 \hfuzz=10cm
 \begin{BVerbatim}[boxwidth=10cm,baseline=c]
-\begin{NiceTabular}{|C|C|C|}[code-before = ~emphase#\cellcolor{red!15}{3-1,2-2,1-3}@]
+\begin{NiceTabular}{|c|c|c|}[code-before = ~emphase#\cellcolor{red!15}{3-1,2-2,1-3}@]
 \hline
 a & b & c \\ \hline
 e & f & g \\ \hline
@@ -848,7 +869,7 @@
 h & i & j \\ \hline
 \end{NiceTabular}
 \end{BVerbatim}
-\begin{NiceTabular}{|C|C|C|}[code-before = \cellcolor{red!15}{3-1,2-2,1-3}]
+\begin{NiceTabular}{|c|c|c|}[code-before = \cellcolor{red!15}{3-1,2-2,1-3}]
 \hline
 a & b & c \\ \hline
 e & f & g \\ \hline
@@ -864,7 +885,7 @@
 \begin{scope}
 \hfuzz=10cm
 \begin{BVerbatim}[boxwidth=10cm,baseline=c]
-\begin{NiceTabular}{|C|C|C|}[code-before = ~emphase#\rectanglecolor{blue!15}{2-2}{3-3}@]
+\begin{NiceTabular}{|c|c|c|}[code-before = ~emphase#\rectanglecolor{blue!15}{2-2}{3-3}@]
 \hline
 a & b & c \\ \hline
 e & f & g \\ \hline
@@ -871,7 +892,7 @@
 h & i & j \\ \hline
 \end{NiceTabular}
 \end{BVerbatim}
-\begin{NiceTabular}{|C|C|C|}[code-before = \rectanglecolor{blue!15}{2-2}{3-3}]
+\begin{NiceTabular}{|c|c|c|}[code-before = \rectanglecolor{blue!15}{2-2}{3-3}]
 \hline
 a & b & c \\ \hline
 e & f & g \\ \hline
@@ -891,7 +912,7 @@
 \begin{scope}
 \hfuzz=10cm
 \begin{BVerbatim}[boxwidth=9cm,baseline=c]
-$\begin{NiceArray}{LLL}[hvlines, ~emphase#code-before = \rowcolor{red!15}{1,3-5,8-}@]
+$\begin{NiceArray}{lll}[hvlines, ~emphase#code-before = \rowcolor{red!15}{1,3-5,8-}@]
 a_1 & b_1 & c_1 \\
 a_2 & b_2 & c_2 \\
 a_3 & b_3 & c_3 \\
@@ -905,7 +926,7 @@
 \end{NiceArray}$
 \end{BVerbatim}
 %
-$\begin{NiceArray}{LLL}%
+$\begin{NiceArray}{lll}%
 [baseline=4,hvlines, code-before = \rowcolor{red!15}{1,3-5,8-}]
 a_1 & b_1 & c_1 \\
 a_2 & b_2 & c_2 \\
@@ -935,7 +956,7 @@
 \begin{scope}
 \hfuzz=10cm
 \begin{BVerbatim}[baseline=c,boxwidth=9cm]
-\begin{NiceTabular}{LR}[hlines,code-before = ~emphase#\rowcolors{1}{blue!10}{}@]
+\begin{NiceTabular}{lr}[hlines,code-before = ~emphase#\rowcolors{1}{blue!10}{}@]
 Pierre & 12 \\
 Jacques & 8 \\
 Stéphanie & 18 \\
@@ -944,7 +965,7 @@
 Estelle & 15 
 \end{NiceTabular}
 \end{BVerbatim}
-\begin{NiceTabular}{LR}[hlines,code-before = \rowcolors{1}{blue!10}{},baseline=3]
+\begin{NiceTabular}{lr}[hlines,code-before = \rowcolors{1}{blue!10}{},baseline=3]
 Pierre & 12 \\
 Jacques & 8 \\
 Stéphanie & 18 \\
@@ -964,7 +985,7 @@
 \begin{scope}
 \hfuzz=10cm
 \begin{BVerbatim}[baseline=c,boxwidth=9cm]
-$\begin{pNiceMatrix}[R,margin, ~emphase#code-before=\chessboardcolors{red!15}{blue!15}@]
+$\begin{pNiceMatrix}[r,margin, ~emphase#code-before=\chessboardcolors{red!15}{blue!15}@]
 1 & -1 & 1 \\
 -1 & 1 & -1 \\
 1 & -1 & 1 
@@ -971,7 +992,7 @@
 \end{pNiceMatrix}$
 \end{BVerbatim}
 $\begin{pNiceMatrix}%
-[baseline=1, R, margin, code-before = \chessboardcolors{red!15}{blue!15}]
+[baseline=1, r, margin, code-before = \chessboardcolors{red!15}{blue!15}]
 1 & -1 & 1 \\
 -1 & 1 & -1 \\
 1 & -1 & 1 
@@ -979,7 +1000,7 @@
 \end{scope}
 
 \medskip
-On a utilisé la clé |R| qui impose que toutes les colonnes soient alignées à droite (cf. p.~\pageref{key-R}).
+On a utilisé la clé |r| qui impose que toutes les colonnes soient alignées à droite (cf. p.~\pageref{key-R}).
 \end{itemize}
 
 \bigskip
@@ -990,7 +1011,7 @@
 \begin{scope}
 \hfuzz=10cm
 \begin{BVerbatim}[baseline=c,boxwidth=8.5cm]
-\begin{NiceTabular}{LSSSS}%
+\begin{NiceTabular}{lSSSS}%
 [code-before = \rowcolor{red!15}{1-2} \rowcolors{3}{blue!15}{}]
 ~emphase#\toprule@
 \Block{2-1}{Produit} \\
@@ -1007,7 +1028,7 @@
 ~emphase#\bottomrule@
 \end{NiceTabular}
 \end{BVerbatim}
-\begin{NiceTabular}[c]{LSSSS}%
+\begin{NiceTabular}[c]{lSSSS}%
 [code-before = \rowcolor{red!15}{1-2} \rowcolors{3}{blue!15}{}]
 \toprule
 \Block{2-1}{Produit} & 
@@ -1040,13 +1061,13 @@
 
 \medskip
 \begin{BVerbatim}[baseline=c,boxwidth=9cm]
-\begin{NiceTabular}{~emphase#Wc{2cm}@CC}[hvlines]
+\begin{NiceTabular}{~emphase#W{c}{2cm}@cc}[hvlines]
 Paris  & New York & Madrid \\
 Berlin & London   & Roma    \\
 Rio    & Tokyo    & Oslo 
 \end{NiceTabular}
 \end{BVerbatim}
-\begin{NiceTabular}{Wc{2cm}CC}[hvlines]
+\begin{NiceTabular}{W{c}{2cm}cc}[hvlines]
 Paris  & New York & Madrid \\
 Berlin & London   & Roma    \\
 Rio    & Tokyo    & Oslo 
@@ -1079,7 +1100,7 @@
 \bigskip
 Il est possible de donner la valeur spéciale |auto| à l'option |columns-width|: toutes les colonnes du tableau
 auront alors une largeur égale à la largeur de la case la plus large du tableau.\footnote{Le résultat est atteint
-  dès la première compilation (mais Tikz écrivant des informations dans le fichier |.aux|, un message demandant une
+  dès la première compilation (mais PGF/Tikz écrivant des informations dans le fichier |.aux|, un message demandant une
   deuxième compilation apparaîtra).}\par\nobreak
 
 \medskip
@@ -1238,7 +1259,7 @@
                    ~emphase#code-for-first-col@ = \color{blue},
                    ~emphase#code-for-last-row@ = \color{green},
                    ~emphase#code-for-last-col@ = \color{magenta}}
-$\begin{pNiceArray}{CC|CC}[first-row,last-row=6,first-col,last-col,nullify-dots]
+$\begin{pNiceArray}{cc|cc}[first-row,last-row=6,first-col,last-col,nullify-dots]
        & C_1    & \Cdots &        & C_4    &        \\
 L_1    & a_{11} & a_{12} & a_{13} & a_{14} & L_1    \\
 \Vdots & a_{21} & a_{22} & a_{23} & a_{24} & \Vdots \\
@@ -1255,14 +1276,14 @@
                    code-for-last-row = \color{green},
                    code-for-last-col = \color{magenta}}
 \begin{displaymath}
-\begin{pNiceArray}{CC|CC}[first-row,last-row=5,first-col,last-col,nullify-dots]
-       & C_1    & \multicolumn1C{\Cdots} &        & C_4    &        \\
+\begin{pNiceArray}{cc|cc}[first-row,last-row=5,first-col,last-col,nullify-dots]
+       & C_1    & \multicolumn1c{\Cdots} &        & C_4    &        \\
 L_1    & a_{11} & a_{12} & a_{13} & a_{14} & L_1    \\
 \Vdots & a_{21} & a_{22} & a_{23} & a_{24} & \Vdots \\
 \hline
        & a_{31} & a_{32} & a_{33} & a_{34} &        \\
 L_4    & a_{41} & a_{42} & a_{43} & a_{44} & L_4    \\
-       & C_1    & \multicolumn1C{\Cdots} &        & C_4    &     
+       & C_1    & \multicolumn1c{\Cdots} &        & C_4    &     
 \end{pNiceArray}
 \end{displaymath}
 \end{scope}
@@ -1717,31 +1738,22 @@
 par des cases reliées par des lignes pointillées.
 
 \medskip
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
-\NiceMatrixOptions{nullify-dots}
-$\begin{pNiceMatrix}[rules/color=gray,~emphase#hvlines@,margin]
-0      & \Cdots &  &   &        & 0      \\
-1      & \Cdots &  &   & 1      & 2      \\
-0      & \Ddots &  &   & \Vdots & \Vdots \\
-\Vdots & \Ddots &  &   &        &        \\
-       &        &  &   &        &        \\
-0      & \Cdots &  & 0 &  1     & 2      \\
-\end{pNiceMatrix}$
+\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+$\begin{bNiceMatrix}[margin,~emphase#hvlines@]
+\Block{3-3}<\LARGE>{A} & & & 0 \\
+& \hspace*{1cm} & & \Vdots \\
+& & & 0 \\
+0 & \Cdots& 0 & 0
+\end{bNiceMatrix}$
 \end{BVerbatim}
-\begin{scope}
-\NiceMatrixOptions{nullify-dots}
-$\begin{pNiceMatrix}[rules/color=gray,hvlines,margin]
-0      & \Cdots &  &   &        & 0      \\
-1      & \Cdots &  &   & 1      & 2      \\
-0      & \Ddots &  &   & \Vdots & \Vdots \\
-\Vdots & \Ddots &  &   &        &        \\
-       &        &  &   &        &        \\
-0      & \Cdots &  & 0 &  1     & 2      \\
-\end{pNiceMatrix}$
-\end{scope}
+$\begin{bNiceMatrix}[margin,hvlines]
+\Block{3-3}<\LARGE>{A} & & & 0 \\
+& \hspace*{1cm} & & \Vdots \\
+& & & 0 \\
+0 & \Cdots& 0 & 0
+\end{bNiceMatrix}$
 
 
-
 \section{Le code-after}
 
 \label{code-after}
@@ -1777,15 +1789,343 @@
 
 \medskip
 Pour améliorer la lisibilité du code, une syntaxe alternative est proposée : on peut spécifier les instructions du
-|code-after| à la fin de l'environnement, après le mot-clé |\CodeAfter|. Pour un exemple, voir page
+|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}.
 
+\section{Les notes dans les tableaux}
 
+\label{s:notes}
 
-\section{Autres fonctionnalités}
+\subsection{Les notes de pied de page}
 
+\smallskip
+L'extension \pkg{nicematrix} permet, en utilisant \pkg{footnote} ou bien
+\pkg{footnotehyper}, d'extraire les notes insérées avec |\footnote| dans un
+environnement de \pkg{nicematrix} pour les reporter en pied de page avec les
+autres notes du document.
 
+\smallskip
+Si \pkg{nicematrix} est chargée avec l'option |footnote| (avec
+|\usepackage[footnote]{nicematrix}| ou avec |\PassOptionsToPackage|),
+l'extension \pkg{footnote} est chargée (si elle ne l'est pas déjà) et elle est
+utilisée pour extraire les notes de pied de page.
 
+\smallskip
+Si \pkg{nicematrix} est chargée avec l'option |footnotehyper|, l'extension
+\pkg{footnotehyper} est chargée (si elle ne l'est pas déjà) et elle est utilisée
+pour extraire les notes de pied de page.
+
+\smallskip
+Attention : Les extensions \pkg{footnote} et \pkg{footnotehyper} sont
+incompatibles. L'extension \pkg{footnotehyper} est le successeur de l'extension
+\pkg{footnote} et devrait être utilisée préférentiellement. L'extension
+\pkg{footnote} a quelques défauts ; en particulier, elle doit être chargée après
+l'extension \pkg{xcolor} et elle n'est pas parfaitement compatible avec
+\pkg{hyperref}.
+
+
+
+\subsection{Les notes de tableaux}
+
+\label{tabularnote}
+
+L'extension \pkg{nicematrix} propose aussi une commande |\tabularnote| qui
+permet de spécifier des notes qui seront composées à la fin du tableau avec une
+longueur de ligne égale à la largeur du tableau (hors éventuelles colonnes
+extérieures). Sans surprise, cette commande n'est disponible que dans les
+environnements sans délimiteurs, c'est-à-dire |{NiceTabular}|, |{NiceArray}| et
+|{NiceMatrix}|. 
+
+En fait, cette commande n'est disponible que si l'extension \pkg{enumitem} a été
+chargée (avant ou après \pkg{nicematrix}). Les notes sont en effet composées en
+fin de tableau selon un type de liste défini par l'extension \pkg{enumitem}.
+
+\begin{scope}
+\fvset{commandchars=\~\#\!}
+\begin{Verbatim}
+\begin{NiceTabular}{@{}llr@{}}[first-row,code-for-first-row = \bfseries]
+\toprule
+Nom & Prénom & Date de naissance \\
+\midrule
+Achard~emphase#\tabularnote{La famille Achard est une très ancienne famille du Poitou.}!
+& Jacques & 5 juin 1962 \\
+Lefèbvre~emphase#\tabularnote{Le patronyme Lefèbvre est une altération de Lefébure.}!
+& Mathilde & 23 mai 1988 \\
+Vanesse & Stéphanie & 30 octobre 1994 \\
+Dupont & Chantal & 15 janvier 1998 \\
+\bottomrule
+\end{NiceTabular}
+\end{Verbatim}
+\end{scope}
+
+\begin{center}
+\begin{NiceTabular}{@{}llr@{}}[first-row,code-for-first-row = \bfseries]
+\toprule
+Nom & Prénom & Date de naissance \\
+\midrule
+Achard\tabularnote{La famille Achard est une très ancienne famille du Poitou.} 
+& Jacques & 5 juin 1962 \\
+Lefebvre\tabularnote{Le patronyme Lefebvre est une altération de Lefébure.} 
+& Mathilde & 23 mai 1988 \\
+Vanesse & Stéphanie & 30 octobre 1994 \\
+Dupont & Chantal & 15 janvier 1998 \\
+\bottomrule
+\end{NiceTabular}
+\end{center}
+
+
+\begin{table}
+\setlength{\belowcaptionskip}{1ex}
+\centering
+\caption{Utilisation de \texttt{\textbackslash tabularnote}\tabularnote{On peut
+    mettre une note dans le titre.}}
+\label{t:tabularnote}
+\begin{NiceTabular}{@{}llc@{}}[notes/bottomrule]
+\toprule
+Nom & Prénom & Durée de vie \\
+\midrule
+Barrère & Bertrand &  86\\
+Nightingale\tabularnote{Souvent considérée comme la première
+  infirmière.}\tabularnote{Surnommée «la Dame à la Lampe».}
+& Florence & 90 \\
+Schœlcher & Victor & 89\tabularnote{L'appel de note déborde à droite.}\\
+Touchet & Marie & 89 \\
+Wallis & John & 87 \\
+\bottomrule
+\end{NiceTabular}
+\end{table}
+
+
+\bigskip
+\begin{itemize}
+\item La commande |\tabularnote| est en fait utilisable avant
+l'environnement de \pkg{nicematrix}, le but étant de pouvoir l'utiliser sur le
+titre inséré par |\caption| dans un environnement |{table}| de LaTeX.
+
+\item Si plusieurs commandes |\tabularnote{...}| se suivent \emph{sans aucun espace
+  entre elles}, les appels de notes correspondants sont composés ensemble,
+séparés par une virgule.
+
+\item Si une commande |\tabularnote{...}| se trouve exactement à la fin d'une cellule
+(sans aucun espace après), l'appel de note est composé en débordement vers la
+droite (cela peut permettre de mieux conserver l'alignement des contenus d'une
+colonne).
+
+\item Si la clé |notes/para| est utilisée, les notes sont composées à la fin du
+tableau en un seul paragraphe.
+
+\item Si l'extension \pkg{booktabs} a été chargée (avant ou après
+\pkg{nicematrix}), la clé |notes/bottomrule| permet de faire tracer un
+|\bottomrule| de \pkg{booktabs} \emph{après} les notes.
+
+\item Il est possible de référencer une note de tableau (avec la commande
+|\label| placée après le |\tabularnote|).
+\end{itemize}
+%
+Voir sur la table \ref{t:tabularnote}, p.~\pageref{t:tabularnote}, certaines de ces
+remarques illustrées. Cette table a été composée avec le code suivant.
+
+\begin{center}
+\fvset{commandchars=\~\#\!}
+\begin{BVerbatim}[formatcom=\small\color{gray}]
+\begin{table}
+\setlength{\belowcaptionskip}{1ex}
+\centering
+\caption{Utilisation de \texttt{\textbackslash
+    tabularnote}~emphase#\tabularnote{On peut!
+     ~emphase# mettre une note dans le titre.}!}
+\label{t:tabularnote}
+\begin{NiceTabular}{@{}llc@{}}[~emphase#notes/bottomrule!]
+\toprule
+Nom & Prénom & Durée de vie \\
+\midrule
+Barrère & Bertrand &  86\\
+Nightingale~emphase#\tabularnote{Souvent considérée comme la première!
+  ~emphase#infirmière.}\tabularnote{Surnommée «la Dame à la Lampe».}!
+& Florence & 90 \\
+Schœlcher & Victor & 89~emphase#\tabularnote{L'appel de note déborde à droite.}!\\
+Touchet & Marie & 89 \\
+Wallis & John & 87 \\
+\bottomrule
+\end{NiceTabular}
+\end{table}
+\end{BVerbatim}
+\end{center}
+
+
+
+\subsection{Personnalisation des notes de tableau}
+
+
+Les notes de tableau peuvent être personnalisées grâce à un ensemble de clés disponibles dans
+|\NiceMatrixOptions|. Ces clés ont un nom préfixé par |notes| :
+\begin{itemize}
+\item |notes/para| 
+\item |notes/bottomrule| 
+\item |notes/style| 
+\item |notes/label-in-tabular| 
+\item |notes/label-in-list| 
+\item |notes/enumitem-keys| 
+\item |notes/enumitem-keys-para| 
+\item |notes/code-before|
+\end{itemize}
+Pour la commmodité, il est aussi possible de fixer ces clés dans
+|\NiceMatrixOptions| via une clé |notes| qui prend en argument une liste de
+paires \textsl{clé=valeur} où le nom des clés n'a plus à être préfixé par
+|notes|:
+\begin{center}
+\begin{BVerbatim}[formatcom = \small \color{gray}]
+\NiceMatrixOptions
+  {
+    notes = 
+     {
+       bottomrule ,
+       style = ... ,
+       label-in-tabular = ... ,
+       enumitem-keys = 
+        {
+          labelsep = ... ,
+          align = ... ,
+          ...
+        }
+     }
+  }
+\end{BVerbatim}
+\end{center}
+
+
+\bigskip
+On détaille maintenant ces clés.
+
+\begin{itemize}[itemsep=\medskipamount]
+\item La clé |notes/para| demande la composition des notes en fin de tableau en un seul
+paragraphe. 
+
+Valeur initiale : |false|
+
+Cette clé est également accessible dans un environnement individuel.
+
+\item La clé |notes/bottomrule| permet de faire tracer un |\bottomrule| de \pkg{booktabs}
+\emph{après} les notes. Ce trait n'est tracé que s'il y a effectivement des
+notes dans le tableau. L'extension \pkg{booktabs} doit avoir été chargée (avant
+ou après l'extension \pkg{nicematrix}). Dans le cas contraire, une erreur est générée.
+
+Valeur initiale : |false|
+
+Cette clé est également accessible dans un environnement individuel.
+
+\item La clé |notes/style| est une commande dont l'argument est spécifié par
+|#1| et qui indique le style de numérotation des notes. C'est ce style qui est
+utilisé par |\ref| pour faire référence à une note de tableau pour laquelle on a
+utilisé un |\label|. Ce sont les labels mis en forme avec ce style qui sont
+séparés par des virgules quand on utilise plusieurs commandes |\tabularnote|
+successivement. Le marqueur |#1| est censé correspondre à un nom de compteur
+LaTeX. 
+
+Valeur initiale : |\emph{\alph{#1}}|
+
+Une autre valeur possible pourrait être tout simplement |\arabic{#1}|
+
+\item La clé |notes/label-in-tabular| est une commande dont l'argument est
+spécifié par |#1| et qui sert au formatage de l'appel de note dans le tableau.
+En interne, le numéro de note a déjà été formaté par |notes/style| avant d'être
+passé en argument à cette commande.
+
+Valeur initiale : |\textsuperscript{#1}|
+
+Pour la composition du français, il est de tradition de mettre un petit espace
+avant l'appel de note. On peut faire ce réglage de la manière suivante :
+
+\begin{Verbatim}
+\NiceMatrixOptions{notes/label-in-tabular = \,\textsuperscript{~#1}}
+\end{Verbatim}
+
+
+\item La clé |notes/label-in-list| est une commande dont l'argument est
+spécifié par |#1| et qui sert au formatage du numéro de note dans la liste des
+notes en fin de tableau. En interne, le numéro de note a déjà été formaté par
+|notes/style| avant d'être passé en argument à cette commande.
+
+Valeur initiale : |\textsuperscript{#1}|
+
+Pour la composition du français, on ne compose pas les labels des notes en
+lettres supérieures dans la liste des notes. On pourra donc prendre le réglage
+suivant :
+\begin{Verbatim}
+\NiceMatrixOptions{notes/label-in-list = ~#1.\nobreak\hspace{0.25em}}
+\end{Verbatim}
+La commande |\nobreak| est pour le cas où l'option |para| est utilisée.
+
+
+
+\item Les notes sont composées en fin de tableau en utilisant en interne un
+style de liste de \pkg{enumitem}.
+
+La clé |notes/enumitem-keys| permet de spécifier une liste de paires
+\textsl{clé=valeur} (au format de \pkg{enumitem}) permettant de paramétrer ce
+type de liste.
+
+Valeur initiale :\quad |noitemsep , leftmargin = * , align = left , labelsep = 0pt|
+
+Cette valeur initiale contient la spécification |align = left| qui demande que
+le label de la note soit composé à gauche dans la boîte qui lui est dévolue.
+
+Ce réglage a l'avantage d'avoir les notes calées à gauche, ce qui est plaisant
+si on compose des tableaux dans l'esprit de \pkg{booktabs} (voir par exemple la
+table \ref{t:tabularnote}, p.~\pageref{t:tabularnote}).
+
+
+\item La clé |notes/enumitem-keys-para| est similaire à la précédente mais elle
+est utilisée pour le type de liste qui sera utilisé quand l'option |para| est
+choisie. Bien entendu, quand cette option |para| est active, c'est une liste de
+type |inline| (suivant le vocabulaire de \pkg{enumitem}) qui est utilisée et les
+paires \textsl{clé=valeur} doivent donc correspondre à une telle liste de type
+|inline|.
+
+Valeur initiale :\quad |afterlabel = \nobreak, itemjoin = \quad|
+
+
+\item La clé |notes/code-before| est une liste de tokens qui seront insérés
+avant la composition de la liste de notes.
+
+Valeur initiale : \textsl{vide}
+
+Si on souhaite, par exemple, que les notes soient composées en gris et en
+|\footnotesize|, c'est cette clé qu'il faut utiliser.
+\begin{Verbatim}
+\NiceMatrixOptions{notes/code-before = \footnotesize \color{gray}}
+\end{Verbatim}
+On peut aussi mettre dans cette clé |\raggedright| ou |\RaggedRight| (cette
+dernière est une commande de \pkg{ragged2e}).
+\end{itemize}
+
+
+
+\bigskip
+Pour un exemple de personnalisation des notes de tableau, voir p.~\pageref{ex:notes}.
+
+
+\subsection{Utilisation de \{NiceTabular\} avec threeparttable}
+
+
+Si vous souhaitez utiliser l'environnement |{NiceTabular}| dans un environnement
+|{threeparttable}| de l'extension éponyme, vous devez patcher l'environnement
+|{threeparttable}| avec le code suivant.
+\begin{Verbatim}[commandchars=\~\#\!]
+\makeatletter
+\AtBeginEnvironment{threeparttable}{\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}
+
 \subsection{Utilisation du type de colonne S de siunitx}
 
 Si l'extension \pkg{siunitx} est chargée (avant ou après \pkg{nicematrix}), il est possible d'utiliser les colonnes
@@ -1793,8 +2133,8 @@
 aucune macro privée de \pkg{siunitx}. 
 
 \medskip
-\begin{BVerbatim}[baseline = c, boxwidth = 10.5cm]
-$\begin{pNiceArray}{~emphase#S at CWc{1cm}C}[nullify-dots,first-row]
+\begin{BVerbatim}[baseline = c, boxwidth = 10.6cm]
+$\begin{pNiceArray}{~emphase#S at cW{c}{1cm}c}[nullify-dots,first-row]
 {C_1} & \Cdots &  & C_n \\
 2.3  & 0 & \Cdots & 0 \\
 12.4 & \Vdots & & \Vdots \\
@@ -1802,7 +2142,7 @@
 7.2  & 0 & \Cdots & 0 
 \end{pNiceArray}$
 \end{BVerbatim}
-$\begin{pNiceArray}{SCWc{1cm}C}[nullify-dots,first-row]
+$\begin{pNiceArray}{ScW{c}{1cm}c}[nullify-dots,first-row]
 {C_1} & \Cdots &  & C_n \\
 2.3  & 0 & \Cdots & 0 \\
 12.4 & \Vdots & & \Vdots \\
@@ -1824,12 +2164,12 @@
 
 \medskip
 \begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$\begin{bNiceMatrix}[R]
+$\begin{bNiceMatrix}[r]
 \cos x & - \sin x \\
 \sin x & \cos x 
 \end{bNiceMatrix}$
 \end{BVerbatim}
-$\begin{bNiceMatrix}[R]
+$\begin{bNiceMatrix}[r]
 \cos x & - \sin x \\
 \sin x & \cos x 
 \end{bNiceMatrix}$
@@ -1911,7 +2251,7 @@
 
 \bigskip
 \begin{Verbatim}
-$\begin{bNiceArray}{CCCC|C}[~emphase#small@, 
+$\begin{bNiceArray}{cccc|c}[~emphase#small@, 
                             last-col, 
                             code-for-last-col = \scriptscriptstyle, 
                             columns-width = 3mm ] 
@@ -1921,7 +2261,7 @@
 \end{bNiceArray}$
 \end{Verbatim}
 %
-\[\begin{bNiceArray}{CCCC|C}[small, last-col, code-for-last-col = \scriptscriptstyle, columns-width=3mm]
+\[\begin{bNiceArray}{cccc|c}[small, last-col, code-for-last-col = \scriptscriptstyle, columns-width=3mm]
 1 & -2 & 3 & 4 & 5 \\
 0 & 3  & 2 & 1 & 2 & L_2 \gets 2 L_1 - L_2 \\
 0 & 1  & 1 & 2 & 3 & L_3 \gets L_1 + L_3 
@@ -2054,7 +2394,7 @@
 \medskip
 \begin{BVerbatim}[baseline=c,boxwidth=11cm]
 $\begin{~emphase#NiceArrayWithDelims@}
-   {\downarrow}{\uparrow}{CCC}[margin]
+   {\downarrow}{\uparrow}{ccc}[margin]
 1 & 2 & 3 \\
 4 & 5 & 6 \\
 7 & 8 & 9 
@@ -2062,7 +2402,7 @@
 \end{BVerbatim}
 %
 $\begin{NiceArrayWithDelims}
-   {\downarrow}{\uparrow}{CCC}[margin]
+   {\downarrow}{\uparrow}{ccc}[margin]
 1 & 2 & 3 \\
 4 & 5 & 6 \\
 7 & 8 & 9 
@@ -2148,7 +2488,8 @@
 
 
 \bigskip
-Dans l'exemple suivant, nous avons surligné tous nœuds de la matrice (on explique plus loin la technique utilisée :
+Dans l'exemple suivant, nous avons surligné tous les nœuds de la matrice (on
+explique plus loin la technique utilisée : 
 cf. p. \pageref{highlight}).
 
 \[\begin{pNiceMatrix}
@@ -2250,8 +2591,9 @@
 l'espace des deux côtés du tableau et aussi de l'espace dans les «nœuds larges» de la première colonne et de la
 dernière colonne. Dans l'exemple suivant, nous avons 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| (par
-  défaut, 5~pt). Il existe aussi une option |margin| pour fixer à la fois |left-margin| et |right-margin|.}
+  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 option |margin| pour fixer à la fois
+  |left-margin| et |right-margin|.} 
 \[\begin{pNiceMatrix}[
  create-large-nodes,left-margin,right-margin,
  code-after = {\begin{tikzpicture}
@@ -2310,7 +2652,7 @@
 \medskip
 \begin{BVerbatim}
 \large
-\begin{NiceTabular}{wl{2cm}LL}[hvlines]
+\begin{NiceTabular}{wl{2cm}ll}[hvlines]
 fraise & amande & abricot \\
 prune & pêche & poire  \\[1ex]
 noix & noisette & brugnon
@@ -2320,7 +2662,7 @@
 \hspace{1cm}
 \begin{scope}
 \large
-\begin{NiceTabular}[c]{wl{2cm}LL}[hvlines]
+\begin{NiceTabular}[c]{wl{2cm}ll}[hvlines]
 fraise & amande & abricot \\
 prune & pêche & poire  \\[1ex]
 noix & noisette & brugnon
@@ -2334,7 +2676,7 @@
 \hspace{1.5cm}
 \begin{scope}
 \large
-\begin{NiceTabular}[c]{wl{2cm}LL}[hvlines,code-before = \chessboardcolors{red!15}{blue!15}]
+\begin{NiceTabular}[c]{wl{2cm}ll}[hvlines,code-before = \chessboardcolors{red!15}{blue!15}]
 fraise & amande & abricot \\
 prune & pêche & poire  \\[1ex]
 noix & noisette & brugnon
@@ -2349,7 +2691,7 @@
 \hspace{1.5cm}
 \begin{scope}
 \large
-\begin{NiceTabular}[c]{wl{2cm}LL}[hvlines,
+\begin{NiceTabular}[c]{w{l}{2cm}ll}[hvlines,
  create-large-nodes,
  code-after = {\begin{tikzpicture}
                   [every node/.style = {blend mode = multiply,
@@ -2385,7 +2727,7 @@
 (avec les noms |row-|$i$) et de chaque filet vertical (avec les noms |col-|$j$), comme décrit sur la figure
 ci-dessous. Ces nœuds sont accessibles dans le |code-before| et dans le |code-after|.
 \begin{center}
-\begin{NiceTabular}{CCC}[hvlines,rules/width=1pt,rules/color=gray]
+\begin{NiceTabular}{ccc}[hvlines,rules/width=1pt,rules/color=gray]
 rose & tulipe & lys \\
 arum & iris & violette \\
 muguet & dahlia & souci 
@@ -2481,7 +2823,7 @@
 \newcolumntype{?}{!{\OnlyMainNiceMatrix{\vrule width 1 pt}}}
 
 \begin{BVerbatim}[baseline = c, boxwidth = 10.5cm]
-$\begin{pNiceArray}{CC?CC}[first-row,last-row=3]
+$\begin{pNiceArray}{cc?cc}[first-row,last-row=3]
 C_1 & C_2 & C_3 & C_4 \\
 a & b & c & d \\
 e & f & g & h \\
@@ -2488,7 +2830,7 @@
 C_1 & C_2 & C_3 & C_4
 \end{pNiceArray}$
 \end{BVerbatim}
-$\begin{pNiceArray}{CC?CC}[first-row,last-row=3]
+$\begin{pNiceArray}{cc?cc}[first-row,last-row=3]
 C_1 & C_2 & C_3 & C_4 \\
 a & b & c & d \\
 e & f & g & h \\
@@ -2632,9 +2974,6 @@
 
 \subsection{Incompatibilités}
 
-L'extension \pkg{nicematrix} n'est pas compatible with \pkg{threeparttable}.
-
-\medskip
 L'extension \pkg{nicematrix} n'est pas parfaitement compatible avec l'extension \pkg{arydshln} (parce que cette
 extension redéfinit de nombreuses commandes internes de \pkg{array}).
 
@@ -2641,6 +2980,107 @@
 
 \section{Exemples}
 
+\subsection{Notes dans les tableaux}
+
+\label{ex:notes}
+
+Les outils de \pkg{nicematrix} pour les notes dans les tableaux ont été
+présentés à la partie \ref{s:notes} p.~\pageref{s:notes}.
+
+\bigskip
+Imaginons que l'on souhaite numéroter les notes de tableau (celles construites
+avec |\tabularnote|) avec des astérisques.\footnote{Bien entendu, il faut qu'il
+  y en ait très peu : trois paraît un maximum.}
+
+On commence par écrire une commande |\stars| similaire aux commandes classiques
+|\arabic|, |\alph|, |\Alph|, etc. mais qui produit un nombre d'astérisques égal
+à son argument.\footnote{Ou plutôt : à la valeur de son argument.}
+\begin{Verbatim}
+\ExplSyntaxOn
+\NewDocumentCommand ~emphase#\stars@ { m }
+  { \prg_replicate:nn { \value { ~#1 } } { $ \star $ } } 
+\ExplSyntaxOff
+\end{Verbatim}
+%
+Bien entendu, on change le style des notes avec la clé |notes/style|. Mais, il
+serait bon aussi de changer certains paramètres du type de liste (au sens de
+\pkg{enumitem}) utilisé pour composer les notes après le tableau. On demande de
+composer les labels avec une largeur égale à celle du plus grand des labels. Or,
+le label le plus large est bien entendu celui avec le maximum d'astéristiques.
+On connaît ce nombre : il est égal à |\value{tabularnote}| (car |tabularnote|
+est le compteur LaTeX utilisé par |\tabularnote| et il est donc égal à la fin au
+nombre total de notes dans le tableau). On utilise alors la clé |widest*| de 
+\pkg{enumitem} pour demander une largeur de label correspondante :
+|widest*=\value{tabularnote}|. 
+\begin{Verbatim}
+\NiceMatrixOptions 
+  {
+    notes = 
+     {
+       ~emphase#style = \stars{~#1} , @
+       ~emphase#enumitem-keys = @
+       ~emphase# { @
+       ~emphase#   widest* = \value{tabularnote} ,@
+       ~emphase#   align = right @
+       ~emphase# } @
+     }
+  }
+\end{Verbatim}
+
+
+
+\begin{scope}
+\ExplSyntaxOn
+\NewDocumentCommand \stars { m }
+  { \prg_replicate:nn { \value { #1 } } { $ \star $ } } 
+\NiceMatrixOptions 
+  {
+    notes = 
+     {
+       style = \stars{#1} ,
+       enumitem-keys = 
+        {
+          widest* = \value{tabularnote} ,
+          align = right 
+        }
+     }
+  }
+\ExplSyntaxOff
+\fvset{commandchars=\~\#\!}
+\begin{Verbatim}
+\begin{NiceTabular}{@{}llr@{}}[first-row,code-for-first-row = \bfseries]
+\toprule
+Nom & Prénom & Date de naissance \\
+\midrule
+Achard~emphase#\tabularnote{La famille Achard est une très ancienne famille du Poitou.}!
+& Jacques & 5 juin 1962 \\
+Lefèbvre~emphase#\tabularnote{Le patronyme Lefèbvre est une altération de Lefébure.}!
+& Mathilde & 23 mai 1988 \\
+Vanesse & Stéphanie & 30 octobre 1994 \\
+Dupont & Chantal & 15 janvier 1998 \\
+\bottomrule
+\end{NiceTabular}
+\end{Verbatim}
+
+\begin{center}
+\begin{NiceTabular}{@{}llr@{}}[first-row,code-for-first-row = \bfseries]
+\toprule
+Nom & Prénom & Date de naissance \\
+\midrule
+Achard\tabularnote{La famille Achard est une très ancienne famille du Poitou.} 
+& Jacques & 5 juin 1962 \\
+Lefebvre\tabularnote{Le patronyme Lefebvre est une altération de Lefébure.} 
+& Mathilde & 23 mai 1988 \\
+Vanesse & Stéphanie & 30 octobre 1994 \\
+Dupont & Chantal & 15 janvier 1998 \\
+\bottomrule
+\end{NiceTabular}
+\end{center}
+\end{scope}
+
+
+
+
 \subsection{Lignes en pointillés}
 
 
@@ -2698,7 +3138,7 @@
 \begin{BNiceMatrix}[nullify-dots]
 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\
 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\
-\Cdots &  & ~emphase#\multicolumn{6}{C}{10 \text{ autres lignes}}@ & \Cdots \\
+\Cdots &  & ~emphase#\multicolumn{6}{c}{10 \text{ autres lignes}}@ & \Cdots \\
 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10
 \end{BNiceMatrix}
 \end{BVerbatim}
@@ -2707,7 +3147,7 @@
 \[\begin{BNiceMatrix}[nullify-dots]
 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\
 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\
-\Cdots &  & \multicolumn{6}{C}{10 \text{ autres lignes}} & \Cdots \\
+\Cdots &  & \multicolumn{6}{c}{10 \text{ autres lignes}} & \Cdots \\
 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10
 \end{BNiceMatrix}\]
 
@@ -2742,7 +3182,7 @@
 \bigskip
 \begin{BVerbatim}
 \setlength{\extrarowheight}{1mm}
-\begin{vNiceArray}{CCCC:CCC}[columns-width=6mm]
+\begin{vNiceArray}{cccc:ccc}[columns-width=6mm]
 a_0   &      &&       &b_0    &      &     \\
 a_1   &\Ddots&&       &b_1    &\Ddots&     \\
 \Vdots&\Ddots&&       &\Vdots &\Ddots&b_0  \\
@@ -2757,7 +3197,7 @@
 
 \begin{scope}
 \setlength{\extrarowheight}{1mm}
-\[\begin{vNiceArray}{CCCC:CCC}[columns-width=6mm]
+\[\begin{vNiceArray}{cccc:ccc}[columns-width=6mm]
 a_0   &      &&       &b_0    &      &     \\
 a_1   &\Ddots&&       &b_1    &\Ddots&     \\
 \Vdots&\Ddots&&       &\Vdots &\Ddots&b_0  \\
@@ -2772,7 +3212,7 @@
 Un exemple avec un système linéaire:\par\nobreak 
 
 \begin{Verbatim}
-$\begin{pNiceArray}{*6C|C}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
+$\begin{pNiceArray}{*6c|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
 1      & 1 & 1 &\Cdots &   & 1      & 0      & \\
 0      & 1 & 0 &\Cdots &   & 0      &        & L_2 \gets L_2-L_1 \\
 0      & 0 & 1 &\Ddots &   & \Vdots &        & L_3 \gets L_3-L_1 \\
@@ -2783,7 +3223,7 @@
 \end{Verbatim}
 
 
-\[\begin{pNiceArray}{*6C|C}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
+\[\begin{pNiceArray}{*6c|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
 1      & 1 & 1 &\Cdots &   & 1      & 0      & \\
 0      & 1 & 0 &\Cdots &   & 0      &        & L_2 \gets L_2-L_1 \\
 0      & 0 & 1 &\Ddots &   & \Vdots &        & L_3 \gets L_3-L_1 \\
@@ -2842,7 +3282,7 @@
 \NiceMatrixOptions
  { last-col,code-for-last-col = \color{blue}\scriptstyle,light-syntax}
 \setlength{\extrarowheight}{1mm}
-$\begin{pNiceArray}{CCCC:C}
+$\begin{pNiceArray}{cccc:c}
   1  1  1   1   1 ;
   2  4  8  16   9 ;
   3  9 27  81  36 ;
@@ -2849,7 +3289,7 @@
   4 16 64 256 100 
 \end{pNiceArray}$
 \medskip
-$\begin{pNiceArray}{CCCC:C}
+$\begin{pNiceArray}{cccc:c}
   1  1  1   1  1 ;
   0  2  6  14  7        { L_2 \gets -2 L_1 + L_2 } ;
   0  6 24  78 33        { L_3 \gets -3 L_1 + L_3 } ;
@@ -2866,7 +3306,7 @@
 \NiceMatrixOptions{last-col,code-for-last-col = \color{blue}\scriptstyle,light-syntax}
 \setlength{\extrarowheight}{1mm}
 
-\enskip $\begin{pNiceArray}{CCCC:C}
+\enskip $\begin{pNiceArray}{cccc:c}
 1  1  1   1   1 ;
 2  4  8  16   9 ;
 3  9 27  81  36 ;
@@ -2875,7 +3315,7 @@
 
 \medskip
 
-\enskip $\begin{pNiceArray}{CCCC:C}
+\enskip $\begin{pNiceArray}{cccc:c}
 1  1  1   1  1 ;
 0  2  6  14  7 { L_2 \gets -2 L_1 + L_2 } ;
 0  6 24  78 33 { L_3 \gets -3 L_1 + L_3 } ;
@@ -2884,7 +3324,7 @@
 
 \medskip
 
-\enskip $\begin{pNiceArray}{CCCC:C}
+\enskip $\begin{pNiceArray}{cccc:c}
 1 1  1  1 1 ;
 0 1  3  7 \frac72    { L_2 \gets \frac12 L_2 } ;
 0 3 12 39 \frac{33}2 { L_3 \gets \frac12 L_3 } ;
@@ -2893,7 +3333,7 @@
 
 \medskip
 
-\enskip $\begin{pNiceArray}{CCCC:C}
+\enskip $\begin{pNiceArray}{cccc:c}
 1 1  1   1 1       ;
 0 1  3   7 \frac72 ;
 0 0  3  18 6        { L_3 \gets -3 L_2 + L_3 } ;
@@ -2902,7 +3342,7 @@
 
 \medskip
 
-\enskip $\begin{pNiceArray}{CCCC:C}
+\enskip $\begin{pNiceArray}{cccc:c}
 1 1  1   1 1       ;
 0 1  3   7 \frac72 ;
 0 0  1   6 2        { L_3 \gets \frac13 L_3 } ;
@@ -2911,7 +3351,7 @@
 
 \medskip
 
-\enskip $\begin{pNiceArray}{CCCC:C}
+\enskip $\begin{pNiceArray}{cccc:c}
 1 1 1  1 1       ;
 0 1 3  7 \frac72 ;
 0 0 1  6 2       ;
@@ -2948,7 +3388,7 @@
 \label{exemple-CodeAfter}
 
 \begin{Verbatim}
-$\begin{pNiceArray}{>{\strut}CCCC}[create-large-nodes,margin,extra-margin = 2pt]
+$\begin{pNiceArray}{>{\strut}cccc}[create-large-nodes,margin,extra-margin = 2pt]
   a_{11} & a_{12} & a_{13} & a_{14} \\
   a_{21} & a_{22} & a_{23} & a_{24} \\
   a_{31} & a_{32} & a_{33} & a_{34} \\
@@ -2964,7 +3404,7 @@
 \end{pNiceArray}$
 \end{Verbatim}
 %
-\[\begin{pNiceArray}{>{\strut}CCCC}[create-large-nodes,margin,extra-margin = 2pt]
+\[\begin{pNiceArray}{>{\strut}cccc}[create-large-nodes,margin,extra-margin = 2pt]
 a_{11} & a_{12} & a_{13} & a_{14} \\
 a_{21} & a_{22} & a_{23} & a_{24} \\
 a_{31} & a_{32} & a_{33} & a_{34} \\
@@ -3058,7 +3498,7 @@
 
 \medskip
 \begin{Verbatim}
-$\begin{pNiceArray}{CCC}[~emphase#name=exemple@,last-col,create-medium-nodes]
+$\begin{pNiceArray}{ccc}[~emphase#name=exemple@,last-col,create-medium-nodes]
 a & a + b & a + b + c & L_1 \\
 a & a     & a + b     & L_2 \\
 a & a     & a         & L_3
@@ -3065,7 +3505,7 @@
 \end{pNiceArray}$
 \end{Verbatim}
                           
-\[\begin{pNiceArray}{CCC}[last-col]
+\[\begin{pNiceArray}{ccc}[last-col]
 a & a + b & a + b + c & L_1 \\
 a & a     & a + b     & L_2 \\
 a & a     & a         & L_3
@@ -3105,7 +3545,7 @@
 \medskip
 On obtient la matrice suivante.
 
-\[\begin{pNiceArray}{CCC}[
+\[\begin{pNiceArray}{ccc}[
      last-col,
      code-after = {\begin{tikzpicture}[highlight/.style = {fill = red!15,
                                                            blend mode = multiply,
@@ -3134,7 +3574,7 @@
 \medskip
 On obtient la matrice suivante.
 
-\[\begin{pNiceArray}{CCC}[
+\[\begin{pNiceArray}{ccc}[
      last-col,
      create-medium-nodes,
      code-after = {\begin{tikzpicture}[highlight/.style = {fill = red!15,
@@ -3156,7 +3596,7 @@
 
 Dans l'exemple suivant, on utilise les «nœuds larges» pour surligner une zone de la matrice.\par\nobreak
 \begin{Verbatim}
-\begin{pNiceArray}{>{\strut}CCCC}[create-large-nodes,margin,extra-margin=2pt]
+\begin{pNiceArray}{>{\strut}cccc}[create-large-nodes,margin,extra-margin=2pt]
   A_{11} & A_{12} & A_{13} & A_{14} \\
   A_{21} & A_{22} & A_{23} & A_{24} \\
   A_{31} & A_{32} & A_{33} & A_{34} \\
@@ -3173,7 +3613,7 @@
 \end{Verbatim}
                              
 
-\[\begin{pNiceArray}{>{\strut}CCCC}[create-large-nodes,margin,extra-margin=2pt]
+\[\begin{pNiceArray}{>{\strut}cccc}[create-large-nodes,margin,extra-margin=2pt]
   A_{11} & A_{12} & A_{13} & A_{14} \\
   A_{21} & A_{22} & A_{23} & A_{24} \\
   A_{31} & A_{32} & A_{33} & A_{34} \\
@@ -3212,7 +3652,7 @@
 
 La matrice $B$ a une «première rangée» (pour $C_j$) d'où l'option |first-row|.
 \begin{Verbatim}
-\begin{bNiceArray}{C>{\strut}CCCC}[name=B,first-row]
+\begin{bNiceArray}{c>{\strut}cccc}[name=B,first-row]
        &          & ~emphase#C_j@                      \\
 b_{11} & \Cdots   & b_{1j} & \Cdots & b_{1n} \\
 \Vdots &          & \Vdots &        & \Vdots \\
@@ -3224,7 +3664,7 @@
 
 La matrice $A$ a une «première colonne» (pour $L_i$) d'où l'option |first-col|.
 \begin{Verbatim}
-\begin{bNiceArray}{CC>{\strut}CCC}[name=A,first-col]
+\begin{bNiceArray}{cc>{\strut}ccc}[name=A,first-col]
     & a_{11} & \Cdots &        &        & a_{1n} \\
     & \Vdots &        &        &        & \Vdots \\
 ~emphase#L_i@ & a_{i1} & \Cdots & a_{ik} & \Cdots & a_{in} \\
@@ -3236,7 +3676,7 @@
 
 Dans la matrice produit, on remarquera que les lignes en pointillés sont «semi-ouvertes».
 \begin{Verbatim}
-\begin{bNiceArray}{CC>{\strut}CCC}
+\begin{bNiceArray}{cc>{\strut}ccc}
        & &        & & \\
        & & \Vdots     \\
 \Cdots & & c_{ij}     \\
@@ -3257,11 +3697,12 @@
 \end{Verbatim}
 
 
+
 \begin{NiceMatrixBlock}[auto-columns-width]
 \NiceMatrixOptions{nullify-dots}
 $\begin{array}{cc}
 & 
-\begin{bNiceArray}{C>{\strut}CCCC}[name=B,first-row]
+\begin{bNiceArray}{c>{\strut}cccc}[name=B,first-row]
       &        & C_j \\
 b_{11} & \Cdots & b_{1j} & \Cdots & b_{1n} \\
 \Vdots &       & \Vdots &       & \Vdots \\
@@ -3269,7 +3710,7 @@
        &       & \Vdots \\
  b_{n1}  & \Cdots & b_{nj} & \Cdots & b_{nn} 
 \end{bNiceArray} \\ \\
-\begin{bNiceArray}{CC>{\strut}CCC}[name=A,first-col]
+\begin{bNiceArray}{cc>{\strut}ccc}[name=A,first-col]
     & a_{11} & \Cdots &  &  & a_{1n} \\
     & \Vdots &       &  &  & \Vdots \\
 L_i & a_{i1} & \Cdots & a_{ik} & \Cdots & a_{in} \\
@@ -3277,7 +3718,7 @@
     & a_{n1} & \Cdots &  &  & a_{nn} \\
 \end{bNiceArray}
 & 
-\begin{bNiceArray}{CC>{\strut}CCC}
+\begin{bNiceArray}{cc>{\strut}ccc}
        &  &        & & \\
        &  & \Vdots     \\
 \Cdots &  & c_{ij}      \\
@@ -3299,9 +3740,14 @@
 Le document |nicematrix.pdf| (fourni avec l'extension \pkg{nicematrix}) contient une traduction anglaise de la
 documentation ici présente, ainsi que le code source commenté et un historique des versions.
 
-
 \end{document}
 
+% Local Variables:
+% TeX-fold-mode: t
+% TeX-fold-preserve-comments: nil
+% flyspell-mode: true
+% fill-column: 80
+% End:
 
 
 

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-07-16 22:02:41 UTC (rev 55850)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx	2020-07-16 22:02:56 UTC (rev 55851)
@@ -15,8 +15,8 @@
 %
 % \fi
 % \iffalse
-\def\myfileversion{4.4}
-\def\myfiledate{2020/06/30}
+\def\myfileversion{5.0}
+\def\myfiledate{2020/07/15}
 %
 %
 %<*batchfile>
@@ -83,8 +83,7 @@
   \int_gset:Nn,\int_gset_eq:NN,\int_gzero:N,\int_gzero_new:N,\int_if_odd:nTF,
   \int_max:nn,\int_new:N,\int_set:Nn,\int_set_eq:NN,\int_step_inline:nnn,
   \int_step_variable:nNn,\int_step_variable:nnNn,\int_sub:Nn,\int_use:N,\int_zero:N,
-  \int_zero_new:N,\g_tmpa_int,\l_tmpa_int,\l_tmpb_int
-}
+  \int_zero_new:N,\g_tmpa_int,\l_tmpa_int,\l_tmpb_int}
 \DoNotIndex{\dim_abs:n,\dim_add:Nn,\dim_compare:nNnTF,\dim_compare_p:nNn,
 \dim_const:Nn,\dim_eval:n,\dim_gadd:Nn,\dim_gset:Nn,\dim_gset_eq:NN,
 \dim_gset:Nn,\dim_gset_eq:NN,\dim_gsub:Nn,\dim_gzero_new:N,\dim_max:nn,
@@ -129,7 +128,7 @@
 %
 % \vspace{1cm}
 % \hspace{1cm}
-% $\begin{bNiceArray}{CCCC}[first-row,first-col,
+% $\begin{bNiceArray}{cccc}[first-row,first-col,
 %                           code-for-first-col=\color{blue}\scriptstyle,
 %                           code-for-first-row=\color{blue}\scriptstyle,
 %                           columns-width = auto]
@@ -139,9 +138,9 @@
 % \Vdots & \Vdots & \Vdots & \Ddots & \Vdots\\
 % L_n    & a_{n1}  & a_{n2}  & \Cdots & a_{nn} 
 % \end{bNiceArray}$\hspace{2cm}
-% \begin{NiceTabular}{LSSSS}[code-before = \rowcolor{red!15}{1-2} \rowcolors{3}{blue!15}{}]
+% \begin{NiceTabular}{lSSSS}[code-before = \rowcolor{red!15}{1-2} \rowcolors{3}{blue!15}{}]
 % \toprule
-% \Block{2-1}{Product} & \multicolumn{3}{C}{dimensions (cm)} & \Block{2-1}{\rotate Price} \\
+% \Block{2-1}{Product} & \multicolumn{3}{c}{dimensions (cm)} & \Block{2-1}{\rotate Price} \\
 % \cmidrule(rl){2-4} 
 %  & L & l & h \\
 % \midrule
@@ -189,6 +188,20 @@
 % semi-global). 
 %
 %
+% \bigskip
+% {\bfseries \color{red} Important
+%
+% In this version 5.0 of \pkg{nicematrix}, one must use the letters |l|, |c| and
+% |r| in the preambles of the environments and no longer the letters |L|, |C| and
+% |R|.
+%
+% For sake of compatibility with the previous versions, there exists an option
+% |define-L-C-R| which must be used when loading \pkg{nicematrix}.
+% \begin{Verbatim}
+% \usepackage[define-L-C-R]{nicematrix}
+% \end{Verbatim}
+% }
+%
 % \newpage
 %
 % \section{The environments of this package} 
@@ -214,22 +227,11 @@
 % \medskip
 % The environments |{NiceArray}| and |{NiceTabular}| are similar to the
 % environments |{array}| and |{tabular}| of the package \pkg{array} (which is
-% loaded by \pkg{nicematrix} ).
+% loaded by \pkg{nicematrix}).
 %
-% \medskip
-% However, there are some small differences:
-% \begin{itemize}
-% \item For technical reasons, in the preamble of these environments, the user
-% must use the letters |L|, |C| and~|R|\footnote{The column types |L|, |C| and
-% |R| are defined locally inside |{NiceTabular}| or |{NiceArray}| with
-% |\newcolumntype| of \pkg{array}. This definition overrides an eventual
-% previous definition.} instead of |l|, |c| and |r|, included in the commands
-% |\multicolumn| and in the types of columns defined by |\newcolumntype|.
-% 
-% * In |{NiceArray}| (and its variants), the columns of type |w| (ex. :
+% However, in |{NiceArray}| (and its variants), the columns of type |w| (e.g.:
 % |wc{1cm}|) are composed in math mode whereas, in |{array}| of \pkg{array},
 % they are composed in text mode.
-% \end{itemize}
 %
 % \medskip
 % The environments |{pNiceArray}|, |{bNiceArray}|, etc. have no equivalent in
@@ -245,6 +247,18 @@
 % brackets, an optional list of \textsl{key=value} pairs. \textbf{There must be
 % no space before the opening bracket (|[|) of this list of options.}
 %
+%\bigskip
+% \textbf{Important}
+%
+% Before the version 5.0, it was mandatory to use, for technical reasons, the 
+% letters |L|, |C| et |R| instead of |l|, |c| et |r| in the preambles of the
+% environments of \pkg{nicematrix}. If we want to be able to go on using these
+% letters, \pkg{nicematrix} must be loaded with the option |define-L-C-R|.
+% \begin{Verbatim}
+% \usepackage[define-L-C-R]{nicematrix}
+% \end{Verbatim}
+%
+%
 % \section{The vertical space between the rows}
 %
 % It's well known that some rows of the arrays created by default with LaTeX
@@ -270,7 +284,9 @@
 % parameters is $0$~pt in order to have for the environments of \pkg{nicematrix}
 % the same behaviour as those of \pkg{array} and \pkg{amsmath}. However, a value
 % of $1$~pt would probably be a good choice and we suggest to set them with
-% |\NiceMatrixOptions|. 
+% |\NiceMatrixOptions|.\footnote{One should remark that these parameters apply
+% also to the columns of type |S| of \pkg{siunitx} whereas the package
+% \pkg{cellspace} is not able to act on such columns of type~|S|.}
 %
 % \medskip
 % \begin{Verbatim}
@@ -341,7 +357,7 @@
 % \item an item
 % \smallskip
 % \item \renewcommand{\arraystretch}{1.2}
-% $\begin{NiceArray}~emphase#[t]@{LCCCCCC}
+% $\begin{NiceArray}~emphase#[t]@{lcccccc}
 % \hline
 % n   & 0 & 1 & 2 & 3 & 4  & 5 \\
 % u_n & 1 & 2 & 4 & 8 & 16 & 32 
@@ -354,7 +370,7 @@
 % \item an item
 % \smallskip
 % \item \renewcommand{\arraystretch}{1.2}
-% $\begin{NiceArray}[t]{LCCCCCC}
+% $\begin{NiceArray}[t]{lcccccc}
 % \hline
 % n   & 0 & 1 & 2 & 3 & 4  & 5  \\
 % u_n & 1 & 2 & 4 & 8 & 16 & 32 \\
@@ -373,7 +389,7 @@
 % \item an item
 % \smallskip
 % \item 
-% $\begin{NiceArray}[t]{LCCCCCC}
+% $\begin{NiceArray}[t]{lcccccc}
 % ~emphase#\toprule@
 % n   & 0 & 1 & 2 & 3 & 4  & 5 \\
 % ~emphase#\midrule@
@@ -387,7 +403,7 @@
 % \item an item
 % \smallskip
 % \item 
-% $\begin{NiceArray}[t]{LCCCCCC}
+% $\begin{NiceArray}[t]{lcccccc}
 % \toprule
 % n   & 0 & 1 & 2 & 3 & 4  & 5  \\
 % \midrule
@@ -415,7 +431,7 @@
 %
 % \medskip
 % \begin{BVerbatim}
-% \begin{NiceTabular}{CCCC}
+% \begin{NiceTabular}{cccc}
 % rose      & tulipe & marguerite & dahlia \\
 % violette  & ~emphase#\Block{2-2}{\LARGE\color{blue} fleurs}@  & & souci \\
 % pervenche & & & lys \\
@@ -426,7 +442,7 @@
 %
 % \medskip
 % \begin{center}
-% \begin{NiceTabular}{CCCC}
+% \begin{NiceTabular}{cccc}
 % rose      & tulipe & marguerite & dahlia \\
 % violette  & \Block{2-2}{\LARGE\color{blue} fleurs}  & & souci \\
 % pervenche & & & lys \\
@@ -435,7 +451,7 @@
 % \end{center}
 %
 % \interitem
-% On should remark that the horizontal centering of the contents of the blocks
+% One should remark that the horizontal centering of the contents of the blocks
 % is correct even when an instruction such as |!{\qquad}| has been used in the
 % preamble of the array in order to increase the space between two columns (this
 % is not the case with |\multicolumn|). In the following example, the header
@@ -443,10 +459,11 @@
 %
 % \medskip
 % \begin{center}
+% \fvset{commandchars=\~\#\+}
 % \begin{BVerbatim}
-% \begin{NiceTabular}{C!{\qquad}CCC~emphase#!{\qquad}@CCC}
+% \begin{NiceTabular}{@{}c!{\qquad}ccc~emphase#!{\qquad}+ccc@{}}
 % \toprule
-% & ~emphase#\Block{1-3}{First group}@ & & & \Block{1-3}{Second group} \\
+% & ~emphase#\Block{1-3}{First group}+ & & & \Block{1-3}{Second group} \\
 % Rank & 1A & 1B & 1C & 2A & 2B & 2C \\
 % \midrule
 %  1 & 0.657 & 0.913 & 0.733 & 0.830 & 0.387 & 0.893\\
@@ -460,7 +477,7 @@
 %
 % \bigskip
 % \begin{center}
-% \begin{NiceTabular}{C!{\qquad}CCC!{\qquad}CCC}
+% \begin{NiceTabular}{@{}c!{\qquad}ccc!{\qquad}ccc@{}}
 % \toprule
 % & \Block{1-3}{First group} & & & \Block{1-3}{Second group} \\
 % Rank & 1A & 1B & 1C & 2A & 2B & 2C \\
@@ -481,7 +498,7 @@
 %
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-% $\begin{bNiceArray}{CCC|C}[margin]
+% $\begin{bNiceArray}{ccc|c}[margin]
 % ~emphase#\Block{3-3}{A}@ & & & 0 \\
 % & \hspace*{1cm} & & \Vdots \\
 % & & & 0 \\
@@ -489,7 +506,7 @@
 % 0 & \Cdots& 0 & 0
 % \end{bNiceArray}$
 % \end{BVerbatim}
-% $\begin{bNiceArray}{CCC|C}[margin]
+% $\begin{bNiceArray}{ccc|c}[margin]
 % \Block{3-3}{A} & & & 0 \\
 % & \hspace*{1cm} & & \Vdots \\
 % & & & 0 \\
@@ -507,7 +524,7 @@
 %
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-% $\begin{bNiceArray}{CCC|C}[margin]
+% $\begin{bNiceArray}{ccc|c}[margin]
 % \Block{3-3}~emphase#<\Large>@{A} & & & 0 \\
 % & \hspace*{1cm} & & \Vdots \\
 % & & & 0 \\
@@ -516,7 +533,7 @@
 % \end{bNiceArray}$
 % \end{BVerbatim}
 % \begin{scope}
-% $\begin{bNiceArray}{CCC|C}[margin]
+% $\begin{bNiceArray}{ccc|c}[margin]
 % \Block{3-3}<\Large>{A} & & & 0 \\
 % & \hspace*{1cm} & & \Vdots \\
 % & & & 0 \\
@@ -552,7 +569,7 @@
 % \begin{scope}
 % \hfuzz=10cm
 % \begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
-% \begin{NiceTabular}{|CCC|}[~emphase#rules/color=[gray]{0.9},rules/width=1pt@]
+% \begin{NiceTabular}{|ccc|}[~emphase#rules/color=[gray]{0.9},rules/width=1pt@]
 % \hline
 % rose & tulipe & lys \\
 % arum & iris & violette \\
@@ -560,7 +577,7 @@
 % \hline
 % \end{NiceTabular}
 % \end{BVerbatim}
-% \begin{NiceTabular}{|CCC|}[rules/color=[gray]{0.9},rules/width=1pt]
+% \begin{NiceTabular}{|ccc|}[rules/color=[gray]{0.9},rules/width=1pt]
 % \hline
 % rose & tulipe & lys \\
 % arum & iris & violette \\
@@ -614,7 +631,7 @@
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=10cm]
 % \setlength{\arrayrulewidth}{2pt}
-% \begin{NiceTabular}{CCCC} \hline
+% \begin{NiceTabular}{cccc} \hline
 % A&B&C&D \\ ~emphase#\cline{2-2}@
 % A&B&C&D \\ \hline
 % \end{NiceTabular}
@@ -621,7 +638,7 @@
 % \end{BVerbatim}
 % \begin{scope}
 % \setlength{\arrayrulewidth}{2pt}
-% \begin{NiceTabular}[c]{CCCC}
+% \begin{NiceTabular}[c]{cccc}
 % \hline
 % A&B&C&D \\
 % \cline{2-2}
@@ -711,7 +728,7 @@
 % \medskip
 % \begin{Verbatim}
 % \setlength{\arrayrulewidth}{1pt}
-% \begin{NiceTabular}{CCCC}[~emphase#hvlines@,rules/color=blue]
+% \begin{NiceTabular}{cccc}[~emphase#hvlines@,rules/color=blue]
 % rose      & tulipe & marguerite & dahlia \\
 % violette  & \Block{2-2}{\LARGE\color{blue} fleurs}  & & souci \\
 % pervenche & & & lys \\
@@ -721,7 +738,7 @@
 %
 % \begin{center}
 % \setlength{\arrayrulewidth}{1pt}
-% \begin{NiceTabular}{CCCC}[hvlines,rules/color=blue]
+% \begin{NiceTabular}{cccc}[hvlines,rules/color=blue]
 % rose      & tulipe & marguerite & dahlia \\
 % violette  & \Block{2-2}{\LARGE\color{blue} fleurs}  & & souci \\
 % pervenche & & & lys \\
@@ -737,7 +754,7 @@
 %
 % \medskip
 % \begin{Verbatim}
-% \begin{NiceTabular}{*{6}{C}}[~emphase#hvlines-except-corners@,cell-space-top-limit=3pt]
+% \begin{NiceTabular}{*{6}{c}}[~emphase#hvlines-except-corners@,cell-space-top-limit=3pt]
 %   &   &   &   & A \\
 %   &   & A & A & A \\
 %   &   &   & A \\
@@ -751,7 +768,7 @@
 % \end{Verbatim}
 % %
 % \begin{center}
-% \begin{NiceTabular}{*{6}{C}}[hvlines-except-corners,cell-space-top-limit=3pt]
+% \begin{NiceTabular}{*{6}{c}}[hvlines-except-corners,cell-space-top-limit=3pt]
 %   &   &   &   & A \\
 %   &   & A & A & A \\
 %   &   &   & A \\
@@ -769,7 +786,7 @@
 %
 % \bigskip
 % \begin{BVerbatim}[boxwidth=11cm,baseline=c]
-% \begin{NiceTabular}{*{6}{C}}%
+% \begin{NiceTabular}{*{6}{c}}%
 %   [~emphase#hvlines-except-corners@,cell-space-top-limit=3pt]
 % 1\\
 % 1&1\\
@@ -779,7 +796,7 @@
 % 1&5&10&10&5&1
 % \end{NiceTabular}
 % \end{BVerbatim}
-% \begin{NiceTabular}{*{6}{C}}[c,hvlines-except-corners,cell-space-top-limit=3pt]
+% \begin{NiceTabular}{*{6}{c}}[c,hvlines-except-corners,cell-space-top-limit=3pt]
 % 1\\
 % 1&1\\
 % 1&2&1\\
@@ -798,7 +815,7 @@
 %
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=10cm]
-% $\begin{NiceArray}{*{5}{C}}[hvlines]
+% $\begin{NiceArray}{*{5}{c}}[hvlines]
 % ~emphase#\diagbox{x}{y}@  & e & a & b & c \\
 % e & e & a & b & c \\
 % a & a & e & c & b \\
@@ -806,7 +823,7 @@
 % c & c & b & a & e 
 % \end{NiceArray}$
 % \end{BVerbatim}
-% $\begin{NiceArray}{*{5}{C}}[hvlines]
+% $\begin{NiceArray}{*{5}{c}}[hvlines]
 % \diagbox{x}{y}  & e & a & b & c \\
 % e & e & a & b & c \\
 % a & a & e & c & b \\
@@ -814,6 +831,8 @@
 % c & c & b & a & e 
 % \end{NiceArray}$
 %
+% \medskip
+% It's possible to use the command |\diagbox| in a |\Block|.
 %
 %
 % \subsection{Dotted rules}
@@ -848,13 +867,13 @@
 % 
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
-% \left(\begin{NiceArray}{CCCC~emphase#:@C}
+% \left(\begin{NiceArray}{cccc~emphase#:@c}
 % 1 & 2 & 3 & 4 & 5 \\
 % 6 & 7 & 8 & 9 & 10 \\
 % 11 & 12 & 13 & 14 & 15 
 % \end{NiceArray}\right)
 % \end{BVerbatim}
-% $\left(\begin{NiceArray}{CCCC:C}
+% $\left(\begin{NiceArray}{cccc:c}
 % 1 & 2 & 3 & 4 & 5 \\
 % 6 & 7 & 8 & 9 & 10 \\
 % 11 & 12 & 13 & 14 & 15 
@@ -896,7 +915,8 @@
 %
 % \medskip
 % These commands are independent of \pkg{colortbl}.\footnote{Thus, it's possible
-% to coloror the rules, the cells, the rows, the columns, etc. without loading \pkg{colortbl}.}
+% to color the rules, the cells, the rows, the columns, etc. without loading
+% \pkg{colortbl}.} 
 % 
 % \medskip
 % All these commands accept an optional argument (between square brackets and
@@ -916,7 +936,7 @@
 % \begin{scope}
 % \hfuzz=10cm
 % \begin{BVerbatim}[boxwidth=10cm,baseline=c]
-% \begin{NiceTabular}{|C|C|C|}[code-before =
+% \begin{NiceTabular}{|c|c|c|}[code-before =
 % ~emphase#\cellcolor{red!15}{3-1,2-2,1-3}@] 
 % \hline
 % a & b & c \\ \hline
@@ -924,7 +944,7 @@
 % h & i & j \\ \hline
 % \end{NiceTabular}
 % \end{BVerbatim}
-% \begin{NiceTabular}{|C|C|C|}[code-before =
+% \begin{NiceTabular}{|c|c|c|}[code-before =
 % \cellcolor{red!15}{3-1,2-2,1-3}]
 % \hline
 % a & b & c \\ \hline
@@ -942,7 +962,7 @@
 % \begin{scope}
 % \hfuzz=10cm
 % \begin{BVerbatim}[boxwidth=10cm,baseline=c]
-% \begin{NiceTabular}{|C|C|C|}[code-before =
+% \begin{NiceTabular}{|c|c|c|}[code-before =
 % ~emphase#\rectanglecolor{blue!15}{2-2}{3-3}@]
 % \hline
 % a & b & c \\ \hline
@@ -950,7 +970,7 @@
 % h & i & j \\ \hline
 % \end{NiceTabular}
 % \end{BVerbatim}
-% \begin{NiceTabular}{|C|C|C|}[code-before =
+% \begin{NiceTabular}{|c|c|c|}[code-before =
 % \rectanglecolor{blue!15}{2-2}{3-3}]
 % \hline
 % a & b & c \\ \hline
@@ -971,7 +991,7 @@
 % \begin{scope}
 % \hfuzz = 10cm
 % \begin{BVerbatim}[boxwidth=9cm,baseline=c]
-% $\begin{NiceArray}{LLL}[hvlines, ~emphase#code-before = \rowcolor{red!15}{1,3-5,8-}@]
+% $\begin{NiceArray}{lll}[hvlines, ~emphase#code-before = \rowcolor{red!15}{1,3-5,8-}@]
 % a_1 & b_1 & c_1 \\
 % a_2 & b_2 & c_2 \\
 % a_3 & b_3 & c_3 \\
@@ -984,7 +1004,7 @@
 % a_{10} & b_{10} & c_{10} \\
 % \end{NiceArray}$
 % \end{BVerbatim}
-% $\begin{NiceArray}{LLL}[baseline=4,hvlines, code-before = \rowcolor{red!15}{1,3-5,8-}]
+% $\begin{NiceArray}{lll}[baseline=4,hvlines, code-before = \rowcolor{red!15}{1,3-5,8-}]
 % a_1 & b_1 & c_1 \\
 % a_2 & b_2 & c_2 \\
 % a_3 & b_3 & c_3 \\
@@ -1001,7 +1021,7 @@
 %
 % \bigskip
 % \item The command |\columncolor| takes its name from the command
-% |\columncolor| of \pkg{colortbl}. Its syntax is similar to the syntaxe of
+% |\columncolor| of \pkg{colortbl}. Its syntax is similar to the syntax of
 % |\rowcolor|.
 % 
 % \bigskip
@@ -1017,7 +1037,7 @@
 % \begin{scope}
 % \hfuzz=10cm
 % \begin{BVerbatim}[baseline=c,boxwidth=9cm]
-% \begin{NiceTabular}{LR}[hlines,code-before = ~emphase#\rowcolors{1}{blue!10}{}@]
+% \begin{NiceTabular}{lr}[hlines,code-before = ~emphase#\rowcolors{1}{blue!10}{}@]
 % John & 12 \\
 % Stephen & 8 \\
 % Sarah & 18 \\
@@ -1026,7 +1046,7 @@
 % Madison & 15 
 % \end{NiceTabular}
 % \end{BVerbatim}
-% \begin{NiceTabular}{LR}[hlines,code-before = \rowcolors{1}{blue!10}{},baseline=3]
+% \begin{NiceTabular}{lr}[hlines,code-before = \rowcolors{1}{blue!10}{},baseline=3]
 % John & 12 \\
 % Stephen & 8 \\
 % Sarah & 18 \\
@@ -1044,13 +1064,13 @@
 % \begin{scope}
 % \hfuzz=10cm
 % \begin{BVerbatim}[baseline=c,boxwidth=9cm]
-% $\begin{pNiceMatrix}[R,margin, ~emphase#code-before=\chessboardcolors{red!15}{blue!15}@]
+% $\begin{pNiceMatrix}[r,margin, ~emphase#code-before=\chessboardcolors{red!15}{blue!15}@]
 % 1 & -1 & 1 \\
 % -1 & 1 & -1 \\
 % 1 & -1 & 1 
 % \end{pNiceMatrix}$
 % \end{BVerbatim}
-% $\begin{pNiceMatrix}[R,baseline=1, margin, code-before = \chessboardcolors{red!15}{blue!15}]
+% $\begin{pNiceMatrix}[r,baseline=1, margin, code-before = \chessboardcolors{red!15}{blue!15}]
 % 1 & -1 & 1 \\
 % -1 & 1 & -1 \\
 % 1 & -1 & 1 
@@ -1058,7 +1078,7 @@
 % \end{scope}
 % 
 % \medskip
-% We have used the key |R| which aligns all the columns rightwards (cf. p.~\pageref{key-R}).
+% We have used the key |r| which aligns all the columns rightwards (cf. p.~\pageref{key-R}).
 % \end{itemize}
 %
 %
@@ -1071,7 +1091,7 @@
 % \begin{scope}
 % \hfuzz=10cm
 % \begin{BVerbatim}[baseline=c,boxwidth=8.5cm]
-% \begin{NiceTabular}[c]{LSSSS}%
+% \begin{NiceTabular}[c]{lssss}%
 % [code-before = \rowcolor{red!15}{1-2} \rowcolors{3}{blue!15}{}]
 % ~emphase#\toprule@
 % \Block{2-1}{Product} \\
@@ -1088,7 +1108,7 @@
 % ~emphase#\bottomrule@
 % \end{NiceTabular}
 % \end{BVerbatim}
-% \begin{NiceTabular}[c]{LSSSS}[code-before = \rowcolor{red!15}{1-2} 
+% \begin{NiceTabular}[c]{lssss}[code-before = \rowcolor{red!15}{1-2} 
 % \rowcolors{3}{blue!15}{}]
 % \toprule
 % \Block{2-1}{Product} & 
@@ -1115,21 +1135,21 @@
 % In the environments with an explicit preamble (like |{NiceTabular}|,
 % |{NiceArray}|, etc.), it's possible to fix the width of a given column with
 % the standard letters |w| and |W| of the package \pkg{array}. In
-% |{NiceTabular}|, the cells of such columns are composed in texte mode but, in
+% |{NiceTabular}|, the cells of such columns are composed in text mode but, in
 % |{NiceArray}|, |{pNiceArray}|, etc., they are composed in math mode (whereas,
 % in |{array}| of \pkg{array}, they are composed in text mode).
 % 
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=9cm]
-% \begin{NiceTabular}{~emphase#Wc{2cm}@CC}[hvlines]
+% \begin{NiceTabular}{~emphase#Wc{2cm}@cc}[hvlines]
 % Paris  & New York & Madrid \\
-% Berlin & London   & Roma    \\
+% Berlin & London   & Roma   \\
 % Rio    & Tokyo    & Oslo 
 % \end{NiceTabular}
 % \end{BVerbatim}
-% \begin{NiceTabular}{Wc{2cm}CC}[hvlines]
+% \begin{NiceTabular}{Wc{2cm}cc}[hvlines]
 % Paris  & New York & Madrid \\
-% Berlin & London   & Roma    \\
+% Berlin & London   & Roma   \\
 % Rio    & Tokyo    & Oslo 
 % \end{NiceTabular}
 %
@@ -1160,10 +1180,10 @@
 %
 % \bigskip
 % It's possible to give the special value |auto| to the option |columns-width|:
-% all the columns of the array will have a width equal to the widest cell of 
-% the array.\footnote{The result is achieved with only one compilation (but Tikz
+% all the columns of the array will have a width equal to the widest cell of the
+% array.\footnote{The result is achieved with only one compilation (but PGF/Tikz
 % will have written informations in the |.aux| file and a message requiring a
-% second compilation will appear).}\par\nobreak 
+% second compilation will appear).}\par\nobreak
 %
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1285,11 +1305,11 @@
 %
 % \bigskip
 % We have several remarks to do.
-% \begin{itemize}
+% \begin{itemize}[beginpenalty=10000]
 % \item For the environments with an explicit preamble (i.e. |{NiceArray}| and
 % its variants), no letter must be given in that preamble for the potential
 % first column and the potential last column: they will automatically (and
-% necessarily) be of type |R| for the first column and |L| for the last one.
+% necessarily) be of type |r| for the first column and |l| for the last one.
 % \item One may wonder how \pkg{nicematrix} determines the number of rows and
 % columns which are needed for the composition of the ``last row'' and ``last
 % column''.
@@ -1328,7 +1348,7 @@
 %                    ~emphase#code-for-first-col@ = \color{blue},
 %                    ~emphase#code-for-last-row@ = \color{green},
 %                    ~emphase#code-for-last-col@ = \color{magenta}}
-% $\begin{pNiceArray}{CC|CC}[first-row,last-row=5,first-col,last-col,nullify-dots]
+% $\begin{pNiceArray}{cc|cc}[first-row,last-row=5,first-col,last-col,nullify-dots]
 %        & C_1    & \Cdots &        & C_4    &        \\
 % L_1    & a_{11} & a_{12} & a_{13} & a_{14} & L_1    \\
 % \Vdots & a_{21} & a_{22} & a_{23} & a_{24} & \Vdots \\
@@ -1345,14 +1365,14 @@
 %                    code-for-last-row = \color{green},
 %                    code-for-last-col = \color{magenta}}
 % \begin{displaymath}
-% \begin{pNiceArray}{CC|CC}[first-row,last-row=5,first-col,last-col,nullify-dots]
-%        & C_1    & \multicolumn1C{\Cdots} &        & C_4    &        \\
+% \begin{pNiceArray}{cc|cc}[first-row,last-row=5,first-col,last-col,nullify-dots]
+%        & C_1    & \multicolumn1c{\Cdots} &        & C_4    &        \\
 % L_1    & a_{11} & a_{12} & a_{13} & a_{14} & L_1    \\
 % \Vdots & a_{21} & a_{22} & a_{23} & a_{24} & \Vdots \\
 % \hline
 %        & a_{31} & a_{32} & a_{33} & a_{34} &        \\
 % L_4    & a_{41} & a_{42} & a_{43} & a_{44} & L_4    \\
-%        & C_1    & \multicolumn1C{\Cdots} &        & C_4    &     
+%        & C_1    & \multicolumn1c{\Cdots} &        & C_4    &     
 % \end{pNiceArray}
 % \end{displaymath}
 % \end{scope}
@@ -1360,8 +1380,8 @@
 %
 % \emph{Remarks}
 % \begin{itemize}[beginpenalty=10000]
-% \item As shown in the previous example, the horizontal and rules doesn't
-% extend in the exterior rows and columns.
+% \item As shown in the previous example, the horizontal and vertical rules
+% doesn't extend in the exterior rows and columns.
 % 
 % However, if one wishes to define new specifiers for columns in order to draw
 % vertical rules (for example thicker than the standard rules), he should
@@ -1830,28 +1850,20 @@
 % cells relied par dotted lines.
 %
 % \medskip
-% \begin{BVerbatim}[baseline=c,boxwidth=11cm]
-% \NiceMatrixOptions{nullify-dots}
-% $\begin{pNiceMatrix}[rules/color=gray,~emphase#hvlines@,margin]
-% 0      & \Cdots &  &   &        & 0      \\
-% 1      & \Cdots &  &   & 1      & 2      \\
-% 0      & \Ddots &  &   & \Vdots & \Vdots \\
-% \Vdots & \Ddots &  &   &        &        \\
-%        &        &  &   &        &        \\
-% 0      & \Cdots &  & 0 &  1     & 2      \\
-% \end{pNiceMatrix}$
+% \begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+% $\begin{bNiceMatrix}[margin,~emphase#hvlines@]
+% \Block{3-3}<\LARGE>{A} & & & 0 \\
+% & \hspace*{1cm} & & \Vdots \\
+% & & & 0 \\
+% 0 & \Cdots& 0 & 0
+% \end{bNiceMatrix}$
 % \end{BVerbatim}
-% \begin{scope}
-% \NiceMatrixOptions{nullify-dots}
-% $\begin{pNiceMatrix}[rules/color=gray,hvlines,margin]
-% 0      & \Cdots &  &   &        & 0      \\
-% 1      & \Cdots &  &   & 1      & 2      \\
-% 0      & \Ddots &  &   & \Vdots & \Vdots \\
-% \Vdots & \Ddots &  &   &        &        \\
-%        &        &  &   &        &        \\
-% 0      & \Cdots &  & 0 &  1     & 2      \\
-% \end{pNiceMatrix}$
-% \end{scope}
+% $\begin{bNiceMatrix}[margin,hvlines]
+% \Block{3-3}<\LARGE>{A} & & & 0 \\
+% & \hspace*{1cm} & & \Vdots \\
+% & & & 0 \\
+% 0 & \Cdots& 0 & 0
+% \end{bNiceMatrix}$
 % 
 %
 %
@@ -1858,7 +1870,7 @@
 % \section{The code-after}
 %
 % \label{code-after}
-% The option |code-after| may be used to give some code that will be excuted
+% The option |code-after| may be used to give some code that will be executed
 % after the construction of the matrix.\footnote{There is also a key
 % |code-before| described p.~\pageref{code-before}.}
 %
@@ -1866,7 +1878,7 @@
 % dotted lines between nodes. It takes two arguments for the two cells to rely,
 % both of the form $i$-$j$ where is the number of row and $j$ is the number of
 % column. It may be used, for example, to draw a dotted line
-% between two adjacents cells. \label{line-in-code-after}
+% between two adjacent cells. \label{line-in-code-after}
 %
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=11cm]
@@ -1889,14 +1901,337 @@
 % \end{scope}
 %
 % \medskip
-% For the readability of the code, an alternative syntax is provided: it's
+% 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|. For an example, cf.
+% 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}. 
 %
 % 
 % 
+% \section{The notes in the tabulars}
+%
+% \label{s:notes}
+%
+% \subsection{The footnotes}
+%
+% \smallskip
+% The package \pkg{nicematrix} allows, by using \pkg{footnote} or
+% \pkg{footnotehyper}, the extraction of the notes inserted by |\footnote| in
+% the environments of \pkg{nicematrix} and their composition in the footpage
+% with the other notes of the document.
+%
+% \smallskip
+%
+% \smallskip
+% If \pkg{nicematrix} is loaded with the option |footnote| (with
+% |\usepackage[footnote]{nicematrix}| or with |\PassOptionsToPackage|), the
+% package \pkg{footnote} is loaded (if it is not yet loaded) and it is used to
+% extract the footnotes.
+%
+% \smallskip
+% If \pkg{nicematrix} is loaded with the option |footnotehyper|, the package
+% \pkg{footnotehyper} is loaded (if it is not yet loaded) ant it is used to
+% extract footnotes.
+%
+% \smallskip
+% Caution: The packages \pkg{footnote} and \pkg{footnotehyper} are incompatible.
+% The package \pkg{footnotehyper} is the successor of the package \pkg{footnote}
+% and should be used preferently. The package \pkg{footnote} has some drawbacks,
+% in particular: it must be loaded after the package \pkg{xcolor} and it is not
+% perfectly compatible with \pkg{hyperref}.
+%
+%
+% \subsection{The notes of tabular}
+%
+% The package \pkg{nicematrix} also provides a command |\tabularnote| which gives
+% the ability to specify notes that will be composed at the end of the array
+% with a width of line equal to the width of the array (excepted the potential
+% exterior columns). With no surprise, that command is available only in the
+% environments without delimiters, that is to say |{NiceTabular}|, |{NiceArray}|
+% and |{NiceMatrix}|.
+%
+% In fact, this command is available only if the extension \pkg{enumitem} has
+% been loaded (before or after \pkg{nicematrix}). Indeed, the notes are composed
+% at the end of the array with a type of list provided by the package
+% \pkg{enumitem}. 
+%
+% \begin{scope}
+% \fvset{commandchars=\~\#\!}
+% \begin{Verbatim}
+% \begin{NiceTabular}{@{}llr@{}}[first-row,code-for-first-row = \bfseries]
+% \toprule
+% Last name & First name & Birth day \\
+% \midrule
+% Achard\tabularnote{~emphase#Achard is an old family of the Poitou.!} 
+% & Jacques & 5 juin 1962 \\
+% Lefebvre\tabularnote{~emphase#The name Lefebvre is an alteration of the name Lefebure.!} 
+% & Mathilde & 23 mai 1988 \\
+% Vanesse & Stephany & 30 octobre 1994 \\
+% Dupont & Chantal & 15 janvier 1998 \\
+% \bottomrule
+% \end{NiceTabular}
+% \end{Verbatim}
+% \end{scope}
 % 
+% \begin{center}
+% \begin{NiceTabular}{@{}llr@{}}[first-row,code-for-first-row = \bfseries]
+% \toprule
+% Last name & First name & Birth day \\
+% \midrule
+% Achard\tabularnote{Achard is an old family of the Poitou.} 
+% & Jacques & June 5, 2005 \\
+% Lefebvre\tabularnote{The name Lefebvre is an alteration of the name Lefebure.} 
+% & Mathilde & January 23, 1975 \\
+% Vanesse & Stephany & October 30, 1994 \\
+% Dupont & Chantal & January 15, 1998 \\
+% \bottomrule
+% \end{NiceTabular}
+% \end{center}
+%
+%
+% \bigskip
+% \begin{itemize}
+% \item If you have several successive commands |\tabularnote{...}| \emph{with no
+% space at all between them}, the labels of the corresponding notes are composed
+% together, separated by commas.
+%
+% \item If a command |\tabularnote{...}| is exactly at the end of a cell (with
+% no space at all after), the label of the note is composed in an overlapping
+% position (towards the right). This structure may provide a better alignment of
+% the cells of a given column.
+%
+% \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 If the package \pkg{booktabs} has been loaded (before or after
+% \pkg{nicematrix}), the key |notes/bottomrule| draws a |\bottomrule| of
+% \pkg{booktabs} \emph{after} the notes. 
+%
+% \item The command |\tabularnote| may be used \emph{before}
+% the environment of \pkg{nicematrix}. Thus, it's possible to use it on the
+% title inserted by |\caption| in an environment |{table}| of LaTeX.
+%
+% \item It's possible to create a reference to a tabular note created by |\tabularnote|
+% (with the usual command |\label| used after the |\tabularnote|).
+% \end{itemize}
+% %
+% For an illustration of some of those remarks, see table
+% \ref{t:tabularnote}, p.~\pageref{t:tabularnote}. This table has been composed
+% with the following code.
+%
+% \begin{center}
+% \fvset{commandchars=\~\#\!}
+% \begin{BVerbatim}[formatcom=\small\color{gray}]
+% \begin{table}
+% \setlength{\belowcaptionskip}{1ex}
+% \centering
+% \caption{Utilisation of \texttt{\textbackslash tabularnote}~emphase#\tabularnote{It's possible!
+%     ~emphase#to put a note in the caption.}}!
+% \label{t:tabularnote}
+% \begin{NiceTabular}{@{}llc@{}[~emphase#notes/bottomrule!]
+% \toprule
+% Last name & First name & Length of life \\
+% \midrule
+% Churchill & Wiston &  91\\
+% Nightingale~emphase#\tabularnote{Considered as the first nurse of!
+% ~emphase#history.}\tabularnote{Nicknamed ``the Lady with the Lamp''.}!
+% & Florence & 90 \\
+% Schoelcher & Victor & 89~emphase#\tabularnote{The label of the note is overlapping.}!\\
+% Touchet & Marie & 89 \\
+% Wallis & John & 87 \\
+% \bottomrule
+% \end{NiceTabular}
+% \end{table}
+% \end{BVerbatim}
+% \end{center}
+% 
+%
+% \begin{table}
+% \setlength{\belowcaptionskip}{1ex}
+% \centering
+% \caption{Utilisation of \texttt{\textbackslash tabularnote}\tabularnote{It's possible
+%     to put a note in the caption.}}
+% \label{t:tabularnote}
+% \begin{NiceTabular}{@{}llc@{}}[notes/bottomrule]
+% \toprule
+% Last name & First name & Length of life \\
+% \midrule
+% Churchill & Wiston &  91\\
+% Nightingale\tabularnote{Considered as the first nurse of
+% history.}\tabularnote{Nicknamed ``the Lady with the Lamp''.} 
+% & Florence & 90 \\
+% Schoelcher & Victor & 89\tabularnote{The label of the note is overlapping.}\\
+% Touchet & Marie & 89 \\
+% Wallis & John & 87 \\
+% \bottomrule
+% \end{NiceTabular}
+% \end{table}
+%
+%
+%\subsection{Customisation of the tabular notes}
+%
+%
+% The tabular notes can be customized with a set of keys available in
+% |\NiceMatrixOptions|. The name of these keys is prefixed by |notes|.
+% \begin{itemize}
+% \item |notes/para| 
+% \item |notes/bottomrule| 
+% \item |notes/style| 
+% \item |notes/label-in-tabular| 
+% \item |notes/label-in-list| 
+% \item |notes/enumitem-keys| 
+% \item |notes/enumitem-keys-para| 
+% \item |notes/code-before|
+% \end{itemize}
+% For sake of commodity, it is also possible to set these keys in
+% |\NiceMatrixOptions| via a key |notes| which takes as value a list of 
+% pairs \textsl{key=value} where the name of the keys need no longer be
+% prefixed by |notes|:
+% \begin{center}
+% \begin{BVerbatim}[formatcom = \small \color{gray}]
+% \NiceMatrixOptions
+%   {
+%     notes = 
+%      {
+%        bottomrule ,
+%        style = ... ,
+%        label-in-tabular = ... ,
+%        enumitem-keys = 
+%         {
+%           labelsep = ... ,
+%           align = ... ,
+%           ...
+%         }
+%      }
+%   }
+% \end{BVerbatim}
+% \end{center}
+%
+%
+% \bigskip
+% We detail these keys.
+%
+% \begin{itemize}[itemsep=\medskipamount]
+% \item The key |notes/para| requires the composition of the notes (at the end of
+% the tabular) in a single paragraph.
+%
+% Initial value: |false|
+%
+% That key is also available within a given environment.
+%
+% \item The key |notes/bottomrule| adds a |\bottomrule| of \pkg{booktabs}
+% \emph{after} the notes. Of course, that rule is drawn only if there is really
+% notes in the tabular. The package \pkg{booktabs} must have been loaded (before
+% or after the package \pkg{nicematrix}). If it is not, an error is raised.
+%
+% Initial value: |false|
+%
+% That key is also available within a given environment.
+%
+% \item The key |notes/style| is a command whose argument is specified by |#1|
+% and which gives the style of numerotation of the notes. That style will be
+% used by |\ref| when referencing a tabular note marked with a command |\label|.
+% The labels formatted by that style are used, separated by commas, when the user
+% puts several consecutive commands |\tabularnote|. The marker |#1| is meant to
+% be the name of a LaTeX counter.
+%
+% Initial value: |\emph{\alph{#1}}|
+%
+% Another possible value should be a mere |\arabic{#1}|
+%
+% \item The key |notes/label-in-tabular| is a command whose argument is
+% specified by |#1| which is used when formatting the label of a note in the
+% tabular. Internally, this number of note has already been formatted by
+% |notes/style| before sent to that command.
+%
+% Initial value: |\textsuperscript{#1}|
+%
+% In French, it's a tradition of putting a small space before the label of note.
+% That tuning could be acheived by the following code:
+% %
+% \begin{Verbatim}
+% \NiceMatrixOptions{notes/label-in-tabular = \,\textsuperscript{~#1}}
+% \end{Verbatim}
+%
+%
+% \item The key |notes/label-in-list| is a command whose argument is specified
+% by |#1| which is used when formatting the label in the list of notes at the
+% end of the tabular. Internally, this number of note has already been formatted by
+% |notes/style| before sent to that command.
+%
+% Initial value: |\textsuperscript{#1}|
+%
+% In French, the labels of notes are not composed in upper position when
+% composing the notes. Such behaviour could be acheived by:
+% \begin{Verbatim}
+% \NiceMatrixOptions{notes/label-in-list = ~#1.\nobreak\hspace{0.25em}}
+% \end{Verbatim}
+% The command |\nobreak| is for the event that the option |para| is used.
+%
+%
+% \item The notes are composed at the end of the tabular by using internally a
+% style of list of \pkg{enumitem}.
+%
+% The key |notes/enumitem-keys| specifies a list of pairs 
+% \textsl{key=value} (following the specifications of \pkg{enumitem}) to
+% customize that type of list.
+%
+% Initial value:\quad |noitemsep , leftmargin = * , align = left , labelsep = 0pt|
+%
+% This initial value contains the specification |align = left| which requires a
+% composition of the label leftwards in the box affected to that label.
+% With that tuning, the notes are composed flush left, which is pleasant when
+% composing tabulars in the spirit of \pkg{booktabs} (see for example the 
+% table \ref{t:tabularnote}, p.~\pageref{t:tabularnote}).
+%
+%
+% \item The key |notes/enumitem-keys-para| is similar to the previous one but
+% corresponds to the type of list used when the option |para| is in force. Of
+% course, when the option |para| is used, a list of type |inline| (as called by
+% \pkg{enumitem}) is used and the pairs \textsl{key=value} should correspond to
+% such a list of type |inline| . 
+%
+% Initial value:\quad |afterlabel = \nobreak, itemjoin = \quad|
+%
+%
+% \item The key |notes/code-before| est une token list inserted by \pkg{nicematrix}
+% just before the composition of the notes at the end of the tabular.
+%
+% Initial value: \textsl{empty}
+%
+% For example, if one wishes to compose all the notes in gray and |\footnotesize|,
+% he should use that key:
+% \begin{Verbatim}
+% \NiceMatrixOptions{notes/code-before = \footnotesize \color{gray}}
+% \end{Verbatim}
+% It's also possible to add |\raggedright| or |\RaggedRight| in that key (|\RaggedRight|
+% is a command of \pkg{ragged2e}).
+% \end{itemize}
+%
+%
+%
+% \bigskip
+% For an example of customization of the tabular notes, see p.~\pageref{ex:notes}.
+%
+%
+% \subsection{Utilisation of \{NiceTabular\} with threeparttable}
+%
+%
+% If you wish to use the environment |{NiceTabular}| in an environment
+% |{threeparttable}| of the eponymous package, you have to patch the environment
+% |{threeparttable}| with the following code:
+% \begin{Verbatim}[commandchars=\~\#\!]
+% \makeatletter
+% \AtBeginEnvironment{threeparttable}{\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}
 %
 % \subsection{Use of the column type S of siunitx}
@@ -1909,7 +2244,7 @@
 % 
 % \medskip
 % \begin{BVerbatim}[baseline = c, boxwidth = 10.5cm]
-% $\begin{pNiceArray}{~emphase#S at CWc{1cm}C}[nullify-dots,first-row]
+% $\begin{pNiceArray}{~emphase#S at cWc{1cm}c}[nullify-dots,first-row]
 % {C_1} & \Cdots &  & C_n \\
 % 2.3  & 0 & \Cdots & 0 \\
 % 12.4 & \Vdots & & \Vdots \\
@@ -1917,7 +2252,7 @@
 % 7.2  & 0 & \Cdots & 0 
 % \end{pNiceArray}$
 % \end{BVerbatim}
-% $\begin{pNiceArray}{SCWc{1cm}C}[nullify-dots,first-row]
+% $\begin{pNiceArray}{ScWc{1cm}c}[nullify-dots,first-row]
 % {C_1} & \Cdots &  & C_n \\
 % 2.3  & 0 & \Cdots & 0 \\
 % 12.4 & \Vdots & & \Vdots \\
@@ -1930,7 +2265,7 @@
 % supported by \pkg{nicematrix}.
 %
 %
-% \subsection{Alignement option in \{NiceMatrix\}}
+% \subsection{Alignment option in \{NiceMatrix\}}
 %
 % \label{key-R}
 %
@@ -1942,12 +2277,12 @@
 %
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=10cm]
-% $\begin{bNiceMatrix}[R]
+% $\begin{bNiceMatrix}[r]
 % \cos x & - \sin x \\
 % \sin x & \cos x 
 % \end{bNiceMatrix}$
 % \end{BVerbatim}
-% $\begin{bNiceMatrix}[R]
+% $\begin{bNiceMatrix}[r]
 % \cos x & - \sin x \\
 % \sin x & \cos x 
 % \end{bNiceMatrix}$
@@ -2032,7 +2367,7 @@
 %
 % \bigskip
 % \begin{Verbatim}
-% $\begin{bNiceArray}{CCCC|C}[~emphase#small@, 
+% $\begin{bNiceArray}{cccc|c}[~emphase#small@, 
 %                             last-col, 
 %                             code-for-last-col = \scriptscriptstyle, 
 %                             columns-width = 3mm ] 
@@ -2042,7 +2377,7 @@
 % \end{bNiceArray}$
 % \end{Verbatim}
 % %
-% \[\begin{bNiceArray}{CCCC|C}[small, last-col, 
+% \[\begin{bNiceArray}{cccc|c}[small, last-col, 
 %                      code-for-last-col = \scriptscriptstyle, 
 %                      columns-width=3mm]
 % 1 & -2 & 3 & 4 & 5 \\
@@ -2120,7 +2455,7 @@
 % matrix, with the syntax $n$-$p$ where $n$ is the number of rows and $p$ the
 % number of columns. The second argument is the pattern (it's a list of tokens
 % which are inserted in each cell of the constructed matrix, excepted in the
-% cells of the eventual exterior rows and columns).
+% cells of the potential exterior rows and columns).
 %
 % \medskip
 % \begin{Verbatim}
@@ -2188,7 +2523,7 @@
 % \medskip
 % \begin{BVerbatim}[baseline=c,boxwidth=11cm]
 % $\begin{~emphase#NiceArrayWithDelims@}
-%    {\downarrow}{\uparrow}{CCC}[margin]
+%    {\downarrow}{\uparrow}{ccc}[margin]
 % 1 & 2 & 3 \\
 % 4 & 5 & 6 \\
 % 7 & 8 & 9 
@@ -2195,7 +2530,7 @@
 % \end{~emphase#NiceArrayWithDelims@}$
 % \end{BVerbatim}
 % $\begin{NiceArrayWithDelims}
-%    {\downarrow}{\uparrow}{CCC}[margin]
+%    {\downarrow}{\uparrow}{ccc}[margin]
 % 1 & 2 & 3 \\
 % 4 & 5 & 6 \\
 % 7 & 8 & 9 
@@ -2450,7 +2785,7 @@
 % \medskip
 % \begin{BVerbatim}
 % \large
-% \begin{NiceTabular}{wl{2cm}LL}[hvlines]
+% \begin{NiceTabular}{wl{2cm}ll}[hvlines]
 % fraise & amande & abricot \\
 % prune & pêche & poire  \\[1ex]
 % noix & noisette & brugnon
@@ -2460,7 +2795,7 @@
 % \hspace{0.9cm}
 % \begin{scope}
 % \large
-% \begin{NiceTabular}[c]{wl{2cm}LL}[hvlines]
+% \begin{NiceTabular}[c]{wl{2cm}ll}[hvlines]
 % fraise & amande & abricot \\
 % prune & pêche & poire  \\[1ex]
 % noix & noisette & brugnon
@@ -2474,7 +2809,7 @@
 % \hspace{1.5cm}
 % \begin{scope}
 % \large
-% \begin{NiceTabular}[c]{wl{2cm}LL}[hvlines,code-before = \chessboardcolors{red!15}{blue!15}]
+% \begin{NiceTabular}[c]{wl{2cm}ll}[hvlines,code-before = \chessboardcolors{red!15}{blue!15}]
 % fraise & amande & abricot \\
 % prune & pêche & poire  \\[1ex]
 % noix & noisette & brugnon
@@ -2490,7 +2825,7 @@
 % \hspace{1.5cm}
 % \begin{scope}
 % \large
-% \begin{NiceTabular}[c]{wl{2cm}LL}[hvlines,
+% \begin{NiceTabular}[c]{wl{2cm}ll}[hvlines,
 %  create-large-nodes,
 %  code-after = {\begin{tikzpicture}
 %                   [every node/.style = {blend mode = multiply,
@@ -2522,7 +2857,7 @@
 % rule (with the names |col-|$j$), as described in the following figure. These
 % nodes are available in the |code-before| and the |code-after|.
 % \begin{center}
-% \begin{NiceTabular}{CCC}[hvlines,rules/width=1pt,rules/color=gray]
+% \begin{NiceTabular}{ccc}[hvlines,rules/width=1pt,rules/color=gray]
 % rose & tulipe & lys \\
 % arum & iris & violette \\
 % muguet & dahlia & souci 
@@ -2599,7 +2934,7 @@
 % The package \pkg{nicematrix} provides the command |\OnlyMainNiceMatrix|
 % which is meant to be used in definitions of new column types. Its argument is
 % evaluated if and only if we are in the main part of the array, that is to say
-% not in an eventual exterior row. 
+% not in an potential exterior row.
 %
 % For example, one may wish to define a new column type |?| in order to draw a
 % (black) heavy rule of width 1~pt. The following definition will do the
@@ -2615,7 +2950,7 @@
 % \newcolumntype{?}{!{\OnlyMainNiceMatrix{\vrule width 1 pt}}}
 %
 % \begin{BVerbatim}[baseline = c, boxwidth = 10.5cm]
-% $\begin{pNiceArray}{CC?CC}[first-row,last-row=3]
+% $\begin{pNiceArray}{cc?cc}[first-row,last-row=3]
 % C_1 & C_2 & C_3 & C_4 \\
 % a & b & c & d \\
 % e & f & g & h \\
@@ -2622,7 +2957,7 @@
 % C_1 & C_2 & C_3 & C_4
 % \end{pNiceArray}$
 % \end{BVerbatim}
-% $\begin{pNiceArray}{CC?CC}[first-row,last-row=3]
+% $\begin{pNiceArray}{cc?cc}[first-row,last-row=3]
 % C_1 & C_2 & C_3 & C_4 \\
 % a & b & c & d \\
 % e & f & g & h \\
@@ -2773,9 +3108,6 @@
 %
 % \subsection{Incompatibilities}
 %
-% The package \pkg{nicematrix} is not compatible with \pkg{threeparttable}.
-% 
-% \medskip
 % The package \pkg{nicematrix} is not fully compatible with the package
 % \pkg{arydshln} (because this package redefines many internal of \pkg{array}).
 %
@@ -2782,6 +3114,108 @@
 % 
 % \section{Examples}
 %
+% \subsection{Notes in the tabulars}
+%
+% \label{ex:notes}
+%
+% The tools provided by \pkg{nicematrix} for the composition of the tabular
+% notes have been presented in the section \ref{s:notes} p.~\pageref{s:notes}.
+%
+% \medskip
+% Let's consider that we wish to number the notes of a tabular with
+% stars.\footnote{Of course, it's realistic only when there is very few notes in
+% the tabular.}
+%
+% \medskip
+% First, we write a command |\stars| similar the well-known commands 
+% |\arabic|, |\alph|, |\Alph|, etc. which produce a number of stars equal to its argument
+% \footnote{In fact: the value of its argument.}
+% \begin{Verbatim}
+% \ExplSyntaxOn
+% \NewDocumentCommand ~emphase#\stars@ { m }
+%   { \prg_replicate:nn { \value { ~#1 } } { $ \star $ } } 
+% \ExplSyntaxOff
+% \end{Verbatim}
+% %
+% Of course, we change the style of the labels with the key |notes/style|.
+% However, it would be interesting to change also some parameters in the type of
+% list used to compose the notes at the end of the tabular.
+% First, we required a composition flush right for the labels with the setting
+% |align=right|.
+% Moreover, we want the labels to be composed on a width equal to the width of
+% the widest label. The widest label is, of course, the label with the greatest
+% number of stars. We know that number: it is equal to |\value{tabularnote}|
+% (because |tabularnote| is the LaTeX counter used by |\tabularnote| and,
+% therefore, at the end of the tabular, its value is equal to the total number
+% of tabular notes). We use the key |widest*| of \pkg{enumitem} in order to
+% require a width equal to that value: |widest*=\value{tabularnote}|. 
+% \begin{Verbatim}
+% \NiceMatrixOptions 
+%   {
+%     notes = 
+%      {
+%        ~emphase#style = \stars{~#1} , @
+%        ~emphase#enumitem-keys = @
+%        ~emphase# { @
+%        ~emphase#   widest* = \value{tabularnote} ,@
+%        ~emphase#   align = right @
+%        ~emphase# } @
+%      }
+%   }
+% \end{Verbatim}
+%
+%
+%
+% \begin{scope}
+% \ExplSyntaxOn
+% \NewDocumentCommand \stars { m }
+%   { \prg_replicate:nn { \value { #1 } } { $ \star $ } } 
+% \NiceMatrixOptions 
+%   {
+%     notes = 
+%      {
+%        style = \stars{#1} ,
+%        enumitem-keys = 
+%         {
+%           widest* = \value{tabularnote} ,
+%           align = right 
+%         }
+%      }
+%   }
+% \ExplSyntaxOff
+% \begin{Verbatim}
+% \begin{NiceTabular}{~@{}llr~@{}}[first-row,code-for-first-row = \bfseries]
+% \toprule
+% Last name & First name & Birth day \\
+% \midrule
+% Achard\tabularnote{~emphase#Achard is an old family of the Poitou.@} 
+% & Jacques & 5 juin 1962 \\
+% Lefebvre\tabularnote{~emphase#The name Lefebvre is an alteration of the name Lefebure.@} 
+% & Mathilde & 23 mai 1988 \\
+% Vanesse & Stephany & 30 octobre 1994 \\
+% Dupont & Chantal & 15 janvier 1998 \\
+% \bottomrule
+% \end{NiceTabular}
+% \end{Verbatim}
+%
+% \begin{center}
+% \begin{NiceTabular}{@{}llr@{}}[first-row,code-for-first-row = \bfseries]
+% \toprule
+% Last name & First name & Birth day \\
+% \midrule
+% Achard\tabularnote{Achard is an old family of the Poitou.} 
+% & Jacques & June 5, 2005 \\
+% Lefebvre\tabularnote{The name Lefebvre is an alteration of the name Lefebure.} 
+% & Mathilde & January 23, 1975 \\
+% Vanesse & Stephany & October 30, 1994 \\
+% Dupont & Chantal & January 15, 1998 \\
+% \bottomrule
+% \end{NiceTabular}
+% \end{center}
+% \end{scope}
+%
+%
+%
 % \subsection{Dotted lines}
 %
 %
@@ -2850,7 +3284,7 @@
 % \[\begin{BNiceMatrix}[nullify-dots]
 % 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\
 % 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\
-% \Cdots &  & \multicolumn{6}{C}{10 \text{ other rows}} & \Cdots \\
+% \Cdots &  & \multicolumn{6}{c}{10 \text{ other rows}} & \Cdots \\
 % 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10
 % \end{BNiceMatrix}\]
 % 
@@ -2885,7 +3319,7 @@
 % \bigskip
 % \begin{BVerbatim}
 % \setlength{\extrarowheight}{1mm}
-% \[\begin{vNiceArray}{CCCC:CCC}[columns-width=6mm]
+% \[\begin{vNiceArray}{cccc:ccc}[columns-width=6mm]
 % a_0   &      &&       &b_0    &      &     \\
 % a_1   &\Ddots&&       &b_1    &\Ddots&     \\
 % \Vdots&\Ddots&&       &\Vdots &\Ddots&b_0  \\
@@ -2900,7 +3334,7 @@
 %
 % \begin{scope}
 % \setlength{\extrarowheight}{1mm}
-% \[\begin{vNiceArray}{CCCC:CCC}[columns-width=6mm]
+% \[\begin{vNiceArray}{cccc:ccc}[columns-width=6mm]
 % a_0   &      &&       &b_0    &      &     \\
 % a_1   &\Ddots&&       &b_1    &\Ddots&     \\
 % \Vdots&\Ddots&&       &\Vdots &\Ddots&b_0  \\
@@ -2915,7 +3349,7 @@
 % An example for a linear system:\par\nobreak
 %
 % \begin{Verbatim}
-% $\begin{pNiceArray}{*6C|C}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
+% $\begin{pNiceArray}{*6c|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
 % 1      & 1 & 1 &\Cdots &   & 1      & 0      & \\
 % 0      & 1 & 0 &\Cdots &   & 0      &        & L_2 \gets L_2-L_1 \\
 % 0      & 0 & 1 &\Ddots &   & \Vdots &        & L_3 \gets L_3-L_1 \\
@@ -2926,7 +3360,7 @@
 % \end{Verbatim}
 % 
 %
-% \[\begin{pNiceArray}{*6C|C}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
+% \[\begin{pNiceArray}{*6c|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
 % 1      & 1 & 1 &\Cdots &   & 1      & 0      & \\
 % 0      & 1 & 0 &\Cdots &   & 0      &        & L_2 \gets L_2-L_1 \\
 % 0      & 0 & 1 &\Ddots &   & \Vdots &        & L_3 \gets L_3-L_1 \\
@@ -2984,7 +3418,7 @@
 % \NiceMatrixOptions
 %  { last-col,code-for-last-col = \color{blue}\scriptstyle,light-syntax}
 % \setlength{\extrarowheight}{1mm}
-% $\begin{pNiceArray}{CCCC:C}
+% $\begin{pNiceArray}{cccc:c}
 %   1  1  1   1   1 ;
 %   2  4  8  16   9 ;
 %   3  9 27  81  36 ;
@@ -2991,7 +3425,7 @@
 %   4 16 64 256 100 
 % \end{pNiceArray}$
 % \medskip
-% $\begin{pNiceArray}{CCCC:C}
+% $\begin{pNiceArray}{cccc:c}
 %   1  1  1   1  1 ;
 %   0  2  6  14  7        { L_2 \gets -2 L_1 + L_2 } ;
 %   0  6 24  78 33        { L_3 \gets -3 L_1 + L_3 } ;
@@ -3008,7 +3442,7 @@
 % \NiceMatrixOptions{last-col,code-for-last-col = \color{blue}\scriptstyle,light-syntax}
 % \setlength{\extrarowheight}{1mm}
 %
-% \enskip $\begin{pNiceArray}{CCCC:C}
+% \enskip $\begin{pNiceArray}{cccc:c}
 % 1  1  1   1   1 ;
 % 2  4  8  16   9 ;
 % 3  9 27  81  36 ;
@@ -3017,7 +3451,7 @@
 %
 % \medskip
 %
-% \enskip $\begin{pNiceArray}{CCCC:C}
+% \enskip $\begin{pNiceArray}{cccc:c}
 % 1  1  1   1  1 ;
 % 0  2  6  14  7 { L_2 \gets -2 L_1 + L_2 } ;
 % 0  6 24  78 33 { L_3 \gets -3 L_1 + L_3 } ;
@@ -3026,7 +3460,7 @@
 %
 % \medskip
 %
-% \enskip $\begin{pNiceArray}{CCCC:C}
+% \enskip $\begin{pNiceArray}{cccc:c}
 % 1 1  1  1 1 ;
 % 0 1  3  7 \frac72    { L_2 \gets \frac12 L_2 } ;
 % 0 3 12 39 \frac{33}2 { L_3 \gets \frac12 L_3 } ;
@@ -3035,7 +3469,7 @@
 %
 % \medskip
 %
-% \enskip $\begin{pNiceArray}{CCCC:C}
+% \enskip $\begin{pNiceArray}{cccc:c}
 % 1 1  1   1 1       ;
 % 0 1  3   7 \frac72 ;
 % 0 0  3  18 6        { L_3 \gets -3 L_2 + L_3 } ;
@@ -3044,7 +3478,7 @@
 %
 % \medskip
 %
-% \enskip $\begin{pNiceArray}{CCCC:C}
+% \enskip $\begin{pNiceArray}{cccc:c}
 % 1 1  1   1 1       ;
 % 0 1  3   7 \frac72 ;
 % 0 0  1   6 2        { L_3 \gets \frac13 L_3 } ;
@@ -3053,7 +3487,7 @@
 %
 % \medskip
 %
-% \enskip $\begin{pNiceArray}{CCCC:C}
+% \enskip $\begin{pNiceArray}{cccc:c}
 % 1 1 1  1 1       ;
 % 0 1 3  7 \frac72 ;
 % 0 0 1  6 2       ;
@@ -3090,7 +3524,7 @@
 % \label{example-CodeAfter}
 %
 % \begin{Verbatim}
-% $\begin{pNiceArray}{>{\strut}CCCC}[create-large-nodes,margin,extra-margin = 2pt]
+% $\begin{pNiceArray}{>{\strut}cccc}[create-large-nodes,margin,extra-margin = 2pt]
 %   a_{11} & a_{12} & a_{13} & a_{14} \\
 %   a_{21} & a_{22} & a_{23} & a_{24} \\
 %   a_{31} & a_{32} & a_{33} & a_{34} \\
@@ -3106,7 +3540,7 @@
 % \end{pNiceArray}$
 % \end{Verbatim}
 %
-% \[\begin{pNiceArray}{>{\strut}CCCC}[create-large-nodes,margin,extra-margin = 2pt]
+% \[\begin{pNiceArray}{>{\strut}cccc}[create-large-nodes,margin,extra-margin = 2pt]
 %   a_{11} & a_{12} & a_{13} & a_{14} \\
 %   a_{21} & a_{22} & a_{23} & a_{24} \\
 %   a_{31} & a_{32} & a_{33} & a_{34} \\
@@ -3226,7 +3660,7 @@
 %
 % \medskip
 % \begin{Verbatim}
-% $\begin{pNiceArray}{CCC}[~emphase#name=example@,last-col,create-medium-nodes]
+% $\begin{pNiceArray}{ccc}[~emphase#name=example@,last-col,create-medium-nodes]
 % a & a + b & a + b + c & L_1 \\
 % a & a     & a + b     & L_2 \\
 % a & a     & a         & L_3
@@ -3233,7 +3667,7 @@
 % \end{pNiceArray}$
 % \end{Verbatim}
 %                           
-% \[\begin{pNiceArray}{CCC}[last-col]
+% \[\begin{pNiceArray}{ccc}[last-col]
 % a & a + b & a + b + c & L_1 \\
 % a & a     & a + b     & L_2 \\
 % a & a     & a         & L_3
@@ -3274,7 +3708,7 @@
 % \medskip
 % We obtain the following matrix.
 % 
-% \[\begin{pNiceArray}{CCC}[
+% \[\begin{pNiceArray}{ccc}[
 %      last-col,
 %      code-after = {\begin{tikzpicture}[every node/.style = {fill = red!15,
 %                                                             blend mode = multiply,
@@ -3303,7 +3737,7 @@
 % \medskip
 % We obtain the following matrix.
 % 
-% \[\begin{pNiceArray}{CCC}[
+% \[\begin{pNiceArray}{ccc}[
 %      last-col,
 %      create-medium-nodes,
 %      code-after = {\begin{tikzpicture}[highlight/.style = {fill = red!15,
@@ -3327,7 +3761,7 @@
 % In the following example, we use the ``large nodes'' to highlight a zone of
 % the matrix.\par\nobreak 
 % \begin{Verbatim}
-% \begin{pNiceArray}{>{\strut}CCCC}[create-large-nodes,margin,extra-margin=2pt]
+% \begin{pNiceArray}{>{\strut}cccc}[create-large-nodes,margin,extra-margin=2pt]
 %   A_{11} & A_{12} & A_{13} & A_{14} \\
 %   A_{21} & A_{22} & A_{23} & A_{24} \\
 %   A_{31} & A_{32} & A_{33} & A_{34} \\
@@ -3344,7 +3778,7 @@
 % \end{Verbatim}
 %                              
 %
-% \[\begin{pNiceArray}{>{\strut}CCCC}[create-large-nodes,margin,extra-margin=2pt]
+% \[\begin{pNiceArray}{>{\strut}cccc}[create-large-nodes,margin,extra-margin=2pt]
 %   A_{11} & A_{12} & A_{13} & A_{14} \\
 %   A_{21} & A_{22} & A_{23} & A_{24} \\
 %   A_{31} & A_{32} & A_{33} & A_{34} \\
@@ -3386,7 +3820,7 @@
 % The matrix $B$ has a ``first row'' (for $C_j$) and that's why we use the key
 % |first-row|. 
 % \begin{Verbatim}
-% \begin{bNiceArray}{C>{\strut}CCCC}[name=B,first-row]
+% \begin{bNiceArray}{c>{\strut}cccc}[name=B,first-row]
 %         &        & C_j                      \\
 % b_{11}  & \Cdots & b_{1j} & \Cdots & b_{1n} \\
 % \Vdots  &        & \Vdots &        & \Vdots \\
@@ -3399,7 +3833,7 @@
 % The matrix $A$ has a ``first column'' (for $L_i$) and that's why we use the
 % key |first-col|.
 % \begin{Verbatim}
-% \begin{bNiceArray}{CC>{\strut}CCC}[name=A,first-col]
+% \begin{bNiceArray}{cc>{\strut}ccc}[name=A,first-col]
 %     & a_{11} & \Cdots &        &        & a_{1n} \\
 %     & \Vdots &        &        &        & \Vdots \\
 % L_i & a_{i1} & \Cdots & a_{ik} & \Cdots & a_{in} \\
@@ -3411,7 +3845,7 @@
 %
 % In the matrix product, the two dotted lines have an open extremity.
 % \begin{Verbatim}
-% \begin{bNiceArray}{CC>{\strut}CCC}
+% \begin{bNiceArray}{cc>{\strut}ccc}
 %        & &        & & \\
 %        & & \Vdots     \\
 % \Cdots & & c_{ij}     \\
@@ -3436,7 +3870,7 @@
 % \NiceMatrixOptions{nullify-dots}
 % $\begin{array}{cc}
 % & 
-% \begin{bNiceArray}{C>{\strut}CCCC}[name=B,first-row]
+% \begin{bNiceArray}{c>{\strut}cccc}[name=B,first-row]
 %        &        & C_j    \\
 % b_{11} & \Cdots & b_{1j} & \Cdots & b_{1n} \\
 % \Vdots &        & \Vdots &        & \Vdots \\
@@ -3444,7 +3878,7 @@
 %        &        & \Vdots \\
 % b_{n1} & \Cdots & b_{nj} & \Cdots & b_{nn} 
 % \end{bNiceArray} \\ \\
-% \begin{bNiceArray}{CC>{\strut}CCC}[name=A,first-col]
+% \begin{bNiceArray}{cc>{\strut}ccc}[name=A,first-col]
 %     & a_{11} & \Cdots &        &        & a_{1n} \\
 %     & \Vdots &        &        &        & \Vdots \\
 % L_i & a_{i1} & \Cdots & a_{ik} & \Cdots & a_{in} \\
@@ -3452,7 +3886,7 @@
 %     & a_{n1} & \Cdots &        &        & a_{nn} \\
 % \end{bNiceArray}
 % & 
-% \begin{bNiceArray}{CC>{\strut}CCC}
+% \begin{bNiceArray}{cc>{\strut}ccc}
 %        &         &        & & \\
 %        &         & \Vdots \\
 % \Cdots &         & c_{ij} \\
@@ -3519,7 +3953,7 @@
   {nicematrix}
   {\myfiledate}
   {\myfileversion}
-  {Mathematical matrices with PGF/TikZ}
+  {Enhanced arrays with the help of PGF/TikZ}
 %    \end{macrocode}
 % 
 %
@@ -3541,7 +3975,6 @@
 \cs_new_protected:Npn \@@_error:nn { \msg_error:nnn { nicematrix } }
 \cs_new_protected:Npn \@@_error:nnn { \msg_error:nnnn { nicematrix } }
 \cs_new_protected:Npn \@@_fatal:n { \msg_fatal:nn { nicematrix } }
-\cs_new_protected:Npn \@@_fatal:nn { \msg_fatal:nnn { nicematrix } }
 \cs_new_protected:Npn \@@_msg_new:nn { \msg_new:nnn { nicematrix } }
 \cs_new_protected:Npn \@@_msg_new:nnn { \msg_new:nnnn { nicematrix } }
 %    \end{macrocode}
@@ -3555,9 +3988,15 @@
 % \bigskip
 % \subsection*{Technical  definitions}
 %
+%    \begin{macrocode}
+\bool_new:N \c_@@_in_preamble_bool
+\bool_set_true:N \c_@@_in_preamble_bool
+\AtBeginDocument { \bool_set_false:N \c_@@_in_preamble_bool }
+%    \end{macrocode}
 %
 %    \begin{macrocode}
 \bool_new:N \c_@@_booktabs_loaded_bool
+\bool_new:N \c_@@_enumitem_loaded_bool
 \bool_new:N \c_@@_tikz_loaded_bool
 \AtBeginDocument
   {
@@ -3564,6 +4003,9 @@
     \@ifpackageloaded { booktabs }
       { \bool_set_true:N \c_@@_booktabs_loaded_bool }
       { }
+    \@ifpackageloaded { enumitem }
+      { \bool_set_true:N \c_@@_enumitem_loaded_bool }
+      { }
     \@ifpackageloaded { tikz }
       { 
 %    \end{macrocode}
@@ -3782,7 +4224,14 @@
   { \cs_set:Npn \CT at arc@ { \color { #1 } } }
 %    \end{macrocode}
 %
+% 
 % \bigskip
+%    \begin{macrocode}
+\cs_new:Npn \@@_tab_or_array_colsep:
+  { \bool_if:NTF \l_@@_NiceTabular_bool \tabcolsep \arraycolsep }
+%    \end{macrocode}
+%
+% \bigskip
 % \textbf{The column S of siunitx}\par\nobreak
 %
 % \medskip
@@ -3824,7 +4273,7 @@
 %       {
 %         \tex_the:D \@temptokena
 %         > { ~emphase!\@@_Cell:+ \__siunitx_table_collect_begin: S {#1} }
-%         c
+%         ~emphase!\@@_true_c:+
 %         < { \__siunitx_table_print: ~emphase!\@@_end_Cell:+ }
 %       }
 %     \NC at find
@@ -3882,30 +4331,57 @@
 %
 % \bigskip
 % The command |\@@_renew_NC at rewrite@S:| will be used in each environment of
-% \pkg{nicematrix} in order to ``rewrite'' the |S| column in each environment
-% (only if the boolean |\c_@@_siunitx_loaded_bool| is raised, of course).
+% \pkg{nicematrix} in order to ``rewrite'' the |S| column in each environment.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_renew_NC at rewrite@S:
+\AtBeginDocument
   {
-    \renewcommand*{\NC at rewrite@S}[1][]
+    \bool_if:nTF { ! \c_@@_siunitx_loaded_bool }
+      { \cs_set_eq:NN \@@_renew_NC at rewrite@S: \prg_do_nothing: }
       {
-        \@temptokena \exp_after:wN
+        \cs_new_protected:Npn \@@_renew_NC at rewrite@S:
           {
-            \tex_the:D \@temptokena
-            > { \@@_Cell: \c_@@_table_collect_begin_tl S {##1} }
-            c
-            < { \c_@@_table_print_tl \@@_end_Cell: }
-          }
-        \NC at find
+            \renewcommand*{\NC at rewrite@S}[1][]
+              {
+                \@temptokena \exp_after:wN
+                  {
+                    \tex_the:D \@temptokena
+                    > { \@@_Cell: \c_@@_table_collect_begin_tl S {##1} }
+%    \end{macrocode}
+% |\@@_true_c:| will be replaced statically by |c| at the end of the construction
+% of the preamble.
+%    \begin{macrocode}
+                    \@@_true_c:
+                    < { \c_@@_table_print_tl \@@_end_Cell: }
+                  }
+                \NC at find
+              }
+          } 
       }
   }
 %    \end{macrocode}
 %
 %
-% \bigskip
 % \subsection*{Parameters}
 %
+% \bigskip
+% For compatibility with versions prior to 5.0, we provide a load-time option
+% |define_L_C_R|. With this option, it's possible the letters |L|, |C| and |R|
+% instead of |l|, |c| and |r| in the preamble of the environments of
+% \pkg{nicematrix} as it was mandatory before version~5.0.
+%    \begin{macrocode}
+\bool_new:N \c_@@_define_L_C_R_bool
+%    \end{macrocode}
+%
 % 
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_define_L_C_R:
+  {
+    \newcolumntype L l
+    \newcolumntype C c
+    \newcolumntype R r
+  }
+%    \end{document}
+% 
 % \bigskip 
 % The following counter will count the environments |{NiceArray}|. The value of
 % this counter will be used to prefix the names of the Tikz nodes created in the
@@ -3934,7 +4410,6 @@
 %    \end{macrocode}
 %
 %
-%
 % \bigskip
 % The following command is only a syntaxic shortcut. The |q| in |qpoint| means 
 % \emph{quick}. 
@@ -4016,8 +4491,7 @@
 % The following string will contain the word \emph{command} or
 % \emph{environment} whether we are in a command of \pkg{nicematrix} or in an
 % environment of \pkg{nicematrix}. The default value is \emph{environment}.
-%    \begin{macrocode}
-\str_new:N \g_@@_com_or_env_str
+%    \begin{macrocode} 
 \str_set:Nn \g_@@_com_or_env_str { environment }
 %    \end{macrocode}
 % 
@@ -4148,8 +4622,9 @@
 %    \begin{macrocode}
 \seq_new:N \g_@@_pos_of_blocks_seq
 %    \end{macrocode}
-% The sequence |\g_@@_pos_of_blocks_seq| will be used when we will draw the
-% rules required by the keys |hvlines| or |hvlines-except-corners|.
+% In fact, this sequence will also contain the positions of the cells with a
+% |\diagbox|. The sequence |\g_@@_pos_of_blocks_seq| will be used when we will
+% draw the rules required by the keys |hvlines| or |hvlines-except-corners|.
 %
 % \bigskip
 % We will also manage a sequence for the positions of the dotted lines. These
@@ -4165,6 +4640,7 @@
 % required by the key |hvlines| (these rules won't be drawn within the virtual
 % blocks corresponding to the dotted lines).
 %
+%
 % 
 % \bigskip
 % \textbf{Variables for the exterior rows and columns}\par\nobreak
@@ -4197,7 +4673,7 @@
 % 
 % \medskip
 % \item \textbf{Last row}\par\nobreak
-% The counter |\l_@@_last_row_int| is the number of the eventual ``last row'',
+% The counter |\l_@@_last_row_int| is the number of the potential ``last row'',
 % as specified by the key |last-row|. A value of $-2$ means that there is no
 % ``last row''. A value of $-1$ means that there is a ``last row'' but we don't
 % know the number of that row (the key |last-row| has been used without value
@@ -4255,9 +4731,187 @@
 %    \end{macrocode}
 % This boolean is set to |false| at the end of |\@@_pre_array:|.
 % \end{itemize}
-%       
 % 
+% \bigskip
+% \subsection*{The command \textbackslash tabularnote}
+%
+% \bigskip
+% The LaTeX counter |tabularnote| will be used to count the tabular notes during
+% the construction of the array (this counter won't be used during the
+% composition of the notes at the end of the array). You use a LaTeX counter
+% because we will use |\refstepcounter| in order to have the tabular notes
+% referenceable.
+%    \begin{macrocode}
+\newcounter { tabularnote }
+%    \end{macrocode}
+%
+% \bigskip
+% We will store in the following sequence the tabular notes of a given array.
+%    \begin{macrocode}
+\seq_new:N \g_@@_tabularnotes_seq
+%    \end{macrocode}
+%
+% \bigskip
+% The following counter will be used to count the number of successive tabular
+% notes such as in 
+% |\tabularnote{Note 1}\tabularnote{Note 2}\tabularnote{Note 3}|. 
+% In the tabular, the labels of those nodes are composed as a comma
+% separated list (e.g. \textsuperscript{\emph{a},\emph{b},\emph{c}}).
+%    \begin{macrocode}
+\int_new:N \l_@@_number_of_notes_int
+%    \end{macrocode}
 % 
+% \bigskip
+% The following function can be redefined by using the key |notes/style|.
+%    \begin{macrocode}
+\cs_new:Npn \@@_notes_style:n #1 { \emph { \alph { #1 } } }
+%    \end{macrocode}
+% 
+% \bigskip
+% The following fonction can be redefined by using the key
+% |notes/label-in-tabular|. 
+%    \begin{macrocode}
+\cs_new:Npn \@@_notes_label_in_tabular:n #1 { \textsuperscript { #1 } } 
+%    \end{macrocode}
+%
+% \bigskip
+% The following function can be redefined by using the key |notes/label-in-list|.
+%    \begin{macrocode}
+\cs_new:Npn \@@_notes_label_in_list:n #1 { \textsuperscript { #1 } } 
+%    \end{macrocode}
+% 
+% \bigskip
+% We define |\thetabularnote| because it will be used by LaTeX if the user want
+% to reference a footnote which has been marked by a |\label|. The TeX group is
+% for the case where the user has put an instruction such as |\color{red}| in
+% |\@@_notes_style:n|.
+%    \begin{macrocode}
+\cs_set:Npn \thetabularnote { { \@@_notes_style:n { tabularnote } } }
+%    \end{macrocode}
+%
+% \bigskip
+% The tabular notes will be available for the final user only when
+% \pkg{enumitem} is loaded. Indeed, the tabular notes will be composed at the end
+% of the array with a list customized by \pkg{enumitem} (a list |tabularnotes|
+% in the general case and a list |tabularnotes*| if the key |para| is in force).
+% However, we can test whether \pkg{enumitem} has been loaded only at the
+% beginning of the document (we want to allow the user to load \pkg{enumitem}
+% after \pkg{nicematrix}).
+%    \begin{macrocode}
+\AtBeginDocument
+  {
+    \bool_if:nTF { ! \c_@@_enumitem_loaded_bool }
+      { 
+        \NewDocumentCommand \tabularnote { m }
+          { \@@_error:n { enumitem~not~loaded } }
+      }
+      { 
+%    \end{macrocode}
+% The type of list |tabularnotes| will be used to format the tabular notes at
+% the end of the array in the general case and |tabularnotes*| will be used if
+% the key |para| is in force.
+%    \begin{macrocode}
+        \newlist { tabularnotes } { enumerate } { 1 }
+        \setlist [ tabularnotes ]
+          {
+            noitemsep , leftmargin = * , align = left , labelsep = 0pt ,
+            label = 
+              \@@_notes_label_in_list:n { \@@_notes_style:n { tabularnotesi } } , 
+          }
+        \newlist { tabularnotes* } { enumerate* } { 1 }
+        \setlist [ tabularnotes* ]
+          { 
+            afterlabel = \nobreak , 
+            itemjoin = \quad ,
+            label = 
+              \@@_notes_label_in_list:n { \@@_notes_style:n { tabularnotes*i } }
+          }
+%    \end{macrocode}
+% 
+% \medskip
+% The command |\tabularnote| is available in the whole document (and not only in
+% the environments of \pkg{nicematrix}) because we want it to be available in
+% the caption of a |{table}| (before the following |{NiceTabular}| or
+% |{NiceArray}|). That's also the reason why the variables |\c at tabularnote| and
+% |\g_@@_tabularnotes_seq| will be cleared at the end of the environment of
+% \pkg{nicematrix} (and not at the beginning).
+%
+% Unfortunately, if the package \pkg{caption} is loaded, the command |\caption|
+% evaluates its argument twice and since it is not aware (of course) of
+% |\tabularnote|, the command |\tabularnote| is, in fact, not usable in
+% |\caption| when \pkg{caption} is loaded.\footnote{We should try to find a
+% solution to that problem.}
+%    \begin{macrocode}
+        \NewDocumentCommand \tabularnote { m }
+          {
+            \bool_if:nTF { ! \l_@@_NiceArray_bool && \l_@@_in_env_bool }
+              { \@@_error:n { tabularnote~forbidden } }
+              {
+%    \end{macrocode}
+% |\l_@@_number_of_notes_int| is used to count the number of successive tabular
+% notes such as in 
+% |\tabularnote{Note 1}\tabularnote{Note 2}\tabularnote{Note 3}|. 
+% We will have to compose the labels of theses notes as a comma separated list
+% (e.g. \textsuperscript{\emph{a},\emph{b},\emph{c}}). 
+%    \begin{macrocode}
+                \int_incr:N \l_@@_number_of_notes_int
+%    \end{macrocode}
+% We expand the content of the note at the point of utilisation of
+% |\tabularnote| as does |\footnote|.
+%    \begin{macrocode}
+                \seq_gput_right:Nx \g_@@_tabularnotes_seq { #1 } 
+                \peek_meaning:NF \tabularnote
+                  {
+%    \end{macrocode}
+% If the following token is \emph{not} a |\tabularnote|, we have finished the
+% sequence of successive commands |\tabularnote| and we have to format the
+% labels of these tabular notes (in the array). We compose those labels in a box
+% |\l_tmpa_box| because we will do a special construction in order to have this
+% box in a overlapping position if we are at the end of a cell.
+%    \begin{macrocode}
+                    \hbox_set:Nn \l_tmpa_box 
+                      { 
+%    \end{macrocode}
+% We remind that it is the command |\@@_notes_label_in_tabular:n| that will
+% (most of the time) put the labels in a |\textsuperscript|.
+%    \begin{macrocode}
+                        \@@_notes_label_in_tabular:n 
+                          { 
+                            \stepcounter { tabularnote }
+                            \@@_notes_style:n { tabularnote } 
+                            \prg_replicate:nn { \l_@@_number_of_notes_int - 1 } 
+                              { 
+                                ,
+                                \stepcounter { tabularnote }
+                                \@@_notes_style:n { tabularnote } 
+                              }
+                          } 
+                      }
+%    \end{macrocode}
+% We use |\refstepcounter| in order to have the (last) tabular note referenceable
+% (with the standard command |\label|) and that's why we have to go back with a
+% decrementation of the counter |tabularnote| first.
+%    \begin{macrocode}
+                    \addtocounter { tabularnote } { -1 }
+                    \refstepcounter { tabularnote }
+                    \int_zero:N \l_@@_number_of_notes_int
+                    \hbox_overlap_right:n { \box_use:N \l_tmpa_box }
+%    \end{macrocode}
+% If the command |\tabularnote| is used exactly at the end of the cell, the
+% |\unskip| (inserted by \pkg{array}?) will delete the skip we insert now
+% and the label of the footnote will be composed in an overlapping position (by
+% design). 
+%    \begin{macrocode}
+                    \skip_horizontal:n { \box_wd:N \l_tmpa_box }
+                  }
+              }
+          }
+      }
+  } 
+%    \end{macrocode}
+%      
+% 
+% 
 % \subsection*{Command for creation of rectangle nodes}
 %
 % 
@@ -4436,6 +5090,11 @@
 \bool_new:N \l_@@_hvlines_except_corners_bool
 %    \end{macrocode}
 % 
+%    \begin{macrocode}
+\dim_new:N \l_@@_notes_above_space_dim 
+\dim_set:Nn \l_@@_notes_above_space_dim { 1 mm }
+%    \end{macrocode}
+% 
 % \bigskip
 % The flag |\l_@@_nullify_dots_bool| corresponds to the option |nullify-dots|.
 % When the flag is down, the instructions like |\vdots| are inserted within a
@@ -4525,23 +5184,21 @@
 %    \end{macrocode}
 % 
 % \bigskip
-% First, we define a set of keys ``|NiceMatrix / Global|'' which will be used
-% (with the mechanism of |.inherit:n|) by other sets of keys.
 %    \begin{macrocode}
 \keys_define:nn { NiceMatrix / xdots }
   {
     line-style .code:n = 
-     { 
-       \bool_lazy_or:nnTF 
+      { 
+        \bool_lazy_or:nnTF 
 %    \end{macrocode}
 % We can't use |\c_@@_tikz_loaded_bool| to test whether \pkg{tikz} is loaded
 % because |\NiceMatrixOptions| may be used in the preamble of the document.
 %    \begin{macrocode}
-        { \cs_if_exist_p:N \tikzpicture }
-        { \str_if_eq_p:nn { #1 } { standard } }
-        { \tl_set:Nn \l_@@_xdots_line_style_tl { #1 } } 
-        { \@@_error:n { bad~option~for~line-style } } 
-     } ,
+          { \cs_if_exist_p:N \tikzpicture }
+          { \str_if_eq_p:nn { #1 } { standard } }
+          { \tl_set:Nn \l_@@_xdots_line_style_tl { #1 } } 
+          { \@@_error:n { bad~option~for~line-style } } 
+      } ,
     line-style .value_required:n = true ,
     color .tl_set:N = \l_@@_xdots_color_tl ,
     color .value_required:n = true ,
@@ -4557,7 +5214,12 @@
   }
 %    \end{macrocode}
 %
+% \bigskip
+% The following keys are for the tabular notes (specified by the command
+% |\tabularnote| inside |{NiceTabular}| and |{NiceArray}|).
 % 
+%
+% \bigskip
 %    \begin{macrocode}
 \keys_define:nn { NiceMatrix / rules }
   {
@@ -4567,7 +5229,12 @@
     width .value_required:n = true 
   }
 %    \end{macrocode}
-% 
+%
+%
+% \bigskip 
+% First, we define a set of keys ``|NiceMatrix / Global|'' which will be used
+% (with the mechanism of |.inherit:n|) by other sets of keys.
+%
 %    \begin{macrocode}
 \keys_define:nn { NiceMatrix / Global }
   {
@@ -4598,11 +5265,11 @@
     hlines .bool_set:N = \l_@@_hlines_bool ,
     vlines .bool_set:N = \l_@@_vlines_bool ,
     hvlines .code:n = 
-     { 
-       \bool_set_true:N \l_@@_hvlines_bool 
-       \bool_set_true:N \l_@@_vlines_bool 
-       \bool_set_true:N \l_@@_hlines_bool 
-     } ,
+      { 
+        \bool_set_true:N \l_@@_hvlines_bool 
+        \bool_set_true:N \l_@@_vlines_bool 
+        \bool_set_true:N \l_@@_hlines_bool 
+      } ,
     parallelize-diags .bool_set:N = \l_@@_parallelize_diags_bool ,
 %    \end{macrocode}
 %
@@ -4641,13 +5308,13 @@
     hvlines-except-corners .bool_set:N = \l_@@_hvlines_except_corners_bool , 
     hvlines-except-corners .default:n = true ,
     code-before .code:n = 
-     { 
-       \tl_if_empty:nF { #1 } 
-         {
-           \tl_set:Nn \l_@@_code_before_tl { #1 }
-           \bool_set_true:N \l_@@_code_before_bool 
-         }
-     } ,
+      { 
+        \tl_if_empty:nF { #1 } 
+          {
+            \tl_set:Nn \l_@@_code_before_tl { #1 }
+            \bool_set_true:N \l_@@_code_before_bool 
+          }
+      } ,
 %    \end{macrocode}
 % \bigskip
 % The options |c|, |t| and |b| of the environment |{NiceArray}| have the same
@@ -4683,7 +5350,61 @@
   }
 %    \end{macrocode}
 %
-%
+%    \begin{macrocode}
+\keys_define:nn { NiceMatrix / notes }
+  {
+    para .bool_set:N = \l_@@_notes_para_bool ,
+    para .default:n = true ,
+    code-before .tl_set:N = \l_@@_notes_code_before_tl ,
+    code-before .value_required:n = true ,
+    code-after .tl_set:N = \l_@@_notes_code_after_tl ,
+    code-after .value_required:n = true ,
+    bottomrule .bool_set:N = \l_@@_notes_bottomrule_bool ,
+    bottomrule .default:n = true ,
+    style .code:n = \cs_set:Nn \@@_notes_style:n { #1 } ,
+    style .value_required:n = true ,
+    label-in-tabular .code:n = 
+      \cs_set:Nn \@@_notes_label_in_tabular:n { #1 } ,
+    label-in-tabular .value_required:n = true ,
+    label-in-list .code:n = 
+      \cs_set:Nn \@@_notes_label_in_list:n { #1 } , 
+    label-in-list .value_required:n = true ,
+    enumitem-keys .code:n = 
+      { 
+        \bool_if:NTF \c_@@_in_preamble_bool
+          { 
+            \AtBeginDocument 
+              { 
+                \bool_if:NT \c_@@_enumitem_loaded_bool
+                  { \setlist* [ tabularnotes ] { #1 } }
+              } 
+          }
+          { 
+             \bool_if:NT \c_@@_enumitem_loaded_bool
+               { \setlist* [ tabularnotes ] { #1 } }
+          } 
+      } ,
+    enumitem-keys .value_required:n = true ,
+    enumitem-keys-para .code:n = 
+      { 
+        \bool_if:NTF \c_@@_in_preamble_bool
+          { 
+            \AtBeginDocument 
+              { 
+                \bool_if:NT \c_@@_enumitem_loaded_bool
+                  { \setlist* [ tabularnotes* ] { #1 } }
+              } 
+          }
+          { 
+            \bool_if:NT \c_@@_enumitem_loaded_bool
+              { \setlist* [ tabularnotes* ] { #1 } }
+          }
+      } ,
+    enumitem-keys-para .value_required:n = true ,
+    unknown .code:n  = \@@_error:n { Unknown~key~for~notes } 
+  }
+%    \end{macrocode}  
+% 
 % \bigskip
 % We begin the construction of the major sets of keys (used by the different
 % user commands and environments). 
@@ -4695,6 +5416,8 @@
         NiceMatrix / Global ,
       } ,
     NiceMatrixOptions / xdots .inherit:n = NiceMatrix / xdots ,
+    NiceMatrixOptions / rules .inherit:n = NiceMatrix / rules ,
+    NiceMatrixOptions / notes .inherit:n = NiceMatrix / notes ,
     NiceMatrix .inherit:n = 
       { 
         NiceMatrix / Global ,
@@ -4796,10 +5519,13 @@
           { \@@_error:n { Bad~value~for~letter~for~dotted~lines } } 
       } ,
     letter-for-dotted-lines .value_required:n = true ,
+    notes .code:n = \keys_set:nn { NiceMatrix / notes } { #1 } ,
+    notes .value_required:n = true ,
     unknown .code:n  = \@@_error:n { Unknown~key~for~NiceMatrixOptions } 
   }
 %    \end{macrocode}
 %
+%
 %    \begin{macrocode}
 \str_new:N \l_@@_letter_for_dotted_lines_str
 \str_set_eq:NN \l_@@_letter_for_dotted_lines_str \c_colon_str
@@ -4828,10 +5554,10 @@
                            \int_set:Nn \l_@@_last_col_int { -1 }
                          }
                          { \int_set:Nn \l_@@_last_col_int { #1 } } ,
-    l .code:n = \tl_set:Nn \l_@@_type_of_col_tl L ,
-    r .code:n = \tl_set:Nn \l_@@_type_of_col_tl R ,
-    L .code:n = \tl_set:Nn \l_@@_type_of_col_tl L ,
-    R .code:n = \tl_set:Nn \l_@@_type_of_col_tl R ,
+    l .code:n = \tl_set:Nn \l_@@_type_of_col_tl l ,
+    r .code:n = \tl_set:Nn \l_@@_type_of_col_tl r ,
+    L .code:n = \tl_set:Nn \l_@@_type_of_col_tl l ,
+    R .code:n = \tl_set:Nn \l_@@_type_of_col_tl r ,
     S .code:n = \bool_if:NTF \c_@@_siunitx_loaded_bool
                   { \tl_set:Nn \l_@@_type_of_col_tl S }
                   { \@@_error:n { option~S~without~siunitx } } ,
@@ -4861,6 +5587,10 @@
     last-col .code:n = \tl_if_empty:nF { #1 }
                          { \@@_error:n { last-col~non~empty~for~NiceArray } } 
                        \int_zero:N \l_@@_last_col_int ,
+    notes / para .bool_set:N = \l_@@_notes_para_bool ,
+    notes / para .default:n = true ,
+    notes / bottomrule .bool_set:N = \l_@@_notes_bottomrule_bool ,
+    notes / bottomrule .default:n = true ,
     unknown .code:n = \@@_error:n { Unknown~option~for~NiceArray } 
   }
 %    \end{macrocode}
@@ -4888,6 +5618,10 @@
 %    \begin{macrocode}
 \keys_define:nn { NiceMatrix / NiceTabular }
   {
+    notes / para .bool_set:N = \l_@@_notes_para_bool ,
+    notes / para .default:n = true ,
+    notes / bottomrule .bool_set:N = \l_@@_notes_bottomrule_bool ,
+    notes / bottomrule .default:n = true ,
     last-col .code:n = \tl_if_empty:nF {#1}
                          { \@@_error:n { last-col~non~empty~for~NiceArray } } 
                        \int_zero:N \l_@@_last_col_int ,
@@ -4988,7 +5722,7 @@
 % The following code is used in each cell of the array. It actualises quantities
 % that, at the end of the array, will give informations about the vertical
 % dimension of the two first rows and the two last rows. If the user uses the
-% |last-row|, some lines will be dynamically added to this command.
+% |last-row|, some lines of code will be dynamically added to this command.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_update_for_first_and_last_row:
   {
@@ -5050,7 +5784,7 @@
 % \begin{itemize}
 % \item if the width of the box |\l_@@_cell_box| (created with the content of
 % the cell) is equal to zero, we consider the cell as empty (however,
-% this is not perfect since the user may have use a |\rlap|, a |\llap| or a
+% this is not perfect since the user may have used a |\rlap|, a |\llap| or a
 % |\mathclap| of \pkg{mathtools}.
 % \item the cells with a command |\Ldots| or |\Cdots|, |\Vdots|, etc.,
 % should also be considered as empty; if |nullify-dots| is in force, there would
@@ -5278,9 +6012,9 @@
 %    \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 } }
+    % \cs_if_free:cT { NC @ find @ #1 } 
+    %   { \NC at list \exp_after:wN { \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 ] }
@@ -5318,7 +6052,7 @@
 % 
 % \bigskip
 % The following code |\@@_pre_array:| is used in |{NiceArrayWithDelims}|. It
-% exists as a standalone macro only for lisibility.
+% exists as a standalone macro only for legibility.
 % \label{prearray}
 %
 %   \begin{macrocode}
@@ -5408,9 +6142,7 @@
 %    \end{macrocode}
 % After its first use, the definition of |\ialign| will revert
 % automatically to its default definition. With this programmation, we will
-% have, in the cells of the array, a clean version of |\ialign|.\footnote{The
-% user will probably not use directly |\ialign| in the array...  but more
-% likely environments that utilize |\ialign| internally (e.g.: |{substack}|).}
+% have, in the cells of the array, a clean version of |\ialign|.
 %    \begin{macrocode}
         \cs_set_eq:NN \ialign \@@_old_ialign:
         \halign 
@@ -5499,15 +6231,6 @@
     \cs_set_eq:NN \@ifnextchar \new at ifnextchar
 %    \end{macrocode}
 %
-% \bigskip
-% We define the new column types |L|, |C| and |R| that must be used instead of
-% |l|, |c| and |r| in the preamble of |{NiceArray}|. We use |\@@_newcolumntype|
-% because it will be slightly quicker thant |\newcolumtype|.
-%    \begin{macrocode}
-    \@@_newcolumntype L { > \@@_Cell: l < \@@_end_Cell: }
-    \@@_newcolumntype C { > \@@_Cell: c < \@@_end_Cell: }
-    \@@_newcolumntype R { > \@@_Cell: r < \@@_end_Cell: }
-%    \end{macrocode}
 %
 % \bigskip
 % We redefine the column types |p|, |m| and |b|. The command
@@ -5529,17 +6252,24 @@
             \hbox_set:Nw \l_@@_cell_box
             \@@_Cell:
           }
-        c
+%    \end{macrocode}
+% |\@@_true_c:| will be replaced statically by |c| at the end of the construction
+% of the preamble.
+%    \begin{macrocode}
+        \@@_true_c:
         < {
             \@@_end_Cell:
             \hbox_set_end:
 %    \end{macrocode}
-% The |\str_lowercase:n| is only for giving the user the ability to write
-% |wC{1cm}| instead of |wc{1cm}| for homogeneity with the letters |L|, |C| and
-% |R| used elsewhere in the preamble instead of |l|, |c| and |r|.
+% The construction with |\@@_foldcase:| (defined below) should be replaced by
+% |\str_foldcase:n| when that command of \pkg{expl3} will be widespread. That
+% construction is only for giving the user the ability to write |wC{1cm}|
+% instead of |wc{1cm}| for homogeneity with the letters |L|, |C| and |R| used
+% elsewhere in the preamble instead of |l|, |c| and |r|.
 %    \begin{macrocode}
-            \makebox [ ##2 ] [ \str_lowercase:n { ##1 } ] 
-               { \box_use_drop:N \l_@@_cell_box }  
+            \tl_set:Nn \l_tmpa_tl { ##1 }
+            \makebox [ ##2 ] [ \@@_foldcase: ] 
+              { \box_use_drop:N \l_@@_cell_box }  
           }
       }
     \@@_newcolumntype W [ 2 ]
@@ -5548,12 +6278,17 @@
             \hbox_set:Nw \l_@@_cell_box
             \@@_Cell:
           }
-        c
+%    \end{macrocode}
+% |\@@_true_c:| will be replaced statically by |c| at the end of the construction
+% of the preamble.
+%    \begin{macrocode}
+        \@@_true_c:
         < {
             \@@_end_Cell:
             \hbox_set_end:
             \cs_set_eq:NN \hss \hfil
-            \makebox [ ##2 ] [ \str_lowercase:n { ##1 } ] 
+            \tl_set:Nn \l_tmpa_tl { ##1 }
+            \makebox [ ##2 ] [ \@@_foldcase: ] 
               { \box_use_drop:N \l_@@_cell_box } 
           }
       }
@@ -5623,7 +6358,7 @@
           }
       }
     \int_gzero_new:N \g_@@_last_vdotted_col_int
-    \bool_if:NT \c_@@_siunitx_loaded_bool \@@_renew_NC at rewrite@S:
+    \@@_renew_NC at rewrite@S:
     \int_gset:Nn \g_@@_last_vdotted_col_int { -1 }
     \bool_gset_false:N \g_@@_last_col_found_bool 
 %    \end{macrocode}
@@ -5639,8 +6374,24 @@
     \tl_gclear_new:N \g_@@_Ddots_lines_tl
     \tl_gclear_new:N \g_@@_Iddots_lines_tl
     \tl_gclear_new:N \g_@@_HVdotsfor_lines_tl
- }
+  }
 %    \end{macrocode}
+%
+% \medskip
+% The following command will be deleted when we will consider |\str_lowercase:n|
+% as widespread.
+%    \begin{macrocode}
+\cs_set:Npn \@@_foldcase:
+  {
+    \tl_case:NnF \l_tmpa_tl
+      {
+        C { c }
+        L { l }
+        R { r }
+      }
+      { \l_tmpa_tl }
+  }
+%    \end{macrocode}
 % 
 % \bigskip
 % \subsection*{The environment \{NiceArrayWithDelims\}}
@@ -5648,6 +6399,7 @@
 %    \begin{macrocode}
 \NewDocumentEnvironment { NiceArrayWithDelims } { m m O { } m ! O { } }
   { 
+    \bool_if:NT \c_@@_footnote_bool { \begin { savenotes } }
 %    \end{macrocode}
 % The aim of the following |\bgroup| (the corresponding |\egroup| is, of course,
 % at the end of the environment) is to be able to put an exposant to a matrix in
@@ -5712,6 +6464,8 @@
     \seq_clear:N \g_@@_blocks_seq
     \seq_clear:N \g_@@_pos_of_blocks_seq
 %    \end{macrocode}
+% In fact, the sequence |\g_@@_pos_of_blocks_seq| will also contain the
+% positions of the cells with a |\diagbox|.
 % 
 % 
 % The set of keys is not exactly the same for |{NiceArray}| and for the variants
@@ -5730,6 +6484,8 @@
       { \exp_after:wN \@@_set_CT at arc@: \l_@@_rules_color_tl \q_stop }
 %    \end{macrocode}
 %
+% 
+% 
 % \bigskip
 % If the key |code-before| is used, we have to create the |col| nodes and the
 % |row| nodes before the creation of the array. First, we have to test whether
@@ -5909,7 +6665,7 @@
 %    \begin{macrocode}
         \hbox_set:Nn \l_tmpa_box { $ \bBigg@ 5 #1 $ }
         \dim_set:Nn \l_@@_left_delim_dim { \box_wd:N \l_tmpa_box }
-        \hbox_set:Nn \l_tmpa_box { $\bBigg@ 5 #2 $ }
+        \hbox_set:Nn \l_tmpa_box { $ \bBigg@ 5 #2 $ }
         \dim_set:Nn \l_@@_right_delim_dim { \box_wd:N \l_tmpa_box }
       }
 %    \end{macrocode}
@@ -5921,10 +6677,62 @@
     \box_clear_new:N \l_@@_the_array_box
 %    \end{macrocode}
 %
-% \medskip
+% \bigskip
 % We construct the preamble of the array in |\l_tmpa_tl|.
 %    \begin{macrocode}
     \tl_set:Nn \l_tmpa_tl { #4 }
+%    \end{macrocode}
+%
+%
+% \bigskip
+% If the user has loaded |nicematrix| with the option |define-L-C-R|, he will be
+% able to use |L|, |C| and |R| instead of |l|, |c| and |r| in the preambles of
+% the environments of \pkg{nicematrix} (it's a compatibility mode since |L|, |C|
+% and |R| were mandatory before version 5.0).
+%    \begin{macrocode}
+    \bool_if:NT \c_@@_define_L_C_R_bool \@@_define_L_C_R:
+%    \end{macrocode}
+% 
+% \bigskip
+% We will do an ``expansion''\footnote{This ``expansion'' expands all the
+% constructions with |*| and with the new column types defined by
+% |\newcolumntype|.} of the preamble (with the tools of \pkg{array}
+% itself) and a replacement of the specifiers |c|, |l| and |r| by the specifiers
+% |C|, |L| and |R|.
+% 
+% 
+% We store our preamble in the token register |\@temptokena| (those
+% ``token registers'' are not supported by \pkg{expl3}).
+%    \begin{macrocode}
+    \@temptokena \exp_after:wN { \l_tmpa_tl }
+%    \end{macrocode}
+% Initialisation of a flag used by \pkg{array} to detect the end of the expansion.
+%    \begin{macrocode}
+    \@tempswatrue
+%    \end{macrocode}
+% The following line actually does the expansion (it's has been copied from
+% |array.sty|). 
+%    \begin{macrocode}
+    \@whilesw \if at tempswa \fi { \@tempswafalse \the \NC at list }
+%    \end{macrocode}
+% We put back the preamble in our token list |\l_tmpa_tl|.
+%    \begin{macrocode}
+    \tl_gset:NV \l_tmpa_tl \@temptokena
+%    \end{macrocode}
+% 
+% We do the replacement of letters |c|, |l| and |r| (these column types can't be
+% redefined by |\newcolumtype| of \pkg{array} and that's why we have to do the
+% job ``by hand'' after expansion of the preamble). 
+%    \begin{macrocode}
+    \tl_replace_all:Nnn \l_tmpa_tl c { > \@@_Cell: c < \@@_end_Cell: }
+    \tl_replace_all:Nnn \l_tmpa_tl l { > \@@_Cell: l < \@@_end_Cell: }
+    \tl_replace_all:Nnn \l_tmpa_tl r { > \@@_Cell: r < \@@_end_Cell: }
+    \tl_replace_all:Nnn \l_tmpa_tl \@@_true_c: c
+%    \end{macrocode}
+%
+% \bigskip
+% We complete the preamble with the potential ``exterior columns''.
+%    \begin{macrocode}
     \int_compare:nNnTF \l_@@_first_col_int = 0
       { \tl_put_left:NV \l_tmpa_tl \c_@@_preamble_first_col_tl }
       {
@@ -5949,8 +6757,13 @@
           }
           { \tl_put_right:Nn \l_tmpa_tl { @ { } } }
       }
-    \tl_put_right:Nn \l_tmpa_tl { > { \@@_error_too_much_cols: } L } 
+    \tl_put_right:Nn \l_tmpa_tl { > { \@@_error_too_much_cols: } l } 
 %    \end{macrocode}
+% Now, the preamble is constructed in |\l_tmpa_tl|
+%
+%
+% 
+% \bigskip
 % Here is the beginning of the box which will contain the array. The
 % |\hbox_set_end:| corresponding to this |\hbox_set:Nw| will be in the second
 % part of the environment (and the closing |\c_math_toggle_token| also).
@@ -6011,7 +6824,7 @@
 % |0.5\arrayrulewidth| in order to reserve space for the width of the vertical
 % rules drawn with Tikz after the end of the array. However, the last
 % |\arraycolsep| is used once (between columns, |\arraycolsep| is used twice).
-% That's we add a |0.5 \arrayrulewidth| more.
+% That's why we add a |0.5 \arrayrulewidth| more.
 %    \begin{macrocode}
     \bool_if:NT \l_@@_vlines_bool { \skip_horizontal:N 0.5\arrayrulewidth } 
     \hbox_set_end:
@@ -6036,11 +6849,11 @@
       } 
 %    \end{macrocode}
 %
-% Now, the definition of |\c at jCol| and
-% |\g_@@_col_total_int| change: |\c at jCol| will be the number of
-% columns without the ``last column''; |\g_@@_col_total_int| will be the
-% number of columns with this ``last column''.\footnote{We remind that the
-% potential ``first column'' (exterior) has the number~$0$.}
+% Now, the definition of |\c at jCol| and |\g_@@_col_total_int| change: |\c at jCol|
+% will be the number of columns without the ``last column'';
+% |\g_@@_col_total_int| will be the number of columns with this ``last
+% column''.\footnote{We remind that the potential ``first column'' (exterior)
+% has the number~$0$.} 
 %    \begin{macrocode}
     \int_gset_eq:NN \c at jCol \g_@@_col_total_int
     \bool_if:nT \g_@@_last_col_found_bool { \int_gdecr:N \c at jCol } 
@@ -6054,7 +6867,6 @@
 %    \end{macrocode}
 %
 % 
-% 
 % \bigskip
 % \textbf{Now, we begin the real construction in the output flow of TeX}. First, we take
 % into account a potential ``first column'' (we remind that this ``first
@@ -6069,35 +6881,37 @@
       }
 %    \end{macrocode}
 %
-% The construction of the real box is different in |{NiceArray}| and in the
-% other environments because, in |{NiceArray}|, we have to take into account the
-% value of |baseline| and we have no delimiter to put. We begin with |{NiceArray}|.
+% 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 to take into account the value of
+% |baseline| and we have no delimiter to put. We begin with this case.
 %    \begin{macrocode}
     \bool_if:NTF \l_@@_NiceArray_bool
       { 
 %    \end{macrocode}
-% Remember that, when the key |b| is used, the |\array| (of \pkg{array}) is
+% Remember that, when the key |b| is used, the |{array}| (of \pkg{array}) is
 % constructed with the option |t| (and not |b|). Now, we do the translation to
 % take into account the option |b|.
 %    \begin{macrocode}
         \str_if_eq:VnTF \l_@@_baseline_str { b }
           { 
-           \pgfpicture
-             \@@_qpoint:n { row - 1 } 
-             \dim_gset_eq:NN \g_tmpa_dim \pgf at y
-             \@@_qpoint:n { row - \int_use:N \c at iRow - base }
-             \dim_gsub:Nn \g_tmpa_dim \pgf at y
-           \endpgfpicture
-           \int_compare:nNnT \l_@@_first_row_int = 0 
-             {
-               \dim_gadd:Nn \g_tmpa_dim 
-                 { \g_@@_ht_row_zero_dim + \g_@@_dp_row_zero_dim }
-             }
-           \box_move_up:nn \g_tmpa_dim { \box_use_drop:N \l_@@_the_array_box } 
+            \pgfpicture
+              \@@_qpoint:n { row - 1 } 
+              \dim_gset_eq:NN \g_tmpa_dim \pgf at y
+              \@@_qpoint:n { row - \int_use:N \c at iRow - base }
+              \dim_gsub:Nn \g_tmpa_dim \pgf at y
+            \endpgfpicture
+            \dim_gadd:Nn \g_tmpa_dim \arrayrulewidth 
+            \int_compare:nNnT \l_@@_first_row_int = 0 
+              {
+                \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_array_box_with_notes: } 
           }
           { 
             \str_if_eq:VnTF \l_@@_baseline_str { c }
-              { \box_use_drop:N \l_@@_the_array_box } 
+              { \@@_use_array_box_with_notes: } 
               {
 %    \end{macrocode}
 % We convert a value of |t| to a value of |1|.
@@ -6109,12 +6923,10 @@
 % integer) to an integer stored in |\l_tmpa_int|.
 %    \begin{macrocode}
                 \int_set:Nn \l_tmpa_int \l_@@_baseline_str
-                \bool_if:nT
+                \bool_lazy_or:nnT
+                  { \int_compare_p:nNn \l_tmpa_int < \l_@@_first_row_int }
+                  { \int_compare_p:nNn \l_tmpa_int > \g_@@_row_total_int }
                   { 
-                       \int_compare_p:nNn \l_tmpa_int < \l_@@_first_row_int
-                    || \int_compare_p:nNn \l_tmpa_int > \g_@@_row_total_int 
-                  }
-                  { 
                     \@@_error:n { bad~value~for~baseline }
                     \int_set:Nn \l_tmpa_int 1
                   }
@@ -6124,13 +6936,13 @@
                 \@@_qpoint:n { row - \int_use:N \l_tmpa_int - base }
                 \dim_gsub:Nn \g_tmpa_dim \pgf at y
                 \endpgfpicture
+                \dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
                 \int_compare:nNnT \l_@@_first_row_int = 0 
                   {
-                    \dim_gadd:Nn \g_tmpa_dim 
-                      { \g_@@_ht_row_zero_dim + \g_@@_dp_row_zero_dim }
+                    \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 
-                  { \box_use_drop:N \l_@@_the_array_box } 
+                \box_move_up:nn \g_tmpa_dim { \@@_use_array_box_with_notes: }  
               }
           }
       } 
@@ -6176,12 +6988,13 @@
 % height in |\l_tmpa_dim|). The |\hbox:n| (or |\hbox|) is necessary here.
 %    \begin{macrocode}
                 \skip_vertical:N -\l_tmpa_dim 
+                \skip_vertical:N -\arrayrulewidth 
                 \hbox
                   {
                     \bool_if:NTF \l_@@_NiceTabular_bool
                       { \skip_horizontal:N -\tabcolsep }
                       { \skip_horizontal:N -\arraycolsep }
-                    \box_use_drop:N \l_@@_the_array_box
+                    \@@_use_array_box_with_notes:
                     \bool_if:NTF \l_@@_NiceTabular_bool
                       { \skip_horizontal:N -\tabcolsep }
                       { \skip_horizontal:N -\arraycolsep }
@@ -6191,6 +7004,7 @@
 % height in |\l_tmpb_dim|).
 %    \begin{macrocode}
                 \skip_vertical:N -\l_tmpb_dim 
+                \skip_vertical:N \arrayrulewidth 
               }
             \right #2 
             \c_math_toggle_token
@@ -6219,10 +7033,13 @@
       }
     \@@_after_array:
     \egroup 
+    \bool_if:NT \c_@@_footnote_bool { \end { savenotes } }
   }
 %    \end{macrocode}
 % This is the end of the environment |{NiceArrayWithDelims}|.
 %
+%
+%
 % \bigskip
 % The command |\@@_put_box_in_flow:| puts the box |\l_tmpa_box| (which contains
 % the array) in the flow. It is used for the environments with delimiters.
@@ -6289,6 +7106,71 @@
 %    \end{macrocode}
 %
 % \bigskip
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_use_array_box_with_notes:
+  {
+    \int_compare:nNnTF \c at tabularnote = 0
+      { \box_use_drop:N \l_@@_the_array_box }
+      {
+        \begin { minipage } { \box_wd:N \l_@@_the_array_box }
+        \box_use_drop:N \l_@@_the_array_box
+        \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
+%    \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}
+        \bool_if:NTF \l_@@_notes_para_bool
+          {
+            \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
+          }
+        \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 
+%    \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 } }
+          }
+        \l_@@_notes_code_after_tl
+        \end { minipage }
+        \seq_gclear:N \g_@@_tabularnotes_seq
+        \int_gzero:N \c at tabularnote
+      }
+  }
+%    \end{macrocode}
+% 
+% 
+% \bigskip
 % The command |\@@_put_box_in_flow_bis:| is used when the option
 % |max-delimiter-width| is used because, in this case, we have to adjust the
 % widths of the delimiters. The arguments |#1| and |#2| are the delimiters
@@ -6489,7 +7371,6 @@
 \cs_new:Npn \@@_create_col_nodes:
   {
     \crcr 
-    \int_compare:nNnT \c at iRow = 0 { \@@_fatal:n { Zero~row } }
     \int_compare:nNnT \l_@@_first_col_int = 0 
       { 
         \omit 
@@ -6559,7 +7440,7 @@
 %
 % \smallskip
 % We give a default value for |\g_tmpa_skip| (|0 pt plus 1 fill|) but it will
-% just after erased by a fixed value in the concerned cases.
+% just after be erased by a fixed value in the concerned cases.
 %    \begin{macrocode}
     \skip_gset:Nn \g_tmpa_skip { 0 pt~plus 1 fill } 
     \bool_if:NF \l_@@_auto_columns_width_bool
@@ -6882,7 +7763,7 @@
     \NewDocumentEnvironment { #1 NiceMatrix } { ! O { } }
       {
         \str_gset:Nn \g_@@_name_env_str { #1 NiceMatrix } 
-        \tl_set:Nn \l_@@_type_of_col_tl C
+        \tl_set:Nn \l_@@_type_of_col_tl c
         \keys_set:nn { NiceMatrix / NiceMatrix } { ##1 }
         \exp_args:Nnx \@@_begin_of_NiceMatrix:nn { #1 } \l_@@_type_of_col_tl 
       }
@@ -7144,7 +8025,7 @@
 %    \end{macrocode}
 % When |light-syntax| is used, we insert systematically a |\CodeAfter| in the
 % flow. Thus, it's possible to have two instructions |\CodeAfter| and the second
-% one is eventually present in |\g_@@_code_after_tl|. That's why we set
+% one may be present in |\g_@@_code_after_tl|. That's why we set
 % |\Code-after| to be \textsl{no-op} now.
 %    \begin{macrocode}
     \cs_set_eq:NN \CodeAfter \prg_do_nothing:
@@ -7345,7 +8226,7 @@
 %    \end{macrocode}
 % If the case is empty, we declare that the cell as non-empty. Indeed, we will
 % draw a dotted line and the cell will be on that dotted line. All the cells of
-% a dotted line have to be mark as ``dotted'' because we don't want
+% a dotted line have to be marked as ``dotted'' because we don't want
 % intersections between dotted lines. We recall that the research of the
 % extremities of the lines are all done in the same TeX group (the group of the
 % environnement), even though, when the extremities are found, each line is
@@ -7545,8 +8426,7 @@
       {
         \@@_qpoint:n { col - \int_use:N \l_@@_initial_j_int }
         \dim_set_eq:NN \l_@@_x_initial_dim \pgf at x 
-        \dim_add:Nn \l_@@_x_initial_dim 
-           { \bool_if:NTF \l_@@_NiceTabular_bool \tabcolsep \arraycolsep } 
+        \dim_add:Nn \l_@@_x_initial_dim \@@_tab_or_array_colsep:
         \@@_qpoint:n { row - \int_use:N \l_@@_initial_i_int - base }
         \dim_set_eq:NN \l_@@_y_initial_dim \pgf at y
       }
@@ -7555,8 +8435,7 @@
       {
         \@@_qpoint:n { col - \@@_succ:n \l_@@_final_j_int }
         \dim_set_eq:NN \l_@@_x_final_dim \pgf at x 
-        \dim_sub:Nn \l_@@_x_final_dim 
-           { \bool_if:NTF \l_@@_NiceTabular_bool \tabcolsep \arraycolsep } 
+        \dim_sub:Nn \l_@@_x_final_dim \@@_tab_or_array_colsep:
         \@@_qpoint:n { row - \int_use:N \l_@@_final_i_int - base }
         \dim_set_eq:NN \l_@@_y_final_dim \pgf at y
       }
@@ -7625,7 +8504,7 @@
         \@@_qpoint:n { col - \int_use:N \l_@@_initial_j_int } 
         \dim_set_eq:NN \l_@@_x_initial_dim \pgf at x 
         \dim_add:Nn \l_@@_x_initial_dim 
-           { \bool_if:NTF \l_@@_NiceTabular_bool \tabcolsep \arraycolsep } 
+          { \bool_if:NTF \l_@@_NiceTabular_bool \tabcolsep \arraycolsep } 
       }
       { \@@_set_initial_coords_from_anchor:n { mid~east } }
     \bool_if:NTF \l_@@_final_open_bool
@@ -7633,7 +8512,7 @@
         \@@_qpoint:n { col - \@@_succ:n \l_@@_final_j_int }
         \dim_set_eq:NN \l_@@_x_final_dim \pgf at x 
         \dim_sub:Nn \l_@@_x_final_dim 
-           { \bool_if:NTF \l_@@_NiceTabular_bool \tabcolsep \arraycolsep } 
+          { \bool_if:NTF \l_@@_NiceTabular_bool \tabcolsep \arraycolsep } 
       }
       { \@@_set_final_coords_from_anchor:n { mid~west } }
     \bool_lazy_and:nnTF
@@ -7701,8 +8580,8 @@
 \cs_new_protected:Npn \@@_actually_draw_Vdots:
   {
 %    \end{macrocode}
-% The boolean |\l_tmpa_bool| indicates whether the column is of type |l| (|L| of
-% |{NiceArray}|) or may be considered as if.
+% The boolean |\l_tmpa_bool| indicates whether the column is of type |l| or may
+% be considered as if.
 %    \begin{macrocode}      
     \bool_set_false:N \l_tmpa_bool 
     \bool_lazy_or:nnF \l_@@_initial_open_bool \l_@@_final_open_bool 
@@ -7713,8 +8592,8 @@
           { \dim_compare_p:nNn \l_@@_x_initial_dim = \l_@@_x_final_dim }
       }
 %    \end{macrocode}
-% Now, we try to determine whether the column is of type |c| (|C| of
-% |{NiceArray}|) or may be considered as if.
+% Now, we try to determine whether the column is of type |c| or may be
+% considered as if.
 %    \begin{macrocode}
     \bool_if:NTF \l_@@_initial_open_bool
       { 
@@ -8042,7 +8921,7 @@
         \pgftransformshift 
           { 
             \pgfpointlineattime { 0.5 }
-              { \pgfpoint \l_@@_x_initial_dim  \l_@@_y_initial_dim }
+              { \pgfpoint \l_@@_x_initial_dim \l_@@_y_initial_dim }
               { \pgfpoint \l_@@_x_final_dim \l_@@_y_final_dim }
           } 
         \pgftransformrotate
@@ -8051,7 +8930,7 @@
               { 
                 atand 
                  ( 
-                  \l_@@_y_final_dim - \l_@@_y_initial_dim ,
+                   \l_@@_y_final_dim - \l_@@_y_initial_dim ,
                    \l_@@_x_final_dim - \l_@@_x_initial_dim 
                   ) 
               }        
@@ -8232,7 +9111,7 @@
 % \pkg{nicematrix} rely upon |{NiceArray}|). 
 %
 % The starred versions of these commands are deprecated since version~3.1 but,
-% as for now, they are still available with an error.
+% as of now, they are still available with an error.
 %
 % 
 % \medskip
@@ -8378,8 +9257,24 @@
 \cs_set_eq:NN \@@_old_multicolumn \multicolumn
 \cs_new:Npn \@@_multicolumn:nnn #1 #2 #3
   { 
-    \@@_old_multicolumn { #1 } { #2 } { #3 }
+%    \begin{macrocode}
+% We have to act in expandable way since it will begin by a |\multicolumn|.
+%    \end{macrocode
+    \exp_args:NNe 
+      \@@_old_multicolumn 
+      { #1 } 
 %    \end{macrocode}
+% We will have to replace |\tl_lower_case:n| in some times
+% since |\tl_lower_case:n| seems to be deprecated.
+%    \begin{macrocode}
+      { 
+        > \@@_Cell: 
+        \bool_if:NT \c_@@_define_L_C_R_bool \tl_lower_case:n 
+        #2 
+        < \@@_end_Cell: 
+      } 
+      { #3 } 
+%    \end{macrocode}
 % The |\peek_remove_spaces:n| is mandatory.
 %    \begin{macrocode}
     \peek_remove_spaces:n
@@ -8413,7 +9308,7 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_Hdotsfor:
   {
-    \multicolumn { 1 } { C } { }
+    \multicolumn { 1 } { c } { }
     \@@_Hdotsfor_i
   }
 %    \end{macrocode}
@@ -8445,7 +9340,7 @@
                 down = \exp_not:n { #4 } , up = \exp_not:n { #5 }
               } 
           }
-        \prg_replicate:nn { #2 - 1 } { & \multicolumn { 1 } { C } { } }
+        \prg_replicate:nn { #2 - 1 } { & \multicolumn { 1 } { c } { } }
       } 
   }
 %    \end{macrocode}
@@ -9355,17 +10250,14 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_test_if_hline_in_block:nnnn #1 #2 #3 #4
   {
-    \int_compare:nNnT \l_tmpa_tl > { #1 }
+    \bool_lazy_all:nT
       {
-        \int_compare:nNnT \l_tmpa_tl < { #3 + 1 }
-          {
-            \int_compare:nNnT \l_tmpb_tl > { #2 - 1 }
-              {
-                \int_compare:nNnT \l_tmpb_tl < { #4 + 1 }
-                  { \bool_gset_false:N \g_tmpa_bool }
-              }
-          }
+        { \int_compare_p:nNn \l_tmpa_tl > { #1 } }
+        { \int_compare_p:nNn \l_tmpa_tl < { #3 + 1 } }
+        { \int_compare_p:nNn \l_tmpb_tl > { #2 - 1 } }
+        { \int_compare_p:nNn \l_tmpb_tl < { #4 + 1 } }
       }
+      { \bool_gset_false:N \g_tmpa_bool }
   }
 %    \end{macrocode}
 %
@@ -9373,17 +10265,14 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_test_if_vline_in_block:nnnn #1 #2 #3 #4
   {
-    \int_compare:nNnT \l_tmpa_tl > { #1 - 1 }
+    \bool_lazy_all:nT
       {
-        \int_compare:nNnT \l_tmpa_tl < { #3 + 1 }
-          {
-            \int_compare:nNnT \l_tmpb_tl > { #2 }
-              {
-                \int_compare:nNnT \l_tmpb_tl < { #4 + 1 }
-                  { \bool_gset_false:N \g_tmpa_bool }
-              }
-          }
+        { \int_compare_p:nNn \l_tmpa_tl > { #1 - 1 } }
+        { \int_compare_p:nNn \l_tmpa_tl < { #3 + 1 } }
+        { \int_compare_p:nNn \l_tmpb_tl > { #2 } }
+        { \int_compare_p:nNn \l_tmpb_tl < { #4 + 1 } }
       }
+      { \bool_gset_false:N \g_tmpa_bool }
   }
 %    \end{macrocode}
 %
@@ -9440,7 +10329,7 @@
     \int_zero_new:N \l_@@_last_empty_row_int
     \int_step_inline:nnnn { #1 } { #3 } { #5 }
       {
-        \@@_test_if_cell_in_a_block:nx { ##1 } { \int_eval:n { #2 } }
+        \@@_test_if_cell_in_a_block:nn { ##1 } { \int_eval:n { #2 } }
         \bool_if:nTF
           {
              \cs_if_exist_p:c
@@ -9461,7 +10350,7 @@
     \int_zero_new:N \l_@@_last_empty_column_int
     \int_step_inline:nnnn { #2 } { #4 } { #6 }
       {
-        \@@_test_if_cell_in_a_block:xn { \int_eval:n { #1 } } { ##1 } 
+        \@@_test_if_cell_in_a_block:nn { \int_eval:n { #1 } } { ##1 } 
         \bool_if:nTF
           {
             \cs_if_exist_p:c
@@ -9507,33 +10396,33 @@
   }
 %    \end{macrocode}
 %
-% \bigskip
-% The following macro tests whether if a cell is in (at least) one of the blocks
-% of the array.
+% \bigskip 
+% The following macro tests whether a cell is in (at least) one of
+% the blocks of the array (or in a cell with a |\diagbox|).
 % 
-% The flag |\l_tmpb_bool| will be raised if the cell |#1|-|#2| is in a block.
+% The flag |\l_tmpb_bool| will be raised if the cell |#1|-|#2| is in a block (or
+% in a cell with a |\diagbox|).
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_test_if_cell_in_a_block:nn #1 #2
   {
+    \int_set:Nn \l_tmpa_int { #1 }
+    \int_set:Nn \l_tmpb_int { #2 }
     \bool_set_false:N \l_tmpb_bool
     \seq_map_inline:Nn \g_@@_pos_of_blocks_seq 
-      { \@@_test_if_cell_in_block:nnnnnnn { #1 } { #2 } ##1 }
+      { \@@_test_if_cell_in_block:nnnnnnn { \l_tmpa_int } { \l_tmpb_int } ##1 }
   }
 %    \end{macrocode}
 % 
-%    \begin{macrocode}
-\cs_generate_variant:Nn \@@_test_if_cell_in_a_block:nn { nx , xn }
-%    \end{macrocode}
 % 
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_test_if_cell_in_block:nnnnnnn #1 #2 #3 #4 #5 #6
   {
-    \bool_if:nT
+    \bool_lazy_all:nT
       {
-           \int_compare_p:n { #3 <= #1 }
-        && \int_compare_p:n { #1 <= #5 }
-        && \int_compare_p:n { #4 <= #2 }
-        && \int_compare_p:n { #2 <= #6 }
+        { \int_compare_p:n { #3 <= #1 } }
+        { \int_compare_p:n { #1 <= #5 } }
+        { \int_compare_p:n { #4 <= #2 } }
+        { \int_compare_p:n { #2 <= #6 } }
       }
     { \bool_set_true:N \l_tmpb_bool }
   }
@@ -9565,7 +10454,7 @@
 \cs_new_protected:Npn \@@_hdottedline_i:
   { 
 %    \end{macrocode}
-% We write in the code-after the instruction that will eventually draw the
+% We write in the code-after the instruction that will potentially draw the
 % dotted line.  It's not possible to draw this dotted line now because we don't
 % know the length of the line (we don't even know the number of columns).
 %    \begin{macrocode}
@@ -9693,7 +10582,7 @@
 %    \end{macrocode}
 %
 % \medskip
-% As for now, we have no option to control the style of the lines drawn by
+% As of 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}
@@ -9761,7 +10650,7 @@
     \@@_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}
-% As for now, we have no option to control the style of the lines drawn by
+% As of 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}
@@ -9770,8 +10659,8 @@
   }
 %    \end{macrocode}
 % 
-%
 % 
+% 
 % \bigskip 
 % \subsection*{The environment \{NiceMatrixBlock\}}
 %
@@ -9829,7 +10718,7 @@
             \cs_gset:cpn 
               { @@ _ max _ cell _ width _ \int_use:N \g_@@_NiceMatrixBlock_int } 
 %    \end{macrocode}
-% For technical reasons, we have to include the width of an eventual rule on the
+% For technical reasons, we have to include the width of a potential rule on the
 % right side of the cells.
 %    \begin{macrocode}
               { \dim_eval:n { \g_@@_max_cell_width_dim + \arrayrulewidth } }
@@ -10205,6 +11094,8 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_Block_ii:nnnnn #1 #2 #3 #4 #5
   {
+    \bool_if:NT \l_@@_NiceTabular_bool
+      { \tl_if_empty:nF { #4 } { \@@_error:n { angle~option~in~NiceTabular } } } 
 %    \end{macrocode}
 %
 % \medskip
@@ -10217,8 +11108,8 @@
         { \int_eval:n { \c at jCol + #2 - 1 } }
       }
 %    \end{macrocode}
-% Now, |\l_tmpa_tl|  constains a ``object'' corresponding to the position of the
-% block whith four components surrounded by brackets:
+% Now, |\l_tmpa_tl|  contains an ``object'' corresponding to the position of the
+% block whith four components surrounded by curly brackets:
 % 
 % |{|\textsl{imin}|}{|\textsl{jmin}|}{|\textsl{imax}|}{|\textsl{jmax}|}|.
 % 
@@ -10229,7 +11120,7 @@
 % We also store a complete description of the block in the sequence
 % |\g_@@_blocks_seq|. Of course, the sequences |\g_@@_pos_of_blocks_seq| and
 % |\g_@@_blocks_seq| are redundant, but it's for efficiency. In
-% |\g_@@_blocks_seq|, each block is represented by an ``objet'' with six
+% |\g_@@_blocks_seq|, each block is represented by an ``object'' with six
 % components:
 %
 % |{|\textsl{imin}|}{|\textsl{jmin}|}{|\textsl{imax}|}{|\textsl{jmax}|}{|\textsl{options}|}{|\textsl{contents}|}|.
@@ -10247,7 +11138,7 @@
 % \bigskip
 % The key |tikz| is for Tikz options used when the \textsc{pgf} node of the
 % block is created (the ``normal'' block node and not the ``short'' one nor the
-% ``medium'' one). \textbf{In fact, as for now, it is \emph{not} documented}. Is
+% ``medium'' one). \textbf{In fact, as of now, it is \emph{not} documented}. Is
 % it really a good idea to provide such a key?
 %   \begin{macrocode}
 \keys_define:nn { NiceMatrix / Block }
@@ -10269,7 +11160,7 @@
 \cs_new_protected:Npn \@@_Block_iii:nnnnnn #1 #2 #3 #4 #5 #6
   { 
 %    \end{macrocode}
-% The group is for the keys (even if, as for now, there is only one key, called
+% The group is for the keys (even if, as of now, there is only one key, called
 % |tikz| and not documented).
 %    \begin{macrocode}
     \group_begin:
@@ -10276,7 +11167,20 @@
     \keys_set:nn { NiceMatrix / Block } { #5 }
 %    \end{macrocode}
 %
+% \medskip
 %    \begin{macrocode}
+     \cs_set_protected:Npn \diagbox ##1 ##2
+       {
+         \tl_gput_right:Nx \g_@@_internal_code_after_tl    
+           { 
+             \@@_actually_diagbox:nnnnnn 
+               { #1 } { #2 } { #3 } { #4 } { ##1 } { ##2 }
+           }
+       }  
+%    \end{macrocode}
+% 
+% \medskip
+%    \begin{macrocode}
     \bool_lazy_or:nnTF
       { \int_compare_p:nNn { #3 } > \g_@@_row_total_int } 
       { \int_compare_p:nNn { #4 } > \c at jCol }
@@ -10298,7 +11202,7 @@
 % will be used by \pkg{nicematrix} to put the label of the node. The first one
 % won't be used explicitely.
 % \begin{Verbatim}
-% \begin{NiceTabular}{CC!{\hspace{1cm}}C}
+% \begin{NiceTabular}{cc!{\hspace{1cm}}c}
 % \Block{2-2}{our block} &      & one    \\
 %                        &      & two    \\
 % three                  & four & five   \\
@@ -10316,7 +11220,7 @@
 % \begin{tabular}{c!{\hspace{1cm}}c}
 % We highlight the node |1-1-block| 
 % & We highlight the node |1-1-block-short| \\[2mm]
-% \begin{NiceTabular}{CC!{\hspace{1cm}}C}
+% \begin{NiceTabular}{cc!{\hspace{1cm}}c}
 % \Block{2-2}{our block} &      & one    \\
 %                        &      & two    \\
 % three                  & four & five   \\
@@ -10325,7 +11229,7 @@
 % \tikz \node [highlight = (1-1-block)] { } ;
 % \end{NiceTabular} 
 % & 
-% \begin{NiceTabular}{CC!{\hspace{1cm}}C}
+% \begin{NiceTabular}{cc!{\hspace{1cm}}c}
 % \Block{2-2}{our block} &      & one    \\
 %                        &      & two    \\
 % three                  & four & five   \\
@@ -10365,8 +11269,6 @@
           \end { pgfscope }
 %    \end{macrocode}
 % 
-%   
-%
 % \medskip
 % We construct the |short| node.
 %    \begin{macrocode}
@@ -10522,7 +11424,7 @@
     \int_zero_new:N \l_@@_nb_cols_int
     \@@_set_size:n #4 \q_stop
     \begin { NiceArrayWithDelims } { #1 } { #2 } 
-      { * { \l_@@_nb_cols_int } { C } } [ #3 , #5 , #7 ] 
+      { * { \l_@@_nb_cols_int } { c } } [ #3 , #5 , #7 ] 
     \int_compare:nNnT \l_@@_first_row_int = 0
       { 
         \int_compare:nNnT \l_@@_first_col_int = 0 { & } 
@@ -10533,7 +11435,7 @@
       { 
         \int_compare:nNnT \l_@@_first_col_int = 0 { & }
 %    \end{macrocode}
-% You put |{ }| before |#6| to avoid a hasty expansion of an eventual
+% You put |{ }| before |#6| to avoid a hasty expansion of a potential
 % |\arabic{iRow}| at the beginning of the row which would result in an incorrect
 % value of that |iRow| (since |iRow| is incremented in the first cell of the row
 % of the |\halign|).
@@ -10613,6 +11515,8 @@
 % \bigskip
 % \subsection*{The command \textbackslash diagbox}
 %
+% The command |\diagbox| will be linked to |\diagbox:nn| in the environments of
+% \pkg{nicematrix}. 
 %
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_diagbox:nn #1 #2
@@ -10619,18 +11523,39 @@
   {
     \tl_gput_right:Nx \g_@@_internal_code_after_tl    
       { 
-        \@@_actually_diagbox:nnnn 
-          { \int_use:N \c at iRow } { \int_use:N \c at jCol } { #1 } { #2 }
+        \@@_actually_diagbox:nnnnnn
+          { \int_use:N \c at iRow } 
+          { \int_use:N \c at jCol } 
+          { \int_use:N \c at iRow } 
+          { \int_use:N \c at jCol } 
+          { #1 } 
+          { #2 }
       }
+%    \end{macrocode}
+% We put the cell with |\diagbox| in the sequence |\g_@@_pos_of_blocks_seq|
+% because a cell with |\diagbox| must be considered as non empty by the key 
+% |hvlines-except-corners|.
+%    \begin{macrocode}
+    \seq_gput_right:Nx \g_@@_pos_of_blocks_seq
+      {
+        { \int_use:N \c at iRow } 
+        { \int_use:N \c at jCol } 
+        { \int_use:N \c at iRow } 
+        { \int_use:N \c at jCol } 
+      }
   }
 %    \end{macrocode}
+%
+% \medskip
+% The command |\diagbox| is also redefined locally when we draw a block.
 % 
 % \medskip
-% The two arguments of |\@@_actually_diagbox:nn| are the number of row and the
-% number of column of the cell to slash. The two other are the elements to draw
-% below and above the diagonal line.
+% The first four arguments of |\@@_actually_diagbox:nnnnnn| correspond to the
+% rectangle (=block) to slash (we recall that it's possible to use |\diagbox| in
+% a |\Block|). The two other are the elements to draw below and above the
+% diagonal line.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_actually_diagbox:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_actually_diagbox:nnnnnn #1 #2 #3 #4 #5 #6
   {
     \pgfpicture
     \pgf at relevantforpicturesizefalse
@@ -10640,9 +11565,9 @@
     \@@_qpoint:n { col - #2 }
     \dim_set_eq:NN \l_tmpb_dim \pgf at x
     \pgfpathmoveto { \pgfpoint \l_tmpb_dim \l_tmpa_dim }
-    \@@_qpoint:n { row - \@@_succ:n { #1 } }
+    \@@_qpoint:n { row - \@@_succ:n { #3 } }
     \dim_set_eq:NN \l_tmpc_dim \pgf at y 
-    \@@_qpoint:n { col - \@@_succ:n { #2 } }
+    \@@_qpoint:n { col - \@@_succ:n { #4 } }
     \dim_set_eq:NN \l_tmpd_dim \pgf at x
     \pgfpathlineto { \pgfpoint \l_tmpd_dim \l_tmpc_dim }
     {
@@ -10659,15 +11584,18 @@
     \pgfscope
     \pgftransformshift { \pgfpoint \l_tmpb_dim \l_tmpc_dim }
     \pgfnode { rectangle } { south~west } 
-      { \@@_math_toggle_token: #3 \@@_math_toggle_token: } { } { }
+      { \@@_math_toggle_token: #5 \@@_math_toggle_token: } { } { }
     \endpgfscope
     \pgftransformshift { \pgfpoint \l_tmpd_dim \l_tmpa_dim }
     \pgfnode { rectangle } { north~east } 
-      { \@@_math_toggle_token: #4 \@@_math_toggle_token: } { } { }
+      { \@@_math_toggle_token: #6 \@@_math_toggle_token: } { } { }
     \endpgfpicture
   }
 %    \end{macrocode}
+%
 % 
+%
+% 
 % \bigskip
 % \subsection*{The keyword \textbackslash CodeAfter}
 %
@@ -10710,8 +11638,8 @@
   }
 %    \end{macrocode}
 %
-% 
 %
+%
 % \bigskip
 % \subsection*{We process the options at package loading}
 %
@@ -10725,9 +11653,47 @@
 %
 % Of course, the command |\NiceMatrix| must be defined before such an
 % instruction is executed. 
+%
+% \medskip
+%% \medskip
+% The boolean |\g_@@_footnotehyper_bool| will indicate if the option
+% |footnotehyper| is used.
 %    \begin{macrocode}
+\bool_new:N \c_@@_footnotehyper_bool
+%    \end{macrocode}
+%
+% \medskip
+% The boolean |\c_@@_footnote_bool| will indicate if the option |footnote| is
+% used, but quicky, it will also be set to |true| if the option |footnotehyper|
+% is used.
+%    \begin{macrocode}
+\bool_new:N \c_@@_footnote_bool
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\@@_msg_new:nnn { Unknown~option~for~package } 
+  { 
+    The~option~'\l_keys_key_tl'~is~unknown. \\
+    If~you~go~on,~it~will~be~ignored. \\
+    For~a~list~of~the~available~options,~type~H~<return>.
+  }
+  {
+    The~available~options~are~(in~alphabetic~order):~
+    define-L-C-R,~
+    footnote,~
+    footnotehyper,~
+    renew-dots,~
+    renew-matrix~and~
+    transparent.
+  }
+%    \end{macrocode}
+%
+%
+%    \begin{macrocode}
 \keys_define:nn { NiceMatrix / Package }
   {
+    define-L-C-R .bool_set:N = \c_@@_define_L_C_R_bool ,
+    define-L-C-R .default:n = true ,
     renew-dots .bool_set:N = \l_@@_renew_dots_bool ,
     renew-dots .value_forbidden:n = true ,
     renew-matrix .code:n = \@@_renew_matrix: ,
@@ -10734,33 +11700,82 @@
     renew-matrix .value_forbidden:n = true ,
     transparent .meta:n = { renew-dots , renew-matrix } ,
     transparent .value_forbidden:n = true,
+    footnote .bool_set:N = \c_@@_footnote_bool ,
+    footnotehyper .bool_set:N = \c_@@_footnotehyper_bool ,
+    unknown .code:n = \@@_error:n { Unknown~option~for~package } 
   }
 \ProcessKeysOptions { NiceMatrix / Package }
 %    \end{macrocode}
 %
 % \bigskip
-% \subsection*{Error messages of the package}
+%    \begin{macrocode}
+\@@_msg_new:nn { footnote~with~footnotehyper~package }
+  { 
+    You~can't~use~the~option~'footnote'~because~the~package~
+    footnotehyper~has~already~been~loaded.~
+    If~you~want,~you~can~use~the~option~'footnotehyper'~and~the~footnotes~  
+    within~the~environments~of~nicematrix~will~be~extracted~with~the~tools~
+    of~the~package~footnotehyper.\\
+    If~you~go~on,~the~package~footnote~won't~be~loaded.
+  }
+%    \end{macrocode}
 %
-% The following command converts all the elements of a sequence (which are token
-% lists) into strings. 
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_convert_to_str_seq:N #1
-  {
-    \seq_clear:N \l_tmpa_seq
-    \seq_map_inline:Nn #1 
-      {
-        \seq_put_left:Nx \l_tmpa_seq { \tl_to_str:n { ##1 } }
+\@@_msg_new:nn { footnotehyper~with~footnote~package }
+  { 
+    You~can't~use~the~option~'footnotehyper'~because~the~package~
+    footnote~has~already~been~loaded.~
+    If~you~want,~you~can~use~the~option~'footnote'~and~the~footnotes~  
+    within~the~environments~of~nicematrix~will~be~extracted~with~the~tools~
+    of~the~package~footnote.\\ 
+    If~you~go~on,~the~package~footnotehyper~won't~be~loaded.
+  }
+%    \end{macrocode}
+%
+% \medskip
+%    \begin{macrocode}
+\bool_if:NT \c_@@_footnote_bool 
+  { 
+    \@ifclassloaded { beamer }
+      { \msg_info:nn { nicematrix } { Option~incompatible~with~Beamer } }
+      { 
+        \@ifpackageloaded { footnotehyper }
+          { \@@_error:n { footnote~with~footnotehyper~package } }
+          { \usepackage { footnote } }
       }
-    \seq_set_eq:NN #1 \l_tmpa_seq
   }
 %    \end{macrocode}
+%
+%    \begin{macrocode}
+\bool_if:NT \c_@@_footnotehyper_bool
+  { 
+    \@ifclassloaded { beamer }
+      { \@@_info:n  { Option~incompatible~with~Beamer } }
+      { 
+        \@ifpackageloaded { footnote }
+          { \@@_error:n { footnotehyper~with~footnote~package } }
+          { \usepackage { footnotehyper } }
+      }
+    \bool_set_true:N \c_@@_footnote_bool 
+  }
+%    \end{macrocode}
+% The flag |\c_@@_footnote_bool| is raised and so, we will only have to test
+% |\c_@@_footnote_bool| in order to know if we have to insert an environment
+% |{savenotes}|.
+%
+%
+% \bigskip
+% \subsection*{Error messages of the package}
+%
 % 
-% The following command creates a sequence of strings (|str|) from a |clist|.
+% The following command creates a sequence of strings (|str|) from a |clist|. Be
+% careful: we use |\seq_set_map:NNn| and the name of that function will maybe
+% change to |\eq_set_map_x:NNn|.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_set_seq_of_str_from_clist:Nn #1 #2
   {
     \seq_set_from_clist:Nn #1 { #2 }
-    \@@_convert_to_str_seq:N #1
+    \seq_set_map:NNn #1 #1 { \tl_to_str:n { ##1 } }
   }
 %    \end{macrocode}
 % 
@@ -10899,6 +11914,7 @@
   }
 %    \end{macrocode}
 %
+%
 %    \begin{macrocode}
 \@@_msg_new:nn { ampersand~in~light-syntax }
   {
@@ -10978,12 +11994,46 @@
   {
     You~try~to~draw~a~block~in~the~cell~#1-#2~of~your~matrix~but~the~matrix~is~
     too~small~for~that~block. \\
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\@@_msg_new:nn { angle~option~in~NiceTabular }
+  {
+    You~should~not~the~option~between~angle~brackets~(<~and~>)~for~a~command~
+    \token_to_str:N \Block\ in~\{NiceTabular\}.~However,~you~can~go~on.
+  }
+%    \end{macrocode}
+% 
+%    \begin{macrocode}
+\@@_msg_new:nn { tabularnote~forbidden }
+  {
+    You~can't~use~the~command~\token_to_str:N\tabularnote\ 
+    ~in~a~\@@_full_name_env:.~This~command~is~available~only~in~
+    \{NiceTabular\},~\{NiceArray\}~and~\{NiceMatrix\}. \\
     If~you~go~on,~this~command~will~be~ignored.
   }
 %    \end{macrocode}
 %
+%    \begin{macrocode}
+\@@_msg_new:nn { bottomule~without~booktabs }
+  {
+    You~can't~use~the~option~'tabular/bottomrule'~because~you~haven't~
+    loaded~'booktabs'.\\
+    If~you~go~on,~this~option~will~be~ignored.
+  }
+%    \end{macrocode}
 % 
 %    \begin{macrocode}
+\@@_msg_new:nn { enumitem~not~loaded }
+  {
+    You~can't~use~the~command~\token_to_str:N\tabularnote\ 
+    ~because~you~haven't~loaded~'enumitem'.\\
+    If~you~go~on,~this~command~will~be~ignored.
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \@@_msg_new:nn { Wrong~last~row }
   { 
     You~have~used~'last-row=\int_use:N \l_@@_last_row_int'~but~your~
@@ -10997,10 +12047,7 @@
 %
 %    \begin{macrocode}
 \@@_msg_new:nn { Yet~in~env }
-  { 
-    Environments~\{NiceArray\}~(or~\{NiceMatrix\},~etc.)~can't~be~nested.\\ 
-    This~error~is~fatal.
-  }
+  { Environments~of~nicematrix~can't~be~nested.\\ This~error~is~fatal. }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -11015,7 +12062,7 @@
 %    \begin{macrocode}
 \@@_msg_new:nn { Bad~value~for~letter~for~dotted~lines }
   { 
-    The~value~of~key~'\tl_use:N\l_keys_key_tl'~must~be~of~length~1.\\
+    The~value~of~key~'\l_keys_key_tl'~must~be~of~length~1.\\
     If~you~go~on,~it~will~be~ignored. 
   }
 %    \end{macrocode}
@@ -11022,9 +12069,30 @@
 %
 %
 %    \begin{macrocode}
+\@@_msg_new:nnn { Unknown~key~for~notes } 
+  {
+    The~key~'\l_keys_key_tl'~is~unknown.\\
+    If~you~go~on,~it~will~be~ignored. \\
+    For~a~list~of~the~available~keys~about~notes,~type~H~<return>.
+  }
+  {
+    The~available~options~are~(in~alphabetic~order):~
+    bottomrule,~
+    code-after,~
+    code-before,~
+    enumitem-keys,~
+    enumitem-keys-para,~
+    para,~
+    label-in-list,~
+    label-in-tabular~and~
+    style.
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \@@_msg_new:nnn { Unknown~key~for~NiceMatrixOptions }
   {
-    The~key~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~command~
+    The~key~'\l_keys_key_tl'~is~unknown~for~the~command~
     \token_to_str:N \NiceMatrixOptions. \\
     If~you~go~on,~it~will~be~ignored. \\
     For~a~list~of~the~*principal*~available~keys,~type~H~<return>.
@@ -11052,6 +12120,7 @@
     left-margin,~
     letter-for-dotted-lines,~
     light-syntax,~
+    notes~(several subkeys),~
     nullify-dots,~
     renew-dots,~
     renew-matrix,~
@@ -11068,7 +12137,7 @@
 %    \begin{macrocode}
 \@@_msg_new:nnn { Unknown~option~for~NiceArray }
   { 
-    The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~
+    The~option~'\l_keys_key_tl'~is~unknown~for~the~environment~
     \{NiceArray\}. \\
     If~you~go~on,~it~will~be~ignored. \\
     For~a~list~of~the~*principal*~available~options,~type~H~<return>.
@@ -11100,6 +12169,8 @@
     left-margin,~
     light-syntax,~
     name,~
+    notes/bottomrule,~
+    notes/para,~
     nullify-dots,~
     renew-dots,~
     right-margin,~
@@ -11121,7 +12192,7 @@
 %    \begin{macrocode}
 \@@_msg_new:nnn { Unknown~option~for~NiceMatrix }
   { 
-    The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~
+    The~option~'\l_keys_key_tl'~is~unknown~for~the~
     \@@_full_name_env:. \\
     If~you~go~on,~it~will~be~ignored. \\
     For~a~list~of~the~*principal*~available~options,~type~H~<return>.
@@ -11173,7 +12244,7 @@
 %    \begin{macrocode}
 \@@_msg_new:nnn { Unknown~option~for~NiceTabular }
   { 
-    The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~
+    The~option~'\l_keys_key_tl'~is~unknown~for~the~environment~
     \{NiceTabular\}. \\
     If~you~go~on,~it~will~be~ignored. \\
     For~a~list~of~the~*principal*~available~options,~type~H~<return>.
@@ -11205,6 +12276,8 @@
     left-margin,~
     light-syntax,~
     name,~
+    notes/bottomrule,~
+    notes/para,~
     nullify-dots,~
     renew-dots,~
     right-margin,~
@@ -11243,15 +12316,6 @@
   }
 %    \end{macrocode}
 % 
-%    \begin{macrocode}
-\@@_msg_new:nn { Zero~row }
-  { 
-    There~is~a~problem.~Maybe~you~have~used~l,~c~and~r~instead~of~L,~C~
-    and~R~in~the~preamble~of~your~environment. \\
-    This~error~is~fatal.
-  }
-%    \end{macrocode}
-%
 % 
 % \vspace{1cm}
 % \section{History}
@@ -11326,7 +12390,7 @@
 % the ``main matrix'' (not in the exterior column), the cells in the exterior
 % column are considered as outside the matrix. That means that it's possible to
 % do the following matrix with only a |\Cdots| command (and a single |\Vdots|).
-% \[\begin{pNiceArray}{Wc{5mm}CWc{5mm}}[first-row,last-col]
+% \[\begin{pNiceArray}{Wc{5mm}cWc{5mm}}[first-row,last-col]
 % & C_j & \\
 % \mbox{\Large $0$} & \Vdots & \mbox{\Large $0$} \\
 % \strut            & a & \Cdots &  L_i \\
@@ -11541,7 +12605,7 @@
 % The option |baseline| is now available in all the environments of
 % \pkg{nicematrix}. Before, it was available only in |{NiceArray}|.
 % 
-% New command |\CodeAfter| (in the environments of \pkg{nicematrix}).
+% New keyword |\CodeAfter| (in the environments of \pkg{nicematrix}).
 %
 %
 % \subsection*{Changes between versions 3.15 and 4.0}
@@ -11574,8 +12638,15 @@
 % \subsection*{Changes between versions 4.3 and 4.4}
 % 
 % New key |hvlines-except-corners|.
+%
+% \subsection*{Changes between versions 4.4 and 5.0}
+%
+% Use of the standard column types |l|, |c| and |r| instead of |L|, |C| and |R|.
 % 
+% It's now possible to use the command |\diagbox| in a |\Block|.
 %
+% Command |\tabularnote|
+%
 % \PrintIndex
 % 
 % \tableofcontents

Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins	2020-07-16 22:02:41 UTC (rev 55850)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins	2020-07-16 22:02:56 UTC (rev 55851)
@@ -1,5 +1,5 @@
 %%
-%% Copyright (C) 2017-2019 by F. Pantigny
+%% Copyright (C) 2018-2020 by F. Pantigny
 %%
 %%
 %% This file may be distributed and/or modified under the
@@ -17,7 +17,7 @@
 \usedir{tex/latex/nicematrix}
 \preamble
 
-Copyright (C) 2017-2019 by F. Pantigny
+Copyright (C) 2018-2020 by F. Pantigny
 
 This file may be distributed and/or modified under the
 conditions of the LaTeX Project Public License, either

Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2020-07-16 22:02:41 UTC (rev 55850)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty	2020-07-16 22:02:56 UTC (rev 55851)
@@ -6,7 +6,7 @@
 %%
 %% nicematrix.dtx  (with options: `package')
 %% 
-%% Copyright (C) 2017-2019 by F. Pantigny
+%% Copyright (C) 2018-2020 by F. Pantigny
 %% 
 %% This file may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either
@@ -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{4.4}
-\def\myfiledate{2020/06/30}
+\def\myfileversion{5.0}
+\def\myfiledate{2020/07/15}
 \RequirePackage{pgfcore}
 \usepgfmodule{shapes}
 \RequirePackage{l3keys2e}
@@ -27,7 +27,7 @@
   {nicematrix}
   {\myfiledate}
   {\myfileversion}
-  {Mathematical matrices with PGF/TikZ}
+  {Enhanced arrays with the help of PGF/TikZ}
 \RequirePackage { array }
 \RequirePackage { amsmath }
 \RequirePackage { xparse }
@@ -35,12 +35,15 @@
 \cs_new_protected:Npn \__nicematrix_error:nn { \msg_error:nnn { nicematrix } }
 \cs_new_protected:Npn \__nicematrix_error:nnn { \msg_error:nnnn { nicematrix } }
 \cs_new_protected:Npn \__nicematrix_fatal:n { \msg_fatal:nn { nicematrix } }
-\cs_new_protected:Npn \__nicematrix_fatal:nn { \msg_fatal:nnn { nicematrix } }
 \cs_new_protected:Npn \__nicematrix_msg_new:nn { \msg_new:nnn { nicematrix } }
 \cs_new_protected:Npn \__nicematrix_msg_new:nnn { \msg_new:nnnn { nicematrix } }
 \cs_new_protected:Npn \__nicematrix_msg_redirect_name:nn
   { \msg_redirect_name:nnn { nicematrix } }
+\bool_new:N \c__nicematrix_in_preamble_bool
+\bool_set_true:N \c__nicematrix_in_preamble_bool
+\AtBeginDocument { \bool_set_false:N \c__nicematrix_in_preamble_bool }
 \bool_new:N \c__nicematrix_booktabs_loaded_bool
+\bool_new:N \c__nicematrix_enumitem_loaded_bool
 \bool_new:N \c__nicematrix_tikz_loaded_bool
 \AtBeginDocument
   {
@@ -47,6 +50,9 @@
     \@ifpackageloaded { booktabs }
       { \bool_set_true:N \c__nicematrix_booktabs_loaded_bool }
       { }
+    \@ifpackageloaded { enumitem }
+      { \bool_set_true:N \c__nicematrix_enumitem_loaded_bool }
+      { }
     \@ifpackageloaded { tikz }
       {
         \bool_set_true:N \c__nicematrix_tikz_loaded_bool
@@ -154,6 +160,8 @@
   { \cs_set:Npn \CT at arc@ { \color [ #1 ] { #2 } } }
 \cs_new_protected:Npn \__nicematrix_set_CT at arc@_ii: #1 \q_stop
   { \cs_set:Npn \CT at arc@ { \color { #1 } } }
+\cs_new:Npn \__nicematrix_tab_or_array_colsep:
+  { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
 \bool_new:N \c__nicematrix_siunitx_loaded_bool
 \AtBeginDocument
   {
@@ -179,20 +187,34 @@
         \cs_gset_eq:NN \__nicematrix_adapt_S_column: \prg_do_nothing:
       }
   }
-\cs_new_protected:Npn \__nicematrix_renew_NC at rewrite@S:
+\AtBeginDocument
   {
-    \renewcommand*{\NC at rewrite@S}[1][]
+    \bool_if:nTF { ! \c__nicematrix_siunitx_loaded_bool }
+      { \cs_set_eq:NN \__nicematrix_renew_NC at rewrite@S: \prg_do_nothing: }
       {
-        \@temptokena \exp_after:wN
+        \cs_new_protected:Npn \__nicematrix_renew_NC at rewrite@S:
           {
-            \tex_the:D \@temptokena
-            > { \__nicematrix_Cell: \c__nicematrix_table_collect_begin_tl S {##1} }
-            c
-            < { \c__nicematrix_table_print_tl \__nicematrix_end_Cell: }
+            \renewcommand*{\NC at rewrite@S}[1][]
+              {
+                \@temptokena \exp_after:wN
+                  {
+                    \tex_the:D \@temptokena
+                    > { \__nicematrix_Cell: \c__nicematrix_table_collect_begin_tl S {##1} }
+                    \__nicematrix_true_c:
+                    < { \c__nicematrix_table_print_tl \__nicematrix_end_Cell: }
+                  }
+                \NC at find
+              }
           }
-        \NC at find
       }
   }
+\bool_new:N \c__nicematrix_define_L_C_R_bool
+\cs_new_protected:Npn \__nicematrix_define_L_C_R:
+  {
+    \newcolumntype L l
+    \newcolumntype C c
+    \newcolumntype R r
+  }
 \int_new:N \g__nicematrix_env_int
 \cs_new:Npn \__nicematrix_env: { nm - \int_use:N \g__nicematrix_env_int }
 \NewExpandableDocumentCommand \NiceMatrixLastEnv { }
@@ -214,7 +236,6 @@
 \colorlet { nicematrix-last-col } { . }
 \colorlet { nicematrix-last-row } { . }
 \str_new:N \g__nicematrix_name_env_str
-\str_new:N \g__nicematrix_com_or_env_str
 \str_set:Nn \g__nicematrix_com_or_env_str { environment }
 \cs_new:Npn \__nicematrix_full_name_env:
   {
@@ -253,6 +274,69 @@
 \int_new:N \l__nicematrix_last_col_int
 \int_set:Nn \l__nicematrix_last_col_int { -2 }
 \bool_new:N \g__nicematrix_last_col_found_bool
+\newcounter { tabularnote }
+\seq_new:N \g__nicematrix_tabularnotes_seq
+\int_new:N \l__nicematrix_number_of_notes_int
+\cs_new:Npn \__nicematrix_notes_style:n #1 { \emph { \alph { #1 } } }
+\cs_new:Npn \__nicematrix_notes_label_in_tabular:n #1 { \textsuperscript { #1 } }
+\cs_new:Npn \__nicematrix_notes_label_in_list:n #1 { \textsuperscript { #1 } }
+\cs_set:Npn \thetabularnote { { \__nicematrix_notes_style:n { tabularnote } } }
+\AtBeginDocument
+  {
+    \bool_if:nTF { ! \c__nicematrix_enumitem_loaded_bool }
+      {
+        \NewDocumentCommand \tabularnote { m }
+          { \__nicematrix_error:n { enumitem~not~loaded } }
+      }
+      {
+        \newlist { tabularnotes } { enumerate } { 1 }
+        \setlist [ tabularnotes ]
+          {
+            noitemsep , leftmargin = * , align = left , labelsep = 0pt ,
+            label =
+              \__nicematrix_notes_label_in_list:n { \__nicematrix_notes_style:n { tabularnotesi } } ,
+          }
+        \newlist { tabularnotes* } { enumerate* } { 1 }
+        \setlist [ tabularnotes* ]
+          {
+            afterlabel = \nobreak ,
+            itemjoin = \quad ,
+            label =
+              \__nicematrix_notes_label_in_list:n { \__nicematrix_notes_style:n { tabularnotes*i } }
+          }
+        \NewDocumentCommand \tabularnote { m }
+          {
+            \bool_if:nTF { ! \l__nicematrix_NiceArray_bool && \l__nicematrix_in_env_bool }
+              { \__nicematrix_error:n { tabularnote~forbidden } }
+              {
+                \int_incr:N \l__nicematrix_number_of_notes_int
+                \seq_gput_right:Nx \g__nicematrix_tabularnotes_seq { #1 }
+                \peek_meaning:NF \tabularnote
+                  {
+                    \hbox_set:Nn \l_tmpa_box
+                      {
+                        \__nicematrix_notes_label_in_tabular:n
+                          {
+                            \stepcounter { tabularnote }
+                            \__nicematrix_notes_style:n { tabularnote }
+                            \prg_replicate:nn { \l__nicematrix_number_of_notes_int - 1 }
+                              {
+                                ,
+                                \stepcounter { tabularnote }
+                                \__nicematrix_notes_style:n { tabularnote }
+                              }
+                          }
+                      }
+                    \addtocounter { tabularnote } { -1 }
+                    \refstepcounter { tabularnote }
+                    \int_zero:N \l__nicematrix_number_of_notes_int
+                    \hbox_overlap_right:n { \box_use:N \l_tmpa_box }
+                    \skip_horizontal:n { \box_wd:N \l_tmpa_box }
+                  }
+              }
+          }
+      }
+  }
 \cs_new_protected:Npn \__nicematrix_pgf_rect_node:nnnnn #1 #2 #3 #4 #5
   {
     \begin { pgfscope }
@@ -324,6 +408,8 @@
 \bool_new:N \l__nicematrix_vlines_bool
 \bool_new:N \l__nicematrix_hvlines_bool
 \bool_new:N \l__nicematrix_hvlines_except_corners_bool
+\dim_new:N \l__nicematrix_notes_above_space_dim
+\dim_set:Nn \l__nicematrix_notes_above_space_dim { 1 mm }
 \bool_new:N \l__nicematrix_nullify_dots_bool
 \bool_new:N \l__nicematrix_auto_columns_width_bool
 \str_new:N \l__nicematrix_name_str
@@ -340,13 +426,13 @@
 \keys_define:nn { NiceMatrix / xdots }
   {
     line-style .code:n =
-     {
-       \bool_lazy_or:nnTF
-        { \cs_if_exist_p:N \tikzpicture }
-        { \str_if_eq_p:nn { #1 } { standard } }
-        { \tl_set:Nn \l__nicematrix_xdots_line_style_tl { #1 } }
-        { \__nicematrix_error:n { bad~option~for~line-style } }
-     } ,
+      {
+        \bool_lazy_or:nnTF
+          { \cs_if_exist_p:N \tikzpicture }
+          { \str_if_eq_p:nn { #1 } { standard } }
+          { \tl_set:Nn \l__nicematrix_xdots_line_style_tl { #1 } }
+          { \__nicematrix_error:n { bad~option~for~line-style } }
+      } ,
     line-style .value_required:n = true ,
     color .tl_set:N = \l__nicematrix_xdots_color_tl ,
     color .value_required:n = true ,
@@ -392,11 +478,11 @@
     hlines .bool_set:N = \l__nicematrix_hlines_bool ,
     vlines .bool_set:N = \l__nicematrix_vlines_bool ,
     hvlines .code:n =
-     {
-       \bool_set_true:N \l__nicematrix_hvlines_bool
-       \bool_set_true:N \l__nicematrix_vlines_bool
-       \bool_set_true:N \l__nicematrix_hlines_bool
-     } ,
+      {
+        \bool_set_true:N \l__nicematrix_hvlines_bool
+        \bool_set_true:N \l__nicematrix_vlines_bool
+        \bool_set_true:N \l__nicematrix_hlines_bool
+      } ,
     parallelize-diags .bool_set:N = \l__nicematrix_parallelize_diags_bool ,
     renew-dots .bool_set:N = \l__nicematrix_renew_dots_bool ,
     renew-dots .value_forbidden:n = true ,
@@ -422,13 +508,13 @@
     hvlines-except-corners .bool_set:N = \l__nicematrix_hvlines_except_corners_bool ,
     hvlines-except-corners .default:n = true ,
     code-before .code:n =
-     {
-       \tl_if_empty:nF { #1 }
-         {
-           \tl_set:Nn \l__nicematrix_code_before_tl { #1 }
-           \bool_set_true:N \l__nicematrix_code_before_bool
-         }
-     } ,
+      {
+        \tl_if_empty:nF { #1 }
+          {
+            \tl_set:Nn \l__nicematrix_code_before_tl { #1 }
+            \bool_set_true:N \l__nicematrix_code_before_bool
+          }
+      } ,
     c .code:n = \str_set:Nn \l__nicematrix_baseline_str c ,
     t .code:n = \str_set:Nn \l__nicematrix_baseline_str t ,
     b .code:n = \str_set:Nn \l__nicematrix_baseline_str b ,
@@ -452,6 +538,58 @@
     code-after .tl_gset:N = \g__nicematrix_code_after_tl ,
     code-after .value_required:n = true ,
   }
+\keys_define:nn { NiceMatrix / notes }
+  {
+    para .bool_set:N = \l__nicematrix_notes_para_bool ,
+    para .default:n = true ,
+    code-before .tl_set:N = \l__nicematrix_notes_code_before_tl ,
+    code-before .value_required:n = true ,
+    code-after .tl_set:N = \l__nicematrix_notes_code_after_tl ,
+    code-after .value_required:n = true ,
+    bottomrule .bool_set:N = \l__nicematrix_notes_bottomrule_bool ,
+    bottomrule .default:n = true ,
+    style .code:n = \cs_set:Nn \__nicematrix_notes_style:n { #1 } ,
+    style .value_required:n = true ,
+    label-in-tabular .code:n =
+      \cs_set:Nn \__nicematrix_notes_label_in_tabular:n { #1 } ,
+    label-in-tabular .value_required:n = true ,
+    label-in-list .code:n =
+      \cs_set:Nn \__nicematrix_notes_label_in_list:n { #1 } ,
+    label-in-list .value_required:n = true ,
+    enumitem-keys .code:n =
+      {
+        \bool_if:NTF \c__nicematrix_in_preamble_bool
+          {
+            \AtBeginDocument
+              {
+                \bool_if:NT \c__nicematrix_enumitem_loaded_bool
+                  { \setlist* [ tabularnotes ] { #1 } }
+              }
+          }
+          {
+             \bool_if:NT \c__nicematrix_enumitem_loaded_bool
+               { \setlist* [ tabularnotes ] { #1 } }
+          }
+      } ,
+    enumitem-keys .value_required:n = true ,
+    enumitem-keys-para .code:n =
+      {
+        \bool_if:NTF \c__nicematrix_in_preamble_bool
+          {
+            \AtBeginDocument
+              {
+                \bool_if:NT \c__nicematrix_enumitem_loaded_bool
+                  { \setlist* [ tabularnotes* ] { #1 } }
+              }
+          }
+          {
+            \bool_if:NT \c__nicematrix_enumitem_loaded_bool
+              { \setlist* [ tabularnotes* ] { #1 } }
+          }
+      } ,
+    enumitem-keys-para .value_required:n = true ,
+    unknown .code:n  = \__nicematrix_error:n { Unknown~key~for~notes }
+  }
 \keys_define:nn { NiceMatrix }
   {
     NiceMatrixOptions .inherit:n =
@@ -459,6 +597,8 @@
         NiceMatrix / Global ,
       } ,
     NiceMatrixOptions / xdots .inherit:n = NiceMatrix / xdots ,
+    NiceMatrixOptions / rules .inherit:n = NiceMatrix / rules ,
+    NiceMatrixOptions / notes .inherit:n = NiceMatrix / notes ,
     NiceMatrix .inherit:n =
       {
         NiceMatrix / Global ,
@@ -514,6 +654,8 @@
           { \__nicematrix_error:n { Bad~value~for~letter~for~dotted~lines } }
       } ,
     letter-for-dotted-lines .value_required:n = true ,
+    notes .code:n = \keys_set:nn { NiceMatrix / notes } { #1 } ,
+    notes .value_required:n = true ,
     unknown .code:n  = \__nicematrix_error:n { Unknown~key~for~NiceMatrixOptions }
   }
 \str_new:N \l__nicematrix_letter_for_dotted_lines_str
@@ -528,10 +670,10 @@
                            \int_set:Nn \l__nicematrix_last_col_int { -1 }
                          }
                          { \int_set:Nn \l__nicematrix_last_col_int { #1 } } ,
-    l .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl L ,
-    r .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl R ,
-    L .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl L ,
-    R .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl R ,
+    l .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl l ,
+    r .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl r ,
+    L .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl l ,
+    R .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl r ,
     S .code:n = \bool_if:NTF \c__nicematrix_siunitx_loaded_bool
                   { \tl_set:Nn \l__nicematrix_type_of_col_tl S }
                   { \__nicematrix_error:n { option~S~without~siunitx } } ,
@@ -546,6 +688,10 @@
     last-col .code:n = \tl_if_empty:nF { #1 }
                          { \__nicematrix_error:n { last-col~non~empty~for~NiceArray } }
                        \int_zero:N \l__nicematrix_last_col_int ,
+    notes / para .bool_set:N = \l__nicematrix_notes_para_bool ,
+    notes / para .default:n = true ,
+    notes / bottomrule .bool_set:N = \l__nicematrix_notes_bottomrule_bool ,
+    notes / bottomrule .default:n = true ,
     unknown .code:n = \__nicematrix_error:n { Unknown~option~for~NiceArray }
   }
 \keys_define:nn { NiceMatrix / pNiceArray }
@@ -561,6 +707,10 @@
   }
 \keys_define:nn { NiceMatrix / NiceTabular }
   {
+    notes / para .bool_set:N = \l__nicematrix_notes_para_bool ,
+    notes / para .default:n = true ,
+    notes / bottomrule .bool_set:N = \l__nicematrix_notes_bottomrule_bool ,
+    notes / bottomrule .default:n = true ,
     last-col .code:n = \tl_if_empty:nF {#1}
                          { \__nicematrix_error:n { last-col~non~empty~for~NiceArray } }
                        \int_zero:N \l__nicematrix_last_col_int ,
@@ -744,9 +894,9 @@
   }
 \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 } }
+    % \cs_if_free:cT { NC @ find @ #1 }
+    %   { \NC at list \exp_after:wN { \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 ] }
@@ -851,9 +1001,6 @@
     \int_gzero_new:N \g__nicematrix_row_total_int
     \int_gzero_new:N \g__nicematrix_col_total_int
     \cs_set_eq:NN \@ifnextchar \new at ifnextchar
-    \__nicematrix_newcolumntype L { > \__nicematrix_Cell: l < \__nicematrix_end_Cell: }
-    \__nicematrix_newcolumntype C { > \__nicematrix_Cell: c < \__nicematrix_end_Cell: }
-    \__nicematrix_newcolumntype R { > \__nicematrix_Cell: r < \__nicematrix_end_Cell: }
     \__nicematrix_define_columntype:nn p t
     \__nicematrix_define_columntype:nn m c
     \__nicematrix_define_columntype:nn b b
@@ -863,12 +1010,13 @@
             \hbox_set:Nw \l__nicematrix_cell_box
             \__nicematrix_Cell:
           }
-        c
+        \__nicematrix_true_c:
         < {
             \__nicematrix_end_Cell:
             \hbox_set_end:
-            \makebox [ ##2 ] [ \str_lowercase:n { ##1 } ]
-               { \box_use_drop:N \l__nicematrix_cell_box }
+            \tl_set:Nn \l_tmpa_tl { ##1 }
+            \makebox [ ##2 ] [ \__nicematrix_foldcase: ]
+              { \box_use_drop:N \l__nicematrix_cell_box }
           }
       }
     \__nicematrix_newcolumntype W [ 2 ]
@@ -877,12 +1025,13 @@
             \hbox_set:Nw \l__nicematrix_cell_box
             \__nicematrix_Cell:
           }
-        c
+        \__nicematrix_true_c:
         < {
             \__nicematrix_end_Cell:
             \hbox_set_end:
             \cs_set_eq:NN \hss \hfil
-            \makebox [ ##2 ] [ \str_lowercase:n { ##1 } ]
+            \tl_set:Nn \l_tmpa_tl { ##1 }
+            \makebox [ ##2 ] [ \__nicematrix_foldcase: ]
               { \box_use_drop:N \l__nicematrix_cell_box }
           }
       }
@@ -906,7 +1055,7 @@
           }
       }
     \int_gzero_new:N \g__nicematrix_last_vdotted_col_int
-    \bool_if:NT \c__nicematrix_siunitx_loaded_bool \__nicematrix_renew_NC at rewrite@S:
+    \__nicematrix_renew_NC at rewrite@S:
     \int_gset:Nn \g__nicematrix_last_vdotted_col_int { -1 }
     \bool_gset_false:N \g__nicematrix_last_col_found_bool
     \tl_gclear_new:N \g__nicematrix_Cdots_lines_tl
@@ -915,9 +1064,20 @@
     \tl_gclear_new:N \g__nicematrix_Ddots_lines_tl
     \tl_gclear_new:N \g__nicematrix_Iddots_lines_tl
     \tl_gclear_new:N \g__nicematrix_HVdotsfor_lines_tl
- }
+  }
+\cs_set:Npn \__nicematrix_foldcase:
+  {
+    \tl_case:NnF \l_tmpa_tl
+      {
+        C { c }
+        L { l }
+        R { r }
+      }
+      { \l_tmpa_tl }
+  }
 \NewDocumentEnvironment { NiceArrayWithDelims } { m m O { } m ! O { } }
   {
+    \bool_if:NT \c__nicematrix_footnote_bool { \begin { savenotes } }
     \bgroup
     \tl_set:Nn \l__nicematrix_left_delim_tl { #1 }
     \tl_set:Nn \l__nicematrix_right_delim_tl { #2 }
@@ -1062,11 +1222,20 @@
       {
         \hbox_set:Nn \l_tmpa_box { $ \bBigg@ 5 #1 $ }
         \dim_set:Nn \l__nicematrix_left_delim_dim { \box_wd:N \l_tmpa_box }
-        \hbox_set:Nn \l_tmpa_box { $\bBigg@ 5 #2 $ }
+        \hbox_set:Nn \l_tmpa_box { $ \bBigg@ 5 #2 $ }
         \dim_set:Nn \l__nicematrix_right_delim_dim { \box_wd:N \l_tmpa_box }
       }
     \box_clear_new:N \l__nicematrix_the_array_box
     \tl_set:Nn \l_tmpa_tl { #4 }
+    \bool_if:NT \c__nicematrix_define_L_C_R_bool \__nicematrix_define_L_C_R:
+    \@temptokena \exp_after:wN { \l_tmpa_tl }
+    \@tempswatrue
+    \@whilesw \if at tempswa \fi { \@tempswafalse \the \NC at list }
+    \tl_gset:NV \l_tmpa_tl \@temptokena
+    \tl_replace_all:Nnn \l_tmpa_tl c { > \__nicematrix_Cell: c < \__nicematrix_end_Cell: }
+    \tl_replace_all:Nnn \l_tmpa_tl l { > \__nicematrix_Cell: l < \__nicematrix_end_Cell: }
+    \tl_replace_all:Nnn \l_tmpa_tl r { > \__nicematrix_Cell: r < \__nicematrix_end_Cell: }
+    \tl_replace_all:Nnn \l_tmpa_tl \__nicematrix_true_c: c
     \int_compare:nNnTF \l__nicematrix_first_col_int = 0
       { \tl_put_left:NV \l_tmpa_tl \c__nicematrix_preamble_first_col_tl }
       {
@@ -1091,7 +1260,7 @@
           }
           { \tl_put_right:Nn \l_tmpa_tl { @ { } } }
       }
-    \tl_put_right:Nn \l_tmpa_tl { > { \__nicematrix_error_too_much_cols: } L }
+    \tl_put_right:Nn \l_tmpa_tl { > { \__nicematrix_error_too_much_cols: } l }
     \hbox_set:Nw \l__nicematrix_the_array_box
     \bool_if:NT \l__nicematrix_NiceTabular_bool
       {
@@ -1143,32 +1312,31 @@
       {
         \str_if_eq:VnTF \l__nicematrix_baseline_str { b }
           {
-           \pgfpicture
-             \__nicematrix_qpoint:n { row - 1 }
-             \dim_gset_eq:NN \g_tmpa_dim \pgf at y
-             \__nicematrix_qpoint:n { row - \int_use:N \c at iRow - base }
-             \dim_gsub:Nn \g_tmpa_dim \pgf at y
-           \endpgfpicture
-           \int_compare:nNnT \l__nicematrix_first_row_int = 0
-             {
-               \dim_gadd:Nn \g_tmpa_dim
-                 { \g__nicematrix_ht_row_zero_dim + \g__nicematrix_dp_row_zero_dim }
-             }
-           \box_move_up:nn \g_tmpa_dim { \box_use_drop:N \l__nicematrix_the_array_box }
+            \pgfpicture
+              \__nicematrix_qpoint:n { row - 1 }
+              \dim_gset_eq:NN \g_tmpa_dim \pgf at y
+              \__nicematrix_qpoint:n { row - \int_use:N \c at iRow - base }
+              \dim_gsub:Nn \g_tmpa_dim \pgf at y
+            \endpgfpicture
+            \dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
+            \int_compare:nNnT \l__nicematrix_first_row_int = 0
+              {
+                \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_array_box_with_notes: }
           }
           {
             \str_if_eq:VnTF \l__nicematrix_baseline_str { c }
-              { \box_use_drop:N \l__nicematrix_the_array_box }
+              { \__nicematrix_use_array_box_with_notes: }
               {
                 \str_if_eq:VnT \l__nicematrix_baseline_str { t }
                   { \str_set:Nn \l__nicematrix_baseline_str { 1 } }
                 \int_set:Nn \l_tmpa_int \l__nicematrix_baseline_str
-                \bool_if:nT
+                \bool_lazy_or:nnT
+                  { \int_compare_p:nNn \l_tmpa_int < \l__nicematrix_first_row_int }
+                  { \int_compare_p:nNn \l_tmpa_int > \g__nicematrix_row_total_int }
                   {
-                       \int_compare_p:nNn \l_tmpa_int < \l__nicematrix_first_row_int
-                    || \int_compare_p:nNn \l_tmpa_int > \g__nicematrix_row_total_int
-                  }
-                  {
                     \__nicematrix_error:n { bad~value~for~baseline }
                     \int_set:Nn \l_tmpa_int 1
                   }
@@ -1178,13 +1346,13 @@
                 \__nicematrix_qpoint:n { row - \int_use:N \l_tmpa_int - base }
                 \dim_gsub:Nn \g_tmpa_dim \pgf at y
                 \endpgfpicture
+                \dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
                 \int_compare:nNnT \l__nicematrix_first_row_int = 0
                   {
-                    \dim_gadd:Nn \g_tmpa_dim
-                      { \g__nicematrix_ht_row_zero_dim + \g__nicematrix_dp_row_zero_dim }
+                    \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
-                  { \box_use_drop:N \l__nicematrix_the_array_box }
+                \box_move_up:nn \g_tmpa_dim { \__nicematrix_use_array_box_with_notes: }
               }
           }
       }
@@ -1208,17 +1376,19 @@
             \vcenter
               {
                 \skip_vertical:N -\l_tmpa_dim
+                \skip_vertical:N -\arrayrulewidth
                 \hbox
                   {
                     \bool_if:NTF \l__nicematrix_NiceTabular_bool
                       { \skip_horizontal:N -\tabcolsep }
                       { \skip_horizontal:N -\arraycolsep }
-                    \box_use_drop:N \l__nicematrix_the_array_box
+                    \__nicematrix_use_array_box_with_notes:
                     \bool_if:NTF \l__nicematrix_NiceTabular_bool
                       { \skip_horizontal:N -\tabcolsep }
                       { \skip_horizontal:N -\arraycolsep }
                   }
                 \skip_vertical:N -\l_tmpb_dim
+                \skip_vertical:N \arrayrulewidth
               }
             \right #2
             \c_math_toggle_token
@@ -1234,6 +1404,7 @@
       }
     \__nicematrix_after_array:
     \egroup
+    \bool_if:NT \c__nicematrix_footnote_bool { \end { savenotes } }
   }
 \cs_new_protected:Npn \__nicematrix_put_box_in_flow:
   {
@@ -1273,6 +1444,45 @@
     \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_array_box_with_notes:
+  {
+    \int_compare:nNnTF \c at tabularnote = 0
+      { \box_use_drop:N \l__nicematrix_the_array_box }
+      {
+        \begin { minipage } { \box_wd:N \l__nicematrix_the_array_box }
+        \box_use_drop:N \l__nicematrix_the_array_box
+        \skip_vertical:N 0.65ex
+        \group_begin:
+        \l__nicematrix_notes_code_before_tl
+        \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
+          }
+        \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
+        \end { minipage }
+        \seq_gclear:N \g__nicematrix_tabularnotes_seq
+        \int_gzero:N \c at tabularnote
+      }
+  }
 \cs_new_protected:Npn \__nicematrix_put_box_in_flow_bis:nn #1 #2
   {
     \dim_zero_new:N \l__nicematrix_real_left_delim_dim
@@ -1367,7 +1577,6 @@
 \cs_new:Npn \__nicematrix_create_col_nodes:
   {
     \crcr
-    \int_compare:nNnT \c at iRow = 0 { \__nicematrix_fatal:n { Zero~row } }
     \int_compare:nNnT \l__nicematrix_first_col_int = 0
       {
         \omit
@@ -1639,7 +1848,7 @@
     \NewDocumentEnvironment { #1 NiceMatrix } { ! O { } }
       {
         \str_gset:Nn \g__nicematrix_name_env_str { #1 NiceMatrix }
-        \tl_set:Nn \l__nicematrix_type_of_col_tl C
+        \tl_set:Nn \l__nicematrix_type_of_col_tl c
         \keys_set:nn { NiceMatrix / NiceMatrix } { ##1 }
         \exp_args:Nnx \__nicematrix_begin_of_NiceMatrix:nn { #1 } \l__nicematrix_type_of_col_tl
       }
@@ -2037,8 +2246,7 @@
       {
         \__nicematrix_qpoint:n { col - \int_use:N \l__nicematrix_initial_j_int }
         \dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf at x
-        \dim_add:Nn \l__nicematrix_x_initial_dim
-           { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
+        \dim_add:Nn \l__nicematrix_x_initial_dim \__nicematrix_tab_or_array_colsep:
         \__nicematrix_qpoint:n { row - \int_use:N \l__nicematrix_initial_i_int - base }
         \dim_set_eq:NN \l__nicematrix_y_initial_dim \pgf at y
       }
@@ -2047,8 +2255,7 @@
       {
         \__nicematrix_qpoint:n { col - \__nicematrix_succ:n \l__nicematrix_final_j_int }
         \dim_set_eq:NN \l__nicematrix_x_final_dim \pgf at x
-        \dim_sub:Nn \l__nicematrix_x_final_dim
-           { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
+        \dim_sub:Nn \l__nicematrix_x_final_dim \__nicematrix_tab_or_array_colsep:
         \__nicematrix_qpoint:n { row - \int_use:N \l__nicematrix_final_i_int - base }
         \dim_set_eq:NN \l__nicematrix_y_final_dim \pgf at y
       }
@@ -2082,7 +2289,7 @@
         \__nicematrix_qpoint:n { col - \int_use:N \l__nicematrix_initial_j_int }
         \dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf at x
         \dim_add:Nn \l__nicematrix_x_initial_dim
-           { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
+          { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
       }
       { \__nicematrix_set_initial_coords_from_anchor:n { mid~east } }
     \bool_if:NTF \l__nicematrix_final_open_bool
@@ -2090,7 +2297,7 @@
         \__nicematrix_qpoint:n { col - \__nicematrix_succ:n \l__nicematrix_final_j_int }
         \dim_set_eq:NN \l__nicematrix_x_final_dim \pgf at x
         \dim_sub:Nn \l__nicematrix_x_final_dim
-           { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
+          { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
       }
       { \__nicematrix_set_final_coords_from_anchor:n { mid~west } }
     \bool_lazy_and:nnTF
@@ -2336,7 +2543,7 @@
         \pgftransformshift
           {
             \pgfpointlineattime { 0.5 }
-              { \pgfpoint \l__nicematrix_x_initial_dim  \l__nicematrix_y_initial_dim }
+              { \pgfpoint \l__nicematrix_x_initial_dim \l__nicematrix_y_initial_dim }
               { \pgfpoint \l__nicematrix_x_final_dim \l__nicematrix_y_final_dim }
           }
         \pgftransformrotate
@@ -2345,7 +2552,7 @@
               {
                 atand
                  (
-                  \l__nicematrix_y_final_dim - \l__nicematrix_y_initial_dim ,
+                   \l__nicematrix_y_final_dim - \l__nicematrix_y_initial_dim ,
                    \l__nicematrix_x_final_dim - \l__nicematrix_x_initial_dim
                   )
               }
@@ -2577,7 +2784,16 @@
 \cs_set_eq:NN \__nicematrix_old_multicolumn \multicolumn
 \cs_new:Npn \__nicematrix_multicolumn:nnn #1 #2 #3
   {
-    \__nicematrix_old_multicolumn { #1 } { #2 } { #3 }
+    \exp_args:NNe
+      \__nicematrix_old_multicolumn
+      { #1 }
+      {
+        > \__nicematrix_Cell:
+        \bool_if:NT \c__nicematrix_define_L_C_R_bool \tl_lower_case:n
+        #2
+        < \__nicematrix_end_Cell:
+      }
+      { #3 }
     \peek_remove_spaces:n
       {
         \int_compare:nNnT #1 > 1
@@ -2598,7 +2814,7 @@
   }
 \cs_new:Npn \__nicematrix_Hdotsfor:
   {
-    \multicolumn { 1 } { C } { }
+    \multicolumn { 1 } { c } { }
     \__nicematrix_Hdotsfor_i
   }
 \AtBeginDocument
@@ -2618,7 +2834,7 @@
                 down = \exp_not:n { #4 } , up = \exp_not:n { #5 }
               }
           }
-        \prg_replicate:nn { #2 - 1 } { & \multicolumn { 1 } { C } { } }
+        \prg_replicate:nn { #2 - 1 } { & \multicolumn { 1 } { c } { } }
       }
   }
 \cs_new_protected:Npn \__nicematrix_Hdotsfor:nnnn #1 #2 #3 #4
@@ -3200,31 +3416,25 @@
   }
 \cs_new_protected:Npn \__nicematrix_test_if_hline_in_block:nnnn #1 #2 #3 #4
   {
-    \int_compare:nNnT \l_tmpa_tl > { #1 }
+    \bool_lazy_all:nT
       {
-        \int_compare:nNnT \l_tmpa_tl < { #3 + 1 }
-          {
-            \int_compare:nNnT \l_tmpb_tl > { #2 - 1 }
-              {
-                \int_compare:nNnT \l_tmpb_tl < { #4 + 1 }
-                  { \bool_gset_false:N \g_tmpa_bool }
-              }
-          }
+        { \int_compare_p:nNn \l_tmpa_tl > { #1 } }
+        { \int_compare_p:nNn \l_tmpa_tl < { #3 + 1 } }
+        { \int_compare_p:nNn \l_tmpb_tl > { #2 - 1 } }
+        { \int_compare_p:nNn \l_tmpb_tl < { #4 + 1 } }
       }
+      { \bool_gset_false:N \g_tmpa_bool }
   }
 \cs_new_protected:Npn \__nicematrix_test_if_vline_in_block:nnnn #1 #2 #3 #4
   {
-    \int_compare:nNnT \l_tmpa_tl > { #1 - 1 }
+    \bool_lazy_all:nT
       {
-        \int_compare:nNnT \l_tmpa_tl < { #3 + 1 }
-          {
-            \int_compare:nNnT \l_tmpb_tl > { #2 }
-              {
-                \int_compare:nNnT \l_tmpb_tl < { #4 + 1 }
-                  { \bool_gset_false:N \g_tmpa_bool }
-              }
-          }
+        { \int_compare_p:nNn \l_tmpa_tl > { #1 - 1 } }
+        { \int_compare_p:nNn \l_tmpa_tl < { #3 + 1 } }
+        { \int_compare_p:nNn \l_tmpb_tl > { #2 } }
+        { \int_compare_p:nNn \l_tmpb_tl < { #4 + 1 } }
       }
+      { \bool_gset_false:N \g_tmpa_bool }
   }
 \cs_new_protected:Npn \__nicematrix_draw_hvlines_except_corners:
   {
@@ -3241,7 +3451,7 @@
     \int_zero_new:N \l__nicematrix_last_empty_row_int
     \int_step_inline:nnnn { #1 } { #3 } { #5 }
       {
-        \__nicematrix_test_if_cell_in_a_block:nx { ##1 } { \int_eval:n { #2 } }
+        \__nicematrix_test_if_cell_in_a_block:nn { ##1 } { \int_eval:n { #2 } }
         \bool_if:nTF
           {
              \cs_if_exist_p:c
@@ -3259,7 +3469,7 @@
     \int_zero_new:N \l__nicematrix_last_empty_column_int
     \int_step_inline:nnnn { #2 } { #4 } { #6 }
       {
-        \__nicematrix_test_if_cell_in_a_block:xn { \int_eval:n { #1 } } { ##1 }
+        \__nicematrix_test_if_cell_in_a_block:nn { \int_eval:n { #1 } } { ##1 }
         \bool_if:nTF
           {
             \cs_if_exist_p:c
@@ -3299,19 +3509,20 @@
   }
 \cs_new_protected:Npn \__nicematrix_test_if_cell_in_a_block:nn #1 #2
   {
+    \int_set:Nn \l_tmpa_int { #1 }
+    \int_set:Nn \l_tmpb_int { #2 }
     \bool_set_false:N \l_tmpb_bool
     \seq_map_inline:Nn \g__nicematrix_pos_of_blocks_seq
-      { \__nicematrix_test_if_cell_in_block:nnnnnnn { #1 } { #2 } ##1 }
+      { \__nicematrix_test_if_cell_in_block:nnnnnnn { \l_tmpa_int } { \l_tmpb_int } ##1 }
   }
-\cs_generate_variant:Nn \__nicematrix_test_if_cell_in_a_block:nn { nx , xn }
 \cs_new_protected:Npn \__nicematrix_test_if_cell_in_block:nnnnnnn #1 #2 #3 #4 #5 #6
   {
-    \bool_if:nT
+    \bool_lazy_all:nT
       {
-           \int_compare_p:n { #3 <= #1 }
-        && \int_compare_p:n { #1 <= #5 }
-        && \int_compare_p:n { #4 <= #2 }
-        && \int_compare_p:n { #2 <= #6 }
+        { \int_compare_p:n { #3 <= #1 } }
+        { \int_compare_p:n { #1 <= #5 } }
+        { \int_compare_p:n { #4 <= #2 } }
+        { \int_compare_p:n { #2 <= #6 } }
       }
     { \bool_set_true:N \l_tmpb_bool }
   }
@@ -3622,6 +3833,8 @@
 \cs_new:Npn \__nicematrix_Block_i #1-#2 \q_stop { \__nicematrix_Block_ii:nnnnn { #1 } { #2 } }
 \cs_new_protected:Npn \__nicematrix_Block_ii:nnnnn #1 #2 #3 #4 #5
   {
+    \bool_if:NT \l__nicematrix_NiceTabular_bool
+      { \tl_if_empty:nF { #4 } { \__nicematrix_error:n { angle~option~in~NiceTabular } } }
     \tl_set:Nx \l_tmpa_tl
       {
         { \int_use:N \c at iRow }
@@ -3648,6 +3861,14 @@
   {
     \group_begin:
     \keys_set:nn { NiceMatrix / Block } { #5 }
+     \cs_set_protected:Npn \diagbox ##1 ##2
+       {
+         \tl_gput_right:Nx \g__nicematrix_internal_code_after_tl
+           {
+             \__nicematrix_actually_diagbox:nnnnnn
+               { #1 } { #2 } { #3 } { #4 } { ##1 } { ##2 }
+           }
+       }
     \bool_lazy_or:nnTF
       { \int_compare_p:nNn { #3 } > \g__nicematrix_row_total_int }
       { \int_compare_p:nNn { #4 } > \c at jCol }
@@ -3763,7 +3984,7 @@
     \int_zero_new:N \l__nicematrix_nb_cols_int
     \__nicematrix_set_size:n #4 \q_stop
     \begin { NiceArrayWithDelims } { #1 } { #2 }
-      { * { \l__nicematrix_nb_cols_int } { C } } [ #3 , #5 , #7 ]
+      { * { \l__nicematrix_nb_cols_int } { c } } [ #3 , #5 , #7 ]
     \int_compare:nNnT \l__nicematrix_first_row_int = 0
       {
         \int_compare:nNnT \l__nicematrix_first_col_int = 0 { & }
@@ -3820,11 +4041,23 @@
   {
     \tl_gput_right:Nx \g__nicematrix_internal_code_after_tl
       {
-        \__nicematrix_actually_diagbox:nnnn
-          { \int_use:N \c at iRow } { \int_use:N \c at jCol } { #1 } { #2 }
+        \__nicematrix_actually_diagbox:nnnnnn
+          { \int_use:N \c at iRow }
+          { \int_use:N \c at jCol }
+          { \int_use:N \c at iRow }
+          { \int_use:N \c at jCol }
+          { #1 }
+          { #2 }
       }
+    \seq_gput_right:Nx \g__nicematrix_pos_of_blocks_seq
+      {
+        { \int_use:N \c at iRow }
+        { \int_use:N \c at jCol }
+        { \int_use:N \c at iRow }
+        { \int_use:N \c at jCol }
+      }
   }
-\cs_new_protected:Npn \__nicematrix_actually_diagbox:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \__nicematrix_actually_diagbox:nnnnnn #1 #2 #3 #4 #5 #6
   {
     \pgfpicture
     \pgf at relevantforpicturesizefalse
@@ -3834,9 +4067,9 @@
     \__nicematrix_qpoint:n { col - #2 }
     \dim_set_eq:NN \l_tmpb_dim \pgf at x
     \pgfpathmoveto { \pgfpoint \l_tmpb_dim \l_tmpa_dim }
-    \__nicematrix_qpoint:n { row - \__nicematrix_succ:n { #1 } }
+    \__nicematrix_qpoint:n { row - \__nicematrix_succ:n { #3 } }
     \dim_set_eq:NN \l_tmpc_dim \pgf at y
-    \__nicematrix_qpoint:n { col - \__nicematrix_succ:n { #2 } }
+    \__nicematrix_qpoint:n { col - \__nicematrix_succ:n { #4 } }
     \dim_set_eq:NN \l_tmpd_dim \pgf at x
     \pgfpathlineto { \pgfpoint \l_tmpd_dim \l_tmpc_dim }
     {
@@ -3848,11 +4081,11 @@
     \pgfscope
     \pgftransformshift { \pgfpoint \l_tmpb_dim \l_tmpc_dim }
     \pgfnode { rectangle } { south~west }
-      { \__nicematrix_math_toggle_token: #3 \__nicematrix_math_toggle_token: } { } { }
+      { \__nicematrix_math_toggle_token: #5 \__nicematrix_math_toggle_token: } { } { }
     \endpgfscope
     \pgftransformshift { \pgfpoint \l_tmpd_dim \l_tmpa_dim }
     \pgfnode { rectangle } { north~east }
-      { \__nicematrix_math_toggle_token: #4 \__nicematrix_math_toggle_token: } { } { }
+      { \__nicematrix_math_toggle_token: #6 \__nicematrix_math_toggle_token: } { } { }
     \endpgfpicture
   }
 \cs_new_protected:Npn \__nicematrix_CodeAfter:n #1 \end
@@ -3869,8 +4102,28 @@
         \__nicematrix_CodeAfter:n
       }
   }
+%% \medskip
+\bool_new:N \c__nicematrix_footnotehyper_bool
+\bool_new:N \c__nicematrix_footnote_bool
+\__nicematrix_msg_new:nnn { Unknown~option~for~package }
+  {
+    The~option~'\l_keys_key_tl'~is~unknown. \\
+    If~you~go~on,~it~will~be~ignored. \\
+    For~a~list~of~the~available~options,~type~H~<return>.
+  }
+  {
+    The~available~options~are~(in~alphabetic~order):~
+    define-L-C-R,~
+    footnote,~
+    footnotehyper,~
+    renew-dots,~
+    renew-matrix~and~
+    transparent.
+  }
 \keys_define:nn { NiceMatrix / Package }
   {
+    define-L-C-R .bool_set:N = \c__nicematrix_define_L_C_R_bool ,
+    define-L-C-R .default:n = true ,
     renew-dots .bool_set:N = \l__nicematrix_renew_dots_bool ,
     renew-dots .value_forbidden:n = true ,
     renew-matrix .code:n = \__nicematrix_renew_matrix: ,
@@ -3877,21 +4130,54 @@
     renew-matrix .value_forbidden:n = true ,
     transparent .meta:n = { renew-dots , renew-matrix } ,
     transparent .value_forbidden:n = true,
+    footnote .bool_set:N = \c__nicematrix_footnote_bool ,
+    footnotehyper .bool_set:N = \c__nicematrix_footnotehyper_bool ,
+    unknown .code:n = \__nicematrix_error:n { Unknown~option~for~package }
   }
 \ProcessKeysOptions { NiceMatrix / Package }
-\cs_new_protected:Npn \__nicematrix_convert_to_str_seq:N #1
+\__nicematrix_msg_new:nn { footnote~with~footnotehyper~package }
   {
-    \seq_clear:N \l_tmpa_seq
-    \seq_map_inline:Nn #1
+    You~can't~use~the~option~'footnote'~because~the~package~
+    footnotehyper~has~already~been~loaded.~
+    If~you~want,~you~can~use~the~option~'footnotehyper'~and~the~footnotes~
+    within~the~environments~of~nicematrix~will~be~extracted~with~the~tools~
+    of~the~package~footnotehyper.\\
+    If~you~go~on,~the~package~footnote~won't~be~loaded.
+  }
+\__nicematrix_msg_new:nn { footnotehyper~with~footnote~package }
+  {
+    You~can't~use~the~option~'footnotehyper'~because~the~package~
+    footnote~has~already~been~loaded.~
+    If~you~want,~you~can~use~the~option~'footnote'~and~the~footnotes~
+    within~the~environments~of~nicematrix~will~be~extracted~with~the~tools~
+    of~the~package~footnote.\\
+    If~you~go~on,~the~package~footnotehyper~won't~be~loaded.
+  }
+\bool_if:NT \c__nicematrix_footnote_bool
+  {
+    \@ifclassloaded { beamer }
+      { \msg_info:nn { nicematrix } { Option~incompatible~with~Beamer } }
       {
-        \seq_put_left:Nx \l_tmpa_seq { \tl_to_str:n { ##1 } }
+        \@ifpackageloaded { footnotehyper }
+          { \__nicematrix_error:n { footnote~with~footnotehyper~package } }
+          { \usepackage { footnote } }
       }
-    \seq_set_eq:NN #1 \l_tmpa_seq
   }
+\bool_if:NT \c__nicematrix_footnotehyper_bool
+  {
+    \@ifclassloaded { beamer }
+      { \__nicematrix_info:n  { Option~incompatible~with~Beamer } }
+      {
+        \@ifpackageloaded { footnote }
+          { \__nicematrix_error:n { footnotehyper~with~footnote~package } }
+          { \usepackage { footnotehyper } }
+      }
+    \bool_set_true:N \c__nicematrix_footnote_bool
+  }
 \cs_new_protected:Npn \__nicematrix_set_seq_of_str_from_clist:Nn #1 #2
   {
     \seq_set_from_clist:Nn #1 { #2 }
-    \__nicematrix_convert_to_str_seq:N #1
+    \seq_set_map:NNn #1 #1 { \tl_to_str:n { ##1 } }
   }
 \__nicematrix_set_seq_of_str_from_clist:Nn \c__nicematrix_types_of_matrix_seq
   {
@@ -4024,8 +4310,31 @@
   {
     You~try~to~draw~a~block~in~the~cell~#1-#2~of~your~matrix~but~the~matrix~is~
     too~small~for~that~block. \\
+  }
+\__nicematrix_msg_new:nn { angle~option~in~NiceTabular }
+  {
+    You~should~not~the~option~between~angle~brackets~(<~and~>)~for~a~command~
+    \token_to_str:N \Block\ in~\{NiceTabular\}.~However,~you~can~go~on.
+  }
+\__nicematrix_msg_new:nn { tabularnote~forbidden }
+  {
+    You~can't~use~the~command~\token_to_str:N\tabularnote\
+    ~in~a~\__nicematrix_full_name_env:.~This~command~is~available~only~in~
+    \{NiceTabular\},~\{NiceArray\}~and~\{NiceMatrix\}. \\
     If~you~go~on,~this~command~will~be~ignored.
   }
+\__nicematrix_msg_new:nn { bottomule~without~booktabs }
+  {
+    You~can't~use~the~option~'tabular/bottomrule'~because~you~haven't~
+    loaded~'booktabs'.\\
+    If~you~go~on,~this~option~will~be~ignored.
+  }
+\__nicematrix_msg_new:nn { enumitem~not~loaded }
+  {
+    You~can't~use~the~command~\token_to_str:N\tabularnote\
+    ~because~you~haven't~loaded~'enumitem'.\\
+    If~you~go~on,~this~command~will~be~ignored.
+  }
 \__nicematrix_msg_new:nn { Wrong~last~row }
   {
     You~have~used~'last-row=\int_use:N \l__nicematrix_last_row_int'~but~your~
@@ -4035,10 +4344,7 @@
     without~value~(more~compilations~might~be~necessary).
   }
 \__nicematrix_msg_new:nn { Yet~in~env }
-  {
-    Environments~\{NiceArray\}~(or~\{NiceMatrix\},~etc.)~can't~be~nested.\\
-    This~error~is~fatal.
-  }
+  { Environments~of~nicematrix~can't~be~nested.\\ This~error~is~fatal. }
 \__nicematrix_msg_new:nn { Outside~math~mode }
   {
     The~\__nicematrix_full_name_env:\ can~be~used~only~in~math~mode~
@@ -4047,12 +4353,30 @@
   }
 \__nicematrix_msg_new:nn { Bad~value~for~letter~for~dotted~lines }
   {
-    The~value~of~key~'\tl_use:N\l_keys_key_tl'~must~be~of~length~1.\\
+    The~value~of~key~'\l_keys_key_tl'~must~be~of~length~1.\\
     If~you~go~on,~it~will~be~ignored.
   }
+\__nicematrix_msg_new:nnn { Unknown~key~for~notes }
+  {
+    The~key~'\l_keys_key_tl'~is~unknown.\\
+    If~you~go~on,~it~will~be~ignored. \\
+    For~a~list~of~the~available~keys~about~notes,~type~H~<return>.
+  }
+  {
+    The~available~options~are~(in~alphabetic~order):~
+    bottomrule,~
+    code-after,~
+    code-before,~
+    enumitem-keys,~
+    enumitem-keys-para,~
+    para,~
+    label-in-list,~
+    label-in-tabular~and~
+    style.
+  }
 \__nicematrix_msg_new:nnn { Unknown~key~for~NiceMatrixOptions }
   {
-    The~key~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~command~
+    The~key~'\l_keys_key_tl'~is~unknown~for~the~command~
     \token_to_str:N \NiceMatrixOptions. \\
     If~you~go~on,~it~will~be~ignored. \\
     For~a~list~of~the~*principal*~available~keys,~type~H~<return>.
@@ -4080,6 +4404,7 @@
     left-margin,~
     letter-for-dotted-lines,~
     light-syntax,~
+    notes~(several subkeys),~
     nullify-dots,~
     renew-dots,~
     renew-matrix,~
@@ -4093,7 +4418,7 @@
   }
 \__nicematrix_msg_new:nnn { Unknown~option~for~NiceArray }
   {
-    The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~
+    The~option~'\l_keys_key_tl'~is~unknown~for~the~environment~
     \{NiceArray\}. \\
     If~you~go~on,~it~will~be~ignored. \\
     For~a~list~of~the~*principal*~available~options,~type~H~<return>.
@@ -4125,6 +4450,8 @@
     left-margin,~
     light-syntax,~
     name,~
+    notes/bottomrule,~
+    notes/para,~
     nullify-dots,~
     renew-dots,~
     right-margin,~
@@ -4139,7 +4466,7 @@
   }
 \__nicematrix_msg_new:nnn { Unknown~option~for~NiceMatrix }
   {
-    The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~
+    The~option~'\l_keys_key_tl'~is~unknown~for~the~
     \__nicematrix_full_name_env:. \\
     If~you~go~on,~it~will~be~ignored. \\
     For~a~list~of~the~*principal*~available~options,~type~H~<return>.
@@ -4188,7 +4515,7 @@
   }
 \__nicematrix_msg_new:nnn { Unknown~option~for~NiceTabular }
   {
-    The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~
+    The~option~'\l_keys_key_tl'~is~unknown~for~the~environment~
     \{NiceTabular\}. \\
     If~you~go~on,~it~will~be~ignored. \\
     For~a~list~of~the~*principal*~available~options,~type~H~<return>.
@@ -4220,6 +4547,8 @@
     left-margin,~
     light-syntax,~
     name,~
+    notes/bottomrule,~
+    notes/para,~
     nullify-dots,~
     renew-dots,~
     right-margin,~
@@ -4249,12 +4578,6 @@
     You~can't~give~the~value~'auto'~to~the~option~'columns-width'~here.~
     If~you~go~on,~the~option~will~be~ignored.
   }
-\__nicematrix_msg_new:nn { Zero~row }
-  {
-    There~is~a~problem.~Maybe~you~have~used~l,~c~and~r~instead~of~L,~C~
-    and~R~in~the~preamble~of~your~environment. \\
-    This~error~is~fatal.
-  }
 
 \endinput
 %%



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