summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-02-22 21:53:07 +0000
committerKarl Berry <karl@freefriends.org>2021-02-22 21:53:07 +0000
commitbf27672804b8dfb033345715f25e6570db144c75 (patch)
tree296e638d969cf69816944493d380bcc92e72bfdd
parent4df1518635747fd1a390c2cd210da9a09f1b4b1d (diff)
nicematrix (22feb21)
git-svn-id: svn://tug.org/texlive/trunk@57845 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdfbin439492 -> 420606 bytes
-rw-r--r--Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex526
-rw-r--r--Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdfbin1131373 -> 1133328 bytes
-rw-r--r--Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx998
-rw-r--r--Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty292
5 files changed, 1050 insertions, 766 deletions
diff --git a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf
index b5ce89cab3e..7c58a0449ce 100644
--- a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf
+++ b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex
index ef0cd4123bd..75a1954df9b 100644
--- a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex
+++ b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex
@@ -117,9 +117,18 @@ dans le répertoire courant ou dans une arborescence |texmf|. Le mieux reste né
avec une distribution TeX comme MiKTeX ou TeXlive.
\bigskip
-Cette extension peut être utilisée avec |xelatex|, |lualatex| et |pdflatex| mais aussi avec le cheminement
-classique |latex|-|dvips|-|ps2pdf| (ou Adobe Distiller). \textsl{Néanmoins, le fichier nicematrix-french.tex de la présente documentation
-ne peut être compilé qu'avec XeLaTeX.}
+\emph{Remarque} : Si vous utilisez un service LaTeX via Internet (ex. :
+Overleaf) vous pouvez télécharger le fichier |nicematrix.sty| dans le dossier de
+votre projet pour bénéficier de la dernière version de
+\pkg{nicematrix}.\footnote{La dernière version de \verb|nicematrix.sty| peut
+ être téléchargée sur le serveur \textsc{svn} de TeXLive : \newline \small
+ \url{https:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty}}
+
+\bigskip
+Cette extension peut être utilisée avec |xelatex|, |lualatex| et |pdflatex| mais
+aussi avec le cheminement classique |latex|-|dvips|-|ps2pdf| (ou Adobe
+Distiller). \textsl{Néanmoins, le fichier nicematrix-french.tex de la présente
+ documentation ne peut être compilé qu'avec XeLaTeX.}
\bigskip
Cette extension nécessite et charge les extensions \pkg{l3keys2e}, \pkg{array},
@@ -145,21 +154,6 @@ Une commande|\NiceMatrixOptions| est fournie pour régler les options (la porté
commande est le groupe TeX courant : elles sont semi-globales).
-\bigskip
-{\bfseries \color{red} Important
-
-Depuis la 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}
@@ -238,7 +232,7 @@ l'extension \pkg{nicematrix} propose deux 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}.
-\colorbox{yellow!50}{\textbf{Nouveau 5.9}}\enskip Il existe aussi une clé
+\colorbox{yellow!30}{Nouveau 5.9}\enskip Il existe aussi une clé
|cell-space-limits| pour régler simultanément les deux paramètres.
La valeur initiale de ces paramètres est $0$~pt pour que les environnements de
@@ -716,9 +710,7 @@ classiques.
Dans les environnements de \pkg{nicematrix}, les filets verticaux spécifiés par
\verb+|+ dans le préambule des environnements ne sont jamais coupés, même en cas
de ligne incomplète ou de double filet horizontal spécifié par |\hline\hline|
-(il n'y a pas besoin d'utiliser \pkg{hhline}).\footnote{Il s'agit là du comportement depuis la version 5.1 de
- \pkg{nicematrix}. Dans les versions précédentes, le comportement était
- le comportement par défaut de \pkg{array}.}
+(il n'y a pas besoin d'utiliser \pkg{hhline}).
\bigskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -845,7 +837,7 @@ A&B&C&D \\
Les environnements de \pkg{nicematrix} proposent une clé |rules/width| pour
fixer la largeur (en fait l'épaisseur) des filets dans l'environnement. En fait,
-cette clé ne fait que fixer la valeur de |\arrayrulewidth|.
+cette clé ne fait que fixer la valeur du paramètre dimensionnel |\arrayrulewidth|.
\smallskip
On sait que \pkg{colortbl} propose la commande |\arrayrulecolor| pour spécifier
@@ -1162,7 +1154,9 @@ compilations successives.
L'extension \pkg{nicematrix} fournit une clé |code-before| pour du code qui sera
exécuté avant le tracé du tableau. De nouvelles commandes y sont disponibles :
|\cellcolor|, |\rectanglecolor|, |\rowcolor|, |\columncolor|, |\rowcolors| et
-|\chessboardcolors|.
+|\chessboardcolors|.\footnote{On pourra remarquer que, dans le
+ \verb|code-before|, des nœuds PGF/Tikz correspondant à la position des filets
+ éventuels sont également accessibles : cf. p.~\pageref{noeuds-i}.}
\label{code-before}
\medskip
@@ -1274,13 +1268,12 @@ a_{10} & b_{10} & c_{10} \\
\bigskip
\item La commande |\rowcolors| (avec un \emph{s}) doit son nom à la commande
|\rowcolors| de \pkg{xcolor}\footnote{La commande |\rowcolors| de \pkg{xcolor}
- est disponible quand \pkg{xcolor} est chargé avec l'option |table|.}. Le
-\emph{s} rappelle qu'il y a deux couleurs. Elle colorie alternativement les
-rangées avec les deux couleurs à partir de la rangée dont le numéro est donné en
-premier argument (obligatoire), comme le fait la commande |\rowcolors| de
-\pkg{xcolor}.
+ est disponible quand \pkg{xcolor} est chargé avec l'option |table|. Cett
+ option charge également l'extension \pkg{colortbl}.}. Le \emph{s} rappelle
+qu'il y a deux couleurs. Elle colorie alternativement les rangées avec les deux
+couleurs à partir de la rangée dont le numéro est donné en premier argument
+(obligatoire), comme le fait la commande |\rowcolors| de \pkg{xcolor}.
-\colorbox{yellow!30}{Nouveau 5.8}\enskip
En fait, le premier argument (obligatoire) peut, plus généralement, contenir
une liste d'intervalles correspondant à l'ensemble des rangées sur lesquelles
portera l'effet de |\rowcolors| (un intervalle de la forme $i$ désigne en fait
@@ -1293,20 +1286,19 @@ optionnel en dernière position (l'argument optionel en première position
correspond à l'espace colorimétrique). Les clés disponibles sont |cols|,
|restart| et |respect-blocks|.
\begin{itemize}
-\item \colorbox{yellow!30}{Nouveau 5.8}\enskip
-La clé |cols| décrit un ensemble de colonnes sur lesquelles portera
+\item La clé |cols| décrit un ensemble de colonnes sur lesquelles portera
l'effet de |\rowcolors|. Cet ensemble de colonnes est une liste d'intervalles de
la forme $i$|-|$j$.
-\item \colorbox{yellow!30}{Nouveau 5.8}\enskip Avec la clé |restart|, chacun
-des intervalles de rangées spécifié par le premier argument de |\rowcolors|
-recommence avec la même couleur.\footnote{Autrement, la couleur d'une rangée ne
- dépend que de la partié de son numéro.}
+\item Avec la clé |restart|, chacun des intervalles de rangées spécifié par le
+premier argument de |\rowcolors| recommence avec la même
+couleur.\footnote{Autrement, la couleur d'une rangée ne dépend que de la parité
+ de son numéro.}
\item Avec la clé |respect-blocks|, qui est de type booléen, les ``rangées''
colorées alternativement peuvent s'étendre sur plusieurs rangées réelles du
-tableau pour englober les blocs (créés par la commande |\Block|).
+tableau pour englober les blocs (créés par la commande |\Block| : cf.~p.~\pageref{Block}).
\end{itemize}
@@ -1405,7 +1397,8 @@ droite (cf. p.~\pageref{key-R}).
\bigskip
On remarquera que ces commandes sont compatibles avec les commandes de
-\pkg{booktabs} (|\toprule|, |\midrule|, |\bottomrule|, etc).
+\pkg{booktabs} (|\toprule|, |\midrule|, |\bottomrule|, etc). Néanmoins,
+l'extension \pkg{booktabs} n'est pas chargée par \pkg{nicematrix}.
\medskip
\begin{scope}
@@ -1455,19 +1448,21 @@ On a utilisé le type de colonne |S| de \pkg{siunitx}.
\label{colortbl-like}
On peut accéder aux outils de coloriage précédents avec une syntaxe proche de
-celle proposée par \pkg{colortbl}. On doit pour cela utiliser la clé
-|colortbl-like| dans l'environnement concerné.\footnote{Pour le moment, cette
- clé n'est pas disponible dans |\NiceMatrixOptions|.}
+celle proposée par \pkg{colortbl} (même si \pkg{colortbl} n'est pas chargé). On
+doit pour cela utiliser la clé |colortbl-like| dans l'environnement
+concerné.\footnote{Pour le moment, cette clé n'est \emph{pas} disponible dans
+ |\NiceMatrixOptions|.}
On a alors accès aux trois commandes suivantes :
\begin{itemize}
\item |\cellcolor| qui colorie la case courante ;
\item |\rowcolor| à utiliser dans une case et qui colorie le reste de la rangée
;
-\item |\columncolor| à utiliser dans le préambule de la même manière que la
-commande éponyme de \pkg{colortbl} (néanmoins, contrairement à la commande
-|\columncolor| de \pkg{colortbl}, celle-ci peut apparaître à l'intérieur d'une
-autre commande, elle-même utilisée dans le préambule).
+\item |\columncolor| à utiliser dans le préambule du tableau de la même manière
+que la commande éponyme de \pkg{colortbl} (néanmoins, contrairement à la
+commande |\columncolor| de \pkg{colortbl}, celle de \pkg{nicematrix} peut
+apparaître à l'intérieur d'une autre commande, elle-même utilisée dans le
+préambule).
\end{itemize}
\medskip
@@ -1673,18 +1668,21 @@ L_4 & a_{41} & a_{42} & a_{43} & a_{44} & L_4 \\
\end{pNiceMatrix}\]
\medskip
-Les lignes pointillées ont été tracées avec les outils présentés p.~\pageref{Cdots}.
+Les lignes pointillées ont été tracées avec les outils qui seront présentés p.~\pageref{Cdots}.
\bigskip
Il y a plusieurs remarques à formuler.
%
\begin{itemize}[beginpenalty=10000]
-\item Si on utilise un environnement avec préambule explicite (c'est-à-dire
+\item Si on utilise un environnement avec préambule explicite (|{NiceTabular}|,
|{NiceArray}| ou l'une de ses variantes), on ne doit pas mettre dans ce
préambule de spécification de colonne pour les éventuelles première et dernière
-colonne : ce sera automatiquement (et nécessairement) une colonne |R| pour la
-première colonne et une colonne |L| pour la dernière.
+colonne : ce sera automatiquement (et nécessairement) une colonne |r| pour la
+première colonne et une colonne |l| pour la dernière.\footnote{Si on souhaite
+ une colonne extérieure avec un autre type d'alignement, on aura intérêt à
+ considérer la commande \verb|\SubMatrix| disponible dans le \verb|\CodeAfter|
+ (cf. p.~\pageref{sub-matrix}).}
\item On peut se demander comment \pkg{nicematrix} détermine le nombre de rangées et de colonnes nécessaires à la
composition de la «dernière rangée» et de la «dernière colonne».
@@ -1725,7 +1723,7 @@ au début de chaque case de la rangée ou de la colonne considérée.
~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=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 \\
@@ -1771,8 +1769,10 @@ commande |\OnlyMainNiceMatrix| décrite p.~\pageref{OnlyMainNiceMatrix}.
p.~\pageref{width}) ne s'applique pas à la «première colonne» ni à la «dernière
colonne».
\item Pour des raisons techniques, il n'est pas possible d'utiliser l'option de
-la commande |\\| après la «première rangée» ou avant la «dernière rangée» (le
-placement des délimiteurs serait erroné).
+la commande |\\| après la «première rangée» ou avant la «dernière rangée». Le
+placement des délimiteurs serait erroné. Pour contourner cette restriction, on
+pourra envisager d'utiliser la commande |\SubMatrix| dans le |\CodeAfter| (cf.
+p.~\pageref{sub-matrix}).
\end{itemize}
@@ -1785,7 +1785,7 @@ placement des délimiteurs serait erroné).
À l'intérieur des environnements de l'extension \pkg{nicematrix}, de nouvelles
commandes sont définies : |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, et |\Iddots|.
Ces commandes sont conçues pour être utilisées à la place de |\dots|, |\cdots|,
-|\vdots|, |\ddots| et |\iddots|.\footnote{La commande |\iddots|, définie dans
+|\vdots|, |\ddots| et |\iddots|.\footnote{La commande |\iddots|, définie par
\pkg{nicematrix}, est une variante de |\ddots| avec les points allant vers le
haut. Si \pkg{mathdots} est chargée, la version de \pkg{mathdots} est
utilisée. Elle correspond à la commande |\adots| de \pkg{unicode-math}.}
@@ -2040,10 +2040,12 @@ $\begin{pNiceMatrix}
\end{pNiceMatrix}$
\medskip
-Remarque : Contrairement à la commande |\hdotsfor| de \pkg{amsmath}, la commande
-|\Hdotsfor| est utilisable lorsque l'extension \pkg{colortbl} est chargée (mais
-vous risquez d'avoir des problèmes si vous utilisez |\rowcolor| sur la même
-rangée que |\Hdotsfor|).
+\emph{Remarque} : Contrairement à la commande |\hdotsfor| de \pkg{amsmath}, la
+commande |\Hdotsfor| est utilisable même lorsque l'extension
+\pkg{colortbl}\footnote{On rappelle que lorsque l'extension \pkg{xcolor} est
+ chargée avec l'option \verb|table|, l'extension \pkg{colortbl} est chargée.}
+est chargée (mais vous risquez d'avoir des problèmes si vous utilisez
+|\rowcolor| sur la même rangée que |\Hdotsfor|).
\bigskip
L'extension \pkg{nicematrix} propose aussi une commande |\Vdotsfor| similaire à
@@ -2175,9 +2177,9 @@ options (que l'on met entre crochets après la commande) :
\item |line-style|.
\end{itemize}
-Ces options peuvent aussi être fixées avec |\NiceMatrixOptions| ou bien au
-niveau d'un environnement mais elles doivent alors être préfixées par |xdots|,
-ce qui fait que leurs noms deviennent :
+Ces options peuvent aussi être fixées avec |\NiceMatrixOptions|, comme options
+de |\CodeAfter|, ou bien au niveau d'un environnement mais elles doivent alors
+être préfixées par |xdots|, ce qui fait que leurs noms deviennent :
%
\begin{itemize}
\item |xdots/color| ;
@@ -2303,11 +2305,18 @@ sera exécuté après la construction du tableau.
\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|.
+après le mot-clé |\CodeAfter|. Bien que ce soit un mot-clé, |\CodeAfter| accepte
+quand même un argument optionnel (entre crochets). Les clés autorisées forment
+un sous-ensemble des clés acceptées par |\NiceMatrixOptions|.
+
+\medskip
+Les utilisateurs expérimentés peuvent, en particulier, utiliser les nœuds
+PGF/Tikz créés par \pkg{nicematrix} dans le |\CodeAfter|. Ces nœuds sont décrits
+à partir de la page \pageref{PGF-nodes}.
\medskip
-Deux commandes spéciales sont disponibles dans le |\CodeAfter| : |\line| et
-|\SubMatrix|.
+Par ailleurs, deux commandes spéciales sont disponibles dans le |\CodeAfter| :
+|\line| et |\SubMatrix|.
\subsection{La commande \textbackslash line dans le \textbackslash CodeAfter}
@@ -2341,14 +2350,19 @@ I & 0 & \Cdots &0 \\
\end{pNiceMatrix}$
\end{scope}
+\medskip
+Les options disponibles pour personnaliser les lignes pointillées créées par
+|\Cdots|, |\Vdots|, etc. peuvent aussi être passées à cette commande (cf.
+p.~\pageref{customization}).
+
\subsection{La commande \textbackslash SubMatrix dans le \textbackslash CodeAfter}
\label{sub-matrix}
\colorbox{yellow!50}{\textbf{Nouveau 5.10}}\enskip
La commande |\SubMatrix| permet de positionner des délimiteurs sur une partie du
-tableau considérée comme une sous-matrice. La commande |\SubMatrix| prend cinq
-arguments :
+tableau, partie qui est considérée comme une sous-matrice. La commande
+|\SubMatrix| prend cinq arguments :
\begin{itemize}
\item le premier argument est le délimiteur gauche qui peut être n'importe
quel délimiteur extensible de LaTeX : |(|, |[|, |\{|, |\langle|, |\lgroup|,
@@ -2370,10 +2384,10 @@ colonne avec |@{\hspace{1.5em}}| dans le préambule du tableau.
\medskip
\begin{scope}
+\hfuzz=15cm
\fvset{commandchars=\~\#\+}%
\begin{BVerbatim}[boxwidth=11cm,baseline=c]
-\[\begin{NiceArray}{ccc~emphase#@{\hspace{1.5em}}+c}%
- [cell-space-limits=2pt,~emphase#margin+]
+\[\begin{NiceArray}{ccc~emphase#@{\hspace{1.5em}}+c}[cell-space-limits=2pt,~emphase#margin+]
1 & 1 & 1 & x \\
\dfrac{1}{4} & \dfrac{1}{2} & \dfrac{1}{4} & y \\
1 & 2 & 3 & z
@@ -2401,7 +2415,7 @@ Les options de la commande |\SubMatrix| sont les suivantes :
clés) ;
\item |extra-height| ajoute une quantité à la hauteur totale des délimiteurs
(hauteur~|\ht| + profondeur |\dp|) ;
-\item |delimiters-color| permet de fixer la couleur des délimiteurs (cette clé
+\item |delimiters/color| permet de fixer la couleur des délimiteurs (cette clé
est également disponible dans |\NiceMatrixOptions| et au niveau des
environnements à délimiteurs ou comme option de |\CodeAfter|) ;
\item |slim| qui est une clé booléenne : lorsqu'elle est utilisée la position
@@ -2417,6 +2431,7 @@ préfixe |sub-matrix|, c'est-à-dire qu'elles sont alors nommées
\bigskip
\begin{scope}
+\hfuzz=12cm
\fvset{commandchars=\~\#\!}%
\begin{BVerbatim}[baseline=c,boxwidth=11cm]
$\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
@@ -2431,8 +2446,7 @@ c & d & \frac12c+\frac14d \\
\end{NiceArray}$
\end{BVerbatim}
\end{scope}
-$\begin{NiceArray}{cc@{\hspace{5mm}}l}%
- [cell-space-limits=2pt]
+$\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
& & \frac12 \\
& & \frac14 \\[1mm]
a & b & \frac12a+\frac14b \\
@@ -2448,10 +2462,10 @@ Voici le même exemple avec la clé |slim| pour l'une des sous-matrices.
\medskip
\begin{scope}
+\hfuzz=12cm
\fvset{commandchars=\~\#\!}%
\begin{BVerbatim}[baseline=c,boxwidth=11cm]
-$\begin{NiceArray}{cc@{\hspace{5mm}}l}%
- [cell-space-limits=2pt]
+$\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
& & \frac12 \\
& & \frac14 \\[1mm]
a & b & \frac12a+\frac14b \\
@@ -2564,28 +2578,6 @@ Dupont & Chantal & 15 janvier 1998 \\
\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, tabularnote = Un peu de texte avant les notes.]
-\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}
@@ -2622,7 +2614,7 @@ remarques illustrées. Cette table a été composée avec le code suivant.
\begin{center}
\fvset{commandchars=\~\#\!}
-\begin{BVerbatim}[formatcom=\small\color{gray}]
+\begin{Verbatim}[formatcom=\small\color{gray}]
\begin{table}
\setlength{\belowcaptionskip}{1ex}
\centering
@@ -2645,9 +2637,33 @@ Wallis & John & 87 \\
\bottomrule
\end{NiceTabular}
\end{table}
-\end{BVerbatim}
+\end{Verbatim}
\end{center}
+\begin{table}[hb]
+\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, tabularnote = Un peu de texte avant les notes.]
+\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}
+
+
+
\subsection{Personnalisation des notes de tableau}
@@ -2690,6 +2706,9 @@ paires \textsl{clé=valeur} où le nom des clés n'a plus à être préfixé par
\end{center}
+
+
+
\bigskip
On détaille maintenant ces clés.
@@ -3090,16 +3109,16 @@ d'éléments en verbatim (avec par exemple la commande
Pour les environnements avec délimiteurs (|{pNiceArray}|, |{pNiceMatrix}|,
etc.), il est possible de changer la couleur des délimiteurs avec la clé
-|delimiters-color|.
+|delimiters/color|.
\medskip
\begin{BVerbatim}[boxwidth=12cm,baseline=c]
-$\begin{bNiceMatrix}[delimiters-color=red]
+$\begin{bNiceMatrix}[delimiters/color=red]
1 & 2 \\
3 & 4
\end{bNiceMatrix}$
\end{BVerbatim}
-$\begin{bNiceMatrix}[delimiters-color=red]
+$\begin{bNiceMatrix}[delimiters/color=red]
1 & 2 \\
3 & 4
\end{bNiceMatrix}$
@@ -3136,7 +3155,8 @@ $\begin{NiceArrayWithDelims}
\section{Utilisation de Tikz avec nicematrix}
-\label{name}
+\label{name}\label{PGF-nodes}
+
\subsection{Les nœuds correspondant aux contenus des cases}
@@ -3464,14 +3484,18 @@ noix & noisette & brugnon
-\subsection{Les nœuds «row» et «col»}
+\subsection{Les nœuds indiquant la position des filets}
+
+\label{noeuds-i}
-L'extension \pkg{nicematrix} crée un nœud PGF-Tikz indiquant la position
-potentielle de chaque filet horizontal (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 |\CodeAfter|.
+\colorbox{yellow!50}{\textbf{Nouveau 5.11}}\enskip L'extension \pkg{nicematrix}
+crée un nœud PGF-Tikz nommé simplement $i$ (précédé du préfixe habituel) à
+l'intersection du filet horizontal de numéro $i$ et du filet vertical de
+numéro~$j$ (ou plutôt la position potentielle de ces filets car ils ne sont
+peut-être pas tracés). Ces nœuds sont accessibles dans le |\CodeAfter| mais
+aussi dans le |code-before|.
\begin{center}
-\begin{NiceTabular}{ccc}[hvlines,rules/width=1pt,rules/color=gray]
+\begin{NiceTabular}{ccc}[hvlines,rules={width=1pt,color=gray}]
rose & tulipe & lys \\
arum & iris & violette \\
muguet & dahlia & souci
@@ -3480,13 +3504,8 @@ muguet & dahlia & souci
\begin{tikzpicture}
\foreach \i in {1,2,3,4}
{
- \fill [red] (row-\i) circle (0.5mm) ;
- \node [red,anchor=east] at (row-\i) {row-\i} ;
- }
-\foreach \j in {1,2,3,4}
- {
- \fill [blue] (col-\j) circle (0.5mm) ;
- \node [blue,anchor=north] at (col-\j) {col-\j} ;
+ \fill [red] (\i) circle (0.5mm) ;
+ \node [red,above right] at (\i) {\i} ;
}
\end{tikzpicture}
\end{NiceTabular}
@@ -3494,10 +3513,10 @@ muguet & dahlia & souci
\bigskip
-Si on utilise Tikz (on rappelle que \pkg{nicematrix} ne charge pas Tikz par
-défaut), on peut donc accéder (dans le |code-before| et le |\CodeAfter|) à
-l'intersection du filet horizontal~$i$ et du filet vertical~$j$ avec la syntaxe
-|(row-|$i$\verb+-|col-+$j$|)|.
+Si on utilise Tikz (on rappelle que \pkg{nicematrix} ne charge pas Tikz mais
+uniquement \textsc{pgf} qui est une sous-couche de Tikz), on peut donc accéder
+(dans le |\CodeAfter| mais aussi dans le |code-before|) à l'intersection du filet
+horizontal~$i$ et du filet vertical~$j$ avec la syntaxe |(|$i$\verb+-|+$j$|)|.
\medskip
@@ -3506,8 +3525,7 @@ l'intersection du filet horizontal~$i$ et du filet vertical~$j$ avec la syntaxe
code-before =
{
~emphase# \tikz \draw [fill = red!15] @
-~emphase# (row-7-|col-4) -- (row-8-|col-4) -- (row-8-|col-5) -- @
-~emphase# (row-9-|col-5) -- (row-9-|col-6) |- cycle ; @
+~emphase# (7-|4) -- (8-|4) -- (8-|5) -- (9-|5) -- (9-|6) |- cycle ; @
}
]
1 \\
@@ -3526,8 +3544,7 @@ l'intersection du filet horizontal~$i$ et du filet vertical~$j$ avec la syntaxe
code-before =
{
\tikz \draw [fill = red!15]
- (row-7-|col-4) -- (row-8-|col-4) -- (row-8-|col-5) --
- (row-9-|col-5) -- (row-9-|col-6) |- cycle ;
+ (7-|4) -- (8-|4) -- (8-|5) -- (9-|5) -- (9-|6) |- cycle ;
}
]
1 \\
@@ -3546,6 +3563,7 @@ l'intersection du filet horizontal~$i$ et du filet vertical~$j$ avec la syntaxe
\label{node-sub-matrix}
+\colorbox{yellow!50}{\textbf{Nouveau 5.10}}\enskip
La commande |\SubMatrix| disponible dans le |\CodeAfter| a été présentée
p.~\pageref{sub-matrix}.
@@ -3616,70 +3634,56 @@ bibliothèque Tikz \pkg{patterns} : |\usetikzlibrary{patterns}|).
\fvset{commandchars=\§\¤\μ}
\begin{Verbatim}
\ExplSyntaxOn
-\cs_new_protected:Nn \__pantigny_hatchcell:nnn
+\cs_new_protected:Nn \__pantigny_hatch:nnn
{
\begin { tikzpicture }
\fill [ pattern = north~west~lines , pattern~color = #3 ]
- ( row - #1 -| col - #2)
- rectangle
- ( row - \int_eval:n { #1 + 1 } -| col - \int_eval:n { #2 + 1 } ) ;
+ ( #1 -| #2) rectangle ( \int_eval:n { #1 + 1 } -| \int_eval:n { #2 + 1 } ) ;
\end { tikzpicture }
}
\NewDocumentCommand \hatchcell { ! O { black } }
{
\tl_gput_right:Nx §emphase¤\g_nicematrix_code_before_tlμ
- {
- \__pantigny_hatchcell:nnn
- { \int_use:c { c@iRow } }
- { \int_use:c { c@jCol } }
- { #1 }
- }
+ { \__pantigny_hatch:nnn { \arabic { iRow } } { \arabic { jCol } } { #1 } }
}
\ExplSyntaxOff
\end{Verbatim}
\end{scope}
-
\ExplSyntaxOn
-\cs_new_protected:Nn \__pantigny_hatchcell:nnn
+\cs_new_protected:Nn \__pantigny_hatch:nnn
{
\begin { tikzpicture }
\fill [ pattern = north~west~lines , pattern~color = #3 ]
- ( row - #1 -| col - #2)
- rectangle
- ( row - \int_eval:n { #1 + 1 } -| col - \int_eval:n { #2 + 1 } ) ;
+ ( #1 -| #2 ) rectangle ( \int_eval:n { #1 + 1 } -| \int_eval:n { #2 + 1 } ) ;
\end { tikzpicture }
}
\NewDocumentCommand \hatchcell { ! O { black } }
{
\tl_gput_right:Nx \g_nicematrix_code_before_tl
- {
- \__pantigny_hatchcell:nnn
- { \int_use:c { c@iRow } }
- { \int_use:c { c@jCol } }
- { #1 }
- }
+ { \__pantigny_hatch:nnn { \arabic { iRow } } { \arabic { jCol } } { #1 } }
}
\ExplSyntaxOff
+
\bigskip
Voici un exemple d'utilisation.
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=9cm]
\begin{NiceTabular}{ccc}[hvlines]
-Tokyo & Paris & London \\
-Roma & ~emphase#\hatchcell[blue!30]@Oslo & Miami \\
-Los Angeles & Madrid & Roma
+Tokyo & Paris & Londres \\
+Lima & ~emphase#\hatchcell[blue!30]@Oslo & Miami \\
+Los Angeles & Madrid & Rome
\end{NiceTabular}
\end{BVerbatim}
\begin{NiceTabular}{ccc}[hvlines]
-Tokyo & Paris & London \\
+Tokyo & Paris & Londres \\
Lima & \hatchcell[blue!30]Oslo & Miami \\
-Los Angeles & Madrid & Roma
+Los Angeles & Madrid & Rome
\end{NiceTabular}
@@ -4001,101 +4005,6 @@ Dupont & Chantal & 15 janvier 1998 \\
\subsection{Lignes en pointillés}
-
-Une matrice de permutation.\par\nobreak
-
-À titre d'exemple, on a augmenté la valeur du paramètre
-|xdots/shorten|.\par\nobreak
-
-
-\bigskip
-\begin{BVerbatim}[baseline=c]
-$\begin{pNiceMatrix}[~emphase#xdots/shorten=6em@]
-0 & 1 & 0 & & \Cdots & 0 \\
-\Vdots & & & \Ddots & & \Vdots \\
- & & & \Ddots & & \\
- & & & \Ddots & & 0 \\
-0 & 0 & & & & 1 \\
-1 & 0 & & \Cdots & & 0
-\end{pNiceMatrix}$
-\end{BVerbatim}
-\hspace{2.5cm}
-$\begin{pNiceMatrix}[xdots/shorten=0.6em]
-0 & 1 & 0 & & \Cdots & 0 \\
-\Vdots & & & \Ddots & & \Vdots \\
- & & & \Ddots & & \\
- & & & \Ddots & & 0 \\
-0 & 0 & & & & 1 \\
-1 & 0 & & \Cdots & & 0
-\end{pNiceMatrix}$
-
-\vspace{2cm}
-
-Un exemple avec |\Iddots|. On a augmenté encore davantage la valeur de |xdots/shorten|.\par\nobreak
-\bigskip
-\begin{BVerbatim}[baseline=c]
-$\begin{pNiceMatrix}[~emphase#xdots/shorten = 0.9em@]
-1 & \Cdots & & 1 \\
-\Vdots & & & 0 \\
- & ~emphase#\Iddots@ & ~emphase#\Iddots@ & \Vdots \\
-1 & 0 & \Cdots & 0
-\end{pNiceMatrix}$
-\end{BVerbatim}
-\hspace{4cm}
-$\begin{pNiceMatrix}[xdots/shorten = 0.9em]
-1 & \Cdots & & 1 \\
-\Vdots & & & 0 \\
- & \Iddots & \Iddots & \Vdots \\
-1 & 0 & \Cdots & 0
-\end{pNiceMatrix}$
-
-
-\vspace{2cm}
-Un exemple avec |\multicolumn|:\par\nobreak
-\bigskip
-\begin{BVerbatim}
-\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 \\
-1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10
-\end{BNiceMatrix}
-\end{BVerbatim}
-
-\bigskip
-\[\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 \\
-1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10
-\end{BNiceMatrix}\]
-
-\vspace{2cm}
-Un exemple avec |\Hdotsfor|:\par\nobreak
-
-\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
-\begin{pNiceMatrix}[nullify-dots]
-0 & 1 & 1 & 1 & 1 & 0 \\
-0 & 1 & 1 & 1 & 1 & 0 \\
-\Vdots & ~emphase#\Hdotsfor{4}@ & \Vdots \\
- & ~emphase#\Hdotsfor{4}@ & \\
- & ~emphase#\Hdotsfor{4}@ & \\
- & ~emphase#\Hdotsfor{4}@ & \\
-0 & 1 & 1 & 1 & 1 & 0
-\end{pNiceMatrix}
-\end{BVerbatim}
-$\begin{pNiceMatrix}[nullify-dots]
-0 & 1 & 1 & 1 & 1 & 0 \\
-0 & 1 & 1 & 1 & 1 & 0 \\
-\Vdots & \Hdotsfor{4} & \Vdots \\
- & \Hdotsfor{4} & \\
- & \Hdotsfor{4} & \\
- & \Hdotsfor{4} & \\
-0 & 1 & 1 & 1 & 1 & 0
-\end{pNiceMatrix}$
-
-\vspace{2cm}
Un exemple pour le résultant de deux polynômes :
\par\nobreak
\bigskip
@@ -4160,6 +4069,57 @@ L'option |line-style| permet de changer le style des lignes tracées par
|\Ldots|, |\Cdots|, etc. On peut de ce fait tracer des lignes qui ne sont plus
pointillées.
+
+
+
+\begin{Verbatim}[formatcom=\small\color{gray}]
+\NiceMatrixOptions{code-for-first-row = \scriptstyle,code-for-first-col = \scriptstyle }
+\setcounter{MaxMatrixCols}{12}
+\newcommand{\blue}{\color{blue}}
+\[\begin{pNiceMatrix}[last-row,last-col,nullify-dots,xdots/line-style={dashed,blue}]
+1& & & \Vdots & & & & \Vdots \\
+& \Ddots[line-style=standard] \\
+& & 1 \\
+\Cdots[color=blue,line-style=dashed]& & & \blue 0 &
+\Cdots & & & \blue 1 & & & \Cdots & \blue \leftarrow i \\
+& & & & 1 \\
+& & &\Vdots & & \Ddots[line-style=standard] & & \Vdots \\
+& & & & & & 1 \\
+\Cdots & & & \blue 1 & \Cdots & & \Cdots & \blue 0 & & & \Cdots & \blue \leftarrow j \\
+& & & & & & & & 1 \\
+& & & & & & & & & \Ddots[line-style=standard] \\
+& & & \Vdots & & & & \Vdots & & & 1 \\
+& & & \blue \overset{\uparrow}{i} & & & & \blue \overset{\uparrow}{j} \\
+\end{pNiceMatrix}\]
+\end{Verbatim}
+
+
+\begin{scope}
+\NiceMatrixOptions{code-for-first-row = \scriptstyle,code-for-first-col = \scriptstyle }
+\setcounter{MaxMatrixCols}{12}
+\newcommand{\blue}{\color{blue}}
+\[\begin{pNiceMatrix}[last-row,last-col,nullify-dots,xdots/line-style={dashed,blue}]
+1& & & \Vdots & & & & \Vdots \\
+& \Ddots[line-style=standard] \\
+& & 1 \\
+\Cdots[color=blue,line-style=dashed]& & & \blue 0 &
+\Cdots & & & \blue 1 & & & \Cdots & \blue \leftarrow i \\
+& & & & 1 \\
+& & &\Vdots & & \Ddots[line-style=standard] & & \Vdots \\
+& & & & & & 1 \\
+\Cdots & & & \blue 1 & \Cdots & & \Cdots & \blue 0 & & & \Cdots & \blue \leftarrow j \\
+& & & & & & & & 1 \\
+& & & & & & & & & \Ddots[line-style=standard] \\
+& & & \Vdots & & & & \Vdots & & & 1 \\
+& & & \blue \overset{\uparrow}{i} & & & & \blue \overset{\uparrow}{j} \\
+\end{pNiceMatrix}\]
+\end{scope}
+
+
+
+\interitem
+On peut même tracer des lignes continues.
+
\begin{Verbatim}
\NiceMatrixOptions
{nullify-dots,code-for-first-col = \color{blue},code-for-first-col=\color{blue}}
@@ -4321,14 +4281,38 @@ matrice.\footnote{Pour la commande |\cline|, voir la remarque
\vspace{1cm}
Il est possible de colorier une rangée avec |\rowcolor| dans le |code-before|
(ou avec |\rowcolor| dans la première case de la rangée si on utilise la clé
-|colortbl-like|). Les possibilités de réglages sont néanmoins limitées. C'est
+|colortbl-like| − même si \pkg{colortbl} n'est pas chargé).
+
+
+\begin{Verbatim}
+\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,colortbl-like]
+ ~emphase#\rowcolor{red!15}@A_{11} & A_{12} & A_{13} & A_{14} \\
+ A_{21} & ~emphase#\rowcolor{red!15}@A_{22} & A_{23} & A_{24} \\
+ A_{31} & A_{32} & ~emphase#\rowcolor{red!15}@A_{33} & A_{34} \\
+ A_{41} & A_{42} & A_{43} & ~emphase#\rowcolor{red!15}@A_{44}
+\end{pNiceArray}
+\end{Verbatim}
+
+
+
+\[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,colortbl-like]
+ \rowcolor{red!15}A_{11} & A_{12} & A_{13} & A_{14} \\
+ A_{21} & \rowcolor{red!15}A_{22} & A_{23} & A_{24} \\
+ A_{31} & A_{32} & \rowcolor{red!15}A_{33} & A_{34} \\
+ A_{41} & A_{42} & A_{43} & \rowcolor{red!15}A_{44}
+\end{pNiceArray}\]
+
+
+\medskip
+Les possibilités de réglages sont néanmoins limitées. C'est
pourquoi nous présentons ici une autre méthode pour surligner une rangée d'une
matrice.
\medskip
Cet exemple et les suivants nécessitent d'avoir chargé Tikz (\pkg{nicematrix} ne
-charge que \textsc{pgf}) ainsi que la bibliothèque Tikz |fit|, ce qui peut se
-faire avec les deux instructions suivantes dans le préambule du document :
+charge que \textsc{pgf}, qui est une sous-couche de Tikz) ainsi que la
+bibliothèque Tikz |fit|, ce qui peut se faire avec les deux instructions
+suivantes dans le préambule du document :
\begin{verbatim}
\usepackage{tikz}
@@ -4336,12 +4320,14 @@ faire avec les deux instructions suivantes dans le préambule du document :
\end{verbatim}
\medskip
-Nous créons un nœud Tikz rectangulaire qui englobe les nœuds de la
-deuxième rangée en utilisant les outils de la bibliothèque Tikz \pkg{fit}. Ce
-nœud est rempli après la construction de la matrice. Pour que l'on puisse voir
-le texte \emph{sous} le nœud, nous devons utiliser la transparence avec le
-|blend mode| égal à |multiply|.
-
+Nous créons un nœud Tikz rectangulaire qui englobe les nœuds de la deuxième
+rangée en utilisant les outils de la bibliothèque Tikz \pkg{fit}. Ce nœud est
+rempli après la construction de la matrice. Pour que l'on puisse voir le texte
+\emph{sous} le nœud, nous devons utiliser la transparence avec le |blend mode|
+égal à |multiply|. \textbf{Attention} : Certains lecteurs de \textsc{pdf}
+n'affichent pas la transparence.\footnote{Dans Overleaf, the lecteur de
+ \textsc{PDF} «intégré» n'affiche pas la transparence. On peut sélectionner le
+ lecteur «natif» dans ce cas-là.}
\tikzset{highlight/.style={rectangle,
fill=red!15,
@@ -4504,43 +4490,6 @@ a & a & a & L_3 \\
\end{pNiceArray}\]
-\vspace{1cm}
-
-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]
- A_{11} & A_{12} & A_{13} & A_{14} \\
- A_{21} & A_{22} & A_{23} & A_{24} \\
- A_{31} & A_{32} & A_{33} & A_{34} \\
- A_{41} & A_{42} & A_{43} & A_{44}
-\CodeAfter
- \tikz \path [~emphase#name suffix = -large@,fill = red!15, blend mode = multiply]
- (1-1.north west)
- |- (2-2.north west)
- |- (3-3.north west)
- |- (4-4.north west)
- |- (4-4.south east)
- |- (1-1.north west) ;
-\end{pNiceArray}
-\end{Verbatim}
-
-
-\[\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} \\
- A_{41} & A_{42} & A_{43} & A_{44}
-\CodeAfter
- \tikz \path [name suffix = -large,fill = red!15, blend mode = multiply]
- (1-1.north west)
- |- (2-2.north west)
- |- (3-3.north west)
- |- (4-4.north west)
- |- (4-4.south east)
- |- (1-1.north west) ;
-\end{pNiceArray}\]
-
\subsection{Utilisation directe des nœuds Tikz}
@@ -4671,7 +4620,6 @@ TeXLive sont disponibles sur le serveur \textsc{svn} de TeXLive :
% Local Variables:
% TeX-fold-mode: t
% TeX-fold-preserve-comments: nil
-% flyspell-mode: true
% fill-column: 80
% End:
diff --git a/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf b/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf
index 12843620c06..a8e3ae524ee 100644
--- a/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf
+++ b/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx b/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx
index 3b7f4d278ec..24732c133c6 100644
--- a/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx
+++ b/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx
@@ -15,8 +15,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{5.10}
-\def\myfiledate{2021/02/05}
+\def\myfileversion{5.11}
+\def\myfiledate{2021/02/22}
%
%
%<*batchfile>
@@ -95,7 +95,8 @@ version 2005/12/01 or later.
\cs_set_protected:Npn}
\DoNotIndex{\bool_if:NTF,\bool_new:N,\bool_set_false:N,\bool_set_true:N,\l_tmpa_bool}
\DoNotIndex{\group_begin:,\group_end:,\c_math_toggle_token}
-\DoNotIndex{\tl_set:Nn,\l_tmpa_tl}
+\DoNotIndex{\tl_set:Nn,\l_tmpa_tl,\l_tmpb_tl}
+\DoNotIndex{\tl_gput_left:Nn,\tl_gput_right:Nn}
\ExplSyntaxOff
\makeatother
@@ -160,6 +161,16 @@ version 2005/12/01 or later.
% distribution as MiKTeX or TeXlive.
%
% \bigskip
+% \emph{Remark}: If you use LaTeX via Internet with, for example, Overleaf, you
+% can upload the file |nicematrix.sty| in the repertory of your
+% project in order to take full advantage of the latest version de
+% \pkg{nicematrix}.\footnote{The latest version of the file
+% \verb|nicematrix.sty| may be downloaded from the \textsc{svn} server of
+% TeXLive:\newline
+% \small
+% \url{https:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty}}
+%
+% \bigskip
% This package can be used with |xelatex|, |lualatex|, |pdflatex| but also by
% the classical workflow |latex|-|dvips|-|ps2pdf| (or Adobe Distiller).
% \textsl{However, the file nicematrix.dtx of the present documentation should
@@ -191,19 +202,6 @@ version 2005/12/01 or later.
% semi-global).
%
%
-% \bigskip
-% {\bfseries \color{red} Important
-%
-% Since the 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
%
@@ -281,8 +279,8 @@ version 2005/12/01 or later.
% |cell-space-bottom-limit| similar to the parameters |\cellspacetoplimit| and
% |\cellspacebottomlimit| of \pkg{cellspace}.
%
-% \colorbox{yellow!50}{\bfseries{New 5.9}}\enskip
-% There is also a key |cell-space-limits| to set both parameters at once.
+% \colorbox{yellow!30}{New 5.9}\enskip There is also a key |cell-space-limits|
+% to set both parameters at once.
%
% The initial value of these parameters is $0$~pt in order to have for the
% environments of \pkg{nicematrix} the same behaviour as those of \pkg{array}
@@ -747,9 +745,7 @@ version 2005/12/01 or later.
% In the environments of \pkg{nicematrix}, the vertical rules specified by
% \verb+|+ in the preambles of the environments are never broken, even by an
% incomplete row or by a double horizontal rule specified by |\hline\hline|
-% (there is no need to use \pkg{hhline}). \footnote{This is the behaviour since
-% the version 5.1 of \pkg{nicematrix}. Prior to that version, the behaviour was
-% the standard behaviour of \pkg{array}.}
+% (there is no need to use \pkg{hhline}).
%
% \bigskip
% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1170,7 +1166,9 @@ version 2005/12/01 or later.
% The extension \pkg{nicematrix} provides a key |code-before| for some code that
% will be executed before the drawing of the tabular. In this |code-before|, new
% commands are available: |\cellcolor|, |\rectanglecolor|, |\rowcolor|,
-% |\columncolor|, |\rowcolors| and |\chessboardcolors|.
+% |\columncolor|, |\rowcolors| and |\chessboardcolors|.\footnote{Remark that, in
+% the \verb|code-before|, some PGF/Tikz nodes corresponding to the position to
+% the potential rules are available: cf.~p.~\pageref{nodes-i}.}
% \label{code-before}
%
% \medskip
@@ -1183,8 +1181,8 @@ version 2005/12/01 or later.
% \pkg{colortbl}.
%
% This command takes in as mandatory arguments a color and a list of cells, each
-% of which with the format $i$-$j$ where $i$ is the number of row and $j$ the
-% number of colummn of the cell.
+% of which with the format $i$-$j$ where $i$ is the number of the row and $j$ the
+% number of the colummn of the cell.
%
%
% \medskip
@@ -1282,17 +1280,17 @@ version 2005/12/01 or later.
% \bigskip
% \item The command |\rowcolors| (with a \emph{s}) takes its name from the
% command |\rowcolors| of \pkg{xcolor}\footnote{The command |\rowcolors| of
-% \pkg{xcolor} is available when \pkg{xcolor} is loaded with the
-% option~|table|.}. The \emph{s} emphasizes the fact that there is \emph{two}
-% colors. This command colors alternately the rows of the tabular with the
-% tow colors (provided in second and third argument), beginning
-% with the row whose number is given in first (mandatory) argument.
+% \pkg{xcolor} is available when \pkg{xcolor} is loaded with the option~|table|.
+% That option also loads the package \pkg{colortbl}.}. The \emph{s} emphasizes
+% the fact that there is \emph{two} colors. This command colors alternately the
+% rows of the tabular with the tow colors (provided in second and third
+% argument), beginning with the row whose number is given in first (mandatory)
+% argument.
%
-% \colorbox{yellow!30}{New 5.8}\enskip In fact, the first (mandatory)
-% argument is, more generally, a comma separated list of intervals describing
-% the rows involved in the action of |\rowcolors| (an interval of the form
-% $i$|-| describes in fact the interval of all the rows of the tabular,
-% beginning with the row~$i$).
+% In fact, the first (mandatory) argument is, more generally, a comma separated
+% list of intervals describing the rows involved in the action of |\rowcolors|
+% (an interval of the form $i$|-| describes in fact the interval of all the rows
+% of the tabular, beginning with the row~$i$).
%
%
%
@@ -1301,15 +1299,15 @@ version 2005/12/01 or later.
% optional argument in the first position corresponds to the colorimetric
% space). The available keys are |cols|, |restart| and |respect-blocks|.
% \begin{itemize}
-% \item \colorbox{yellow!30}{New 5.8}\enskip The key |cols| describes a
-% set of columns. The command |\rowcolors| will color only the cells of these
-% columns. The value is a comma-separated list of intervals of the form $i$-$j$.
-% \item \colorbox{yellow!30}{New 5.8}\enskip With the key |restart|,
-% each interval of rows (specified by the first mandatory argument) begins with
-% the same color.\footnote{Otherwise, the color of a given row relies only upon the
-% parity of its number.}
+% \item The key |cols| describes a set of columns. The command |\rowcolors| will
+% color only the cells of these columns. The value is a comma-separated list of
+% intervals of the form $i$-$j$.
+% \item With the key |restart|, each interval of rows (specified by the first
+% mandatory argument) begins with the same color.\footnote{Otherwise, the color
+% of a given row relies only upon the parity of its number.}
% \item With the key |respect-blocks| the ``rows'' alternately colored may extend over
-% several rows if they have to incorporate blocks (created with the command |\Block|).
+% several rows if they have to incorporate blocks (created with the command
+% |\Block|: cf.~p.~\pageref{Block}).
% \end{itemize}
%
% \medskip
@@ -1402,7 +1400,8 @@ version 2005/12/01 or later.
%
% \bigskip
% One should remark that these commands are compatible with the commands of
-% \pkg{booktabs} (|\toprule|, |\midrule|, |\bottomrule|, etc).
+% \pkg{booktabs} (|\toprule|, |\midrule|, |\bottomrule|, etc). However,
+% \pkg{booktabs} is not loaded by \pkg{nicematrix}.
%
% \medskip
% \begin{scope}
@@ -1451,7 +1450,7 @@ version 2005/12/01 or later.
%
% It's possible to access the preceding tools with a syntax close to the syntax
% of \pkg{colortbl}. For that, one must use the key |colortbl-like| in the
-% current environment.\footnote{As of now, this key is not available in |\NiceMatrixOptions|.}
+% current environment.\footnote{As for now, this key is \emph{not} available in |\NiceMatrixOptions|.}
%
% There are three commands available (they are inspired by \pkg{colortbl} but
% are \emph{independent} of \pkg{colortbl}):
@@ -1463,7 +1462,7 @@ version 2005/12/01 or later.
% with the same syntax as the corresponding command of
% \pkg{colortbl} (however, unlike the command |\columncolor| of \pkg{colortbl},
% this command |\columncolor| can appear within another command, itself used in the
-% preamble).
+% preamble of the array).
% \end{itemize}
%
% \medskip
@@ -1673,10 +1672,13 @@ version 2005/12/01 or later.
% \bigskip
% We have several remarks to do.
% \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.
+% \item For the environments with an explicit preamble (i.e. |{NiceTabular}|,
+% |{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.\footnote{The users wishing exteriors columns with another
+% type of alignment should consider the command |\SubMatrix| available in the
+% |\CodeAfter| (cf.~p.~\pageref{sub-matrix}).}
% \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''.
@@ -1705,9 +1707,8 @@ version 2005/12/01 or later.
% \bigskip
% It's possible to control the appearance of these rows and columns with options
% |code-for-first-row|, |code-for-last-row|, |code-for-first-col| and
-% |code-for-last-col|. These options
-% specify tokens that will be inserted before each cell of the corresponding row
-% or column.
+% |code-for-last-col|. These options specify tokens that will be inserted before
+% each cell of the corresponding row or column.
%
%
% \begin{Verbatim}
@@ -1761,9 +1762,12 @@ version 2005/12/01 or later.
%
% \item Logically, the potential option |columns-width| (described
% p.~\pageref{width}) doesn't apply to the ``first column'' and ``last column''.
+%
% \item For technical reasons, it's not possible to use the option of the
-% command |\\| after the ``first row'' or before the ``last row'' (the placement
-% of the delimiters would be wrong).
+% command |\\| after the ``first row'' or before the ``last row''. The placement
+% of the delimiters would be wrong. If you are looking for a workaround,
+% consider the command |\SubMatrix| in the |\CodeAfter| described
+% p.~\pageref{sub-matrix}.
% \end{itemize}
%
%
@@ -1793,7 +1797,7 @@ version 2005/12/01 or later.
% with the option |color|.\footnote{It's also possible to change the color of
% all theses dotted lines with the option |xdots/color| (\textsl{xdots} to
% remind that it works for |\Cdots|, |\Ldots|, |\Vdots|, etc.): cf. p.
-% \pageref{customization}.}\par\nobreak
+% \pageref{customisation}.}\par\nobreak
%
% \bigskip
% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -2028,10 +2032,12 @@ version 2005/12/01 or later.
% 1 & 2 & 3 & 4 & 5
% \end{pNiceMatrix}$
%
-%
+% \medskip
% Remark: Unlike the command |\hdotsfor| of \pkg{amsmath}, the command
-% |\Hdotsfor| may be used when the package \pkg{colortbl} is loaded (but you
-% might have problem if you use |\rowcolor| on the same row as |\Hdotsfor|).
+% |\Hdotsfor| may be used even when the package \pkg{colortbl}\footnote{We
+% recall that when \pkg{xcolor} is loaded with the option \verb|table|, the
+% package \pkg{colortbl} is loaded.} is loaded (but you might have problem if
+% you use |\rowcolor| on the same row as |\Hdotsfor|).
%
% \bigskip
% The package \pkg{nicematrix} also provides a command |\Vdotsfor| similar to
@@ -2145,9 +2151,9 @@ version 2005/12/01 or later.
% 0 & & 1
% \end{bNiceMatrix}$
%
-% \subsection{Customization of the dotted lines}
+% \subsection{Customisation of the dotted lines}
%
-% \label{customization}
+% \label{customisation}
% The dotted lines drawn by |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots|
% and |\Hdotsfor| (and by the command |\line| in the |\CodeAfter| which is described
% p.~\pageref{line-in-code-after}) may be customized by three options (specified
@@ -2158,9 +2164,9 @@ version 2005/12/01 or later.
% \item |line-style|.
% \end{itemize}
%
-% These options may also be fixed with |\NiceMatrixOptions| or at the level of a
-% given environment but, in those cases, they must be prefixed by |xdots|, and,
-% thus have for names:
+% These options may also be fixed with |\NiceMatrixOptions|, as options of
+% |\CodeAfter| or at the level of a given environment but, in those cases, they
+% must be prefixed by |xdots|, and, thus have for names:
% \begin{itemize}
% \item |xdots/color|;
% \item |xdots/shorten|;
@@ -2280,18 +2286,27 @@ version 2005/12/01 or later.
% \medskip
% For the legibility of the code, an alternative syntax is provided: it's
% possible to give the instructions of the |\code-after| at the end of the
-% environment, after the keyword |\CodeAfter|.
+% environment, after the keyword |\CodeAfter|. Although |\CodeAfter| is a
+% keyword, it takes in an optional argument (between square brackets). The keys
+% accepted form a subset of the keys of the command |\WithArrowsOptions|.
%
+%
+% \medskip
+% The experienced users may use, for instance, the PGF/Tikz nodes created by
+% \pkg{nicematrix} in the |\CodeAfter|. These nodes are described further
+% beginning on p.~\pageref{PGF-nodes}.
+%
% \medskip
-% Two special commands are available in the |\CodeAfter|: |line| and
+% Moreover, two special commands are available in the |\CodeAfter|: |line| and
% |\SubMatrix|.
%
% \subsection{The command \textbackslash line in the \textbackslash CodeAfter}
%
-% The command |\line|draws directly 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 adjacent cells. \label{line-in-code-after}
+% The command |\line| draws directly dotted lines between nodes. It takes in two
+% arguments for the two cells to link, both of the form $i$-$j$ where is the
+% number of the row and $j$ is the number of the column. It may be used, for
+% example, to draw a dotted line between two adjacent
+% cells. \label{line-in-code-after}
%
% \medskip
% \begin{BVerbatim}[baseline=c,boxwidth=11cm]
@@ -2315,13 +2330,18 @@ version 2005/12/01 or later.
% \end{pNiceMatrix}$
% \end{scope}
%
+% \medskip
+% The options available for the customisation of the dotted lines created by
+% |\Cdots|, |\Vdots|, etc. are also available for this command (cf.
+% p.~\pageref{customisation}).
+%
%
% \subsection{The command \textbackslash SubMatrix in the \textbackslash CodeAfter}
%
% \label{sub-matrix}
%
% \colorbox{yellow!50}{\textbf{New 5.10}}\enskip
-% The command |\SubMatrix| provides a way to put delimiters on an portion
+% The command |\SubMatrix| provides a way to put delimiters on a portion
% of the array considered as a submatrix. The command |\SubMatrix| takes in five
% arguments:
% \begin{itemize}
@@ -2343,10 +2363,10 @@ version 2005/12/01 or later.
%
% \medskip
% \begin{scope}
+% \hfuzz=15cm
% \fvset{commandchars=\~\#\+}%
% \begin{BVerbatim}[boxwidth=11cm,baseline=c]
-% \[\begin{NiceArray}{ccc~emphase#@{\hspace{1.5em}}+c}%
-% [cell-space-limits=2pt,~emphase#margin+]
+% \[\begin{NiceArray}{ccc~emphase#@{\hspace{1.5em}}+c}[cell-space-limits=2pt,~emphase#margin+]
% 1 & 1 & 1 & x \\
% \dfrac{1}{4} & \dfrac{1}{2} & \dfrac{1}{4} & y \\
% 1 & 2 & 3 & z
@@ -2372,7 +2392,7 @@ version 2005/12/01 or later.
% exists also the key |xshift| which fixes both parameters);
% \item |extra-height| adds a quantity to the total height of the delimiters
% (height |\ht| + depth |\dp|);
-% \item |delimiters-color| fixes the color of the delimiters (also
+% \item |delimiters/color| fixes the color of the delimiters (also
% available in |\NiceMatrixOptions|, in the environments with delimiters and as
% option of the command |\CodeAfter|);
% \item |slim| is a boolean key: when that key is in force, the horizontal
@@ -2390,10 +2410,10 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{scope}
+% \hfuzz=12cm
% \fvset{commandchars=\~\#\!}%
% \begin{BVerbatim}[baseline=c,boxwidth=11cm]
-% $\begin{NiceArray}{cc@{\hspace{5mm}}l}%
-% [cell-space-limits=2pt]
+% $\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
% & & \frac12 \\
% & & \frac14 \\[1mm]
% a & b & \frac12a+\frac14b \\
@@ -2421,10 +2441,10 @@ version 2005/12/01 or later.
%
% \medskip
% \begin{scope}
+% \hfuzz=12cm
% \fvset{commandchars=\~\#\!}%
% \begin{BVerbatim}[baseline=c,boxwidth=11cm]
-% $\begin{NiceArray}{cc@{\hspace{5mm}}l}%
-% [cell-space-limits=2pt]
+% $\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
% & & \frac12 \\
% & & \frac14 \\[1mm]
% a & b & \frac12a+\frac14b \\
@@ -2450,7 +2470,7 @@ version 2005/12/01 or later.
%
% \bigskip
% There is also a key |name| which gives a name to the submatrix created by
-% |\SubMatrix|. That name is used to created PGF/Tiks nodes: cf
+% |\SubMatrix|. That name is used to created PGF/Tikz nodes: cf
% p.~\pageref{node-sub-matrix}.
%
% \section{The notes in the tabulars}
@@ -2570,7 +2590,7 @@ version 2005/12/01 or later.
%
% \begin{center}
% \fvset{commandchars=\~\#\!}
-% \begin{BVerbatim}[formatcom=\small\color{gray}]
+% \begin{Verbatim}[formatcom=\small\color{gray}]
% \begin{table}
% \setlength{\belowcaptionskip}{1ex}
% \centering
@@ -2592,11 +2612,11 @@ version 2005/12/01 or later.
% \bottomrule
% \end{NiceTabular}
% \end{table}
-% \end{BVerbatim}
+% \end{Verbatim}
% \end{center}
%
%
-% \begin{table}
+% \begin{table}[hb]
% \setlength{\belowcaptionskip}{1ex}
% \centering
% \caption{Use of \texttt{\textbackslash tabularnote}\tabularnote{It's possible
@@ -2745,7 +2765,7 @@ version 2005/12/01 or later.
% Initial value:\quad |afterlabel = \nobreak, itemjoin = \quad|
%
%
-% \item The key |notes/code-before| est une token list inserted by \pkg{nicematrix}
+% \item The key |notes/code-before| is a token list inserted by \pkg{nicematrix}
% just before the composition of the notes at the end of the tabular.
%
% Initial value: \textsl{empty}
@@ -2762,7 +2782,7 @@ version 2005/12/01 or later.
%
%
% \bigskip
-% For an example of customization of the tabular notes, see p.~\pageref{ex:notes}.
+% For an example of customisation of the tabular notes, see p.~\pageref{ex:notes}.
%
%
% \subsection{Use of \{NiceTabular\} with threeparttable}
@@ -3055,16 +3075,17 @@ version 2005/12/01 or later.
%
% For the environements with delimiters (|{pNiceArray}|, |{pNiceMatrix}|, etc.),
% it's possible to change the color of the delimiters with the key
-% |delimiters-color|.
+% |delimiters/color|.\footnote{\verb|delimiters-color| is a synonymous
+% (deprecated) for |delimiters/color|.}
%
% \medskip
% \begin{BVerbatim}[boxwidth=12cm,baseline=c]
-% $\begin{bNiceMatrix}[delimiters-color=red]
+% $\begin{bNiceMatrix}[delimiters/color=red]
% 1 & 2 \\
% 3 & 4
% \end{bNiceMatrix}$
% \end{BVerbatim}
-% $\begin{bNiceMatrix}[delimiters-color=red]
+% $\begin{bNiceMatrix}[delimiters/color=red]
% 1 & 2 \\
% 3 & 4
% \end{bNiceMatrix}$
@@ -3098,7 +3119,8 @@ version 2005/12/01 or later.
%
% \section{Use of Tikz with nicematrix}
%
-% \label{name}
+% \label{name}\label{PGF-nodes}
+%
% \subsection{The nodes corresponding to the contents of the cells}
%
% The package \pkg{nicematrix} creates a PGF/Tikz node for each (non-empty) cell
@@ -3419,12 +3441,15 @@ version 2005/12/01 or later.
%
%
%
-% \subsection{The ``row-nodes'' and the ``col-nodes''}
+% \subsection{The nodes which indicate the position of the rules}
%
-% The package \pkg{nicematrix} creates a PGF/Tikz node indicating the potential
-% position of each horizontal rule (with the names |row-|$i$) and each vertical
-% rule (with the names |col-|$j$), as described in the following figure. These
-% nodes are available in the |code-before| and the |\CodeAfter|.
+% \label{nodes-i}
+% \colorbox{yellow!50}{\textbf{New 5.11}}\enskip The package \pkg{nicematrix}
+% creates a PGF/Tikz node merely called $i$ (with the classical prefix) at the
+% intersection of the horizontal rule of number~$i$ and the vertical rule of
+% number~$j$ (more specifically the potential position of those rules because
+% maybe there are not actually drawn). These nodes are available in the
+% |code-before| and the |\CodeAfter|.
% \begin{center}
% \begin{NiceTabular}{ccc}[hvlines,rules/width=1pt,rules/color=gray]
% rose & tulipe & lys \\
@@ -3435,23 +3460,18 @@ version 2005/12/01 or later.
% \begin{tikzpicture}
% \foreach \i in {1,2,3,4}
% {
-% \fill [red] (row-\i) circle (0.5mm) ;
-% \node [red,anchor=east] at (row-\i) {row-\i} ;
-% }
-% \foreach \j in {1,2,3,4}
-% {
-% \fill [blue] (col-\j) circle (0.5mm) ;
-% \node [blue,anchor=north] at (col-\j) {col-\j} ;
+% \fill [red] (\i) circle (0.5mm) ;
+% \node [red,above right] at (\i) {\i} ;
% }
% \end{tikzpicture}
% \end{NiceTabular}
% \end{center}
%
% \bigskip
-% If we use Tikz (we remind that \pkg{nicematrix} does not load Tikz by
-% default), we can access (in the |code-before| and the |\CodeAfter|) to the
-% intersection of the horizontal rule~$i$ and the vertical rule~$j$ with the
-% syntax |(row-|$i$\verb+-|col-+$j$|)|.
+% If we use Tikz (we remind that \pkg{nicematrix} does not load Tikz by default,
+% by only \textsc{pgf}, which is a sub-layer of Tikz), we can access, in the
+% |\CodeAfter| but also in the |code-before|) to the intersection of the horizontal
+% rule~$i$ and the vertical rule~$j$ with the syntax |(|$i$\verb+-|+$j$|)|.
%
% \medskip
% \begin{Verbatim}
@@ -3459,8 +3479,7 @@ version 2005/12/01 or later.
% code-before =
% {
% ~emphase# \tikz \draw [fill = red!15] @
-% ~emphase# (row-7-|col-4) -- (row-8-|col-4) -- (row-8-|col-5) -- @
-% ~emphase# (row-9-|col-5) -- (row-9-|col-6) |- cycle ; @
+% ~emphase# (7-|4) -- (8-|4) -- (8-|5) -- (9-|5) -- (9-|6) |- cycle ; @
% }
% ]
% 1 \\
@@ -3478,8 +3497,7 @@ version 2005/12/01 or later.
% code-before =
% {
% \tikz \draw [fill = red!15]
-% (row-7-|col-4) -- (row-8-|col-4) -- (row-8-|col-5) --
-% (row-9-|col-5) -- (row-9-|col-6) |- cycle ;
+% (7-|4) -- (8-|4) -- (8-|5) -- (9-|5) -- (9-|6) |- cycle ;
% }
% ]
% 1 \\
@@ -3497,8 +3515,9 @@ version 2005/12/01 or later.
%
% \label{node-sub-matrix}
%
+% \colorbox{yellow!50}{\textbf{New 5.10}}\enskip
% The command |\SubMatrix| available in the |\CodeAfter| has been described
-% p.~\pageref{sub-matrix}.
+% p.~\pageref{sub-matrix}.
%
% \smallskip
% If a command |\SubMatrix| has been used with the key |name| with an expression
@@ -3567,51 +3586,37 @@ version 2005/12/01 or later.
% \fvset{commandchars=\§\¤\μ}
% \begin{Verbatim}
%\ExplSyntaxOn
-% \cs_new_protected:Nn \__pantigny_hatchcell:nnn
+% \cs_new_protected:Nn \__pantigny_hatch:nnn
% {
% \begin { tikzpicture }
% \fill [ pattern = north~west~lines , pattern~color = #3 ]
-% ( row - #1 -| col - #2)
-% rectangle
-% ( row - \int_eval:n { #1 + 1 } -| col - \int_eval:n { #2 + 1 } ) ;
+% ( #1 -| #2) rectangle ( \int_eval:n { #1 + 1 } -| \int_eval:n { #2 + 1 } ) ;
% \end { tikzpicture }
% }
%
% \NewDocumentCommand \hatchcell { ! O { black } }
% {
% \tl_gput_right:Nx §emphase¤\g_nicematrix_code_before_tlμ
-% {
-% \__pantigny_hatchcell:nnn
-% { \int_use:c { c@iRow } }
-% { \int_use:c { c@jCol } }
-% { #1 }
-% }
+% { \__pantigny_hatch:nnn { \arabic { iRow } } { \arabic { jCol } } { #1 } }
% }
% \ExplSyntaxOff
% \end{Verbatim}
% \end{scope}
%
%
-%\ExplSyntaxOn
-% \cs_new_protected:Nn \__pantigny_hatchcell:nnn
+% \ExplSyntaxOn
+% \cs_new_protected:Nn \__pantigny_hatch:nnn
% {
% \begin { tikzpicture }
% \fill [ pattern = north~west~lines , pattern~color = #3 ]
-% ( row - #1 -| col - #2)
-% rectangle
-% ( row - \int_eval:n { #1 + 1 } -| col - \int_eval:n { #2 + 1 } ) ;
+% ( #1 -| #2 ) rectangle ( \int_eval:n { #1 + 1 } -| \int_eval:n { #2 + 1 } ) ;
% \end { tikzpicture }
% }
%
% \NewDocumentCommand \hatchcell { ! O { black } }
% {
% \tl_gput_right:Nx \g_nicematrix_code_before_tl
-% {
-% \__pantigny_hatchcell:nnn
-% { \int_use:c { c@iRow } }
-% { \int_use:c { c@jCol } }
-% { #1 }
-% }
+% { \__pantigny_hatch:nnn { \arabic { iRow } } { \arabic { jCol } } { #1 } }
% }
% \ExplSyntaxOff
%
@@ -3623,7 +3628,7 @@ version 2005/12/01 or later.
% \begin{BVerbatim}[baseline=c,boxwidth=9cm]
% \begin{NiceTabular}{ccc}[hvlines]
% Tokyo & Paris & London \\
-% Roma & ~emphase#\hatchcell[blue!30]@Oslo & Miami \\
+% Lima & ~emphase#\hatchcell[blue!30]@Oslo & Miami \\
% Los Angeles & Madrid & Roma
% \end{NiceTabular}
% \end{BVerbatim}
@@ -3643,7 +3648,7 @@ version 2005/12/01 or later.
% 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 potential exterior row.
+% not in a 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
@@ -3832,7 +3837,7 @@ version 2005/12/01 or later.
% \end{Verbatim}
%
% \bigskip
-% As of now, the package \pkg{nicematrix} is not compatible with
+% As for now, the package \pkg{nicematrix} is not compatible with
% \cls{aastex63}. If you want to use \pkg{nicematrix} with \cls{aastex63}, send
% me an email and I will try to solve the incompatibilies.
%
@@ -3942,103 +3947,7 @@ version 2005/12/01 or later.
%
% \subsection{Dotted lines}
%
-%
-% A permutation matrix (as an example, we have raised the value of
-% |xdots/shorten|).
-%
-% \label{permutation}
-% \bigskip
-% \begin{BVerbatim}[baseline=c]
-% $\begin{pNiceMatrix}[~emphase#xdots/shorten=0.6em@]
-% 0 & 1 & 0 & & \Cdots & 0 \\
-% \Vdots & & & \Ddots & & \Vdots \\
-% & & & \Ddots & & \\
-% & & & \Ddots & & 0 \\
-% 0 & 0 & & & & 1 \\
-% 1 & 0 & & \Cdots & & 0
-% \end{pNiceMatrix}$
-% \end{BVerbatim}
-% \hspace{2.5cm}
-% $\begin{pNiceMatrix}[xdots/shorten=0.6em]
-% 0 & 1 & 0 & & \Cdots & 0 \\
-% \Vdots & & & \Ddots & & \Vdots \\
-% & & & \Ddots & & \\
-% & & & \Ddots & & 0 \\
-% 0 & 0 & & & & 1 \\
-% 1 & 0 & & \Cdots & & 0
-% \end{pNiceMatrix}$
-%
-% \vspace{2cm}
-%
-% An example with |\Iddots| (we have raised again the value of
-% |xdots/shorten|).\par\nobreak
-%
-% \bigskip
-% \begin{BVerbatim}[baseline=c]
-% $\begin{pNiceMatrix}[xdots/shorten=0.9em]
-% 1 & \Cdots & & 1 \\
-% \Vdots & & & 0 \\
-% & ~emphase#\Iddots@ & ~emphase#\Iddots@ & \Vdots \\
-% 1 & 0 & \Cdots & 0
-% \end{pNiceMatrix}$
-% \end{BVerbatim}
-% \hspace{4cm}
-% $\begin{pNiceMatrix}[xdots/shorten=0.9em]
-% 1 & \Cdots & & 1 \\
-% \Vdots & & & 0 \\
-% & \Iddots & \Iddots & \Vdots \\
-% 1 & 0 & \Cdots & 0
-% \end{pNiceMatrix}$
-%
-%
-% \vspace{2cm}
-% An example with |\multicolumn|:\par\nobreak
-%
-% \bigskip
-% \begin{BVerbatim}
-% \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{ other rows}}@ & \Cdots \\
-% 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10
-% \end{BNiceMatrix}
-% \end{BVerbatim}
-%
-% \bigskip
-% \[\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 \\
-% 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10
-% \end{BNiceMatrix}\]
-%
-% \vspace{2cm}
-% An example with |\Hdotsfor|:\par\nobreak
-%
-% \bigskip
-% \begin{BVerbatim}[baseline=c,boxwidth=11cm]
-% \begin{pNiceMatrix}[nullify-dots]
-% 0 & 1 & 1 & 1 & 1 & 0 \\
-% 0 & 1 & 1 & 1 & 1 & 0 \\
-% \Vdots & ~emphase#\Hdotsfor{4}@ & \Vdots \\
-% & ~emphase#\Hdotsfor{4}@ & \\
-% & ~emphase#\Hdotsfor{4}@ & \\
-% & ~emphase#\Hdotsfor{4}@ & \\
-% 0 & 1 & 1 & 1 & 1 & 0
-% \end{pNiceMatrix}
-% \end{BVerbatim}
-% $\begin{pNiceMatrix}[nullify-dots]
-% 0 & 1 & 1 & 1 & 1 & 0 \\
-% 0 & 1 & 1 & 1 & 1 & 0 \\
-% \Vdots & \Hdotsfor{4} & \Vdots \\
-% & \Hdotsfor{4} & \\
-% & \Hdotsfor{4} & \\
-% & \Hdotsfor{4} & \\
-% 0 & 1 & 1 & 1 & 1 & 0
-% \end{pNiceMatrix}$
-%
-% \vspace{2cm}
-% An example for the resultant of two polynoms:\par\nobreak
+% An example with the resultant of two polynoms:\par\nobreak
%
% \bigskip
% \begin{BVerbatim}
@@ -4100,6 +4009,54 @@ version 2005/12/01 or later.
% The option |line-style| controls the style of the lines drawn by |\Ldots|,
% |\Cdots|, etc. Thus, it's possible with these commands to draw lines which are
% not longer dotted.
+%
+%
+% \begin{Verbatim}[formatcom=\small\color{gray}]
+% \NiceMatrixOptions{code-for-first-row = \scriptstyle,code-for-first-col = \scriptstyle }
+% \setcounter{MaxMatrixCols}{12}
+% \newcommand{\blue}{\color{blue}}
+% \[\begin{pNiceMatrix}[last-row,last-col,nullify-dots,xdots/line-style={dashed,blue}]
+% 1& & & \Vdots & & & & \Vdots \\
+% & \Ddots[line-style=standard] \\
+% & & 1 \\
+% \Cdots[color=blue,line-style=dashed]& & & \blue 0 &
+% \Cdots & & & \blue 1 & & & \Cdots & \blue \leftarrow i \\
+% & & & & 1 \\
+% & & &\Vdots & & \Ddots[line-style=standard] & & \Vdots \\
+% & & & & & & 1 \\
+% \Cdots & & & \blue 1 & \Cdots & & \Cdots & \blue 0 & & & \Cdots & \blue \leftarrow j \\
+% & & & & & & & & 1 \\
+% & & & & & & & & & \Ddots[line-style=standard] \\
+% & & & \Vdots & & & & \Vdots & & & 1 \\
+% & & & \blue \overset{\uparrow}{i} & & & & \blue \overset{\uparrow}{j} \\
+% \end{pNiceMatrix}\]
+% \end{Verbatim}
+%
+%
+% \begin{scope}
+% \NiceMatrixOptions{code-for-first-row = \scriptstyle,code-for-first-col = \scriptstyle }
+% \setcounter{MaxMatrixCols}{12}
+% \newcommand{\blue}{\color{blue}}
+% \[\begin{pNiceMatrix}[last-row,last-col,nullify-dots,xdots/line-style={dashed,blue}]
+% 1& & & \Vdots & & & & \Vdots \\
+% & \Ddots[line-style=standard] \\
+% & & 1 \\
+% \Cdots[color=blue,line-style=dashed]& & & \blue 0 &
+% \Cdots & & & \blue 1 & & & \Cdots & \blue \leftarrow i \\
+% & & & & 1 \\
+% & & &\Vdots & & \Ddots[line-style=standard] & & \Vdots \\
+% & & & & & & 1 \\
+% \Cdots & & & \blue 1 & \Cdots & & \Cdots & \blue 0 & & & \Cdots & \blue \leftarrow j \\
+% & & & & & & & & 1 \\
+% & & & & & & & & & \Ddots[line-style=standard] \\
+% & & & \Vdots & & & & \Vdots & & & 1 \\
+% & & & \blue \overset{\uparrow}{i} & & & & \blue \overset{\uparrow}{j} \\
+% \end{pNiceMatrix}\]
+% \end{scope}
+%
+% \interitem
+% In fact, it's even possible to draw solid lines with the commands |\Cdots|,
+% |\Vdots|, etc.
%
% \begin{Verbatim}
% \NiceMatrixOptions
@@ -4260,7 +4217,29 @@ version 2005/12/01 or later.
%
% \vspace{1cm}
% It's possible to color a row with |\rowcolor| in the |code-before| (or with
-% |\rowcolor| in the first cell of the row if the key |colortbl-like| is used).
+% |\rowcolor| in the first cell of the row if the key |colortbl-like| is
+% used−even when \pkg{colortbl} is not loaded).
+%
+% \medskip
+% \begin{Verbatim}
+% \begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,colortbl-like]
+% ~emphase#\rowcolor{red!15}@A_{11} & A_{12} & A_{13} & A_{14} \\
+% A_{21} & ~emphase#\rowcolor{red!15}@A_{22} & A_{23} & A_{24} \\
+% A_{31} & A_{32} & ~emphase#\rowcolor{red!15}@A_{33} & A_{34} \\
+% A_{41} & A_{42} & A_{43} & ~emphase#\rowcolor{red!15}@A_{44}
+% \end{pNiceArray}
+% \end{Verbatim}
+%
+%
+%
+% \[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,colortbl-like]
+% \rowcolor{red!15}A_{11} & A_{12} & A_{13} & A_{14} \\
+% A_{21} & \rowcolor{red!15}A_{22} & A_{23} & A_{24} \\
+% A_{31} & A_{32} & \rowcolor{red!15}A_{33} & A_{34} \\
+% A_{41} & A_{42} & A_{43} & \rowcolor{red!15}A_{44}
+% \end{pNiceArray}\]
+%
+% \bigskip
% However, it's not possible to do a fine tuning. That's why we describe now a
% method to highlight a row of the matrix. We create a rectangular Tikz node
% which encompasses the nodes of the second row with the Tikz library \pkg{fit}.
@@ -4268,11 +4247,16 @@ version 2005/12/01 or later.
% the text \emph{under} this node, we have to use transparency with the
% |blend mode| equal to |multiply|.
%
+% \medskip
+% \textbf{Caution} : Some \textsc{pdf} readers are not able to show
+% transparency.\footnote{In Overleaf, the ``built-in'' \textsc{pdf} viewer does
+% not show transparency. You can switch to the ``native'' viewer in that case.}
+%
%
% \medskip
% That example and the following ones require Tikz (by default, \pkg{nicematrix}
-% only loads \textsc{pgf}) and the Tikz library |fit|. The following lines in
-% the preamble of your document do the job:
+% only loads \textsc{pgf}, which is a sub-layer of Tikz) and the Tikz library
+% |fit|. The following lines in the preamble of your document do the job:
% \begin{verbatim}
% \usepackage{tikz}
% \usetikzlibrary{fit}
@@ -4439,44 +4423,6 @@ version 2005/12/01 or later.
% a & a & a & L_3
% \end{pNiceArray}\]
%
-%
-%
-% \vspace{1cm}
-%
-% 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]
-% A_{11} & A_{12} & A_{13} & A_{14} \\
-% A_{21} & A_{22} & A_{23} & A_{24} \\
-% A_{31} & A_{32} & A_{33} & A_{34} \\
-% A_{41} & A_{42} & A_{43} & A_{44}
-% \CodeAfter
-% \tikz \path [~emphase#name suffix = -large@,fill = red!15, blend mode = multiply]
-% (1-1.north west)
-% |- (2-2.north west)
-% |- (3-3.north west)
-% |- (4-4.north west)
-% |- (4-4.south east)
-% |- (1-1.north west) ;
-% \end{pNiceArray}
-% \end{Verbatim}
-%
-%
-% \[\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} \\
-% A_{41} & A_{42} & A_{43} & A_{44}
-% \CodeAfter
-% \tikz \path [name suffix = -large,fill = red!15, blend mode = multiply]
-% (1-1.north west)
-% |- (2-2.north west)
-% |- (3-3.north west)
-% |- (4-4.north west)
-% |- (4-4.south east)
-% |- (1-1.north west) ;
-% \end{pNiceArray}\]
%
% \subsection{Direct use of the Tikz nodes}
%
@@ -4607,9 +4553,9 @@ version 2005/12/01 or later.
% \smallskip
% Of course, the package \pkg{nicematrix} uses the features of the package
% \pkg{array}. It tries to be independent of its implementation. Unfortunately,
-% it was not possible to be strictly independent: the package \pkg{nicematrix}
-% relies upon the fact that the package |{array}| uses |\ialign| to begin the
-% |\halign|.
+% it was not possible to be strictly independent. For example, the package
+% \pkg{nicematrix} relies upon the fact that the package |{array}| uses
+% |\ialign| to begin the |\halign|.
%
%
% \bigskip
@@ -4647,8 +4593,9 @@ version 2005/12/01 or later.
% this package for technical reasons.
%
% \bigskip
-% We load some packages.
+% We load some packages. The package \pkg{xparse} is still loaded for use on Overleaf.
% \begin{macrocode}
+\RequirePackage { xparse }
\RequirePackage { array }
\RequirePackage { amsmath }
% \end{macrocode}
@@ -4725,7 +4672,7 @@ version 2005/12/01 or later.
%
% We test whether the current class is \cls{revtex4-1} (deprecated) or
% \cls{revtex4-2} because these classes redefines |\array| (of \pkg{array}) in a
-% way incompatible with our programmation. As of january 2021, the current
+% way incompatible with our programmation. At the date January 2021, the current
% version \cls{revtex4-2} is 4.2e (compatible with \pkg{booktabs}).
%
% \begin{macrocode}
@@ -4792,7 +4739,7 @@ version 2005/12/01 or later.
\cs_set_eq:NN \@@_old_pgfutil@check@rerun \pgfutil@check@rerun
% \end{macrocode}
% The new version of |\pgfutil@check@rerun| will not check the PGF nodes whose
-% names start with |nm-| (which is the prefix for the nodes creates by
+% names start with |nm-| (which is the prefix for the nodes created by
% \pkg{nicematrix}).
% \begin{macrocode}
\cs_set_protected:Npn \pgfutil@check@rerun ##1 ##2
@@ -4816,7 +4763,7 @@ version 2005/12/01 or later.
% \end{macrocode}
% The command |\CT@arc@| is a command of \pkg{colortbl} which sets the color of
% the rules in the array. We will use it to store the instruction of color for
-% the rules even if \pkg{colortbl} is not loaded. Idem for
+% the rules even if \pkg{colortbl} is not loaded.
% \begin{macrocode}
\cs_set_protected:Npn \CT@arc@ { }
\cs_set:Npn \arrayrulecolor #1 # { \CT@arc { #1 } }
@@ -5092,7 +5039,7 @@ version 2005/12/01 or later.
% |\pgfsyspdfmark| in the |aux| file. If he changes its mind and no longer loads
% \pkg{nicematrix}, an error may occur at the next compilation because of
% remanent instructions |\pgfsyspdfmark| in the |aux| file. With the following
-% code, we avoid that situation.
+% code, we try to avoid that situation.
% \begin{macrocode}
\cs_new_protected:Npn \@@_provide_pgfsyspdfmark:
{
@@ -5109,10 +5056,10 @@ version 2005/12/01 or later.
%
% \subsection*{Parameters}
%
-% \bigskip
+% \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
+% |define_L_C_R|. With this option, it's possible to use 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
@@ -5198,7 +5145,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% Idem pour the blocks mono-row.
+% Idem pour the mono-row blocks.
% \begin{macrocode}
\dim_new:N \g_@@_blocks_ht_dim
\dim_new:N \g_@@_blocks_dp_dim
@@ -5214,7 +5161,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% We want to know if we are in an environment of \pkg{nicematrix} because we
+% We want to know whether we are in an environment of \pkg{nicematrix} because we
% will raise an error if the user tries to use nested environments.
% \begin{macrocode}
\bool_new:N \l_@@_in_env_bool
@@ -5265,9 +5212,22 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+% \bigskip
+% The letter used for the vlines which will be drawn only in the sub-matrices.
+% |vlism| stands for \emph{vertical lines in sub-matrices}.
+% \begin{macrocode}
+\tl_new:N \l_@@_letter_vlism_tl
+% \end{macrocode}
+%
+% The list of the columns where vertical lines in sub-matrices (vlism) must be
+% drawn. Of course, the actual value of this sequence will be known after the
+% analyse of the preamble of the array.
+% \begin{macrocode}
+\seq_new:N \g_@@_cols_vlism_seq
+% \end{macrocode}
%
% \bigskip
-% The following colors will be used to memorize le color of the potential ``first
+% The following colors will be used to memorize the color of the potential ``first
% col'' and the potential ``first row''.
% \begin{macrocode}
\colorlet { nicematrix-last-col } { . }
@@ -5315,7 +5275,7 @@ version 2005/12/01 or later.
% |\g_nicematrix_code_after_tl| but it is used internally by \pkg{nicematrix}.
% In fact, we have to distinguish between |\g_nicematrix_code_after_tl| and
% |\g_@@_internal_code_after_tl| because we must take care of the order in which
-% instructions stored in that paremeters are executed.
+% instructions stored in that parameters are executed.
% \begin{macrocode}
\tl_new:N \g_@@_internal_code_after_tl
% \end{macrocode}
@@ -5394,7 +5354,7 @@ version 2005/12/01 or later.
%
% \bigskip
% \pkg{expl3} provides scratch dimensions |\l_tmpa_dim| and |\l_tmpb_dim|. We
-% creates two other in the same spirit (if they don't exist yet: that's why we
+% creates two more in the same spirit (if they don't exist yet: that's why we
% use |\dim_zero_new:N|).
% \begin{macrocode}
\dim_zero_new:N \l_tmpc_dim
@@ -5408,12 +5368,6 @@ version 2005/12/01 or later.
\bool_new:N \g_@@_empty_cell_bool
% \end{macrocode}
%
-% \bigskip
-% The following dimension will be used to save the current value of
-% |\arraycolsep|.
-% \begin{macrocode}
-\dim_new:N \@@_old_arraycolsep_dim
-% \end{macrocode}
%
% \bigskip
% The following dimensions will be used internally to compute the width of the
@@ -5426,7 +5380,7 @@ version 2005/12/01 or later.
% \bigskip
% The following sequence will contain the characteristics of the blocks of the
% array, specified by the command |\Block|. Each block is represented by 6
-% components surrounded by braces:
+% components surrounded by curly braces:
%
% |{|\textsl{imin}|}{|\textsl{jmin}|}{|\textsl{imax}|}{|\textsl{jmax}|}{|\textsl{options}|}{|\textsl{contents}|}|.
%
@@ -5461,7 +5415,7 @@ version 2005/12/01 or later.
%
% \medskip
% The final user may decide to ``stroke'' a block (using, for example, the key
-% |color=red!15| when using the command |\Block|). In that case, the rules
+% |draw=red!15| when using the command |\Block|). In that case, the rules
% specified, for instance, by |hvlines| must not be drawn around the block.
% That's why we keep the information of all that stroken blocks in the following
% sequence.
@@ -5471,13 +5425,14 @@ version 2005/12/01 or later.
%
%
% \medskip
-% The list of the names of the potential |\SubMatrix| in the |code-after| of an
+% The list of the names of the potential |\SubMatrix| in the |\CodeAfter| of an
% environment. Unfortunately, that list has to be global (we have to use it
% inside the group for the options of a given |\SubMatrix|).
% \begin{macrocode}
\seq_new:N \g_@@_submatrix_names_seq
% \end{macrocode}
-%
+%
+%
% \medskip
% We are able to determine the number of columns specified in the preamble (for
% the environments with explicit preamble, of course and without the potential
@@ -5531,6 +5486,17 @@ version 2005/12/01 or later.
% \begin{macrocode}
\int_new:N \g_@@_block_box_int
% \end{macrocode}
+%
+% \medskip
+% \begin{macrocode}
+\dim_new:N \l_@@_submatrix_extra_height_dim
+\dim_new:N \l_@@_submatrix_left_xshift_dim
+\dim_new:N \l_@@_submatrix_right_xshift_dim
+\clist_new:N \l_@@_submatrix_hlines_clist
+\clist_new:N \l_@@_submatrix_vlines_clist
+% \end{macrocode}
+%
+%
%
% \bigskip
% \textbf{Variables for the exterior rows and columns}\par\nobreak
@@ -5853,7 +5819,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \medskip
-% The command |\@@_pgf_rect_node:nnn| is a variant of |\@@_pgr_rect_node:nnnn|:
+% The command |\@@_pgf_rect_node:nnn| is a variant of |\@@_pgf_rect_node:nnnn|:
% it takes two \textsc{pgf} points as arguments instead of the four dimensions
% which are the coordinates.
% \begin{macrocode}
@@ -6097,7 +6063,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% The following token list corresponds to the key |delimiters-color|.
+% The following token list corresponds to the key |delimiters/color|.
% \begin{macrocode}
\tl_new:N \l_@@_delimiters_color_tl
% \end{macrocode}
@@ -6150,7 +6116,7 @@ version 2005/12/01 or later.
% construction of the array and not when we draw the dotted lines).
% \begin{macrocode}
draw-first .code:n = \prg_do_nothing: ,
- unknown .code:n = \@@_error:n { Unknown~option~for~xdots }
+ unknown .code:n = \@@_error:n { Unknown~key~for~xdots }
}
% \end{macrocode}
%
@@ -6174,6 +6140,8 @@ version 2005/12/01 or later.
% \begin{macrocode}
\keys_define:nn { NiceMatrix / Global }
{
+ rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
+ rules .value_required:n = true ,
standard-cline .bool_set:N = \l_@@_standard_cline_bool ,
standard-cline .default:n = true ,
cell-space-top-limit .dim_set:N = \l_@@_cell_space_top_limit_dim ,
@@ -6206,6 +6174,13 @@ version 2005/12/01 or later.
code-for-last-row .value_required:n = true ,
hlines .bool_set:N = \l_@@_hlines_bool ,
vlines .bool_set:N = \l_@@_vlines_bool ,
+ vlines-in-sub-matrix .code:n =
+ {
+ \tl_if_single_token:nTF { #1 }
+ { \tl_set:Nn \l_@@_letter_vlism_tl { #1 } }
+ { \@@_error:n { One~letter~allowed } }
+ } ,
+ vlines-in-sub-matrix .value_required:n = true ,
hvlines .code:n =
{
\bool_set_true:N \l_@@_vlines_bool
@@ -6369,6 +6344,7 @@ version 2005/12/01 or later.
NiceMatrixOptions / rules .inherit:n = NiceMatrix / rules ,
NiceMatrixOptions / notes .inherit:n = NiceMatrix / notes ,
NiceMatrixOptions / sub-matrix .inherit:n = NiceMatrix / sub-matrix ,
+ SubMatrix / rules .inherit:n = NiceMatrix / rules ,
CodeAfter / xdots .inherit:n = NiceMatrix / xdots ,
NiceMatrix .inherit:n =
{
@@ -6409,6 +6385,8 @@ version 2005/12/01 or later.
% \begin{macrocode}
\keys_define:nn { NiceMatrix / NiceMatrixOptions }
{
+ delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
+ delimiters / color .value_required:n = true ,
delimiters-color .tl_set:N = \l_@@_delimiters_color_tl ,
delimiters-color .value_required:n = true ,
last-col .code:n = \tl_if_empty:nF { #1 }
@@ -6478,7 +6456,7 @@ version 2005/12/01 or later.
{
\tl_if_single_token:nTF { #1 }
{ \str_set:Nx \l_@@_letter_for_dotted_lines_str { #1 } }
- { \@@_error:n { Bad~value~for~letter~for~dotted~lines } }
+ { \@@_error:n { One~letter~allowed } }
} ,
letter-for-dotted-lines .value_required:n = true ,
notes .code:n = \keys_set:nn { NiceMatrix / notes } { #1 } ,
@@ -6523,6 +6501,8 @@ version 2005/12/01 or later.
r .code:n = \tl_set:Nn \l_@@_type_of_col_tl r ,
small .bool_set:N = \l_@@_small_bool ,
small .value_forbidden:n = true ,
+ delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
+ delimiters / color .value_required:n = true ,
delimiters-color .tl_set:N = \l_@@_delimiters_color_tl ,
delimiters-color .value_required:n = true ,
unknown .code:n = \@@_error:n { Unknown~option~for~NiceMatrix }
@@ -6557,6 +6537,8 @@ version 2005/12/01 or later.
tabularnote .value_required:n = true ,
delimiters-color .tl_set:N = \l_@@_delimiters_color_tl ,
delimiters-color .value_required:n = true ,
+ delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
+ delimiters / color .value_required:n = true ,
unknown .code:n = \@@_error:n { Unknown~option~for~NiceArray }
}
% \end{macrocode}
@@ -6795,7 +6777,7 @@ version 2005/12/01 or later.
% \item we test the existence of these nodes in order to determine whether a
% cell is empty when we search the extremities of a dotted line.
% \end{itemize}
-% However, it's very difficult to determine whether a cell is empty. As of now,
+% However, it's very difficult to determine whether a cell is empty. As for now,
% we use the following technic:
% \begin{itemize}
% \item if the width of the box |\l_@@_cell_box| (created with the content of
@@ -6805,7 +6787,7 @@ version 2005/12/01 or later.
% \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
% be nothing to do (in this case the previous commands only write an instruction
-% in a kind of |code-after|); however, if |nullify-dots| is not in force, a
+% in a kind of |\CodeAfter|); however, if |nullify-dots| is not in force, a
% phantom of |\ldots|, |\cdots|, |\vdots| is inserted and its width is not equal
% to zero; that's why these commands raise a boolean |\g_@@_empty_cell_bool| and
% we begin by testing this boolean.
@@ -6897,11 +6879,6 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_new_protected:Npn \@@_instruction_of_type:nnn #1 #2 #3
{
-% \end{macrocode}
-% It's important to use a |\tl_gput_right:cx| and not a |\tl_gput_left:cx|
-% because we want the |\Ddots| lines to be drawn in the order of appearance
-% in the array (for parallelisation).
-% \begin{macrocode}
\bool_if:nTF { #1 } \tl_gput_left:cx \tl_gput_right:cx
{ g_@@_ #2 _ lines _ tl }
{
@@ -7414,7 +7391,7 @@ version 2005/12/01 or later.
{
% \end{macrocode}
% First, we give values to the LaTeX counters |iRow| and |jCol|. We remind that,
-% in the |code-before| (and in the |code-after|) they represent the numbers of
+% in the |code-before| (and in the |\CodeAfter|) they represent the numbers of
% rows and columns of the array (without the potential last row and last column).
% \begin{macrocode}
\int_zero_new:N \c@iRow
@@ -7464,6 +7441,15 @@ version 2005/12/01 or later.
{ \pgfpointdiff \@@_picture_position: \@@_node_position: }
}
\endpgfpicture
+% \end{macrocode}
+% Now, you create the diagonal nodes by using the |row| nodes and the |col| nodes.
+% \begin{macrocode}
+ \@@_create_diag_nodes:
+% \end{macrocode}
+%
+% \medskip
+% Now, yet another settings before the executation of the |code-before|.
+% \begin{macrocode}
\group_begin:
\bool_if:NT \c_@@_tikz_loaded_bool
{
@@ -7898,6 +7884,12 @@ version 2005/12/01 or later.
}
{ \tl_gclear:N \g_@@_preamble_tl }
% \end{macrocode}
+% The sequence |\g_@@_cols_vlsim_seq| will contain the numbers of the columns
+% where you will to have to draw vertical lines in the potential sub-matrices
+% (hence the name |vlism|).
+% \begin{macrocode}
+ \seq_clear:N \g_@@_cols_vlism_seq
+% \end{macrocode}
% The counter |\l_tmpa_int| will count the number of consecutive occurrences
% of the symbol \verb+|+.
% \begin{macrocode}
@@ -7957,8 +7949,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\dim_compare:nNnT \l_@@_tabular_width_dim = \c_zero_dim
{
- \tl_gput_right:Nn
- \g_@@_preamble_tl
+ \tl_gput_right:Nn \g_@@_preamble_tl
{ > { \@@_error_too_much_cols: } l }
}
% \end{macrocode}
@@ -8004,15 +7995,25 @@ version 2005/12/01 or later.
{
\str_if_eq:VnTF \l_@@_letter_for_dotted_lines_str { #1 }
{ \@@_patch_preamble_xi:n #1 }
- {
- \bool_lazy_and:nnTF
- { \str_if_eq_p:nn { : } { #1 } }
- \c_@@_arydshln_loaded_bool
- {
- \tl_gput_right:Nn \g_@@_preamble_tl { : }
+ {
+ \str_if_eq:VnTF \l_@@_letter_vlism_tl { #1 }
+ {
+ \seq_gput_right:Nx \g_@@_cols_vlism_seq
+ { \int_eval:n { \c@jCol + 1 } }
+ \tl_gput_right:Nx \g_@@_preamble_tl
+ { \exp_not:N ! { \skip_horizontal:N \arrayrulewidth } }
\@@_patch_preamble:n
}
- { \@@_fatal:nn { unknown~column~type } { #1 } }
+ {
+ \bool_lazy_and:nnTF
+ { \str_if_eq_p:nn { : } { #1 } }
+ \c_@@_arydshln_loaded_bool
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl { : }
+ \@@_patch_preamble:n
+ }
+ { \@@_fatal:nn { unknown~column~type } { #1 } }
+ }
}
}
}
@@ -8102,11 +8103,15 @@ version 2005/12/01 or later.
\@@_Cell:
\begin { minipage } [ #1 ] { #3 }
\mode_leave_vertical:
- \arraybackslash % added in the version 5.8
- \box_use:N \@arstrutbox
+ \arraybackslash
+ \vrule height \box_ht:N \@arstrutbox depth 0 pt width 0 pt % v. 5.11
}
c
- < { \box_use:N \@arstrutbox \end { minipage } \@@_end_Cell: }
+ < {
+ \vrule height 0 pt depth \box_dp:N \@arstrutbox width 0 pt % v. 5.11
+ \end { minipage }
+ \@@_end_Cell:
+ }
}
% \end{macrocode}
% We increment the counter of columns, and then we test for the presence of a |<|.
@@ -8603,7 +8608,7 @@ version 2005/12/01 or later.
{ \@@_fatal:n { double-backslash~in~light-syntax } }
}
% \end{macrocode}
-% Now, you extract the |code-after| of the body of the environment. Maybe, there
+% Now, you extract the |\CodeAfter| of the body of the environment. Maybe, there
% is no command |\CodeAfter| in the body. That's why you put a marker
% |\CodeAfter| after |#1|. If there is yet a |\CodeAfter| in |#1|, this second
% (or third...) |\CodeAfter| will be catched in the value of
@@ -8884,6 +8889,12 @@ version 2005/12/01 or later.
{
>
{
+% \end{macrocode}
+% At the beginning of the cell, we link |\CodeAfter| to a command which do
+% \emph{not} begin with |\omit| (whereas the standard version of |\CodeAfter|
+% begins with |\omit|).
+% \begin{macrocode}
+ \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i:n
\bool_gset_true:N \g_@@_after_col_zero_bool
\@@_begin_of_row:
% \end{macrocode}
@@ -8955,6 +8966,12 @@ version 2005/12/01 or later.
>
{
% \end{macrocode}
+% At the beginning of the cell, we link |\CodeAfter| to a command which do
+% \emph{not} begin with |\omit| (whereas the standard version of |\CodeAfter|
+% begins with |\omit|).
+% \begin{macrocode}
+ \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i:n
+% \end{macrocode}
% With the flag |\g_@@_last_col_found_bool|, we will know that the ``last
% column'' is really used.
% \begin{macrocode}
@@ -9259,7 +9276,17 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-%
+% \medskip
+% \begin{macrocode}
+ \@@_create_diag_nodes:
+ \str_if_empty:NF \l_@@_name_str
+ {
+ \pgfpicture
+ \pgfrememberpicturepositiononpagetrue
+ \pgfnodealias { \l_@@_name_str - ##1 } { \@@_env: - ##1 }
+ \endpgfpicture
+ }
+% \end{macrocode}
%
% By default, the diagonal lines will be parallelized\footnote{It's possible to
% use the option |parallelize-diags| to disable this parallelization.}. There
@@ -9363,7 +9390,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% Now, the |code-after|.
+% Now, the |\CodeAfter|.
% \begin{macrocode}
\bool_if:NT \c_@@_tikz_loaded_bool
{
@@ -9389,11 +9416,11 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% We clear the list of the names of the potential |\SubMatrix| that will appear
-% in the |code-after| (unfortunately, that list has to be global).
+% in the |\CodeAfter| (unfortunately, that list has to be global).
% \begin{macrocode}
\seq_gclear:N \g_@@_submatrix_names_seq
% \end{macrocode}
-% And here's the |code-after|. Since the |code-after| may begin with an
+% And here's the |\CodeAfter|. Since the |\CodeAfter| may begin with an
% ``argument'' between square brackets of the options, we extract and treat that
% potential ``argument'' with the command |\@@_CodeAfter_keys:|.
% \begin{macrocode}
@@ -9450,7 +9477,7 @@ version 2005/12/01 or later.
%
% \bigskip
% The following command will extract the potential options (between square
-% brackets) at the beginning of the |code-after| (that is to say, when
+% brackets) at the beginning of the |\CodeAfter| (that is to say, when
% |\CodeAfter| is used, the options of that ``command'' |\CodeAfter|).
% \begin{macrocode}
\NewDocumentCommand \@@_CodeAfter_keys: { O { } }
@@ -9541,6 +9568,26 @@ version 2005/12/01 or later.
%
%
% \bigskip
+% The following command creates the diagonal nodes (in fact, if the matrix is
+% not a square matrix, not all the nodes are on the diagonal).
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_create_diag_nodes:
+ {
+ \int_step_inline:nn { \int_max:nn \c@iRow \c@jCol + 1 }
+ {
+ \pgfpicture
+ \pgfrememberpicturepositiononpagetrue
+ \@@_qpoint:n { row - \int_min:nn { ##1 } { \c@iRow + 1 } }
+ \dim_set_eq:NN \l_tmpa_dim \pgf@y
+ \@@_qpoint:n { col - \int_min:nn { ##1 } { \c@jCol + 1 } }
+ \pgfcoordinate { \@@_env: - ##1 } { \pgfpoint \pgf@x \l_tmpa_dim }
+ \endpgfpicture
+ }
+ }
+% \end{macrocode}
+%
+% \bigskip
% \subsection*{We draw the dotted lines}
%
% A dotted line will be said \emph{open} in one of its extremities when it stops
@@ -11025,7 +11072,7 @@ version 2005/12/01 or later.
% \bigskip
% \subsection*{The command \textbackslash line accessible in code-after}
%
-% In the |code-after|, the command |\@@_line:nn| will be linked to |\line|. This
+% In the |\CodeAfter|, the command |\@@_line:nn| will be linked to |\line|. This
% command takes two arguments which are the specifications of two cells in the
% array (in the format $i$-$j$) and draws a dotted line between these cells.
%
@@ -11033,7 +11080,7 @@ version 2005/12/01 or later.
% First, we write a command with an argument of the format $i$-$j$ and applies
% the command |\int_eval:n| to $i$ and~$j$ ; this must \emph{not} be protected
% (and is, of course fully expandable).\footnote{Indeed, we want that the user
-% may use the command |\line| in |code-after| with LaTeX counters in the
+% may use the command |\line| in |\CodeAfter| with LaTeX counters in the
% arguments --- with the command |\value|.}
% \begin{macrocode}
\cs_new:Npn \@@_double_int_eval:n #1-#2 \q_stop
@@ -11079,7 +11126,7 @@ version 2005/12/01 or later.
\cs_if_free_p:c { pgf @ sh @ ns @ \@@_env: - #2 }
}
{
- \@@_error:nnn { unknown~cell~for~line~in~code-after } { #1 } { #2 }
+ \@@_error:nnn { unknown~cell~for~line~in~CodeAfter } { #1 } { #2 }
}
{ \@@_draw_line_ii:nn { #1 } { #2 } }
}
@@ -11341,7 +11388,7 @@ version 2005/12/01 or later.
cols .tl_set:N = \l_@@_cols_tl ,
restart .bool_set:N = \l_@@_rowcolors_restart_bool ,
restart .default:n = true ,
- unknown .code:n = \@@_error:n { Unknown~option~for~rowcolors }
+ unknown .code:n = \@@_error:n { Unknown~key~for~rowcolors }
}
% \end{macrocode}
%
@@ -11655,7 +11702,7 @@ version 2005/12/01 or later.
}
% \end{macrocode}
% This definition may seem complicated by we must remind that the number of row
-% |\c@iRow| is incremented in the first cell of the row, \emph{after} an
+% |\c@iRow| is incremented in the first cell of the row, \emph{after} a
% potential vertical rule on the left side of the first cell.
%
% \smallskip
@@ -11675,8 +11722,8 @@ version 2005/12/01 or later.
%
% \bigskip
% The following command will be executed in the |internal-code-after|. The rule
-% will be drawn \emph{before} the column |#1|. |#2| is the number of consecutive
-% occurrences of \verb+|+.
+% will be drawn \emph{before} the column |#1| (that is to say on the left side).
+% |#2| is the number of consecutive occurrences of \verb+|+.
% \begin{macrocode}
\cs_new_protected:Npn \@@_vline:nn #1 #2
{
@@ -11715,11 +11762,11 @@ version 2005/12/01 or later.
% \begin{macrocode}
\bool_gset_true:N \g_tmpa_bool
\seq_map_inline:Nn \g_@@_pos_of_blocks_seq
- { \@@_test_if_vline_in_block:nnnn ##1 }
+ { \@@_test_vline_in_block:nnnn ##1 }
\seq_map_inline:Nn \g_@@_pos_of_xdots_seq
- { \@@_test_if_vline_in_block:nnnn ##1 }
+ { \@@_test_vline_in_block:nnnn ##1 }
\seq_map_inline:Nn \g_@@_pos_of_stroken_blocks_seq
- { \@@_test_if_vline_in_stroken_block:nnnn ##1 }
+ { \@@_test_vline_in_stroken_block:nnnn ##1 }
\clist_if_empty:NF \l_@@_except_corners_clist
\@@_test_in_corner_v:
\bool_if:NTF \g_tmpa_bool
@@ -11785,7 +11832,7 @@ version 2005/12/01 or later.
%
% \bigskip
% |#1| is the number of the column; |#2| is the number of vertical rules to
-% draw (with potentially a color between); |#3| and |#4| are the number of the
+% draw (with potentially a color between); |#3| and |#4| are the numbers of the
% rows between which the rule has to be drawn.
% \begin{macrocode}
\cs_new_protected:Npn \@@_vline_ii:nnnn #1 #2 #3 #4
@@ -11831,8 +11878,8 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% The following draws a complete vertical rule in the column |#1| (|#2| is the
-% number of consecutive rules specified by the number of \verb+|+ in the
+% The following command draws a complete vertical rule in the column |#1| (|#2|
+% is the number of consecutive rules specified by the number of \verb+|+ in the
% preamble). This command will be used if there is no block in the array (and
% the key |except-corners| is not used).
% \begin{macrocode}
@@ -11875,7 +11922,7 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_hline_i:nn #1 #2
{
% \end{macrocode}
-% |\l_tmpa_tl| is the number of row and |\l_tmpb_tl| the number of column. Whe,
+% |\l_tmpa_tl| is the number of row and |\l_tmpb_tl| the number of column. When
% we have found a column corresponding to a rule to draw, we note its number in
% |\l_tmpc_tl|.
% \begin{macrocode}
@@ -11892,11 +11939,11 @@ version 2005/12/01 or later.
% \begin{macrocode}
\bool_gset_true:N \g_tmpa_bool
\seq_map_inline:Nn \g_@@_pos_of_blocks_seq
- { \@@_test_if_hline_in_block:nnnn ##1 }
+ { \@@_test_hline_in_block:nnnn ##1 }
\seq_map_inline:Nn \g_@@_pos_of_xdots_seq
- { \@@_test_if_hline_in_block:nnnn ##1 }
+ { \@@_test_hline_in_block:nnnn ##1 }
\seq_map_inline:Nn \g_@@_pos_of_stroken_blocks_seq
- { \@@_test_if_hline_in_stroken_block:nnnn ##1 }
+ { \@@_test_hline_in_stroken_block:nnnn ##1 }
\clist_if_empty:NF \l_@@_except_corners_clist \@@_test_in_corner_h:
\bool_if:NTF \g_tmpa_bool
{
@@ -12064,13 +12111,13 @@ version 2005/12/01 or later.
% \subsection*{The key hvlines}
%
%
-% The following command tests wether the current position in the array (given by
-% |\l_tmpa_tl| for the row and |\l_tmpb_tl| for the col) would provide an
+% The following command tests whether the current position in the array (given by
+% |\l_tmpa_tl| for the row and |\l_tmpb_tl| for the column) would provide an
% horizontal rule towards the right in the block delimited by the four arguments
% |#1|, |#2|, |#3| and |#4|. If this rule would be in the block (it must not be
% drawn), the boolean |\l_tmpa_bool| is set to |false|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_test_if_hline_in_block:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_hline_in_block:nnnn #1 #2 #3 #4
{
\bool_lazy_all:nT
{
@@ -12085,7 +12132,7 @@ version 2005/12/01 or later.
%
% The same for vertical rules.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_test_if_vline_in_block:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_vline_in_block:nnnn #1 #2 #3 #4
{
\bool_lazy_all:nT
{
@@ -12099,7 +12146,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_test_if_hline_in_stroken_block:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_hline_in_stroken_block:nnnn #1 #2 #3 #4
{
\bool_lazy_all:nT
{
@@ -12113,7 +12160,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_test_if_vline_in_stroken_block:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_vline_in_stroken_block:nnnn #1 #2 #3 #4
{
\bool_lazy_all:nT
{
@@ -12332,7 +12379,7 @@ version 2005/12/01 or later.
%
%
% \medskip
-% The command |\@@_hdottedline:n| is the command written in the |code-after|
+% The command |\@@_hdottedline:n| is the command written in the |\CodeAfter|
% that will actually draw the dotted line. Its argument is the number of the row
% \emph{before} which we will draw the row.
% \begin{macrocode}
@@ -12446,16 +12493,14 @@ version 2005/12/01 or later.
% bracket. The correction by |0.5 \l_@@_inter_dots_dim| is \emph{ad hoc} for a
% better result.
% \begin{macrocode}
- \tl_set:Nn \l_tmpa_tl { ( }
- \tl_if_eq:NNF \l_@@_left_delim_tl \l_tmpa_tl
+ \tl_if_eq:NnF \l_@@_left_delim_tl (
{ \dim_gadd:Nn \l_@@_x_initial_dim { 0.5 \l_@@_inter_dots_dim } }
- \tl_set:Nn \l_tmpa_tl { ) }
- \tl_if_eq:NNF \l_@@_right_delim_tl \l_tmpa_tl
+ \tl_if_eq:NnF \l_@@_right_delim_tl )
{ \dim_gsub:Nn \l_@@_x_final_dim { 0.5 \l_@@_inter_dots_dim } }
% \end{macrocode}
%
% \medskip
-% As of now, we have no option to control the style of the lines drawn by
+% As for 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}
@@ -12523,7 +12568,7 @@ version 2005/12/01 or later.
\@@_qpoint:n { row - \@@_succ:n \c@iRow }
\dim_set:Nn \l_@@_y_final_dim { \pgf@y + 0.5 \l_@@_inter_dots_dim }
% \end{macrocode}
-% As of now, we have no option to control the style of the lines drawn by
+% As for 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}
@@ -12544,7 +12589,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% As of now, there is only one option available for the environment
+% As for now, there is only one option available for the environment
% |{NiceMatrixBlock}|.
% \begin{macrocode}
\keys_define:nn { NiceMatrix / NiceMatrixBlock }
@@ -13293,7 +13338,7 @@ version 2005/12/01 or later.
% replaced by the line which is commented.
% \begin{macrocode}
color .code:n =
- \@@_error:n { Key~color~for~Block }
+ \@@_fatal:n { Key~color~for~Block }
\tl_set:Nn \l_@@_fill_tl { #1 } ,
% color .code:n = \color { #1 } \tl_set:Nn \l_@@_draw_tl { #1 } ,
color .value_required:n = true ,
@@ -13347,10 +13392,8 @@ version 2005/12/01 or later.
\int_compare:nNnTF { #4 } > { 99 }
{ \int_set_eq:NN \l_@@_last_col_int \c@jCol }
{ \int_set:Nn \l_@@_last_col_int { #4 } }
- \bool_lazy_or:nnTF
- { \int_compare_p:nNn \l_@@_last_row_int > \g_@@_row_total_int }
- { \int_compare_p:nNn \l_@@_last_col_int > \g_@@_col_total_int }
- {
+ \int_compare:nNnTF \l_@@_last_col_int > \g_@@_col_total_int
+ {
\int_compare:nTF
{ \l_@@_last_col_int <= \g_@@_static_num_of_col_int }
{
@@ -13361,9 +13404,13 @@ version 2005/12/01 or later.
\@@_msg_redirect_name:nn { columns~not~used } { none }
\group_end:
}
+ { \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } }
+ }
+ {
+ \int_compare:nNnTF \l_@@_last_row_int > \g_@@_row_total_int
{ \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } }
+ { \@@_Block_v:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } }
}
- { \@@_Block_v:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } }
}
% \end{macrocode}
%
@@ -13979,17 +14026,20 @@ version 2005/12/01 or later.
% \subsection*{The keyword \textbackslash CodeAfter}
%
%
-% The |code-after| (inserted with the key |code-after| or after the keyword
-% |\CodeAfter| can always begin with a list of pairs \emph{key-value} between
-% square brackets). Here the corresponding set of keys.
+% The |\CodeAfter| (inserted with the key |code-after| or after the keyword
+% |\CodeAfter|) may always begin with a list of pairs \emph{key-value} between
+% square brackets. Here is the corresponding set of keys.
% \begin{macrocode}
+\keys_define:nn { NiceMatrix }
+ { CodeAfter / rules .inherit:n = NiceMatrix / rules }
\keys_define:nn { NiceMatrix / CodeAfter }
{
- sub-matrix .code:n =
- \keys_set:nn { NiceMatrix / sub-matrix } { #1 } ,
+ sub-matrix .code:n = \keys_set:nn { NiceMatrix / sub-matrix } { #1 } ,
sub-matrix .value_required:n = true ,
- delimiters-color .tl_set:N = \l_@@_delimiters_color_tl ,
- delimiters-color .value_required:n = true ,
+ delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
+ delimiters / color .value_required:n = true ,
+ rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
+ rules .value_required:n = true ,
unknown .code:n = \@@_error:n { Unknown~key~for~CodeAfter }
}
% \end{macrocode}
@@ -14034,8 +14084,7 @@ version 2005/12/01 or later.
% If this is really the end of the current environment (of \pkg{nicematrix}), we
% put back the command |\end| and its argument in the TeX flow.
% \begin{macrocode}
- \str_if_eq:eeTF \@currenvir { #1 }
- { \end { #1 } }
+ \str_if_eq:eeTF \@currenvir { #1 } { \end { #1 } }
% \end{macrocode}
% If this is not the |\end| we are looking for, we put those tokens in
% |\g_nicematrix_code_after_tl| and we go on searching for the next command
@@ -14147,7 +14196,7 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-% \subsection*{The command SubMatrix}
+% \subsection*{The command \textbackslash SubMatrix}
%
%
% \begin{macrocode}
@@ -14161,15 +14210,15 @@ version 2005/12/01 or later.
right-xshift .value_required:n = true ,
xshift .meta:n = { left-xshift = #1, right-xshift = #1 } ,
xshift .value_required:n = true ,
- delimiters-color .tl_set:N = \l_@@_delimiters_color_tl ,
- delimiters-color .value_required:n = true ,
+ delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
+ delimiters / color .value_required:n = true ,
slim .bool_set:N = \l_@@_submatrix_slim_bool ,
slim .default:n = true ,
}
\keys_define:nn { NiceMatrix }
{
- SubMatrix .inherit:n = NiceMatrix /sub-matrix ,
- CodeAfter / sub-matrix .inherit:n = NiceMatrix / sub-matrix
+ SubMatrix .inherit:n = NiceMatrix / sub-matrix ,
+ CodeAfter / sub-matrix .inherit:n = NiceMatrix / sub-matrix ,
}
% \end{macrocode}
%
@@ -14179,6 +14228,10 @@ version 2005/12/01 or later.
% \begin{macrocode}
\keys_define:nn { NiceMatrix / SubMatrix }
{
+ hlines .clist_set:N = \l_@@_submatrix_hlines_clist ,
+ hlines .default:n = all ,
+ vlines .clist_set:N = \l_@@_submatrix_vlines_clist ,
+ vlines .default:n = all ,
name .code:n =
\tl_if_empty:nTF { #1 }
{ \@@_error:n { Invalid~name~format } }
@@ -14194,6 +14247,8 @@ version 2005/12/01 or later.
}
{ \@@_error:n { Invalid~name~format } }
} ,
+ rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
+ rules .value_required:n = true ,
name .value_required:n = true ,
unknown .code:n = \@@_error:n { Unknown~key~for~SubMatrix }
}
@@ -14205,7 +14260,7 @@ version 2005/12/01 or later.
% \begin{itemize}
% \item |#1| is the left delimiter;
% \item |#2| is the upper-left cell of the matrix with the format $i$-$j$;
-% \item |#2| is the lower-right cell of the matrix with the format $i$-$j$;
+% \item |#3| is the lower-right cell of the matrix with the format $i$-$j$;
% \item |#4| is the right delimiter;
% \item |#5| is the list of options of the command.
% \end{itemize}
@@ -14229,9 +14284,6 @@ version 2005/12/01 or later.
{ \int_compare_p:nNn \l_tmpd_tl > \g_@@_col_total_int }
{ \@@_error:n { SubMatrix~too~large } }
{
- \dim_zero_new:N \l_@@_submatrix_extra_height_dim
- \dim_zero_new:N \l_@@_submatrix_left_xshift_dim
- \dim_zero_new:N \l_@@_submatrix_right_xshift_dim
\str_clear_new:N \l_@@_submatrix_name_str
\keys_set:nn { NiceMatrix / SubMatrix } { #5 }
\pgfpicture
@@ -14293,6 +14345,109 @@ version 2005/12/01 or later.
\dim_set_eq:NN \nulldelimiterspace \c_zero_dim
% \end{macrocode}
%
+% \bigskip
+% We will draw the rules in the |\SubMatrix|.
+% \begin{macrocode}
+ \group_begin:
+ \pgfsetlinewidth { 1.1 \arrayrulewidth }
+ \tl_if_empty:NF \l_@@_rules_color_tl
+ { \exp_after:wN \@@_set_CT@arc@: \l_@@_rules_color_tl \q_stop }
+ \CT@arc@
+% \end{macrocode}
+% Now, we draw the potential vertical rules specified in the preamble of the
+% environments with the letter fixed with the key |vlines-in-sub-matrix|. The
+% list of the columns where there is such rule to draw is in |\g_@@_cols_vlism_seq|.
+% \begin{macrocode}
+ \seq_map_inline:Nn \g_@@_cols_vlism_seq
+ {
+ \int_compare:nNnT \l_tmpb_tl < { ##1 }
+ {
+ \int_compare:nNnT { ##1 } < { \int_eval:n { \l_tmpd_tl + 1 } }
+ {
+% \end{macrocode}
+% First, we extract the value of the abscissa of the rule we have to draw.
+% \begin{macrocode}
+ \@@_qpoint:n { col - ##1 }
+ \pgfpathmoveto { \pgfpoint \pgf@x \l_@@_y_initial_dim }
+ \pgfpathlineto { \pgfpoint \pgf@x \l_@@_y_final_dim }
+ \pgfusepathqstroke
+ }
+ }
+ }
+% \end{macrocode}
+%
+% \medskip
+% Now, we draw the vertical rules specified in the key |vlines| of |\SubMatrix|.
+% The last argument of |\int_step_inline:nn| or |\clist_map_inline:Nn| is given
+% by curryfication.
+% \begin{macrocode}
+ \tl_if_eq:NnTF \l_@@_submatrix_vlines_clist { all }
+ { \int_step_inline:nn { \l_tmpd_tl - \l_tmpb_tl } }
+ { \clist_map_inline:Nn \l_@@_submatrix_vlines_clist }
+ {
+ \bool_lazy_and:nnTF
+ { \int_compare_p:nNn { ##1 } > 0 }
+ { \int_compare_p:nNn { ##1 } < { \l_tmpd_tl - \l_tmpb_tl + 1 } }
+ {
+ \@@_qpoint:n { col - \int_eval:n { ##1 + \l_tmpb_tl } }
+ \pgfpathmoveto { \pgfpoint \pgf@x \l_@@_y_initial_dim }
+ \pgfpathlineto { \pgfpoint \pgf@x \l_@@_y_final_dim }
+ \pgfusepathqstroke
+ }
+ { \@@_error:nnn { Wrong~line~in~SubMatrix } { vertical } { ##1 } }
+ }
+% \end{macrocode}
+%
+% \medskip
+% Now, we draw the horizontal rules specified in the key |hlines| of
+% |\SubMatrix|.
+% The last argument of |\int_step_inline:nn| or |\clist_map_inline:Nn| is given
+% by curryfication.
+% \begin{macrocode}
+ \tl_if_eq:NnTF \l_@@_submatrix_hlines_clist { all }
+ { \int_step_inline:nn { \l_tmpc_tl - \l_tmpa_tl } }
+ { \clist_map_inline:Nn \l_@@_submatrix_hlines_clist }
+ {
+ \bool_lazy_and:nnTF
+ { \int_compare_p:nNn { ##1 } > 0 }
+ { \int_compare_p:nNn { ##1 } < { \l_tmpc_tl - \l_tmpa_tl + 1 } }
+ {
+ \@@_qpoint:n { row - \int_eval:n { ##1 + \l_tmpa_tl } }
+% \end{macrocode}
+% We use a group to protect |\l_tmpa_dim| and |\l_tmpb_dim|.
+% \begin{macrocode}
+ \group_begin:
+% \end{macrocode}
+% We compute in |\l_tmpa_dim| the $x$-value of the left end of the rule.
+% \begin{macrocode}
+ \dim_set:Nn \l_tmpa_dim
+ { \l_@@_x_initial_dim - \l_@@_submatrix_left_xshift_dim }
+ \str_case:nn { #1 }
+ {
+ ( { \dim_sub:Nn \l_tmpa_dim { 0.9 mm } }
+ [ { \dim_sub:Nn \l_tmpa_dim { 0.2 mm } }
+ \{ { \dim_sub:Nn \l_tmpa_dim { 0.9 mm } }
+ }
+ \pgfpathmoveto { \pgfpoint \l_tmpa_dim \pgf@y }
+% \end{macrocode}
+% We compute in |\l_tmpb_dim| the $x$-value of the right end of the rule.
+% \begin{macrocode}
+ \dim_set:Nn \l_tmpb_dim
+ { \l_@@_x_final_dim + \l_@@_submatrix_right_xshift_dim }
+ \str_case:nn { #4 }
+ {
+ ) { \dim_add:Nn \l_tmpb_dim { 0.9 mm } }
+ ] { \dim_add:Nn \l_tmpb_dim { 0.2 mm } }
+ \} { \dim_add:Nn \l_tmpb_dim { 0.9 mm } }
+ }
+ \pgfpathlineto { \pgfpoint \l_tmpb_dim \pgf@y }
+ \pgfusepathqstroke
+ \group_end:
+ }
+ { \@@_error:nnn { Wrong~line~in~SubMatrix } { horizontal } { ##1 } }
+ }
+% \end{macrocode}
+%
% \medskip
% If the key |name| has been used for the command |\SubMatrix|, we create a PGF
% node with that name for the submatrix (this node does not take into account
@@ -14304,7 +14459,9 @@ version 2005/12/01 or later.
\l_@@_x_initial_dim \l_@@_y_initial_dim
\l_@@_x_final_dim \l_@@_y_final_dim
}
+ \group_end:
% \end{macrocode}
+% The group was for |\CT@arc@| (the color of the rules).
%
% \medskip
% Now, we deal with the left delimiter. Of course, the environment
@@ -14405,6 +14562,9 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+%
+%
+%
% \bigskip
% \subsection*{We process the options at package loading}
%
@@ -14420,7 +14580,6 @@ version 2005/12/01 or later.
% instruction is executed.
%
% \medskip
-%% \medskip
% The boolean |\g_@@_footnotehyper_bool| will indicate if the option
% |footnotehyper| is used.
% \begin{macrocode}
@@ -14692,18 +14851,18 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
-\@@_msg_new:nn { Unknown~option~for~xdots }
+\@@_msg_new:nn { Unknown~key~for~xdots }
{
- As~for~now~there~is~only~three~key~available~here:~'color',~'line-style'~
+ As~for~now,~there~is~only~three~key~available~here:~'color',~'line-style'~
and~'shorten'~(and~you~try~to~use~'\l_keys_key_str').~If~you~go~on,~
this~key~will~be~ignored.
}
% \end{macrocode}
%
% \begin{macrocode}
-\@@_msg_new:nn { Unknown~option~for~rowcolors }
+\@@_msg_new:nn { Unknown~key~for~rowcolors }
{
- As~for~now~there~is~only~two~keys~available~here:~'cols'~and~'respect-blocks'~
+ As~for~now,~there~is~only~two~keys~available~here:~'cols'~and~'respect-blocks'~
(and~you~try~to~use~'\l_keys_key_str').~If~you~go~on,~
this~key~will~be~ignored.
}
@@ -14714,8 +14873,8 @@ version 2005/12/01 or later.
{
The~key~'color'~for~the~command~\token_to_str:N \Block\
is~deprecated:~you~should~use~'fill'~instead.\\
- You~can~go~on~for~this~time~but~remember~that~that~key~
- will~be~deleted~in~a~future~version.
+ This~error~is~fatal.
+
}
% \end{macrocode}
%
@@ -14782,6 +14941,15 @@ version 2005/12/01 or later.
If~you~go~on,~this~key~will~be~ignored.
}
% \end{macrocode}
+%
+% \begin{macrocode}
+\@@_msg_new:nn { Wrong~line~in~SubMatrix }
+ {
+ You~try~to~draw~a~#1~line~of~number~'#2'~in~a~
+ \token_to_str:N \SubMatrix\ of~your~\@@_full_name_env:\ but~that~
+ number~is~not~valid.~If~you~go~on,~it~will~be~ignored.
+ }
+% \end{macrocode}
%
% \begin{macrocode}
\@@_msg_new:nn { empty~environment }
@@ -14798,7 +14966,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
-\@@_msg_new:nn { unknown~cell~for~line~in~code-after }
+\@@_msg_new:nn { unknown~cell~for~line~in~CodeAfter }
{
Your~command~\token_to_str:N\line\{#1\}\{#2\}~in~the~'code-after'~
can't~be~executed~because~a~cell~doesn't~exist.\\
@@ -14947,7 +15115,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
-\@@_msg_new:nn { Bad~value~for~letter~for~dotted~lines }
+\@@_msg_new:nn { One~letter~allowed }
{
The~value~of~key~'\l_keys_key_str'~must~be~of~length~1.\\
If~you~go~on,~it~will~be~ignored.
@@ -14978,7 +15146,8 @@ version 2005/12/01 or later.
}
{
The~available~keys~are~(in~alphabetic~order):~
- delimiters-color,~
+ delimiters/color,~
+ rules~(with~the~subkeys~'color'~and~'width'),~
sub-matrix~(several~subkeys)~
and~xdots~(several~subkeys).~
The~latter~is~for~the~command~\token_to_str:N \line.
@@ -14986,12 +15155,25 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
-\@@_msg_new:nn { Unknown~key~for~SubMatrix }
+\@@_msg_new:nnn { Unknown~key~for~SubMatrix }
{
The~key~'\l_keys_key_str'~is~unknown.\\
- The~only~keys~available~here~are~'delimiters-color',~'extra-height',~
- 'left-xshift',~'name',~'right-xshift',~'slim'~and~'xshift'.\\
If~you~go~on,~this~key~will~be~ignored. \\
+ For~a~list~of~the~available~keys~in~\token_to_str:N
+ \SubMatrix,~type~H~<return>.
+ }
+ {
+ The~available~keys~are~(in~alphabetic~order):~
+ 'delimiters/color',~
+ 'extra-height',~
+ 'hlines',~
+ 'left-xshift',~
+ 'name',~
+ 'right-xshift',~
+ 'rules'~(with~the~subkeys~'color'~and~'width'),~
+ 'slim',~
+ 'vlines'~and~'xshift'~(which~set~both~'left-xshift'~
+ and~'right-xshift').\\
}
% \end{macrocode}
%
@@ -15037,7 +15219,7 @@ version 2005/12/01 or later.
create-extra-nodes,~
create-medium-nodes,~
create-large-nodes,~
- delimiters-color,~
+ delimiters/color,~
end-of-row,~
first-col,~
first-row,~
@@ -15054,6 +15236,7 @@ version 2005/12/01 or later.
renew-dots,~
renew-matrix,~
right-margin,~
+ rules~(with~the~subkeys~'color'~and~'width'),~
small,~
sub-matrix~(several~subkeys),
vlines,~
@@ -15087,7 +15270,7 @@ version 2005/12/01 or later.
create-extra-nodes,~
create-medium-nodes,~
create-large-nodes,~
- delimiters-color,~
+ delimiters/color,~
extra-left-margin,~
extra-right-margin,~
first-col,~
@@ -15105,8 +15288,7 @@ version 2005/12/01 or later.
nullify-dots,~
renew-dots,~
right-margin,~
- rules/color,~
- rules/width,~
+ rules~(with~the~subkeys~'color'~and~'width'),~
small,~
t,~
vlines,~
@@ -15146,7 +15328,7 @@ version 2005/12/01 or later.
create-extra-nodes,~
create-medium-nodes,~
create-large-nodes,~
- delimiters-color,~
+ delimiters/color,~
extra-left-margin,~
extra-right-margin,~
first-col,~
@@ -15164,8 +15346,7 @@ version 2005/12/01 or later.
r,~
renew-dots,~
right-margin,~
- rules/color,~
- rules/width,~
+ rules~(with~the~subkeys~'color'~and~'width'),~
small,~
t,~
vlines,~
@@ -15218,8 +15399,7 @@ version 2005/12/01 or later.
nullify-dots,~
renew-dots,~
right-margin,~
- rules/color,~
- rules/width,~
+ rules~(with~the~subkeys~'color'~and~'width'),~
t,~
vlines,~
xdots/color,~
@@ -15523,7 +15703,7 @@ version 2005/12/01 or later.
%
% The option |dotted-lines-margin| has been renamed in |xdots/shorten| and the
% options |xdots/color| and |xdots/line-style| have been added for a complete
-% customization of the dotted lines.
+% customisation of the dotted lines.
%
% In the environments without preamble (|{NiceMatrix}|, |{pNiceMatrix}|, etc.),
% it's possible to use the options |l| (=|L|) or |r| (=|R|) to specify the type
@@ -15615,8 +15795,8 @@ version 2005/12/01 or later.
%
% The variable |\g_nicematrix_code_before_tl| is now public.
%
-% The key |baseline| can take in as value of the form \textsl{line-i} to align
-% the |\hline| in the row \textsl{i}.
+% The key |baseline| may take in as value an expression of the form
+% \textsl{line-i} to align the |\hline| in the row \textsl{i}.
%
% The key |hvlines-except-corners| may take in as value a list of corners (eg: NW,SE).
%
@@ -15679,6 +15859,12 @@ version 2005/12/01 or later.
% A (non fatal) error is raised when the key |transparent|, which is
% deprecated, is used.
%
+% \subsection*{Changes between versions 5.10 and 5.11}
+%
+% It's now possible, in the |code-before| and in the |\CodeAfter|, to use the
+% syntax \verb+|(i-|j)+ for the Tikz node at the intersection of the (potential)
+% horizontal rule number~$i$ and the (potential) vertical rule number~$j$.
+%
% \PrintIndex
%
% \tableofcontents
diff --git a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
index 6a423f2b113..3a1076b1831 100644
--- a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
+++ b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
@@ -18,8 +18,8 @@
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%%
-\def\myfileversion{5.10}
-\def\myfiledate{2021/02/05}
+\def\myfileversion{5.11}
+\def\myfiledate{2021/02/22}
\RequirePackage{pgfcore}
\usepgfmodule{shapes}
\RequirePackage{l3keys2e}
@@ -28,6 +28,7 @@
{\myfiledate}
{\myfileversion}
{Enhanced arrays with the help of PGF/TikZ}
+\RequirePackage { xparse }
\RequirePackage { array }
\RequirePackage { amsmath }
\cs_new_protected:Npn \__nicematrix_error:n { \msg_error:nn { nicematrix } }
@@ -272,6 +273,8 @@
\__nicematrix_fatal:n { Outside~math~mode }
\fi:
}
+\tl_new:N \l__nicematrix_letter_vlism_tl
+\seq_new:N \g__nicematrix_cols_vlism_seq
\colorlet { nicematrix-last-col } { . }
\colorlet { nicematrix-last-row } { . }
\str_new:N \g__nicematrix_name_env_str
@@ -299,7 +302,6 @@
\dim_zero_new:N \l_tmpc_dim
\dim_zero_new:N \l_tmpd_dim
\bool_new:N \g__nicematrix_empty_cell_bool
-\dim_new:N \__nicematrix_old_arraycolsep_dim
\dim_new:N \g__nicematrix_width_last_col_dim
\dim_new:N \g__nicematrix_width_first_col_dim
\seq_new:N \g__nicematrix_blocks_seq
@@ -316,6 +318,11 @@
\tl_set:Nn \l__nicematrix_pos_of_block_tl { c }
\bool_new:N \l__nicematrix_draw_first_bool
\int_new:N \g__nicematrix_block_box_int
+\dim_new:N \l__nicematrix_submatrix_extra_height_dim
+\dim_new:N \l__nicematrix_submatrix_left_xshift_dim
+\dim_new:N \l__nicematrix_submatrix_right_xshift_dim
+\clist_new:N \l__nicematrix_submatrix_hlines_clist
+\clist_new:N \l__nicematrix_submatrix_vlines_clist
\int_new:N \l__nicematrix_first_row_int
\int_set:Nn \l__nicematrix_first_row_int 1
\int_new:N \l__nicematrix_first_col_int
@@ -500,7 +507,7 @@
down .tl_set:N = \l__nicematrix_xdots_down_tl ,
up .tl_set:N = \l__nicematrix_xdots_up_tl ,
draw-first .code:n = \prg_do_nothing: ,
- unknown .code:n = \__nicematrix_error:n { Unknown~option~for~xdots }
+ unknown .code:n = \__nicematrix_error:n { Unknown~key~for~xdots }
}
\keys_define:nn { NiceMatrix / rules }
{
@@ -511,6 +518,8 @@
}
\keys_define:nn { NiceMatrix / Global }
{
+ rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
+ rules .value_required:n = true ,
standard-cline .bool_set:N = \l__nicematrix_standard_cline_bool ,
standard-cline .default:n = true ,
cell-space-top-limit .dim_set:N = \l__nicematrix_cell_space_top_limit_dim ,
@@ -543,6 +552,13 @@
code-for-last-row .value_required:n = true ,
hlines .bool_set:N = \l__nicematrix_hlines_bool ,
vlines .bool_set:N = \l__nicematrix_vlines_bool ,
+ vlines-in-sub-matrix .code:n =
+ {
+ \tl_if_single_token:nTF { #1 }
+ { \tl_set:Nn \l__nicematrix_letter_vlism_tl { #1 } }
+ { \__nicematrix_error:n { One~letter~allowed } }
+ } ,
+ vlines-in-sub-matrix .value_required:n = true ,
hvlines .code:n =
{
\bool_set_true:N \l__nicematrix_vlines_bool
@@ -674,6 +690,7 @@
NiceMatrixOptions / rules .inherit:n = NiceMatrix / rules ,
NiceMatrixOptions / notes .inherit:n = NiceMatrix / notes ,
NiceMatrixOptions / sub-matrix .inherit:n = NiceMatrix / sub-matrix ,
+ SubMatrix / rules .inherit:n = NiceMatrix / rules ,
CodeAfter / xdots .inherit:n = NiceMatrix / xdots ,
NiceMatrix .inherit:n =
{
@@ -706,6 +723,8 @@
}
\keys_define:nn { NiceMatrix / NiceMatrixOptions }
{
+ delimiters / color .tl_set:N = \l__nicematrix_delimiters_color_tl ,
+ delimiters / color .value_required:n = true ,
delimiters-color .tl_set:N = \l__nicematrix_delimiters_color_tl ,
delimiters-color .value_required:n = true ,
last-col .code:n = \tl_if_empty:nF { #1 }
@@ -734,7 +753,7 @@
{
\tl_if_single_token:nTF { #1 }
{ \str_set:Nx \l__nicematrix_letter_for_dotted_lines_str { #1 } }
- { \__nicematrix_error:n { Bad~value~for~letter~for~dotted~lines } }
+ { \__nicematrix_error:n { One~letter~allowed } }
} ,
letter-for-dotted-lines .value_required:n = true ,
notes .code:n = \keys_set:nn { NiceMatrix / notes } { #1 } ,
@@ -760,6 +779,8 @@
r .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl r ,
small .bool_set:N = \l__nicematrix_small_bool ,
small .value_forbidden:n = true ,
+ delimiters / color .tl_set:N = \l__nicematrix_delimiters_color_tl ,
+ delimiters / color .value_required:n = true ,
delimiters-color .tl_set:N = \l__nicematrix_delimiters_color_tl ,
delimiters-color .value_required:n = true ,
unknown .code:n = \__nicematrix_error:n { Unknown~option~for~NiceMatrix }
@@ -779,6 +800,8 @@
tabularnote .value_required:n = true ,
delimiters-color .tl_set:N = \l__nicematrix_delimiters_color_tl ,
delimiters-color .value_required:n = true ,
+ delimiters / color .tl_set:N = \l__nicematrix_delimiters_color_tl ,
+ delimiters / color .value_required:n = true ,
unknown .code:n = \__nicematrix_error:n { Unknown~option~for~NiceArray }
}
\keys_define:nn { NiceMatrix / pNiceArray }
@@ -1223,6 +1246,7 @@
{ \pgfpointdiff \__nicematrix_picture_position: \__nicematrix_node_position: }
}
\endpgfpicture
+ \__nicematrix_create_diag_nodes:
\group_begin:
\bool_if:NT \c__nicematrix_tikz_loaded_bool
{
@@ -1436,6 +1460,7 @@
{ ! { \skip_horizontal:N \arrayrulewidth } }
}
{ \tl_gclear:N \g__nicematrix_preamble_tl }
+ \seq_clear:N \g__nicematrix_cols_vlism_seq
\int_zero:N \l_tmpa_int
\exp_after:wN \__nicematrix_patch_preamble:n \the \@temptokena \q_stop
\int_gset_eq:NN \g__nicematrix_static_num_of_col_int \c@jCol
@@ -1473,8 +1498,7 @@
}
\dim_compare:nNnT \l__nicematrix_tabular_width_dim = \c_zero_dim
{
- \tl_gput_right:Nn
- \g__nicematrix_preamble_tl
+ \tl_gput_right:Nn \g__nicematrix_preamble_tl
{ > { \__nicematrix_error_too_much_cols: } l }
}
\group_end:
@@ -1511,14 +1535,24 @@
\str_if_eq:VnTF \l__nicematrix_letter_for_dotted_lines_str { #1 }
{ \__nicematrix_patch_preamble_xi:n #1 }
{
- \bool_lazy_and:nnTF
- { \str_if_eq_p:nn { : } { #1 } }
- \c__nicematrix_arydshln_loaded_bool
+ \str_if_eq:VnTF \l__nicematrix_letter_vlism_tl { #1 }
{
- \tl_gput_right:Nn \g__nicematrix_preamble_tl { : }
+ \seq_gput_right:Nx \g__nicematrix_cols_vlism_seq
+ { \int_eval:n { \c@jCol + 1 } }
+ \tl_gput_right:Nx \g__nicematrix_preamble_tl
+ { \exp_not:N ! { \skip_horizontal:N \arrayrulewidth } }
\__nicematrix_patch_preamble:n
}
- { \__nicematrix_fatal:nn { unknown~column~type } { #1 } }
+ {
+ \bool_lazy_and:nnTF
+ { \str_if_eq_p:nn { : } { #1 } }
+ \c__nicematrix_arydshln_loaded_bool
+ {
+ \tl_gput_right:Nn \g__nicematrix_preamble_tl { : }
+ \__nicematrix_patch_preamble:n
+ }
+ { \__nicematrix_fatal:nn { unknown~column~type } { #1 } }
+ }
}
}
}
@@ -1576,11 +1610,15 @@
\__nicematrix_Cell:
\begin { minipage } [ #1 ] { #3 }
\mode_leave_vertical:
- \arraybackslash % added in the version 5.8
- \box_use:N \@arstrutbox
+ \arraybackslash
+ \vrule height \box_ht:N \@arstrutbox depth 0 pt width 0 pt % v. 5.11
}
c
- < { \box_use:N \@arstrutbox \end { minipage } \__nicematrix_end_Cell: }
+ < {
+ \vrule height 0 pt depth \box_dp:N \@arstrutbox width 0 pt % v. 5.11
+ \end { minipage }
+ \__nicematrix_end_Cell:
+ }
}
\int_gincr:N \c@jCol
\__nicematrix_patch_preamble_x:n
@@ -2062,6 +2100,7 @@
{
>
{
+ \cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter_i:n
\bool_gset_true:N \g__nicematrix_after_col_zero_bool
\__nicematrix_begin_of_row:
\hbox_set:Nw \l__nicematrix_cell_box
@@ -2106,6 +2145,7 @@
{
>
{
+ \cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter_i:n
\bool_gset_true:N \g__nicematrix_last_col_found_bool
\int_gincr:N \c@jCol
\int_gset_eq:NN \g__nicematrix_col_total_int \c@jCol
@@ -2286,6 +2326,14 @@
}
\iow_now:Nn \@mainaux \ExplSyntaxOff
}
+ \__nicematrix_create_diag_nodes:
+ \str_if_empty:NF \l__nicematrix_name_str
+ {
+ \pgfpicture
+ \pgfrememberpicturepositiononpagetrue
+ \pgfnodealias { \l__nicematrix_name_str - ##1 } { \__nicematrix_env: - ##1 }
+ \endpgfpicture
+ }
\bool_if:NT \l__nicematrix_parallelize_diags_bool
{
\int_gzero_new:N \g__nicematrix_ddots_int
@@ -2409,6 +2457,19 @@
\cs_if_exist:NT \theiRow { \int_gset_eq:NN \c@iRow \l__nicematrix_old_iRow_int }
\cs_if_exist:NT \thejCol { \int_gset_eq:NN \c@jCol \l__nicematrix_old_jCol_int }
}
+\cs_new_protected:Npn \__nicematrix_create_diag_nodes:
+ {
+ \int_step_inline:nn { \int_max:nn \c@iRow \c@jCol + 1 }
+ {
+ \pgfpicture
+ \pgfrememberpicturepositiononpagetrue
+ \__nicematrix_qpoint:n { row - \int_min:nn { ##1 } { \c@iRow + 1 } }
+ \dim_set_eq:NN \l_tmpa_dim \pgf@y
+ \__nicematrix_qpoint:n { col - \int_min:nn { ##1 } { \c@jCol + 1 } }
+ \pgfcoordinate { \__nicematrix_env: - ##1 } { \pgfpoint \pgf@x \l_tmpa_dim }
+ \endpgfpicture
+ }
+ }
\cs_new_protected:Npn \__nicematrix_find_extremities_of_line:nnnn #1 #2 #3 #4
{
\cs_set:cpn { __nicematrix _ dotted _ #1 - #2 } { }
@@ -3407,7 +3468,7 @@
\cs_if_free_p:c { pgf @ sh @ ns @ \__nicematrix_env: - #2 }
}
{
- \__nicematrix_error:nnn { unknown~cell~for~line~in~code-after } { #1 } { #2 }
+ \__nicematrix_error:nnn { unknown~cell~for~line~in~CodeAfter } { #1 } { #2 }
}
{ \__nicematrix_draw_line_ii:nn { #1 } { #2 } }
}
@@ -3537,7 +3598,7 @@
cols .tl_set:N = \l__nicematrix_cols_tl ,
restart .bool_set:N = \l__nicematrix_rowcolors_restart_bool ,
restart .default:n = true ,
- unknown .code:n = \__nicematrix_error:n { Unknown~option~for~rowcolors }
+ unknown .code:n = \__nicematrix_error:n { Unknown~key~for~rowcolors }
}
\NewDocumentCommand \__nicematrix_rowcolors { O { } m m m O { } }
{
@@ -3740,11 +3801,11 @@
{
\bool_gset_true:N \g_tmpa_bool
\seq_map_inline:Nn \g__nicematrix_pos_of_blocks_seq
- { \__nicematrix_test_if_vline_in_block:nnnn ##1 }
+ { \__nicematrix_test_vline_in_block:nnnn ##1 }
\seq_map_inline:Nn \g__nicematrix_pos_of_xdots_seq
- { \__nicematrix_test_if_vline_in_block:nnnn ##1 }
+ { \__nicematrix_test_vline_in_block:nnnn ##1 }
\seq_map_inline:Nn \g__nicematrix_pos_of_stroken_blocks_seq
- { \__nicematrix_test_if_vline_in_stroken_block:nnnn ##1 }
+ { \__nicematrix_test_vline_in_stroken_block:nnnn ##1 }
\clist_if_empty:NF \l__nicematrix_except_corners_clist
\__nicematrix_test_in_corner_v:
\bool_if:NTF \g_tmpa_bool
@@ -3862,11 +3923,11 @@
{
\bool_gset_true:N \g_tmpa_bool
\seq_map_inline:Nn \g__nicematrix_pos_of_blocks_seq
- { \__nicematrix_test_if_hline_in_block:nnnn ##1 }
+ { \__nicematrix_test_hline_in_block:nnnn ##1 }
\seq_map_inline:Nn \g__nicematrix_pos_of_xdots_seq
- { \__nicematrix_test_if_hline_in_block:nnnn ##1 }
+ { \__nicematrix_test_hline_in_block:nnnn ##1 }
\seq_map_inline:Nn \g__nicematrix_pos_of_stroken_blocks_seq
- { \__nicematrix_test_if_hline_in_stroken_block:nnnn ##1 }
+ { \__nicematrix_test_hline_in_stroken_block:nnnn ##1 }
\clist_if_empty:NF \l__nicematrix_except_corners_clist \__nicematrix_test_in_corner_h:
\bool_if:NTF \g_tmpa_bool
{
@@ -3986,7 +4047,7 @@
{ \__nicematrix_hline:nn { \__nicematrix_succ:n { \c@iRow } } { #1 } }
\ifnum 0 = `{ \fi }
}
-\cs_new_protected:Npn \__nicematrix_test_if_hline_in_block:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \__nicematrix_test_hline_in_block:nnnn #1 #2 #3 #4
{
\bool_lazy_all:nT
{
@@ -3997,7 +4058,7 @@
}
{ \bool_gset_false:N \g_tmpa_bool }
}
-\cs_new_protected:Npn \__nicematrix_test_if_vline_in_block:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \__nicematrix_test_vline_in_block:nnnn #1 #2 #3 #4
{
\bool_lazy_all:nT
{
@@ -4008,7 +4069,7 @@
}
{ \bool_gset_false:N \g_tmpa_bool }
}
-\cs_new_protected:Npn \__nicematrix_test_if_hline_in_stroken_block:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \__nicematrix_test_hline_in_stroken_block:nnnn #1 #2 #3 #4
{
\bool_lazy_all:nT
{
@@ -4019,7 +4080,7 @@
}
{ \bool_gset_false:N \g_tmpa_bool }
}
-\cs_new_protected:Npn \__nicematrix_test_if_vline_in_stroken_block:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \__nicematrix_test_vline_in_stroken_block:nnnn #1 #2 #3 #4
{
\bool_lazy_all:nT
{
@@ -4176,11 +4237,9 @@
\bool_if:NTF \l__nicematrix_NiceArray_bool \c_zero_dim \arraycolsep
+ \l__nicematrix_right_margin_dim
}
- \tl_set:Nn \l_tmpa_tl { ( }
- \tl_if_eq:NNF \l__nicematrix_left_delim_tl \l_tmpa_tl
+ \tl_if_eq:NnF \l__nicematrix_left_delim_tl (
{ \dim_gadd:Nn \l__nicematrix_x_initial_dim { 0.5 \l__nicematrix_inter_dots_dim } }
- \tl_set:Nn \l_tmpa_tl { ) }
- \tl_if_eq:NNF \l__nicematrix_right_delim_tl \l_tmpa_tl
+ \tl_if_eq:NnF \l__nicematrix_right_delim_tl )
{ \dim_gsub:Nn \l__nicematrix_x_final_dim { 0.5 \l__nicematrix_inter_dots_dim } }
\tl_set_eq:NN \l__nicematrix_xdots_line_style_tl \c__nicematrix_standard_tl
\__nicematrix_draw_line:
@@ -4639,7 +4698,7 @@
draw .tl_set:N = \l__nicematrix_draw_tl ,
draw .default:n = default ,
color .code:n =
- \__nicematrix_error:n { Key~color~for~Block }
+ \__nicematrix_fatal:n { Key~color~for~Block }
\tl_set:Nn \l__nicematrix_fill_tl { #1 } ,
% color .code:n = \color { #1 } \tl_set:Nn \l__nicematrix_draw_tl { #1 } ,
color .value_required:n = true ,
@@ -4668,9 +4727,7 @@
\int_compare:nNnTF { #4 } > { 99 }
{ \int_set_eq:NN \l__nicematrix_last_col_int \c@jCol }
{ \int_set:Nn \l__nicematrix_last_col_int { #4 } }
- \bool_lazy_or:nnTF
- { \int_compare_p:nNn \l__nicematrix_last_row_int > \g__nicematrix_row_total_int }
- { \int_compare_p:nNn \l__nicematrix_last_col_int > \g__nicematrix_col_total_int }
+ \int_compare:nNnTF \l__nicematrix_last_col_int > \g__nicematrix_col_total_int
{
\int_compare:nTF
{ \l__nicematrix_last_col_int <= \g__nicematrix_static_num_of_col_int }
@@ -4684,7 +4741,11 @@
}
{ \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } }
}
- { \__nicematrix_Block_v:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } }
+ {
+ \int_compare:nNnTF \l__nicematrix_last_row_int > \g__nicematrix_row_total_int
+ { \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } }
+ { \__nicematrix_Block_v:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } }
+ }
}
\cs_new_protected:Npn \__nicematrix_Block_v:nnnnnn #1 #2 #3 #4 #5 #6
{
@@ -5052,13 +5113,16 @@
{ \__nicematrix_math_toggle_token: #6 \__nicematrix_math_toggle_token: } { } { }
\endpgfpicture
}
+\keys_define:nn { NiceMatrix }
+ { CodeAfter / rules .inherit:n = NiceMatrix / rules }
\keys_define:nn { NiceMatrix / CodeAfter }
{
- sub-matrix .code:n =
- \keys_set:nn { NiceMatrix / sub-matrix } { #1 } ,
+ sub-matrix .code:n = \keys_set:nn { NiceMatrix / sub-matrix } { #1 } ,
sub-matrix .value_required:n = true ,
- delimiters-color .tl_set:N = \l__nicematrix_delimiters_color_tl ,
- delimiters-color .value_required:n = true ,
+ delimiters / color .tl_set:N = \l__nicematrix_delimiters_color_tl ,
+ delimiters / color .value_required:n = true ,
+ rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
+ rules .value_required:n = true ,
unknown .code:n = \__nicematrix_error:n { Unknown~key~for~CodeAfter }
}
\cs_new:Npn \__nicematrix_CodeAfter: { \omit \__nicematrix_CodeAfter_i:n }
@@ -5069,8 +5133,7 @@
}
\cs_new_protected:Npn \__nicematrix_CodeAfter_ii:n #1
{
- \str_if_eq:eeTF \@currenvir { #1 }
- { \end { #1 } }
+ \str_if_eq:eeTF \@currenvir { #1 } { \end { #1 } }
{
\tl_gput_right:Nn \g_nicematrix_code_after_tl { \end { #1 } }
\__nicematrix_CodeAfter_i:n
@@ -5142,18 +5205,22 @@
right-xshift .value_required:n = true ,
xshift .meta:n = { left-xshift = #1, right-xshift = #1 } ,
xshift .value_required:n = true ,
- delimiters-color .tl_set:N = \l__nicematrix_delimiters_color_tl ,
- delimiters-color .value_required:n = true ,
+ delimiters / color .tl_set:N = \l__nicematrix_delimiters_color_tl ,
+ delimiters / color .value_required:n = true ,
slim .bool_set:N = \l__nicematrix_submatrix_slim_bool ,
slim .default:n = true ,
}
\keys_define:nn { NiceMatrix }
{
- SubMatrix .inherit:n = NiceMatrix /sub-matrix ,
- CodeAfter / sub-matrix .inherit:n = NiceMatrix / sub-matrix
+ SubMatrix .inherit:n = NiceMatrix / sub-matrix ,
+ CodeAfter / sub-matrix .inherit:n = NiceMatrix / sub-matrix ,
}
\keys_define:nn { NiceMatrix / SubMatrix }
{
+ hlines .clist_set:N = \l__nicematrix_submatrix_hlines_clist ,
+ hlines .default:n = all ,
+ vlines .clist_set:N = \l__nicematrix_submatrix_vlines_clist ,
+ vlines .default:n = all ,
name .code:n =
\tl_if_empty:nTF { #1 }
{ \__nicematrix_error:n { Invalid~name~format } }
@@ -5169,6 +5236,8 @@
}
{ \__nicematrix_error:n { Invalid~name~format } }
} ,
+ rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
+ rules .value_required:n = true ,
name .value_required:n = true ,
unknown .code:n = \__nicematrix_error:n { Unknown~key~for~SubMatrix }
}
@@ -5186,9 +5255,6 @@
{ \int_compare_p:nNn \l_tmpd_tl > \g__nicematrix_col_total_int }
{ \__nicematrix_error:n { SubMatrix~too~large } }
{
- \dim_zero_new:N \l__nicematrix_submatrix_extra_height_dim
- \dim_zero_new:N \l__nicematrix_submatrix_left_xshift_dim
- \dim_zero_new:N \l__nicematrix_submatrix_right_xshift_dim
\str_clear_new:N \l__nicematrix_submatrix_name_str
\keys_set:nn { NiceMatrix / SubMatrix } { #5 }
\pgfpicture
@@ -5245,12 +5311,79 @@
\l__nicematrix_submatrix_extra_height_dim - \arrayrulewidth
}
\dim_set_eq:NN \nulldelimiterspace \c_zero_dim
+ \group_begin:
+ \pgfsetlinewidth { 1.1 \arrayrulewidth }
+ \tl_if_empty:NF \l__nicematrix_rules_color_tl
+ { \exp_after:wN \__nicematrix_set_CT@arc@: \l__nicematrix_rules_color_tl \q_stop }
+ \CT@arc@
+ \seq_map_inline:Nn \g__nicematrix_cols_vlism_seq
+ {
+ \int_compare:nNnT \l_tmpb_tl < { ##1 }
+ {
+ \int_compare:nNnT { ##1 } < { \int_eval:n { \l_tmpd_tl + 1 } }
+ {
+ \__nicematrix_qpoint:n { col - ##1 }
+ \pgfpathmoveto { \pgfpoint \pgf@x \l__nicematrix_y_initial_dim }
+ \pgfpathlineto { \pgfpoint \pgf@x \l__nicematrix_y_final_dim }
+ \pgfusepathqstroke
+ }
+ }
+ }
+ \tl_if_eq:NnTF \l__nicematrix_submatrix_vlines_clist { all }
+ { \int_step_inline:nn { \l_tmpd_tl - \l_tmpb_tl } }
+ { \clist_map_inline:Nn \l__nicematrix_submatrix_vlines_clist }
+ {
+ \bool_lazy_and:nnTF
+ { \int_compare_p:nNn { ##1 } > 0 }
+ { \int_compare_p:nNn { ##1 } < { \l_tmpd_tl - \l_tmpb_tl + 1 } }
+ {
+ \__nicematrix_qpoint:n { col - \int_eval:n { ##1 + \l_tmpb_tl } }
+ \pgfpathmoveto { \pgfpoint \pgf@x \l__nicematrix_y_initial_dim }
+ \pgfpathlineto { \pgfpoint \pgf@x \l__nicematrix_y_final_dim }
+ \pgfusepathqstroke
+ }
+ { \__nicematrix_error:nnn { Wrong~line~in~SubMatrix } { vertical } { ##1 } }
+ }
+ \tl_if_eq:NnTF \l__nicematrix_submatrix_hlines_clist { all }
+ { \int_step_inline:nn { \l_tmpc_tl - \l_tmpa_tl } }
+ { \clist_map_inline:Nn \l__nicematrix_submatrix_hlines_clist }
+ {
+ \bool_lazy_and:nnTF
+ { \int_compare_p:nNn { ##1 } > 0 }
+ { \int_compare_p:nNn { ##1 } < { \l_tmpc_tl - \l_tmpa_tl + 1 } }
+ {
+ \__nicematrix_qpoint:n { row - \int_eval:n { ##1 + \l_tmpa_tl } }
+ \group_begin:
+ \dim_set:Nn \l_tmpa_dim
+ { \l__nicematrix_x_initial_dim - \l__nicematrix_submatrix_left_xshift_dim }
+ \str_case:nn { #1 }
+ {
+ ( { \dim_sub:Nn \l_tmpa_dim { 0.9 mm } }
+ [ { \dim_sub:Nn \l_tmpa_dim { 0.2 mm } }
+ \{ { \dim_sub:Nn \l_tmpa_dim { 0.9 mm } }
+ }
+ \pgfpathmoveto { \pgfpoint \l_tmpa_dim \pgf@y }
+ \dim_set:Nn \l_tmpb_dim
+ { \l__nicematrix_x_final_dim + \l__nicematrix_submatrix_right_xshift_dim }
+ \str_case:nn { #4 }
+ {
+ ) { \dim_add:Nn \l_tmpb_dim { 0.9 mm } }
+ ] { \dim_add:Nn \l_tmpb_dim { 0.2 mm } }
+ \} { \dim_add:Nn \l_tmpb_dim { 0.9 mm } }
+ }
+ \pgfpathlineto { \pgfpoint \l_tmpb_dim \pgf@y }
+ \pgfusepathqstroke
+ \group_end:
+ }
+ { \__nicematrix_error:nnn { Wrong~line~in~SubMatrix } { horizontal } { ##1 } }
+ }
\str_if_empty:NF \l__nicematrix_submatrix_name_str
{
\__nicematrix_pgf_rect_node:nnnnn \l__nicematrix_submatrix_name_str
\l__nicematrix_x_initial_dim \l__nicematrix_y_initial_dim
\l__nicematrix_x_final_dim \l__nicematrix_y_final_dim
}
+ \group_end:
\begin { pgfscope }
\pgftransformshift
{
@@ -5325,7 +5458,6 @@
{ #2 }
{ }
}
-%% \medskip
\bool_new:N \c__nicematrix_footnotehyper_bool
\bool_new:N \c__nicematrix_footnote_bool
\__nicematrix_msg_new:nnn { Unknown~option~for~package }
@@ -5492,15 +5624,15 @@
Since~you~haven't~loaded~Tikz,~the~only~value~you~can~give~to~'line-style'~
is~'standard'.~If~you~go~on,~this~key~will~be~ignored.
}
-\__nicematrix_msg_new:nn { Unknown~option~for~xdots }
+\__nicematrix_msg_new:nn { Unknown~key~for~xdots }
{
- As~for~now~there~is~only~three~key~available~here:~'color',~'line-style'~
+ As~for~now,~there~is~only~three~key~available~here:~'color',~'line-style'~
and~'shorten'~(and~you~try~to~use~'\l_keys_key_str').~If~you~go~on,~
this~key~will~be~ignored.
}
-\__nicematrix_msg_new:nn { Unknown~option~for~rowcolors }
+\__nicematrix_msg_new:nn { Unknown~key~for~rowcolors }
{
- As~for~now~there~is~only~two~keys~available~here:~'cols'~and~'respect-blocks'~
+ As~for~now,~there~is~only~two~keys~available~here:~'cols'~and~'respect-blocks'~
(and~you~try~to~use~'\l_keys_key_str').~If~you~go~on,~
this~key~will~be~ignored.
}
@@ -5508,8 +5640,8 @@
{
The~key~'color'~for~the~command~\token_to_str:N \Block\
is~deprecated:~you~should~use~'fill'~instead.\\
- You~can~go~on~for~this~time~but~remember~that~that~key~
- will~be~deleted~in~a~future~version.
+ This~error~is~fatal.
+
}
\__nicematrix_msg_new:nn { ampersand~in~light-syntax }
{
@@ -5554,6 +5686,12 @@
A~name~must~be~accepted~by~the~regular~expression~[A-Za-z][A-Za-z0-9]*.\\
If~you~go~on,~this~key~will~be~ignored.
}
+\__nicematrix_msg_new:nn { Wrong~line~in~SubMatrix }
+ {
+ You~try~to~draw~a~#1~line~of~number~'#2'~in~a~
+ \token_to_str:N \SubMatrix\ of~your~\__nicematrix_full_name_env:\ but~that~
+ number~is~not~valid.~If~you~go~on,~it~will~be~ignored.
+ }
\__nicematrix_msg_new:nn { empty~environment }
{ Your~\__nicematrix_full_name_env:\ is~empty.~This~error~is~fatal. }
\__nicematrix_msg_new:nn { Delimiter~with~small }
@@ -5562,7 +5700,7 @@
because~the~key~'small'~is~in~force.\\
This~error~is~fatal.
}
-\__nicematrix_msg_new:nn { unknown~cell~for~line~in~code-after }
+\__nicematrix_msg_new:nn { unknown~cell~for~line~in~CodeAfter }
{
Your~command~\token_to_str:N\line\{#1\}\{#2\}~in~the~'code-after'~
can't~be~executed~because~a~cell~doesn't~exist.\\
@@ -5661,7 +5799,7 @@
(and~not~in~\token_to_str:N \vcenter).\\
This~error~is~fatal.
}
-\__nicematrix_msg_new:nn { Bad~value~for~letter~for~dotted~lines }
+\__nicematrix_msg_new:nn { One~letter~allowed }
{
The~value~of~key~'\l_keys_key_str'~must~be~of~length~1.\\
If~you~go~on,~it~will~be~ignored.
@@ -5685,17 +5823,31 @@
}
{
The~available~keys~are~(in~alphabetic~order):~
- delimiters-color,~
+ delimiters/color,~
+ rules~(with~the~subkeys~'color'~and~'width'),~
sub-matrix~(several~subkeys)~
and~xdots~(several~subkeys).~
The~latter~is~for~the~command~\token_to_str:N \line.
}
-\__nicematrix_msg_new:nn { Unknown~key~for~SubMatrix }
+\__nicematrix_msg_new:nnn { Unknown~key~for~SubMatrix }
{
The~key~'\l_keys_key_str'~is~unknown.\\
- The~only~keys~available~here~are~'delimiters-color',~'extra-height',~
- 'left-xshift',~'name',~'right-xshift',~'slim'~and~'xshift'.\\
If~you~go~on,~this~key~will~be~ignored. \\
+ For~a~list~of~the~available~keys~in~\token_to_str:N
+ \SubMatrix,~type~H~<return>.
+ }
+ {
+ The~available~keys~are~(in~alphabetic~order):~
+ 'delimiters/color',~
+ 'extra-height',~
+ 'hlines',~
+ 'left-xshift',~
+ 'name',~
+ 'right-xshift',~
+ 'rules'~(with~the~subkeys~'color'~and~'width'),~
+ 'slim',~
+ 'vlines'~and~'xshift'~(which~set~both~'left-xshift'~
+ and~'right-xshift').\\
}
\__nicematrix_msg_new:nnn { Unknown~key~for~notes }
{
@@ -5735,7 +5887,7 @@
create-extra-nodes,~
create-medium-nodes,~
create-large-nodes,~
- delimiters-color,~
+ delimiters/color,~
end-of-row,~
first-col,~
first-row,~
@@ -5752,6 +5904,7 @@
renew-dots,~
renew-matrix,~
right-margin,~
+ rules~(with~the~subkeys~'color'~and~'width'),~
small,~
sub-matrix~(several~subkeys),
vlines,~
@@ -5782,7 +5935,7 @@
create-extra-nodes,~
create-medium-nodes,~
create-large-nodes,~
- delimiters-color,~
+ delimiters/color,~
extra-left-margin,~
extra-right-margin,~
first-col,~
@@ -5800,8 +5953,7 @@
nullify-dots,~
renew-dots,~
right-margin,~
- rules/color,~
- rules/width,~
+ rules~(with~the~subkeys~'color'~and~'width'),~
small,~
t,~
vlines,~
@@ -5834,7 +5986,7 @@
create-extra-nodes,~
create-medium-nodes,~
create-large-nodes,~
- delimiters-color,~
+ delimiters/color,~
extra-left-margin,~
extra-right-margin,~
first-col,~
@@ -5852,8 +6004,7 @@
r,~
renew-dots,~
right-margin,~
- rules/color,~
- rules/width,~
+ rules~(with~the~subkeys~'color'~and~'width'),~
small,~
t,~
vlines,~
@@ -5903,8 +6054,7 @@
nullify-dots,~
renew-dots,~
right-margin,~
- rules/color,~
- rules/width,~
+ rules~(with~the~subkeys~'color'~and~'width'),~
t,~
vlines,~
xdots/color,~