texlive[75044] Master/texmf-dist: nicematrix (28apr25)
commits+karl at tug.org
commits+karl at tug.org
Mon Apr 28 21:48:18 CEST 2025
Revision: 75044
https://tug.org/svn/texlive?view=revision&revision=75044
Author: karl
Date: 2025-04-28 21:48:18 +0200 (Mon, 28 Apr 2025)
Log Message:
-----------
nicematrix (28apr25)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-code.pdf
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex
trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-code.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex 2025-04-28 19:47:40 UTC (rev 75043)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex 2025-04-28 19:48:18 UTC (rev 75044)
@@ -1,13 +1,13 @@
% -*- coding: utf-8 ; -*-
% Ce fichier doit être compilé avec LuaLaTeX uniquement.
\documentclass[dvipsnames]{article}% dvipsnames is for xcolor (loaded by TikZ, loaded by nicematrix)
-\usepackage[french]{babel}
-\frenchsetup{og = « , fg = »}
+\usepackage{polyglossia}
+\setmainlanguage{french}
+
\usepackage{geometry}
\geometry{left=2.8cm,right=2.8cm,top=2.5cm,bottom=2.5cm,papersize={21cm,29.7cm}}
-
\usepackage{array}%[=v2.5]
\usepackage{nicematrix}
@@ -21,6 +21,7 @@
babel,
calligraphy
}
+
\usepackage{enumitem}
\usepackage{siunitx}
@@ -120,23 +121,25 @@
Subject = Une extension LaTeX ,
Author = F. Pantigny
}
- }
+}
\begin{document}
-\VerbatimFootnotes
+\UseName{VerbatimFootnotes}
+
\title{L'extension \pkg{nicematrix}
\thanks{Ce document correspond à la version~\myfileversion\space de \pkg{nicematrix},
- en date du~\myfiledate.}}
+ en date du~\myfiledate.}}
+
+
\author{F. Pantigny \\ \texttt{fpantigny at wanadoo.fr}}
\maketitle
-
\begin{abstract}
L'extension LaTeX \pkg{nicematrix} fournit de nouveaux environnements similaires
aux environnements classiques |{tabular}|, |{array}| et |{matrix}| de
@@ -143,7 +146,6 @@
\pkg{array} et \pkg{amsmath} mais avec des fonctionnalités plus étendues.
\end{abstract}
-
\vspace{1cm}
\hspace{1cm}
@@ -164,7 +166,8 @@
\rowcolors{3}{blue!15}{}
\Body
\toprule
- \Block{2-1}{Produit} & \multicolumn{3}{c}{dimensions (cm)} & \Block{2-1}{\rotate Prix} \\
+ \Block[C]{2-1}{Produit} & \multicolumn{3}{c}{dimensions (cm)}
+ & \Block[C]{2-1}{\rotate Prix} \\
\cmidrule(rl){2-4}
& L & l & h \\
\midrule
@@ -173,7 +176,7 @@
premium & 8.5 & 10.5 & 2 & 80 \\
extra & 8.5 & 10 & 1.5 & 85.5 \\
spécial & 12 & 12 & 0.5 & 70 \\
- \bottomrule
+\bottomrule
\end{NiceTabular}
@@ -215,8 +218,9 @@
pour être utilisées à la compilation suivante. C'est pourquoi l'utilisation de
\pkg{nicematrix} nécessite \textbf{plusieurs compilations
successives}\footnote{Si vous utilisez Overleaf, Overleaf effectue
- automatiquement un nombre de compilations suffisant (en utilisant |latexmk|).}. L'utilisateur ne doit
-pas utiliser la commande |\nofiles| (qui bloque l'écriture du fichier |aux|).
+ automatiquement un nombre de compilations suffisant (en utilisant
+ |latexmk|).}. L'utilisateur ne doit pas utiliser la commande |\nofiles| (qui
+bloque l'écriture du fichier |aux|).
\medskip
La plupart des fonctionnalités de \pkg{nicematrix} sont accessibles sans avoir à
@@ -284,11 +288,11 @@
\pkg{nicematrix}) : |{matrix}|, |{pmatrix}|, etc.
\medskip
-L'environnement |{NiceTabularX}| est similaire à l'environnement |{tabularx}| de
-l'extension éponyme.\footnote{Néanmoins, on peut aussi utiliser directement les
- colonnes |X| dans l'environnement |{NiceTabular}|, la largeur
- souhaitée pour le tableau étant spécifiée par la clé |width|: cf.
- p.~\pageref{colonne-X}.}
+L'environnement |{NiceTabularX}| est similaire à l'environnement
+|{tabularx}| de l'extension éponyme.\footnote{Néanmoins, on peut aussi utiliser
+ directement les colonnes |X| dans l'environnement |{NiceTabular}|, la largeur
+ souhaitée pour le tableau étant spécifiée par la clé |width|:
+ cf.~p.~\pageref{colonne-X}.}
\medskip
@@ -300,13 +304,14 @@
\medskip
Tous les environnements de l'extension \pkg{nicematrix} acceptent, entre
crochets, une liste optionnelle de paires de la forme \textsl{clé=valeur}.
-{\bfseries Il doit n'y avoir aucun espace devant le crochet ouvrant (|[|) de
+\textbf{Il doit n'y avoir aucun espace devant le crochet ouvrant (|[|) de
cette liste d'options.}
+
\section{L'espace vertical entre les rangées}
-\label{cell-space}
+\label{cell-space-limits}
\index{cell-space-top-limit}
\index{cell-space-bottom-limit}
\index{cell-space-limits}
@@ -332,8 +337,10 @@
En s'inspirant de l'extension \pkg{cellspace} qui traite de ce problème,
l'extension \pkg{nicematrix} propose deux clés \Definition{cell-space-top-limit}
et \Definition{cell-space-bottom-limit} qui sont similaires aux deux paramètres
-|\cellspacetoplimit| et |\cellspacebottomlimit| proposés par \pkg{cellspace}.\index{cellspace@\pkg{cellspace} (extension)}
+|\cellspacetoplimit| et |\cellspacebottomlimit| proposés par \pkg{cellspace}.
+\index{cellspace@\pkg{cellspace} (extension)}
+
Il existe aussi une clé \Definition{cell-space-limits} pour régler simultanément
les deux paramètres.
@@ -367,10 +374,11 @@
\end{scope}
\bigskip
-Il est également possible de changer ces paramètres pour certaines lignes
-seulement grâce à la commande |\RowStyle| (cf.~p.~\pageref{RowStyle}).
+Il est également possible de changer ces paramètres pour certaines rangées du
+tableau seulement grâce à la commande |\RowStyle| (cf.~p.~\pageref{RowStyle}).
+
\medskip
\section{La clé baseline}
@@ -409,6 +417,8 @@
rangée (avec |{tabular}| ou |{array}| de \pkg{array}, il faut utiliser
|\firsthline|).
+
+
\smallskip
\begin{Code}[width=9cm]
\begin{enumerate}
@@ -442,8 +452,9 @@
\medskip
Il est également possible d'utiliser les outils de \pkg{booktabs}: |\toprule|,
|\bottomrule|, |\midrule|, etc., à condition, bien entendu, d'avoir chargé
-\pkg{booktabs}.\par\nobreak
+\pkg{booktabs}.
+\nobreak
\smallskip
\begin{Code}[width=9cm]
\begin{enumerate}
@@ -554,7 +565,7 @@
\end{bNiceArray}$
\end{Code}
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-\Block{3-3}{A} & & & 0 \\
+\Block[C]{3-3}{A} & & & 0 \\
& & & \Vdots \\
& & & 0 \\
\hline
@@ -585,7 +596,7 @@
\end{bNiceArray}$
\end{Code}
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-\Block{3-3}<\LARGE>{A} & & & 0 \\
+\Block[C]{3-3}<\LARGE>{A} & & & 0 \\
& & & \Vdots \\
& & & 0 \\
\hline
@@ -600,7 +611,7 @@
\smallskip
Les premières clés sont des outils rapides pour contrôler l'apparence du bloc :
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item \index{fill!clé de \texttt{\textbackslash Block}}
la clé \Definition{fill} prend en argument une couleur et remplit le bloc
avec cette couleur ;
@@ -616,8 +627,10 @@
\item \index{color!clé de \texttt{\textbackslash Block}}
la clé \Definition{color} prend en argument une couleur et l'applique au
contenu et trace également le cadre avec cette couleur ;
-\item \index{vlines!clé de \texttt{\textbackslash Block}} \index{hvlines!clé de
- \texttt{\textbackslash Block}} \index{hlines!clé de \texttt{\textbackslash Block}}
+\item \index{vlines!clé de \texttt{\textbackslash Block}}
+\index{hvlines!clé de
+ \texttt{\textbackslash Block}}
+\index{hlines!clé de \texttt{\textbackslash Block}}
les clés \Definition{hlines}, \Definition{vlines} et \Definition{hvlines}
tracent les filets correspondants dans le bloc\footnote{Néanmoins, les filets ne
sont pas tracés dans les sous-blocs du bloc, conformément à l'esprit de
@@ -628,7 +641,8 @@
la clé \Definition{line-width} fixe la largeur utilisée pour tracer les
filets (n'a d'intérêt que si |draw|, |hvlines|,
|hlines| ou |vlines| est utilisée) ;
-\item \index{rounded-corners!clé de \texttt{\textbackslash Block}} \index{Coins arrondis!pour un bloc}
+\item \index{rounded-corners!clé de \texttt{\textbackslash Block}}
+\index{Coins arrondis!pour un bloc}
la clé \Definition{rounded-corners} impose des coins arrondis (pour le
cadre dessiné par |draw| et le fond dessiné par |fill|)
avec un rayon égal à la valeur de cette clé (la valeur par défaut est
@@ -643,7 +657,8 @@
défaut, \pkg{nicematrix} ne charge pas TikZ mais uniquement \textsc{pgf}, qui
est une sous-couche de TikZ.
\begin{itemize}
-\item \index{borders (clé de \texttt{\textbackslash Block})} \index{tikzz at tikz!clé de «borders» de \texttt{\textbackslash Block}}
+\item \index{borders (clé de \texttt{\textbackslash Block})}
+\index{tikzz at tikz!clé de «borders» de \texttt{\textbackslash Block}}
La clé \Definition{borders} permet de ne tracer que certaines des bordures
du bloc : cette clé prend comme valeur une liste d'éléments parmi les suivants :
|left|, |right|, |top| et |bottom| ; on peut en fait, dans la liste qui est la
@@ -650,7 +665,7 @@
valeur de la clé |borders| mettre une entrée de la forme
|tikz={|\textsl{liste}|}| où \textsl{liste} est une liste de couples
\textsl{clé=valeur} de TikZ spécifiant les caractéristiques graphiques des
-traits qui seront dessinés (pour un exemple, voir p.~\pageref{tiretes}).
+traits qui seront dessinés (pour un exemple, voir p.~\pageref{ex:tiretes}).
\item \index{tikzz at tikz!clé de \texttt{\textbackslash Block}}
Quand la clé \Definition{tikz} est utilisée, le chemin TikZ correspondant
@@ -659,7 +674,7 @@
\textsc{pgf}), faute de quoi, une erreur sera levée.} en utilisant comme
options la valeur de cette clé |tikz| (qui doit donc être une liste de clés TikZ
applicables à un chemin de TikZ). Pour des exemples d'utilisation de cette clé
-|tikz|, voir p.~\pageref{tikz-key-examples}.
+|tikz|, voir p.~\pageref{ex:tikz-key}.
En fait, dans la liste des clés fournies à |tikz|, on peut mettre une clé
\Definition{offset}. Cette clé n'est pas fournie par TikZ mais par
@@ -672,7 +687,7 @@
\medskip
Enfin, il existe quelque clés techniques :
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item \index{name!clé de \texttt{\textbackslash Block}}
la clé \Definition{name} donne un nom au nœud TikZ rectangulaire
correspondant au bloc ; on peut utiliser ce nom avec TikZ dans le |\CodeAfter|
@@ -687,8 +702,8 @@
ailleurs, la commande |\TikzEveryCell| disponible dans le |\CodeAfter| et le
|\CodeBefore|, ne s'applique aux blocs avec la clé |transparent|.}
-Pour un exemple, voir la section~\ref{tikz-key-examples},
-page~\pageref{tikz-key-examples}.
+Pour un exemple, voir la section~\ref{ex:tikz-key},
+page~\pageref{ex:tikz-key}.
Attention : cette clé n'implique pas du tout que le contenu du bloc sera
transparent.
@@ -695,7 +710,7 @@
\end{itemize}
Il existe aussi des clés de positionnement horizontal et vertical du bloc qui
-sont décrites ci-dessous (cf. \ref{horizontal-bloc} p.~\pageref{horizontal-bloc}).
+sont décrites ci-dessous (cf. \ref{horizontal-pos-block} p.~\pageref{horizontal-pos-block}).
\interitem
@@ -726,7 +741,7 @@
\begin{center}
\begin{NiceTabular}{cw{c}{2cm}w{c}{3cm}c}
rose & tulipe & marguerite & dahlia \\
-violette & \Block[draw=red,fill=[RGB]{204,204,255},rounded-corners]{2-2}
+violette & \Block[C,draw=red,fill=[RGB]{204,204,255},rounded-corners]{2-2}
{\LARGE De très jolies fleurs} & & souci \\
pervenche & & & lys \\
arum & iris & jacinthe & muguet
@@ -737,14 +752,14 @@
\subsection{Les blocs mono-colonne}
Les blocs mono-colonne ont un comportement spécial.
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item La largeur naturelle du contenu de ces blocs est prise en compte pour la
largeur de la colonne courante.
-Dans les colonnes à largeur fixée (|p{...}|, |b{...}|, |m{...}|, |w{...}{...}|,
-|W{...}{...}|, |V{...}|, similaires aux colonnes |V| de \pkg{varwidth}, et~|X|,
-similaires aux colonnes |X| de \pkg{tabularx}), le contenu du bloc est mis en
-forme comme un paragraphe de cette largeur.
+Dans les colonnes à largeur fixée (|p{...}|, |b{...}|, |m{...}|,
+|w{...}{...}|, |W{...}{...}|, |V{...}|, similaires aux colonnes |V| de
+\pkg{varwidth}, et~|X|, similaires aux colonnes |X| de \pkg{tabularx}), le contenu
+du bloc est mis en forme comme un paragraphe de cette largeur.
\item La spécification d'alignement horizontal donnée par le type de colonne
(|c|, |r| ou |l|) est prise en compte pour le bloc. Pour un bloc dans une
@@ -754,7 +769,7 @@
c'est cette option d'alignement qui est transmise au bloc.
Notons enfin que le bloc peut avoir sa propre spécification d'alignement
-horizontal : cf.~\ref{horizontal-bloc} p.~\pageref{horizontal-bloc}.
+horizontal : cf.~\ref{horizontal-pos-block} p.~\pageref{horizontal-pos-block}.
\item Les spécifications de fontes imposées à une colonne via la construction
|>{...}| dans le préambule du tableau sont prises en compte pour les
@@ -815,10 +830,11 @@
\begin{itemize}
\item Un bloc mono-case permet d'utiliser la commande |\\| pour composer le
-bloc sur plusieurs lignes.
+bloc sur plusieurs lignes de texte.
\item On peut utiliser l'option d'alignement horizontal du bloc pour déroger à
-la consigne générale donnée dans le préambule pour cette colonne (cf.~\ref{horizontal-bloc} p.~\pageref{horizontal-bloc}).
+ la consigne générale donnée dans le préambule pour cette colonne (cf.~\ref{horizontal-pos-block}
+ p.~\pageref{horizontal-pos-block}).
\item On peut tracer un cadre autour du bloc avec la clé |draw| de la commande
|\Block| ou colorier le fond avec des bords arrondis avec les clés |fill| et
@@ -859,7 +875,7 @@
\subsection{Positionnement horizontal du contenu des blocs}
-\label{horizontal-bloc}
+\label{horizontal-pos-block}
La commande |\Block| admet les clés \Definition{l}, \Definition{c} et
\Definition{r} pour la position horizontale du contenu du bloc (calé à gauche,
@@ -926,7 +942,9 @@
Pour avoir un positionnement horizontal du contenu du bloc qui s'appuie sur les
limites des colonnes du tableau LaTeX (et non sur le contenu de ces colonnes),
il faut utiliser les clés \Definition{L}, \Definition{R} et \Definition{C} de la
-commande |\Block|.
+commande |\Block|.\footnote{On remarquera que les clés |L|, |R| et |C|
+ nécessitent moins de calculs que les clés |l|, |r| et |c|. Si on tient à
+ l'efficacité, on devrait écrire |\Block[C]| systématiquement par défaut.}
\medskip
Voici le même exemple avec la clé |C| pour le premier bloc.
@@ -1045,8 +1063,8 @@
\item Avec la clé \Definition{b}, la ligne de base de la dernière rangée du
contenu du bloc (rappelons que le contenu du bloc peut comporter plusieurs
-rangées séparées par |\\|) est alignée avec la ligne de base de la dernière des
-rangées du tableau impliquées dans le bloc.
+lignes de texte séparées par |\\|) est alignée avec la ligne de base de la
+dernière des rangées du tableau impliquées dans le bloc.
\item Avec la clé \Definition{T}, le contenu du bloc est calé vers le haut.
@@ -1073,7 +1091,7 @@
\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,\emph{t},l]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{t},L]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
@@ -1082,7 +1100,7 @@
\end{NiceTabular}
\end{Code}
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,t,l]{4-2}{two\\lines}
+\Block[fill=red!10,t,L]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
@@ -1114,7 +1132,7 @@
\bigskip
\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,\emph{T},l]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{T},\emph{L}]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
@@ -1123,7 +1141,7 @@
\end{NiceTabular}
\end{Code}
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,T,l]{4-2}{two\\lines}
+\Block[fill=red!10,T,L]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
@@ -1135,7 +1153,7 @@
\bigskip
\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,\emph{B},r]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{B},\emph{R}]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
@@ -1144,7 +1162,7 @@
\end{NiceTabular}
\end{Code}
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,B,r]{4-2}{two\\lines}
+\Block[fill=red!10,B,R]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
@@ -1256,7 +1274,7 @@
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|
+de rangée incomplète ou de double filet horizontal spécifié par |\hline\hline|
(il n'y a pas besoin d'utiliser l'extension \pkg{hhline}).
\medskip
@@ -1310,9 +1328,9 @@
\end{NiceArray}$
\medskip
-Il reste néanmoins possible de définir un spécificateur, nommé par exemple
-|I|, pour tracer des filets verticaux avec le comportement standard de
-\pkg{array} :
+Il reste néanmoins possible de définir un spécificateur, nommé par
+exemple~|I|, pour tracer des filets verticaux avec le comportement standard de \pkg{array}
+:
%
\begin{Verbatim}
\newcolumntype{I}{!{\vrule}}
@@ -1319,11 +1337,9 @@
\end{Verbatim}
-
-
\subsubsection{La commande \textbackslash cline}
-\label{remark-cline}
+\label{cline}
\index{cline@\texttt{\textbackslash cline} (commande de LaTeX)}
Les traits verticaux et horizontaux que l'on insère avec |\hline| et le
@@ -1446,7 +1462,7 @@
Les outils proposés par \pkg{nicematrix} pour tracer des filets sont les
suivants :
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item les clés |hlines|, |vlines|, |hvlines| et |hvlines-except-borders|;
\item le spécificateur «\verb+|+» dans le préambule (pour les environnements à
préambule) ;
@@ -1587,7 +1603,7 @@
\begin{center}
\begin{NiceTabular}{cccc}[hvlines,rules/color=blue,rules/width=1pt]
rose & tulipe & marguerite & dahlia \\
-violette & \Block[draw=red]{2-2}{\LARGE fleurs} & & souci \\
+violette & \Block[C,draw=red]{2-2}{\LARGE fleurs} & & souci \\
pervenche & & & lys \\
arum & iris & jacinthe & muguet
\end{NiceTabular}
@@ -1604,7 +1620,7 @@
La clé \Definition{hvlines-except-borders} est similaire à la clé |hvlines| mais
ne trace pas les filets sur les bords horizontaux et verticaux du tableau. Pour
un exemple d'utilisation de cette clé, voir la partie «Exemple d'utilisation
-avec \pkg{tcolorbox}» p.~\pageref{tcolorbox}.
+avec \pkg{tcolorbox}» p.~\pageref{ex:tcolorbox}.
\medskip
@@ -1828,7 +1844,7 @@
utiliser pour tracer des filets horizontaux partiels (de manière similaire à
|\cline|, d'où le nom |ccommand|) : l'argument de cette commande est une liste
d'intervalles de colonnes spécifiés par la syntaxe $i$ ou $i$-$j$ ;\footnote{Il
- est recommandé de n'utiliser ces commandes qu'une seule fois par ligne car
+ est recommandé de n'utiliser ces commandes qu'une seule fois par rangée car
chaque utilisation crée un espace vertical entre les rangées correspondant à
la largeur totale du trait qui sera tracé.}
@@ -1849,8 +1865,9 @@
\begin{itemize}
-\item \emph{Première possibilité}\par\nobreak
+\item \emph{Première possibilité}
+\nobreak
Il est possible de spécifier des filets multiples, colorés avec une couleur
entre les filets (comme on peut le faire avec \pkg{colortbl} par exemple).
@@ -1893,7 +1910,7 @@
\begin{center}
\begin{NiceTabular}{lcIcIc}[custom-line = {letter=I, color=blue}]
\hline
- & \Block{1-3}{dimensions} \\
+ & \Block[C]{1-3}{dimensions} \\
& L & l & H \\
\hline
Produit A & 3 & 1 & 2 \\
@@ -1949,11 +1966,12 @@
\bigskip
-\item \emph{Deuxième possibilité}\par\nobreak
+\item \emph{Deuxième possibilité}\par
\index{tikzz at tikz!clé de «custom-line»}
\index{total-width (clé de «custom-line»)}
+\nobreak
On peut utiliser la clé \Definition{tikz} (si TikZ est chargé, \pkg{nicematrix} ne
chargeant par défaut que \textsc{pgf}). Dans ce cas-là, le filet est tracé
directement avec TikZ en utilisant comme paramètres la valeur de la clé |tikz|
@@ -2006,12 +2024,13 @@
\end{center}
\medskip
-\item \emph{Troisième possibilité} : la clé \Definition{dotted}\par\nobreak
+\item \emph{Troisième possibilité} : la clé \Definition{dotted}
\label{dotted}
\index{dotted (clé de «custom-line»)}
\indexcommand{hdottedline}
\indexcommand{cdottedline}
+\nobreak
Comme on le voit dans l'exemple précédent, les pointillés tracés par la clé
|dotted| de TikZ ne sont pas ronds. C'est pourquoi l'extension \pkg{nicematrix}
propose dans la clé |custom-line| une clé |dotted| qui va tracer des pointillés
@@ -2106,11 +2125,11 @@
\medskip
Il y a néanmoins deux inconvénients :
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item L'extension \pkg{colortbl} patche \pkg{array}, ce qui entraîne des
incompatibilités (par exemple avec la commande |\hdotsfor|).
-\item L'extension \pkg{colortbl} construit le tableau ligne par ligne, en
+\item L'extension \pkg{colortbl} construit le tableau rangée par rangée, en
alternant rectangles colorés, filets et contenu des cases. Le \textsc{pdf}
résultant déroute certains lecteurs de \textsc{pdf} et on a parfois des artefacts
d'affichage.
@@ -2129,7 +2148,7 @@
individuellement, même si on utilise |\columncolor| ou |\rowcolor|.
Concernant ce phénomène, Adobe Reader donne de meilleurs résultats que
-MuPDF.
+MuPDF (les versions récentes de MuPDF semblent avoir résolu ce problème).
\end{itemize}
L'extension \pkg{nicematrix} propose des outils qui permettent d'éviter ces
@@ -2143,13 +2162,13 @@
\index{CodeBefore@\texttt{\textbackslash CodeBefore}...\texttt{\textbackslash Body}}
\index{Body@\texttt{\textbackslash Body}|see{\texttt{\textbackslash CodeBefore}}}
-L'extension \pkg{nicematrix} propose des outils (indépendants de \pkg{colortbl})
-pour tracer d'abord les rectangles colorés, puis le contenu des cases et les
-filets. Cette manière de faire est plus dans l'esprit du «modèle du peintre» des
-formats PostScript et \textsc{pdf} et convient donc mieux aux lecteurs de
-\textsc{pdf}. L'inconvénient est qu'elle nécessite plusieurs compilations
-successives.\footnote{Si vous utilisez Overleaf, Overleaf effectue
- automatiquement un nombre de compilations suffisant (en utilisant |latexmk|).}
+L'extension \pkg{nicematrix} propose des outils pour tracer d'abord les
+rectangles colorés, puis le contenu des cases et les filets. Cette manière de
+faire est plus dans l'esprit du «modèle du peintre» des formats PostScript et
+\textsc{pdf} et convient donc mieux aux lecteurs de \textsc{pdf}. L'inconvénient
+est qu'elle nécessite plusieurs compilations successives.\footnote{Si vous
+ utilisez Overleaf, Overleaf effectue automatiquement un nombre de compilations
+ suffisant (en utilisant |latexmk|).}
\medskip
L'extension \pkg{nicematrix} fournit une clé |code-before| pour du code qui sera
@@ -2216,7 +2235,7 @@
Toutes ces commandes acceptent un argument optionnel, entre crochets et en
première position. Cet argument optionel peut contenir deux éléments (séparés
par une virgule) :
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item le modèle colorimétrique (|RGB|, |rgb|, |HTML|, etc.) comme spécifié par
l'extension \pkg{xcolor} ;
\item \index{opacity!clé des commandes comme\newline \texttt{\textbackslash
@@ -2232,13 +2251,13 @@
On détaille maintenant ces différentes commandes.
\medskip
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item La commande \Definition{\textbackslash cellcolor} tient son nom de la
commande |\cellcolor| de \pkg{colortbl}.
Elle prend en arguments obligatoires une couleur et une liste de cases sous le
-format $i$-$j$ où $i$ est le numéro de ligne et $j$ le numéro de colonne. Malgré
-son nom, elle peut aussi colorier une ligne avec la syntaxe $i$- ou bien une
+format $i$-$j$ où $i$ est le numéro de rangée et $j$ le numéro de colonne. Malgré
+son nom, elle peut aussi colorier une rangée avec la syntaxe $i$- ou bien une
colonne avec la syntaxe~-$j$.
\medskip
@@ -2407,9 +2426,12 @@
\textsl{clé=valeur} comme argument optionnel en dernière position (l'argument
optionnel en première position correspond à l'espace colorimétrique). Les clés
disponibles sont |cols|, |restart| et |respect-blocks|.
-\index{cols (clé de \texttt{\textbackslash rowcolors} du \texttt{\textbackslash CodeBefore})}
-\index{restart (clé de \texttt{\textbackslash rowcolors} du \texttt{\textbackslash CodeBefore})}
-\index{respect-blocks (clé de \texttt{\textbackslash rowcolors} du\newline \texttt{\textbackslash CodeBefore})}
+\index{cols (clé de \texttt{\textbackslash rowcolors} du
+ \texttt{\textbackslash CodeBefore})}
+\index{restart (clé de \texttt{\textbackslash rowcolors} du
+ \texttt{\textbackslash CodeBefore})}
+\index{respect-blocks (clé de \texttt{\textbackslash rowcolors} du\newline
+ \texttt{\textbackslash CodeBefore})}
\begin{itemize}
\item La clé \Definition{cols} décrit un ensemble de colonnes sur lesquelles
portera l'effet de |\rowcolors|. Cet ensemble de colonnes est une liste
@@ -2543,8 +2565,10 @@
tableau : cf~p.~\pageref{iRow}. Cela permet un ajustement de la gradation des
couleurs à la taille du tableau.}).
-\index{definecolorseries@\texttt{\textbackslash definecolorseries} (commande de \pkg{xcolor})}
-\index{resetcolorseries@\texttt{\textbackslash resetcolorseries} (commande de \pkg{xcolor})}
+\index{definecolorseries@\texttt{\textbackslash definecolorseries}
+ (commande de \pkg{xcolor})}
+\index{resetcolorseries@\texttt{\textbackslash resetcolorseries}
+ (commande de \pkg{xcolor})}
\smallskip
\begin{Code}[width=12cm]
@@ -2623,7 +2647,8 @@
\medskip
L'exemple précédent utilise les clés |first-row| et |first-col| qui sont
-décrites dans la partie sur les rangées et colonnes «extérieures» (cf.~p.~\pageref{exterior}).
+décrites dans la partie sur les rangées et colonnes «extérieures»
+(cf.~p.~\pageref{exterior}).
Comme on le voit, \emph{par défaut}, les commandes de coloriage décrites précédemment ne
s'appliquent pas dans ces rangées et colonnes «extérieures».
@@ -2729,11 +2754,14 @@
\bigskip
-\index{EmptyRow@\texttt{\textbackslash EmptyRow} (commande du \texttt{\textbackslash CodeBefore})}
-\index{EmptyColumn@\texttt{\textbackslash EmptyColumn} (commande du \texttt{\textbackslash CodeBefore})}
+\index{EmptyRow@\texttt{\textbackslash EmptyRow} (commande du
+ \texttt{\textbackslash CodeBefore})}
+\index{EmptyColumn@\texttt{\textbackslash EmptyColumn} (commande du
+ \texttt{\textbackslash CodeBefore})}
-\colorbox{yellow!50}{\textbf{Nouveau 7.1}}\par\nobreak
+\colorbox{yellow!50}{\textbf{Nouveau 7.1}}
+\nobreak
\smallskip
On peut aussi, dans le |\CodeBefore|, utiliser les commandes
\DefinitionCommande{EmptyColumn} et \DefinitionCommande{EmptyRow}. La commande
@@ -2744,7 +2772,7 @@
\medskip
\begin{Code}[width=10cm]
-\begin{NiceTabular}{ccccc}[hvlines]
+\begin{NiceTabular}{ccccc}[hvlines,no-cell-nodes]
\CodeBefore
\rowcolor{blue!15}{1}
\emph{\EmptyColumn{3}}
@@ -2753,7 +2781,7 @@
un & \Block{}{deux\\ lignes} && trois & quatre \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccccc}[hvlines]
+\begin{NiceTabular}{ccccc}[hvlines,no-cell-nodes]
\CodeBefore
\rowcolor{blue!15}{1}
\EmptyColumn{3}
@@ -2774,24 +2802,24 @@
\index{columncolor@\texttt{\textbackslash columncolor}!commande dans le
préambule d'un environnement}
-On peut accéder aux outils de coloriage précédents avec une syntaxe proche de
-celle proposée par \pkg{colortbl} (même si \pkg{colortbl} n'est pas chargé).
+L'extension \pkg{nicematrix} propose aussi des commandes de coloriage à utiliser
+directement dans le tableau (comme celles de l'extension \pkg{colortbl}).
-On a alors accès aux commandes suivantes (les trois premières sont inspirées par
-\pkg{colortbl} mais sont indépendantes de \pkg{colortbl}) :
-\begin{itemize}
+Les commandes sont les suivantes (les trois premières sont inspirées par les
+commandes similaires de \pkg{colortbl}).
+\begin{itemize}[beginpenalty=10000]
\item \DefinitionCommande{cellcolor} qui colorie la case courante\footnote{Cette
- commande |\cellcolor| supprimera les espaces qui la suivent, ce que ne fait
- pas la commande |\cellcolor| de \pkg{colortbl}. De plus, si on définit une
+ commande |\cellcolor| supprimera les espaces qui la suivent (ce que ne fait
+ pas la commande |\cellcolor| de \pkg{colortbl}). De plus, si on définit une
fonction au-dessus de |\cellcolor|, il faudra une fonction protégée au sens de
TeX (alors que si c'était la commande |\cellcolor| de \pkg{colortbl}, il
-faudrait une fonction \emph{fully expandable}).} ;
+faudrait au contaire une fonction \emph{fully expandable}).} ;
\item \DefinitionCommande{rowcolor} à utiliser dans une case et qui colorie le
reste de la rangée;\footnote{Si vous souhaitez une commande pour colorier les
$n$~rangées suivantes, considérez la commande |\RowStyle| et sa clé
- |rowcolor|, p.~\pageref{RowStyle}.}
+ |fill|, p.~\pageref{RowStyle}.}
\item \DefinitionCommande{columncolor} à utiliser dans le préambule du tableau
-de la même manière que la commande éponyme de \pkg{colortbl} (néanmoins,
+de la même manière que la commande homonyme 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; en revanche, elle ne prend pas les deux arguments
@@ -2909,7 +2937,7 @@
\medskip
Elle prend aussi en premier argument optionnel, entre crochets, une liste de
couples \textsl{clé=valeur}.
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item \index{nb-rows (clé de \texttt{\textbackslash RowStyle})}
La clé \Definition{nb-rows} indique le nombre de rangées consécutives concernées par
les spécifications de cette commande (une valeur |*| signifie que toutes les
@@ -2916,7 +2944,7 @@
rangées restantes seront concernées).
\item Les clés \Definition{cell-space-top-limit}, \Definition{cell-space-bottom-limit}
et \Definition{cell-space-limits} sont disponibles avec le même effet que les
-clés globales de même nom (cf. p.~\pageref{cell-space}).
+clés globales de même nom (cf. p.~\pageref{cell-space-limits}).
\item
\index{rowcolor (clé de \texttt{\textbackslash RowStyle})}
@@ -2923,7 +2951,7 @@
\index{fill!clé de \texttt{\textbackslash RowStyle}}
\index{opacity!clé de \texttt{\textbackslash RowStyle}}
\index{rounded-corners!clé de \texttt{\textbackslash RowStyle}}
-La clé \Definition{rowcolor} (alias : \Definition{fill}) fixe la couleur de fond
+La clé \Definition{fill} (alias : \Definition{rowcolor}) fixe la couleur de fond
et la clé \Definition{opacity}\footnote{Attention : cette clé génère des
instructions de transparence dans le \textsc{pdf} résultant et certains
lecteurs de \textsc{pdf} n'acceptent pas la transparence.} l'opacité de cette
@@ -2951,7 +2979,7 @@
\hline
\emph{\RowStyle[cell-space-limits=3pt]{\rotate}}
premier & deuxième & troisième & quatrième \\
-\emph{\RowStyle[nb-rows=2,color=white,rowcolor=blue!50]{\sffamily}}
+\emph{\RowStyle[nb-rows=2,color=white,fill=blue!50]{\sffamily}}
1 & 2 & 3 & 4 \\
I & II & III & IV
\end{NiceTabular}
@@ -2961,7 +2989,7 @@
\hline
\RowStyle[cell-space-limits=3pt]{\rotate}
premier & deuxième & troisième & quatrième \\
-\RowStyle[nb-rows=2,color=white,rowcolor=blue!50]{\sffamily}
+\RowStyle[nb-rows=2,color=white,fill=blue!50]{\sffamily}
1 & 2 & 3 & 4 \\
I & II & III & IV \\
\end{NiceTabular}
@@ -3030,8 +3058,9 @@
la largeur de la case la plus large du tableau.\footnote{Le résultat est atteint
dès la première compilation (mais PGF-TikZ écrivant des informations dans le
fichier |aux|, un message demandant une deuxième compilation
- apparaîtra).}\par\nobreak
+ apparaîtra).}
+\nobreak
\medskip
\begin{Code}[width=10cm]
$\begin{pNiceMatrix}[\emph{columns-width = auto}]
@@ -3049,8 +3078,9 @@
\medskip
Sans surprise, il est possible de fixer la largeur minimale de toutes les
colonnes de tous les tableaux dans une certaine portion de document avec la
-commande |\NiceMatrixOptions|.\par\nobreak
+commande |\NiceMatrixOptions|.
+\nobreak
\medskip
\begin{Code}[width=8.5cm]
\emph{\NiceMatrixOptions{columns-width=10mm}}
@@ -3138,9 +3168,9 @@
Comme avec les extensions \pkg{tabu}\footnote{L'extension \pkg{tabu} est
maintenant considérée comme obsolète.} et \pkg{tabularray}, le spécificateur |X|
accepte entre crochets un argument optionnel qui est une liste de clés.
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item On peut spécifier un poids pour la colonne en mettant directement un
-entier positif comme argument du spécificateur |X|. Par exemple, une colonne
+nombre positif comme argument du spécificateur |X|. Par exemple, une colonne
|X[2]| aura une largeur double de celle d'une colonne |X| (qui a un poids de
1).\footnote{Les valeurs négatives pour les poids, comme proposées par
\pkg{tabu} (maintenant obsolète), ne sont \emph{pas} prises en charge par
@@ -3152,11 +3182,11 @@
\pkg{ragged2e} qui sont utilisées, pour un meilleur résultat.}
\item On peut spécifier l'alignement vertical avec l'une des lettres |t| (alias
|p|), |m| et |b| (qui construisent respectivement des colonnes de types |p|, |m|
-et |b|). La valeur par défaut est |t|.
+et |b|). La valeur initiale est |t|.
\end{itemize}
\begin{Code}
-\begin{NiceTabular}\emph{[width=9cm]{X[2,l]X[l]}}[hvlines]
+\begin{NiceTabular}\emph{[width=9cm]{X[c,m]X[0.5,c,m]}}[hvlines]
Un texte relativement long qui tient sur plusieurs lignes. &
Un texte relativement long qui tient sur plusieurs lignes. \\
Un texte plus court. & Un texte plus court.
@@ -3165,7 +3195,7 @@
\begin{center}
-\begin{NiceTabular}[width=9cm]{X[2,l]X[l]}[hvlines]
+\begin{NiceTabular}[width=9cm]{X[c,m]X[0.5,c,m]}[hvlines]
Un texte relativement long qui tient sur plusieurs lignes. &
Un texte relativement long qui tient sur plusieurs lignes. \\
Un texte plus court. & Un texte plus court.
@@ -3300,7 +3330,7 @@
\end{pNiceMatrix}$
\end{Code}
%
-\[\begin{pNiceMatrix}[first-row,last-row,first-col,last-col,nullify-dots]
+\[\begin{pNiceMatrix}[first-row,last-row=5,first-col,last-col=5,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 \\
@@ -3461,8 +3491,9 @@
avec l'option~|color|.\footnote{Il est aussi possible de changer la couleur de
toutes ces lignes pointillées avec l'option |xdots/color| (\textsl{xdots} pour
rappeler que cela s'applique à |\Cdots|, |\Ldots|, |\Vdots|, etc.) : cf.
- p.~\pageref{customization}. }\par\nobreak
+ p.~\pageref{customization}. }
+\nobreak
\medskip
\begin{Code}[width=10cm]
\begin{bNiceMatrix}
@@ -3483,8 +3514,9 @@
\interitem Pour représenter la matrice nulle, on peut choisir d'utiliser le
-codage suivant :\par\nobreak
+codage suivant :
+\nobreak
\medskip
\begin{Code}[width=10cm]
\begin{bNiceMatrix}
@@ -3503,8 +3535,9 @@
On peut néanmoins souhaiter une matrice plus grande. Habituellement, dans un tel
cas, les utilisateurs de LaTeX ajoutent une nouvelle ligne et une nouvelle
colonne. Il est possible d'utiliser la même méthode avec \pkg{nicematrix}
-:\par\nobreak
+:
+\nobreak
\medskip
\begin{Code}[width=10cm]
\begin{bNiceMatrix}
@@ -3515,10 +3548,10 @@
\end{bNiceMatrix}
\end{Code}
$\begin{bNiceMatrix}
-0 & \Cdots & \Cdots & 0 \\
-\Vdots & & & \Vdots \\
-\Vdots & & & \Vdots \\
-0 & \Cdots & \Cdots & 0
+0 & \Cdots & & 0 \\
+\Vdots & & & \\
+ & & & \Vdots \\
+0 & & \Cdots & 0
\end{bNiceMatrix}$
\medskip
@@ -3527,8 +3560,9 @@
\medskip
En fait, dans cet exemple, il aurait été possible de tracer la même matrice plus
-rapidement avec le codage suivant (parmi d'autres) :\par\nobreak
+rapidement avec le codage suivant (parmi d'autres) :
+\nobreak
\medskip
\begin{Code}[width=10cm]
\begin{bNiceMatrix}
@@ -3559,8 +3593,9 @@
Toutefois, une commande~|\hspace*| pourrait interférer dans la construction des
lignes en pointillés. C'est pourquoi l'extension \pkg{nicematrix} fournit une
commande~|\Hspace| qui est une variante de |\hspace| transparente pour la
-construction des lignes en pointillés de \pkg{nicematrix}.\par\nobreak
+construction des lignes en pointillés de \pkg{nicematrix}.
+\nobreak
\medskip
\begin{Code}[width=10cm]
\begin{bNiceMatrix}
@@ -3580,8 +3615,9 @@
\index{nullify-dots}
Considérons la matrice suivante qui a été composée classiquement avec
-l'environnement |{pmatrix}| de \pkg{amsmath}.\par\nobreak
+l'environnement |{pmatrix}| de \pkg{amsmath}.
+\nobreak
\medskip
\begin{Code}[width=10cm]
$A = \begin{pmatrix}
@@ -3597,8 +3633,9 @@
\medskip
Si nous ajoutons des instructions |\ldots| dans la seconde rangée, la géométrie
-de la matrice est modifiée.\par\nobreak
+de la matrice est modifiée.
+\nobreak
\medskip
\begin{Code}[width=10cm]
$B = \begin{pmatrix}
@@ -3614,8 +3651,9 @@
\medskip
Par défaut, avec \pkg{nicematrix}, si nous remplaçons |{pmatrix}| par
|{pNiceMatrix}| et |\ldots| par |\Ldots|, la géométrie de la matrice n'est pas
-changée.\par\nobreak
+changée.
+\nobreak
\medskip
\begin{Code}[width=10cm]
$C = \begin{pNiceMatrix}
@@ -3632,8 +3670,9 @@
On pourrait toutefois préférer la géométrie de la première matrice $A$ et
vouloir avoir la même géométrie avec une ligne en pointillés continue dans la
seconde rangée. C'est possible en utilisant l'option \Definition{nullify-dots}
-(et une seule instruction |\Ldots| suffit).\par\nobreak
+(et une seule instruction |\Ldots| suffit).
+\nobreak
\medskip
\begin{Code}[width=10cm]
$D = \begin{pNiceMatrix}[\emph{nullify-dots}]
@@ -3710,12 +3749,10 @@
\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 |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|). Néanmoins, dans le cadre de
-\pkg{nicematrix}, on conseille de ne pas utiliser \pkg{colortbl} mais d'utiliser
-les outils de nicematrix pour le coloriage des tableaux (cf.
-p.~\pageref{color-in-code-before}).
+ chargée avec l'option |table|, l'extension \pkg{colortbl} est chargée.} est
+chargée (néanmoins, dans le cadre de \pkg{nicematrix}, le chargement de
+\pkg{colortbl} est déconseillé puisque nicematrix propose ses propres commandes
+pour le coloriage des tableaux: cf. p.~\pageref{color-in-code-before}).
\medskip
L'extension \pkg{nicematrix} propose aussi une commande
@@ -3777,8 +3814,9 @@
\smallskip
\begin{itemize}
-\item L'option \Definition{renew-dots}\par\nobreak
+\item L'option \Definition{renew-dots}
+\nobreak
Avec cette option, les commandes |\ldots|, |\cdots|, |\vdots|, |\ddots|,
|\iddots|\footnotemark[\thefniddots] et |\hdotsfor| sont redéfinies dans les
environnements de \pkg{nicematrix} et agissent alors comme |\Ldots|, |\Cdots|,
@@ -3786,8 +3824,9 @@
suspension «automatiques» de |amsmath|) est aussi redéfinie et se comporte comme
|\Ldots|.
-\item L'option \Definition{renew-matrix}\par\nobreak
+\item L'option \Definition{renew-matrix}
+\nobreak
Avec cette option, l'environnement |{matrix}| est redéfini et se comporte comme
|{NiceMatrix}| et il en est de même pour les cinq variantes.
\end{itemize}
@@ -3794,8 +3833,9 @@
\medskip
Par conséquent, avec les options |renew-dots| et |renew-matrix|, un code
-classique donne directement le résultat fourni par \pkg{nicematrix}.\par\nobreak
+classique donne directement le résultat fourni par \pkg{nicematrix}.
+\nobreak
\medskip
\begin{scope}
\NiceMatrixOptions{renew-dots,renew-matrix}
@@ -3849,20 +3889,21 @@
\bigskip
-Avec la clé \Definition{xdots/horizontal-labels}, les labels restent
-horizontaux.\par\nobreak
+Avec la clé \Definition{horizontal-label}, le label reste
+horizontal.
+\nobreak
\smallskip
\begin{Code}[width=10cm]
-$\begin{bNiceMatrix}[\emph{xdots/horizontal-labels}]
+$\begin{bNiceMatrix}
1 & \hspace*{1cm} & 0 \\[8mm]
- & \emph{\Ddots^{n \text{ fois}}} & \\
+ & \emph{\Ddots[horizontal-label]^{n \text{ fois}}} & \\
0 & & 1
\end{bNiceMatrix}$
\end{Code}
-$\begin{bNiceMatrix}[xdots/horizontal-labels]
+$\begin{bNiceMatrix}
1 & \hspace*{1cm} & 0 \\[8mm]
- & \Ddots^{n \text{ fois}} & \\
+ & \Ddots[horizontal-label]^{n \text{ fois}} & \\
0 & & 1
\end{bNiceMatrix}$
@@ -3871,14 +3912,14 @@
\subsection{Personnalisation des lignes en pointillés}
\label{customization}
-\index{color!clé pour les lignes pointillées}
-\index{radius (clé pour les lignes pointillées)}
-\index{inter (clé pour les lignes pointillées)}
-\index{line-style (clé pour les lignes pointillées)}
-\index{shorten (clé pour les lignes pointillées)}
-\index{shorten-end (clé pour les lignes pointillées)}
-\index{shorten-start (clé pour les lignes pointillées)}
-\index{horizontal-labels (clé pour les lignes pointillées)}
+\index{color!clé des lignes pointillées}
+\index{radius (clé des lignes pointillées)}
+\index{inter (clé des lignes pointillées)}
+\index{line-style (clé des lignes pointillées)}
+\index{shorten (clé des lignes pointillées)}
+\index{shorten-end (clé des lignes pointillées)}
+\index{shorten-start (clé des lignes pointillées)}
+\index{horizontal-label(s) (clé des lignes pointillées)}
Les lignes pointillées tracées par |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|,
@@ -3886,8 +3927,8 @@
|\CodeAfter| décrite p.~\pageref{line-in-code-after}) peuvent être paramétrées
par les options suivantes (que l'on met entre crochets après la commande) :
%
-\begin{itemize}
-\item |horizontal-labels| ;
+\begin{itemize}[beginpenalty=10000]
+\item |horizontal-label(s)| ;
\item |color| ;
\item |radius| ;
\item |shorten-start|, |shorten-end| et |shorten| ;
@@ -3895,12 +3936,17 @@
\item |line-style|.
\end{itemize}
+\smallskip
+Pour une commande individuelle, on peut utiliser \Definition{horizontal-label}
+au singulier.
+
+\smallskip
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|
(\textsl{xdots} pour rappeler que cela s'applique à |\Cdots|, |\Ldots|,
|\Vdots|, etc.), ce qui fait que leurs noms deviennent :
%
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item |xdots/horizontal-labels| ;
\item |xdots/color| ;
\item |xdots/radius| ;
@@ -3943,8 +3989,9 @@
dépendante de la fonte courante).
\medskip
-\textbf{L'option \Definition{xdots/line-style}}\par\nobreak
+\textbf{L'option \Definition{xdots/line-style}}
+\nobreak
\smallskip
Il faut savoir que, par défaut, les lignes de TikZ tracées avec le paramètre
|dotted| sont composées de points carrés et non pas ronds.\footnote{La raison de
@@ -3979,8 +4026,9 @@
\medskip
Voici par exemple une matrice tridiagonale avec le style |loosely dotted|
-:\par\nobreak
+:
+\nobreak
\medskip
\begin{Code}
$\begin{pNiceMatrix}[nullify-dots,\emph{xdots/line-style=loosely dotted}]
@@ -4040,9 +4088,9 @@
Les commandes |\Hbrace| et |\Vbrace| ont la même syntaxe. Elles prennent trois
arguments:
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item un premier argument optionnel (entre crochets) pour une liste de couples
-\textsl{clé=valeur} : les clés autorisées sont |color|, |horizontal-labels|,
+\textsl{clé=valeur} : les clés autorisées sont |color|, |horizontal-label|,
|shorten|, |shorten-start| et |shorten-end|.
\item un deuxième argument, obligatoire, qui est le nombre de colonnes (pour
@@ -4132,7 +4180,7 @@
\end{bNiceMatrix}$
\end{Code}
$\begin{bNiceMatrix}[margin,hvlines]
-\Block{3-3}<\LARGE>{A} & & & 0 \\
+\Block[C]{3-3}<\LARGE>{A} & & & 0 \\
& \hspace*{1cm} & & \Vdots \\
& & & 0 \\
0 & \Cdots& 0 & 0
@@ -4204,13 +4252,13 @@
remarquera la compatibilité avec la clé |t|).
\smallskip
-\begin{Code}
+\begin{Verbatim}
On définit $f$ par\quad
\begin{NiceTabular}[t]{\{ll}
$f(x) = 0$ & si $x$ est négatif \\
$f(x) = 1-e^x$ & si $x$ est positif
\end{NiceTabular}
-\end{Code}
+\end{Verbatim}
\smallskip
\begin{center}
@@ -4245,8 +4293,8 @@
\bigskip
Pour des constructions plus complexes, avec en particulier des délimiteurs ne
couvrant pas toutes les rangées, on aura intérêt à considérer la commande
-|\SubMatrix| disponible dans le |\CodeAfter| et le |\CodeBefore|: voir la partie~\ref{sub-matrix},
-p.~\pageref{sub-matrix}.
+|\SubMatrix| disponible dans le |\CodeAfter| et le |\CodeBefore|: voir la
+partie~\ref{sub-matrix}, p.~\pageref{sub-matrix}.
@@ -4291,13 +4339,14 @@
\subsection{La commande \textbackslash line dans le \textbackslash CodeAfter}
\label{line-in-code-after}
-\index{line@\texttt{\textbackslash line} (commande du \texttt{\textbackslash CodeAfter})}
+\index{line@\texttt{\textbackslash line} (commande du
+ \texttt{\textbackslash CodeAfter})}
La commande \DefinitionCommande{line} permet de tracer directement des lignes en
pointillés entre les cases. Elle prend deux arguments correspondant aux cases ou
blocs à relier. Chacun de ces deux arguments peut être :
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item une spécification de case de la forme $i$-$j$ où $i$ est le numéro de
-ligne et $j$ est le numéro de colonne ;
+rangée et $j$ est le numéro de colonne ;
\item le nom d'un bloc (créé avec la commande |\Block| en utilisant la clé
|name| de cette commande).
\end{itemize}
@@ -4368,7 +4417,7 @@
La commande \DefinitionCommande{SubMatrix} permet de positionner des délimiteurs
sur une partie du tableau, partie qui est considérée comme une sous-matrice. La
commande |\SubMatrix| prend cinq arguments :
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item le premier argument est le délimiteur gauche qui peut être n'importe
quel délimiteur extensible de LaTeX : |(|, |[|, |\{|, |\langle|, |\lgroup|,
|\lfloor|, etc. mais aussi le délimiteur nul |.| ;
@@ -4467,7 +4516,7 @@
\bigskip
Les clés disponibles pour la commande |\SubMatrix| sont les suivantes :
%
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item
\index{left-xshift (clé de \texttt{\textbackslash SubMatrix})}
\index{right-xshift (clé de \texttt{\textbackslash SubMatrix})}
@@ -4576,8 +4625,8 @@
lignes en pointillés continues (créées par |\Cdots|, |\Vdots|, etc.) qui ont
une extrémité ouverte.
-Pour un exemple, voir \ref{submatrix-in-codebefore}
-p.~\pageref{submatrix-in-codebefore}.
+Pour un exemple, voir \ref{ex:submatrix}
+p.~\pageref{ex:submatrix}.
\bigskip
En dépit de son nom, la commande |\SubMatrix| peut également être utilisée dans
@@ -4611,14 +4660,15 @@
\vspace{1cm}
\emph{Attention} : La fonctionnalité suivante est fragile et ne fonctionne pas
-avec |latex|--|dvips|--|ps2pdf|.\par\nobreak
+avec |latex|--|dvips|--|ps2pdf|.
+\nobreak
\smallskip
La clé \Definition{code} de la commande |\SubMatrix| permet d'insérer du code
après la création de la matrice. Elle a surtout pour vocation d'être utilisée
pour insérer des instructions TikZ, sachant que, dans les instructions TikZ
insérées dans cette clé, les nœuds de la forme \texttt{i-j.\textsl{anchor}} ou
-\verb+i-|j+ sont interprétés avec |i| et |j| étant des numéros de ligne et
+\verb+i-|j+ sont interprétés avec |i| et |j| étant des numéros de rangée et
colonne \emph{relatifs à la sous-matrice}.\footnote{Attention : la syntaxe
\texttt{j\string|-i} n'est \emph{pas} autorisée.}
@@ -4675,7 +4725,7 @@
Les commandes \DefinitionCommande{OverBrace} and \DefinitionCommande{UnderBrace}
permettent de placer des accolades horizontales sur une partie du tableau. Ces
commandes prennent trois arguments :
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item le premier argument est le coin supérieur gauche du rectangle de cases
impliquées dans l'accolade avec la syntaxe habituelle $i$|-|$j$ où $i$ est le
numéro de rangée et $j$ le numéro de colonne ;
@@ -4687,7 +4737,7 @@
|\OverBrace|) ou au-dessous (pour |\UnderBrace|).
Il est possible de mettre des commandes |\\| dans ce dernier argument pour
-fomater le label sur plusieurs lignes.
+formater le label sur plusieurs lignes de texte.
\end{itemize}
\bigskip
@@ -4724,7 +4774,7 @@
Les commandes |\OverBrace| et |\UnderBrace| acceptent en fait un premier
argument optionnel (entre crochets) pour une liste de couples
\textsl{clé=valeur}. Les clés disponibles sont les suivantes :
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item \Definition{left-shorten} et \Definition{right-shorten} qui ne prennent
pas de valeur ; quand |left-shorten| est utilisée, l'abscisse de l'extrémité de
gauche de l'accolade est calculée à partir du contenu du sous-tableau concerné
@@ -4817,7 +4867,7 @@
\bigskip
La commande |\TikzEveryCell| possède deux clés, utilisables en argument
optionnel, entre crochets.
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item avec la clé \Definition{empty}, la commande ne s'applique qu'aux cases
vides (les cases considérées comme vides sont décrites à la
partie~\ref{empty-cells}, p.~\pageref{empty-cells}) ;
@@ -4879,9 +4929,9 @@
L'environnement |{NiceTabular}| propose des clés \Definition{caption},
-\Definition{short-caption} et \Definition{label} à utiliser lorsque le tableau
-est inséré dans un environnment flottant (typiquement un environnement
-|{table}|).
+\Definition{short-caption} et \Definition{label} à utiliser lorsque le
+tableau est inséré dans un environnment flottant (typiquement un
+environnement |{table}|).
\smallskip
L'intérêt d'utiliser cette clé |caption| plutôt que la commande classique
@@ -4948,14 +4998,15 @@
L'extension \pkg{nicematrix} propose aussi une commande
\DefinitionCommande{tabularnote} qui permet de spécifier des notes qui seront
-composées à la fin du tableau avec une longueur de ligne égale à la largeur du
-tableau (hors éventuelles colonnes extérieures spécifiées par |first-col| et
-|last-col|: cf.~\ref{exterior}, p.~\pageref{exterior}). Sans surprise, cette
-commande n'est disponible que dans |{NiceTabular}|, |{NiceTabular*}| et
-|{NiceTabularX}|.
+composées à la fin du tableau avec une longueur pour les lignes de texte égale à
+la largeur du tableau (hors éventuelles colonnes extérieures spécifiées par
+|first-col| et |last-col|: cf.~\ref{exterior}, p.~\pageref{exterior}). Sans
+surprise, cette commande n'est disponible que dans |{NiceTabular}|,
+|{NiceTabular*}| et |{NiceTabularX}|.
-\index{enumitem@\pkg{enumitem} (extension requise pour utiliser\newline \texttt{\textbackslash tabularnote})}
+\index{enumitem@\pkg{enumitem} (extension requise pour utiliser\newline
+ \texttt{\textbackslash tabularnote})}
En fait, cette commande n'est disponible que si l'extension \pkg{enumitem} a été
chargée (avant ou après \pkg{nicematrix}). Les notes sont en effet composées en
fin de tableau selon un type de liste défini par l'extension \pkg{enumitem}.
@@ -4994,7 +5045,7 @@
\medskip
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item La commande |\tabularnote| est en fait utilisable avant
l'environnement de \pkg{nicematrix}, le but étant de pouvoir l'utiliser sur le
titre inséré par |\caption| dans un environnement |{table}| de LaTeX (ou dans la
@@ -5126,7 +5177,7 @@
Les notes de tableau peuvent être personnalisées grâce à un ensemble de clés
disponibles dans |\NiceMatrixOptions|. Ces clés ont un nom préfixé par |notes| :
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item |notes/para|
\item |notes/bottomrule|
\item |notes/style|
@@ -5166,7 +5217,7 @@
\medskip
On détaille maintenant ces clés.
-\begin{itemize}[itemsep=\medskipamount]
+\begin{itemize}[itemsep=\medskipamount,beginpenalty=10000]
\item La clé \Definition{notes/para} demande la composition des notes en fin de
tableau en un seul paragraphe.
@@ -5174,10 +5225,11 @@
Cette clé est également accessible dans un environnement individuel.
-\item La clé \Definition{notes/bottomrule} permet de faire tracer un |\bottomrule| de \pkg{booktabs}
-\emph{après} les notes. Ce trait n'est tracé que s'il y a effectivement des
-notes dans le tableau. L'extension \pkg{booktabs} doit avoir été chargée (avant
-ou après l'extension \pkg{nicematrix}). Dans le cas contraire, une erreur est générée.
+\item La clé \Definition{notes/bottomrule} permet de faire tracer un
+ |\bottomrule| de \pkg{booktabs} \emph{après} les notes. Ce trait n'est tracé
+ que s'il y a effectivement des notes dans le tableau. L'extension
+ \pkg{booktabs} doit avoir été chargée (avant ou après l'extension
+ \pkg{nicematrix}). Dans le cas contraire, une erreur est générée.
Valeur initiale : |false|
@@ -5238,7 +5290,8 @@
La spécification |align = left| de ce style demande que le label de la note soit
composé à gauche dans la boîte qui lui est dévolue. Ce réglage a l'avantage
d'avoir les notes calées à gauche, ce qui est plaisant si on compose des
-tableaux dans l'esprit de \pkg{booktabs} (voir par exemple la table~\ref{t:tabularnote}, p.~\pageref{t:tabularnote}).
+tableaux dans l'esprit de \pkg{booktabs} (voir par exemple la table~\ref{t:tabularnote},
+p.~\pageref{t:tabularnote}).
\medskip
La clé \Definition{notes/enumitem-keys} fournie par \pkg{nicematrix} permet de
@@ -5323,7 +5376,7 @@
4~pt\footnote{Cette valeur est la valeur par défaut des «\texttt{rounded
corners}» de PGF/Tikz.}). Plus précisément, cette clé a deux effets que l'on
décrit maintenant.
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item Toutes les commandes de coloriage de cases, colonnes et rangées (que ce
soit dans le |\CodeBefore| ou bien directement dans le tableau respectent ces
coins arrondis pour le tableau.
@@ -5584,7 +5637,7 @@
\medskip
En fait, l'option |small| correspond aux réglages suivants :
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item les composantes du tableau sont composées en |\scriptstyle| ;
\item |\arraystretch| est fixé à $0.47$ ;
\item |\arraycolsep| est fixé à $1.45$~pt ;
@@ -5717,7 +5770,7 @@
\medskip
Lorsque l'option |light-syntax| est utilisée, il n'est pas possible de mettre
-d'éléments en verbatim (avec par exemple la commande |\verb|)
+d'éléments en verbatim (avec par exemple la commande \texttt{\textbackslash verb})
dans les cases du tableau.\footnote{La raison en est que lorsque l'option |light-syntax|
est utilisée, le contenu complet de l'environnement est chargé comme un
argument de commande TeX. L'environnement ne se comporte plus comme un «vrai»
@@ -5730,7 +5783,7 @@
La clé \Definition{light-syntax-expanded} a le même comportement que la clé
|light-syntax| mais avec cette différence que le corps de l'environnement est
complètement développé (au sens de TeX\footnote{Plus précisément, il s'agit
- d'une expansion de type |e| de L3.}) avant découpe en lignes (mais après
+ d'une expansion de type |e| de L3.}) avant découpe en rangées (mais après
l'extraction de l'éventuel |\CodeAfter|).
@@ -5921,7 +5974,7 @@
Les nœuds de la dernière colonne (hors éventuelle «colonne extérieure» spécifiée
par |last-col|\footnote{Pour les colonnes extérieures, cf.
partie~\ref{exterior}, p.~\pageref{exterior}.}) peuvent aussi être désignés
-par $i$-|last|. De même, les nœuds de la dernière ligne peuvent être désignés
+par $i$-|last|. De même, les nœuds de la dernière rangée peuvent être désignés
par |last|-$j$.
@@ -5965,8 +6018,8 @@
|minimum width|, |minimum height| et |minimum size|.
\medskip
-Pour un exemple d'utilisation, voir la partie \ref{triangular},
-p.~\pageref{triangular}.
+Pour un exemple d'utilisation, voir la partie \ref{ex:triangular},
+p.~\pageref{ex:triangular}.
\subsubsection{La clé pgf-node-code}
@@ -6235,15 +6288,16 @@
\vspace{1cm}
Les nœuds que l'on vient de décrire ne sont pas accessibles par défaut dans le
-|\CodeBefore| (décrit p.~\pageref{code-before}). \par\nobreak
+|\CodeBefore| (décrit p.~\pageref{code-before}).
-
+\nobreak
\index{create-cell-nodes (clé de \texttt{\textbackslash CodeBefore})}
On peut rendre ces nœuds accessibles dans le |\CodeBefore| en utilisant la clé
\Definition{create-cell-nodes} du mot-clé |\CodeBefore| (dans ce cas-là, les
nœuds sont créés une première fois avant la construction du tableau en utilisant
des informations écrites dans le fichier |aux| puis recréés lors de la composition
-du tableau proprement dit).
+du tableau proprement dit ; ce mécanisme n'est pas actif par défaut pour des
+questions d'efficacité).
\bigskip
Voici un exemple d'utilisation de ces nœuds dans le |\CodeAfter|.
@@ -6368,7 +6422,7 @@
\medskip
Les nœuds «décimaux» (comme $i$|.4|) peuvent être utilisés par exemple pour
-barrer une ligne (si on a chargé TikZ).
+barrer une rangée (si on a chargé TikZ).
\smallskip
\begin{Code}[width=11cm]
@@ -6445,7 +6499,7 @@
toute variable dont le nom commence par |\g_nicematrix| ou |\l_nicematrix| est
publique alors que toute variable dont le nom débute par |\g__nicematrix| ou
par |\l__nicematrix| est privée.} :
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item |\g_nicematrix_code_before_tl| ;
\item |\g_nicematrix_code_after_tl|.
\end{itemize}
@@ -6557,7 +6611,7 @@
\section{Remarques techniques}
Première remarque : l'extension \pkg{nicematrix} doit être chargée après
-l'extension \pkg{underscore}. Si elle est chargée après, une erreur sera levée.
+l'extension \pkg{underscore}. Si elle est chargée avant, une erreur sera levée.
\subsection{Lignes diagonales}
@@ -6618,8 +6672,9 @@
\medskip
Il est possible de désactiver la parallélisation avec l'option
-\Definition{parallelize-diags} mise à |false|: \par\nobreak
+\Definition{parallelize-diags} mise à |false|:
+\nobreak
\medskip
\NiceMatrixOptions{parallelize-diags=false}%
\begin{minipage}{9.5cm}
@@ -6641,6 +6696,8 @@
servira pour tracer les suivantes quand la parallélisation est activée) avec la
clé \Definition{draw-first} : |\Ddots[draw-first]|\rlap{.}
+
+
\subsection{Les cases «vides»}
\label{empty-cells}
@@ -6653,7 +6710,7 @@
La définition précise de «case vide» est la suivante.
-\begin{itemize}
+\begin{itemize}[beginpenalty=10000]
\item Une case implicite est vide. Par exemple, dans la matrice suivante
\begin{Verbatim}
@@ -6667,10 +6724,11 @@
\medskip
\item Pour les colonnes de type |p|, |m|, |b|, |V|\footnote{Les colonnes de type
- |V| sont fournies par l'extension \pkg{varwidth}, qui doit être chargée : cf.~p.~\pageref{varwidth}}
-ou |X|\footnote{Pour les colonnes |X|, voir p.~\pageref{colonne-X}}, la case est vide si (et seulement
-si) son contenu dans le codage TeX est vide (il n'y a que des espaces entre les
-deux esperluettes |&|).
+ |V| sont fournies par l'extension \pkg{varwidth}, qui doit être chargée :
+ cf.~p.~\pageref{varwidth}} ou |X|\footnote{Pour les colonnes |X|, voir
+ p.~\pageref{colonne-X}}, la case est vide si (et seulement si) son contenu
+ dans le codage TeX est vide (il n'y a que des espaces entre les deux
+ esperluettes |&|).
\medskip
\item Pour les colonnes de type |c|, |l|, |r|, |w{...}{...}| ou |W{...}{...}|,
@@ -6690,6 +6748,8 @@
\end{itemize}
+
+
\subsection{L'option exterior-arraycolsep}
\index{exterior-arraycolsep}
@@ -6747,8 +6807,9 @@
L'extension \pkg{nicematrix} n'est pas compatible avec la classe \cls{ieeeaccess}
car cette classe n'est pas compatible avec PGF-TikZ. Il existe néanmoins une
parade simple qui consiste à écrire:\footnote{Voir
- \url{https://tex.stackexchange.com/questions/528975}}\par\nobreak
+ \url{https://tex.stackexchange.com/questions/528975}}
+\nobreak
\begin{Code}
\let\TeXyear\year
\documentclass{IEEEaccess}
@@ -6755,23 +6816,36 @@
\let\year\TeXyear
\end{Code}
+
+
\medskip
% l'information suivante est toujours d'actualité le 23 avril 2024
Pour pouvoir utiliser \pkg{nicematrix} avec la classe \cls{aastex631} (de
l'\emph{American Astronomical Society}), on doit ajouter dans le préambule du
-fichier les lignes suivantes :
+fichier les instructions suivantes :
-\begin{Code}
-\BeforeBegin{NiceTabular}{\let\begin\BeginEnvironment\let\end\EndEnvironment}
-\BeforeBegin{NiceArray}{\let\begin\BeginEnvironment}
-\BeforeBegin{NiceMatrix}{\let\begin\BeginEnvironment}
-\end{Code}
+% La construction suivante a pour but d'éviter que la fontification de Emacs ne
+% soit perturbée.
+\begin{scope}\ttfamily \color{gray}
+\textbackslash BeforeBegin\{NiceTabular\}\{\textbackslash
+let\textbackslash begin\textbackslash BeginEnvironment\textbackslash
+let\textbackslash end\textbackslash EndEnvironment\}
+\textbackslash BeforeBegin\{NiceArray\}\{\textbackslash
+let\textbackslash begin\textbackslash BeginEnvironment\}
+
+\textbackslash BeforeBegin\{NiceMatrix\}\{\textbackslash
+let\textbackslash begin\textbackslash BeginEnvironment\}
+\end{scope}
+
+
\medskip
L'extension \pkg{nicematrix} n'est pas parfaitement compatible avec les classes
et extensions de LuaTeX-ja: la détection des coins vides (cf.
p.~\pageref{corners}) risque d'être erronée dans certaines circonstances.
+
+
\medskip
L'extension \pkg{nicematrix} n'est pas parfaitement compatible avec l'extension
\pkg{arydshln} (parce que cette extension redéfinit de nombreuses commandes
@@ -6786,6 +6860,7 @@
on peut utiliser les colonnes |S| de \pkg{siunitx}).
+
\subsection{Compatibilité avec le Tagging Project de LaTeX}
\index{Tagging Project}
@@ -6833,8 +6908,6 @@
\end{center}
-
-
\section{Exemples}
\subsection{Utilisation de la clé «tikz» de la commande \textbackslash Block}
@@ -6841,7 +6914,7 @@
\index{tikzz at tikz!clé de \texttt{\textbackslash Block}|textit}
-\label{tikz-key-examples}
+\label{ex:tikz-key}
La clé |tikz| de la commande |\Block| n'est disponible que lorsque TikZ est
chargé.\footnote{Par défaut, \pkg{nicematrix} ne charge que \textsc{pgf}, qui
@@ -6888,11 +6961,13 @@
\bigskip
-Dans l'exemple suivant, on utilise la clé |tikz| pour hachurer une ligne du
+Dans l'exemple suivant, on utilise la clé |tikz| pour hachurer une rangée du
tableau. On remarquera que l'on utilise la clé |transparent| de la commande
|\Block| pour que les filets soient tracés dans le bloc.\footnote{Par défaut,
les filets ne sont pas tracés dans les blocs créés avec la commande
- \texttt{\textbackslash Block} : cf.~section~\ref{rules} p.~\pageref{rules}}
+ \texttt{\textbackslash Block} (cf.~section~\ref{rules} p.~\pageref{rules}) :
+ la clé |transparent| permet qu'ils le soient (le block devient ainsi
+ \emph{transparent} aux filets extérieurs).}
\index{transparent (clé de \texttt{\textbackslash Block})|textit}
\index{columncolor@\texttt{\textbackslash columncolor}!commande du
@@ -6908,6 +6983,7 @@
\Block[\emph{transparent, tikz={pattern = north west lines, pattern color = gray}}]{1-*}{}
quatre & cinq & six \\
sept & huit & neuf
+\end{NiceTabular}
\end{Code}
\begin{center}
@@ -6922,9 +6998,11 @@
\end{NiceTabular}
\end{center}
+
+
\subsection{Utilisation avec tcolorbox}
-\label{tcolorbox}
+\label{ex:tcolorbox}
\index{tcolorbox@\pkg{tcolorbox} (extension)|textit}
Voici un exemple d'utilisation de |{NiceTabular}| dans une commande |\tcbox| de
@@ -6968,9 +7046,11 @@
\end{Code}
+
\index{hvlines-except-borders|textit}
\index{rules (clé pour un environnement)|textit}
-\index{rowcolor@\texttt{\textbackslash rowcolor}!commande du \texttt{\textbackslash CodeBefore}|textit}
+\index{rowcolor@\texttt{\textbackslash rowcolor}!commande du
+ \texttt{\textbackslash CodeBefore}|textit}
\medskip
\begin{center}
@@ -7017,7 +7097,8 @@
\index{notes (clé pour paramétrer les notes de\newline tableau)|textit}
\index{style (sous-clé de «notes»)|textit}
\index{enumitem-keys (sous-clé de «notes»)|textit}
-\index{enumitem@\pkg{enumitem} (extension requise pour utiliser\newline \texttt{\textbackslash tabularnote})|textit}
+\index{enumitem@\pkg{enumitem} (extension requise pour utiliser\newline
+ \texttt{\textbackslash tabularnote})|textit}
\label{ex:notes}
Les outils de \pkg{nicematrix} pour les notes dans les tableaux ont été
@@ -7128,7 +7209,8 @@
Un exemple pour le résultant de deux polynômes :
-\par\nobreak
+
+\nobreak
\medskip
\begin{Code}
\setlength{\extrarowheight}{1mm}
@@ -7144,6 +7226,7 @@
\end{Code}
+
\index{Ddots@\texttt{\textbackslash Ddots}|textit}
\medskip
@@ -7168,7 +7251,7 @@
\index{code-for-last-col|textit}
\begin{Verbatim}
-$\begin{pNiceArray}{*6c|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
+$\begin{pNiceArray}{*6{c}|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
1 & 1 & 1 &\Cdots & & 1 & 0 & \\
0 & 1 & 0 &\Cdots & & 0 & & L_2 \gets L_2-L_1 \\
0 & 0 & 1 &\Ddots & & \Vdots & & L_3 \gets L_3-L_1 \\
@@ -7179,7 +7262,7 @@
\end{Verbatim}
-\[\begin{pNiceArray}{*6c|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
+\[\begin{pNiceArray}{*6{c}|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
1 & 1 & 1 &\Cdots & & 1 & 0 & \\
0 & 1 & 0 &\Cdots & & 0 & & L_2 \gets L_2-L_1 \\
0 & 0 & 1 &\Ddots & & \Vdots & & L_3 \gets L_3-L_1 \\
@@ -7203,7 +7286,6 @@
\begin{scope}
\small
\begin{Verbatim}
-\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}]
@@ -7227,7 +7309,6 @@
\index{code-for-last-col|textit}
\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}]
@@ -7361,6 +7442,7 @@
\end{Verbatim}
+
\medskip
\begin{Code}
\NiceMatrixOptions{xdots/horizontal-labels}
@@ -7453,9 +7535,11 @@
\end{pNiceArray}$
+
+
\subsection{Lignes en tiretés}
-\label{tiretes}
+\label{ex:tiretes}
\index{tikzz at tikz!clé de «borders» de \texttt{\textbackslash Block}|textit}
@@ -7479,6 +7563,7 @@
\end{Code}
+
\[\begin{pNiceMatrix}
\Block[borders={bottom,right,tikz=dashed}]{2-2}{}
1 & 2 & 0 & 0 & 0 & 0 \\
@@ -7508,6 +7593,8 @@
\bigskip
+
+
\begin{scope}
\small
\begin{Code}
@@ -7521,7 +7608,6 @@
no-cell-nodes % facultatif
}
\setlength{\extrarowheight}{1mm}
-\end{NiceMatrixBlock}
\quad $\begin{pNiceMatrix}
12 -8 7 5 3 {} ;
@@ -7554,6 +7640,9 @@
\end{Code}
\end{scope}
+
+
+
\medskip
\index{auto-columns-width!(clé de \texttt{\{NiceMatrixBlock\}})|textit}
\begin{NiceMatrixBlock}[auto-columns-width]
@@ -7636,6 +7725,8 @@
\end{Code}
\end{scope}
+
+
\medskip
\begin{NiceMatrixBlock}[auto-columns-width]
\NiceMatrixOptions
@@ -7820,7 +7911,7 @@
\subsection{Comment surligner les cases d'une matrice}
-\label{highlight}
+
\index{draw (clé de \texttt{\textbackslash Block})|textit}
\medskip
@@ -7829,8 +7920,8 @@
blocs mono-case\footnote{On rappelle que si le premier argument obligatoire de
la commande |\Block| est laissé vide, le bloc est considéré comme mono-case.}).
-\label{exemple-CodeAfter}
+
\begin{Code}
$\begin{pNiceArray}{>{\strut}cccc}[margin,rules/color=blue,no-cell-nodes]
\emph{\Block[draw]{}{a_{11}}} & a_{12} & a_{13} & a_{14} \\
@@ -7853,7 +7944,7 @@
les traits tracés par |\hline|, |\Hline|, le spécificateur «\verb+|+» ou les
options |hlines|, |vlines|, |hvlines| et |hvlines-except-borders| «écartent» les
composantes de la matrice.\footnote{Pour la commande |\cline|, voir la remarque
- p.~\pageref{remark-cline}.}
+ p.~\pageref{cline}.}
\vspace{1cm}
Il est possible de colorier une rangée avec |\rowcolor| dans le |\CodeBefore|
@@ -7920,7 +8011,7 @@
$\begin{bNiceMatrix}
\emph{\CodeBefore [create-cell-nodes]
- \tikz \node [highlight = (2-1) (2-3)] {} ;
+ \tikz \node [highlight = (2-1) (2-last)] {} ;
\Body }
0 & \Cdots & 0 \\
1 & \Cdots & 1 \\
@@ -7933,7 +8024,7 @@
\[\begin{bNiceMatrix}
\CodeBefore [create-cell-nodes]
- \tikz \node [highlight = (2-1) (2-3)] {} ;
+ \tikz \node [highlight = (2-1) (2-last)] {} ;
\Body
0 & \Cdots & 0 \\
1 & \Cdots & 1 \\
@@ -7951,9 +8042,9 @@
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt]
\CodeBefore [create-cell-nodes]
\begin{tikzpicture}
- \emph{\node [highlight = (1-1) (1-3)] {} ;
- \node [highlight = (2-1) (2-3)] {} ;
- \node [highlight = (3-1) (3-3)] {} ;}
+ \emph{\node [highlight = (1-1) (1-last)] {} ;
+ \node [highlight = (2-1) (2-last)] {} ;
+ \node [highlight = (3-1) (3-last)] {} ;}
\end{tikzpicture}
\Body
a & a + b & a + b + c & L_1 \\
@@ -7965,9 +8056,9 @@
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt]
\CodeBefore [create-cell-nodes]
\begin{tikzpicture}
- \node [highlight = (1-1) (1-3)] {} ;
- \node [highlight = (2-1) (2-3)] {} ;
- \node [highlight = (3-1) (3-3)] {} ;
+ \node [highlight = (1-1) (1-last)] {} ;
+ \node [highlight = (2-1) (2-last)] {} ;
+ \node [highlight = (3-1) (3-last)] {} ;
\end{tikzpicture}
\Body
a & a + b & a + b + c & L_1 \\
@@ -7986,9 +8077,9 @@
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt, create-medium-nodes]
\CodeBefore [create-cell-nodes]
\begin{tikzpicture} \emph{[name suffix = -medium]}
- \node [highlight = (1-1) (1-3)] {} ;
- \node [highlight = (2-1) (2-3)] {} ;
- \node [highlight = (3-1) (3-3)] {} ;
+ \node [highlight = (1-1) (1-last)] {} ;
+ \node [highlight = (2-1) (2-last)] {} ;
+ \node [highlight = (3-1) (3-last)] {} ;
\end{tikzpicture}
\Body
a & a + b & a + b + c & L_1 \\
@@ -8001,9 +8092,9 @@
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt, create-medium-nodes]
\CodeBefore [create-cell-nodes]
\begin{tikzpicture} [name suffix = -medium]
- \node [highlight = (1-1) (1-3)] {} ;
- \node [highlight = (2-1) (2-3)] {} ;
- \node [highlight = (3-1) (3-3)] {} ;
+ \node [highlight = (1-1) (1-last)] {} ;
+ \node [highlight = (2-1) (2-last)] {} ;
+ \node [highlight = (3-1) (3-last)] {} ;
\end{tikzpicture}
\Body
a & a + b & a + b + c & L_1 \\
@@ -8023,7 +8114,7 @@
\index{create-cell-nodes (clé de \texttt{\textbackslash CodeBefore})|textit}
-\label{submatrix-in-codebefore}
+\label{ex:submatrix}
Dans l'exemple suivant, on illustre le produit mathématique de deux matrices.
@@ -8108,7 +8199,7 @@
\subsection{Un tableau triangulaire}
-\label{triangular}
+\label{ex:triangular}
\index{pgf-node-code|textit}
\index{Coins (les --- vides)|textit}
\index{chessboardcolors@\texttt{\textbackslash chessboardcolors}!(commande
@@ -8147,6 +8238,7 @@
\end{Code}
+
\begin{center}
\pgfset
{
@@ -8181,14 +8273,22 @@
Le document |nicematrix.pdf| (fourni avec l'extension \pkg{nicematrix}) contient
une traduction anglaise de la documentation ici présente ainsi qu'un historique
-des versions.
+des versions.
-Le document |nicematrix-code.pdf| (fourni également avec l'extension \pkg{nicematrix})
-contient le code LaTeX commenté (à partir du fichier |nicematrix-code.dtx|).
+Le document |nicematrix-code.pdf| (fourni également avec l'extension
+\pkg{nicematrix}) contient le code LaTeX commenté (à partir du fichier
+|nicematrix-code.dtx|).
\medskip
+Le développement de l'extension \pkg{nicematrix} se fait sur le dépôt GitHub
+suivant :
+
+\nolinkurl{https://github.com/fpantigny/nicematrix}
+
+
+\medskip
Les versions successives du fichier |nicematrix.sty| fournies par
-TeXLive sont disponibles sur le serveur \textsc{svn} de TeXLive :
+TeXLive sont également disponibles sur le serveur \textsc{svn} de TeXLive :
\smallskip
{
@@ -8203,9 +8303,9 @@
\end{document}
% Local Variables:
-% TeX-fold-mode: t
-% TeX-fold-preserve-comments: nil
+% LaTeX-verbatim-environments-local: ("Code")
% fill-column: 80
% End:
+
Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex 2025-04-28 19:47:40 UTC (rev 75043)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex 2025-04-28 19:48:18 UTC (rev 75044)
@@ -3,6 +3,7 @@
\documentclass[dvipsnames]{article}% dvipsnames is for xcolor (loaded by TikZ,
% loaded by nicematrix)
+
\usepackage{geometry}
\geometry{left=2.8cm,right=2.8cm,top=2.5cm,bottom=2.5cm,papersize={21cm,29.7cm}}
@@ -121,7 +122,7 @@
\begin{document}
-\VerbatimFootnotes
+\UseName{VerbatimFootnotes}
\title{The package \pkg{nicematrix}\thanks{This document corresponds to the
@@ -158,8 +159,8 @@
\rowcolors{3}{blue!15}{}
\Body
\toprule
-\Block{2-1}{Product} & \multicolumn{3}{c}{dimensions (cm)}
- & \Block{2-1}{\rotate Price} \\
+\Block[C]{2-1}{Product} & \multicolumn{3}{c}{dimensions (cm)}
+ & \Block[C]{2-1}{\rotate Price} \\
\cmidrule(rl){2-4}
& L & l & h \\
\midrule
@@ -521,7 +522,7 @@
\end{bNiceArray}$
\end{Code}
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-\Block{3-3}{A} & & & 0 \\
+\Block[C]{3-3}{A} & & & 0 \\
& & & \Vdots \\
& & & 0 \\
\hline
@@ -552,7 +553,7 @@
\end{Code}
\begin{scope}
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-\Block{3-3}<\Large>{A} & & & 0 \\
+\Block[C]{3-3}<\Large>{A} & & & 0 \\
& & & \Vdots \\
& & & 0 \\
\hline
@@ -564,7 +565,7 @@
\interitem
In fact, the command |\Block| accepts as first optional argument (between
-square brackets) a list of couples \textsl{key=value}.
+square brackets) a list of pairs \textsl{key=value}.
First, there are keys which are quick tools to control the apperance of the block.
@@ -691,7 +692,7 @@
\begin{center}
\begin{NiceTabular}{cw{c}{2cm}w{c}{3cm}c}
rose & tulip & daisy & dahlia \\
-violet & \Block[draw=red,fill=[RGB]{204,204,255},rounded-corners]{2-2}
+violet & \Block[C,draw=red,fill=[RGB]{204,204,255},rounded-corners]{2-2}
{\LARGE Some beautiful flowers} & & marigold \\
iris & & & lis \\
arum & periwinkle & forget-me-not & hyacinth
@@ -758,6 +759,7 @@
\end{scope}
+
\subsection{The mono-row blocks}
For the mono-row blocks, the natural height and depth are taken into account
@@ -887,7 +889,9 @@
In order to have an horizontal positionning of the content of the block computed
with the limits of the columns of the LaTeX array (and not with the contents of
those columns), one may use the key \Definition{L}, \Definition{R} and
-\Definition{C} of the command |\Block|.
+\Definition{C} of the command |\Block|.\footnote{Remark: The keys |L|, |C| and
+ |R| require less computations than the keys |l|, |c| and |r|. If you are
+ concernend about efficiency, you should use by default |\Block[C]|.}
\medskip
Here is the same example with the key |C| for the first block.
@@ -996,7 +1000,7 @@
\item With the key \Definition{t}, the baseline of the content of the block is aligned
with the baseline of the first row concerned by the block.
\item with the key \Definition{b}, the baseline of the last row of the content of the
-block (we recall that the content of a block may contains several lines
+block (we recall that the content of a block may contain several lines of text
separated by |\\|) is aligned with the baseline of the last of the rows of the
array involved in the block.
\item With the key \Definition{T}, the content of the block is set upwards.
@@ -1066,7 +1070,7 @@
\bigskip
\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,\emph{T},l]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{T},\emph{L}]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
@@ -1075,7 +1079,7 @@
\end{NiceTabular}
\end{Code}
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,T,l]{4-2}{two\\lines}
+\Block[fill=red!10,T,L]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
@@ -1087,7 +1091,7 @@
\bigskip
\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,\emph{B},r]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{B},\emph{R}]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
@@ -1096,7 +1100,7 @@
\end{NiceTabular}
\end{Code}
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,B,r]{4-2}{two\\lines}
+\Block[fill=red!10,B,R]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
@@ -1121,7 +1125,7 @@
\item One must not use both |\\| and |&| in the same block.
\item For |\\|, there is no other restriction. It's possible to use |\\| in a
-block to format a text on several rows.
+block to format a text on several lines.
\item In order to use |&|, the key \Definition{ampersand-in-blocks} (alias:
\Definition{\&-in-blocks}) must been activated\footnote{Otherwise, the use
@@ -1128,7 +1132,7 @@
of~|&| in the command |\Block|
will raise a TeX error :\\
|! Extra alignment tab has been changed to \cr.|}. Then, the block is divided
-in sub-blocks as illustrated below. Be careful: with |ampersand-in-blocks| is in
+in sub-blocks as illustrated below. Be careful: when |ampersand-in-blocks| is in
force, the (main) argument of the command |\Block| is syntactically divided into
sub-blocks by splitting on the ampersands~|&|, the ampersands between curly
braced are protected but not those in an environment.\footnote{It's not possible
@@ -1519,10 +1523,10 @@
\begin{Code}
\setlength{\arrayrulewidth}{1pt}
\begin{NiceTabular}{cccc}[\emph{hvlines},rules/color=blue]
-rose & tulipe & marguerite & dahlia \\
-violette & \Block[draw=red]{2-2}{\LARGE fleurs} & & souci \\
-pervenche & & & lys \\
-arum & iris & jacinthe & muguet
+rose & tulip & sunflower & lily \\
+violet & \Block[draw=red]{2-2}{\LARGE flowers} & & orchid \\
+carnation & & & lys \\
+daisy & peony & jasmine & magnolia
\end{NiceTabular}
\end{Code}
@@ -1529,10 +1533,10 @@
\begin{center}
\setlength{\arrayrulewidth}{1pt}
\begin{NiceTabular}{cccc}[hvlines,rules/color=blue]
-rose & tulipe & marguerite & dahlia \\
-violette & \Block[draw=red]{2-2}{\LARGE fleurs} & & souci \\
-pervenche & & & lys \\
-arum & iris & jacinthe & muguet
+rose & tulip & sunflower & lily \\
+violet & \Block[C,draw=red]{2-2}{\LARGE flowers} & & orchid \\
+carnation & & & lys \\
+daisy & peony & jasmine & magnolia
\end{NiceTabular}
\end{center}
@@ -1834,7 +1838,7 @@
\begin{center}
\begin{NiceTabular}{lcIcIc}[custom-line = {letter=I, color=blue},no-cell-nodes]
\hline
- & \Block{1-3}{dimensions} \\
+ & \Block[C]{1-3}{dimensions} \\
& L & l & H \\
\hline
Product A & 3 & 1 & 2 \\
@@ -2063,7 +2067,9 @@
\pkg{colortbl}: each cell is colored on its own, even when |\columncolor| or
|\rowcolor| is used.
-As for this phenomenon, Adobe Reader gives better results than MuPDF.
+As for this phenomenon, Adobe Reader gives better results than MuPDF
+(however, it seems, that, in recent versions of MuPDF, the problem has
+been solved...).
\end{itemize}
The package \pkg{nicematrix} provides tools to avoid both problems.
@@ -2076,12 +2082,12 @@
\index{CodeBefore@\texttt{\textbackslash CodeBefore}...\texttt{\textbackslash Body}}
\index{Body@\texttt{\textbackslash Body}|see{\texttt{\textbackslash CodeBefore}}}
-The package \pkg{nicematrix} provides some tools (independent of \pkg{colortbl})
-to draw the colored panels first, and, then, the content of the cells and the
-rules. This strategy is more conform to the ``painting model'' of the formats
-PostScript and \textsc{pdf} and is more suitable for the \textsc{pdf} viewers.
-However, it requires several compilations.\footnote{If you use Overleaf,
- Overleaf will do automatically a sufficient number of compilations.}
+The package \pkg{nicematrix} provides some tools to draw the colored panels
+first, and, then, the content of the cells and the rules. This strategy is more
+conform to the ``painting model'' of the formats PostScript and \textsc{pdf} and
+is more suitable for the \textsc{pdf} viewers. However, it requires several
+compilations.\footnote{If you use Overleaf, Overleaf will do automatically a
+ sufficient number of compilations.}
\medskip
The extension \pkg{nicematrix} provides a key |code-before| for some code that
@@ -2654,8 +2660,9 @@
\index{EmptyRow@\texttt{\textbackslash EmptyRow} (command of \texttt{\textbackslash CodeBefore})}
\index{EmptyColumn@\texttt{\textbackslash EmptyColumn} (command of \texttt{\textbackslash CodeBefore})}
-\colorbox{yellow!50}{\textbf{New 7.1}}\par\nobreak
+\colorbox{yellow!50}{\textbf{New 7.1}}
+\nobreak
\smallskip
It's also possible, in the |\CodeBefore|, to use the commands
\DefinitionCommand{EmptyColumn} and \DefinitionCommand{EmptyRow}. The command
@@ -2665,7 +2672,7 @@
\medskip
\begin{Code}[width=10cm]
-\begin{NiceTabular}{ccccc}[hvlines]
+\begin{NiceTabular}{ccccc}[hvlines,no-cell-nodes]
\CodeBefore
\rowcolor{blue!15}{1}
\emph{\EmptyColumn{3}}
@@ -2674,7 +2681,7 @@
one & \Block{}{two\\ rows} && three & four \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccccc}[hvlines]
+\begin{NiceTabular}{ccccc}[hvlines,no-cell-nodes]
\CodeBefore
\rowcolor{blue!15}{1}
\EmptyColumn{3}
@@ -2693,22 +2700,21 @@
\index{columncolor@\texttt{\textbackslash columncolor}!command in the preamble
of an environment}
+The extension \pkg{nicematrix} also provides commands to be used directly in the
+tabular (as does \pkg{colortbl}).
-It's possible to access the preceding tools with a syntax close to the syntax
-of \pkg{colortbl}.
-
-There are several commands available (the first three ones are inspired by
-\pkg{colortbl} but are \emph{independent} of \pkg{colortbl}):
+These commands are the following several commands available (the first three
+ones are inspired by the similar commands of \pkg{colortbl}).
\begin{itemize}
\item \DefinitionCommand{cellcolor} which colorizes a cell;\footnote{That
- command |\cellcolor| will delete the following spaces, which does not the
- command |\cellcolor| of \pkg{colortbl}. Moreover, if one wishes to define a
+ command |\cellcolor| will delete the following spaces (which does not the
+ command |\cellcolor| of \pkg{colortbl}). Moreover, if one wishes to define a
command above that command |\cellcolor|, it must be protected in the TeX sens
- (whereas, if it were the command |\cellcolor| of \pkg{colortbl}, one should
- write a \emph{fully expandable} command).}
+ (whereas, if it were the command |\cellcolor| of \pkg{colortbl}, one should,
+ no the contrary, write a \emph{fully expandable} command).}
\item \DefinitionCommand{rowcolor} which must be used in a cell and which
colorizes the end of the row;\footnote{If you want a commande to color the
- following $n$~rows, consider the command |\RowStyle| and its key |rowcolor|,
+ following $n$~rows, consider the command |\RowStyle| and its key |fillcolor|,
p.~\pageref{RowStyle}}
\item \DefinitionCommand{columncolor} which must be used in the preamble of the
environment with the same syntax as the corresponding command of \pkg{colortbl}
@@ -2835,7 +2841,7 @@
\index{fill!key of \texttt{\textbackslash RowStyle}}
\index{opacity!key of \texttt{\textbackslash RowStyle}}
\index{rounded-corners!key of \texttt{\textbackslash RowStyle}}
-The key \Definition{rowcolor} (alias: \Definition{fill}) sets the color of the
+The key \Definition{fill} (alias: \Definition{rowcolor}) sets the color of the
background and \Definition{opacity}\footnote{Caution: that feature creates instructions of
transparency in the \textsc{pdf} and some readers of \textsc{pdf} don't
support such instructions.} sets its opacity.
@@ -2863,7 +2869,7 @@
\hline
\emph{\RowStyle[cell-space-limits=3pt]{\rotate}}
first & second & third & fourth \\
-\emph{\RowStyle[nb-rows=2,rowcolor=blue!50,color=white]{\sffamily}}
+\emph{\RowStyle[nb-rows=2,fill=blue!50,color=white]{\sffamily}}
1 & 2 & 3 & 4 \\
I & II & III & IV
\end{NiceTabular}
@@ -2873,7 +2879,7 @@
\hline
\RowStyle[cell-space-limits=3pt]{\rotate}
first & second & third & fourth \\
-\RowStyle[nb-rows=2,rowcolor=blue!50,color=white]{\sffamily}
+\RowStyle[nb-rows=2,fill=blue!50,color=white]{\sffamily}
1 & 2 & 3 & 4 \\
I & II & III & IV \\
\end{NiceTabular}
@@ -3044,7 +3050,7 @@
in an optional argument (between square brackets) which is a list of keys.
\begin{itemize}
\item It's possible to give a weight for the column by providing a positive
-integer directly as argument of the specifier |X|. For example, a column
+number directly as argument of the specifier |X|. For example, a column
|X[2]| will have a width double of the width of a column~|X| (which has a
weight equal to $1$).\footnote{The negative values of the weight, as provided
by \pkg{tabu} (which is now obsolete), are \emph{not} supported by \pkg{nicematrix}.
@@ -3057,11 +3063,11 @@
commands |\raggedright|, |\centering| and |\raggedleft|. That ensures a better output.}
\item It's possible to specify a vertical alignment with one of the keys
|t| (alias |p|), |m| and |b| (which construct respectively columns of type
-|p|, |m| and |b|). The default value is |t|.
+|p|, |m| and |b|). The initial value is |t|.
\end{itemize}
\begin{Code}
-\emph{\begin{NiceTabular}[width=9cm]{X[2,l]X[l]}[hvlines]}
+\emph{\begin{NiceTabular}\emph{[width=9cm]{X[c,m]X[0.5,c,m]}}[hvlines]}
a rather long text which fits on several lines
& a rather long text which fits on several lines \\
a shorter text & a shorter text
@@ -3069,7 +3075,7 @@
\end{Code}
\begin{center}
-\begin{NiceTabular}[width=9cm]{X[2,l]X[l]}[hvlines]
+\begin{NiceTabular}[width=9cm]{X[c,m]X[0.5,c,m]}[hvlines]
a rather long text which fits on several lines
& a rather long text which fits on several lines \\
a shorter text & a shorter text
@@ -3411,10 +3417,10 @@
\end{bNiceMatrix}
\end{Code}
$\begin{bNiceMatrix}
-0 & \Cdots & \Cdots & 0 \\
-\Vdots & & & \Vdots \\
-\Vdots & & & \Vdots \\
-0 & \Cdots & \Cdots & 0
+0 & \Cdots & & 0 \\
+\Vdots & & & \\
+ & & & \Vdots \\
+0 & & \Cdots & 0
\end{bNiceMatrix}$
\bigskip
@@ -3471,6 +3477,8 @@
0 & \Cdots & & 0
\end{bNiceMatrix}$
+
+
\subsection{The option nullify-dots}
\index{nullify-dots}
@@ -3604,14 +3612,12 @@
\end{pNiceMatrix}$
\medskip
-Remark: Unlike the command |\hdotsfor| of \pkg{amsmath}, the command
-|\Hdotsfor| may be used even when the package \pkg{colortbl}\footnote{We
-recall that when \pkg{xcolor} is loaded with the option |table|, the
-package \pkg{colortbl} is loaded.} is loaded (but you might have problem if
-you use |\rowcolor| on the same row as |\Hdotsfor|). However, when using
-\pkg{nicematrix}, it's recommended to use the coloring tools provided by
-\pkg{nicematrix} instead of \pkg{colortbl} (cf.
-p.~\pageref{color-in-code-before}).
+Remark: Unlike the command |\hdotsfor| of \pkg{amsmath}, the command |\Hdotsfor|
+may be used even when the package \pkg{colortbl}\footnote{We recall that when
+ \pkg{xcolor} is loaded with the option |table|, the package \pkg{colortbl} is
+ loaded.} is loaded (however, with \pkg{nicematrix}, loading \pkg{colortbl} is
+rather point-less since \pkg{nicematrix} provides its own coloring tools: cf.
+p.~\pageref{color-in-code-before}).
\bigskip
The package \pkg{nicematrix} also provides a command
@@ -3711,6 +3717,8 @@
\subsection{The labels of the dotted lines}
+
+
The commands |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots|, |\Hdotsfor| and
|\Vdotsfor| (and the command |\line| in the |\CodeAfter| which is described
p.~\pageref{line-in-code-after}) accept two optional arguments specified by the
@@ -3738,35 +3746,36 @@
\bigskip
-With the key \Definition{xdots/horizontal-labels}, the labels stay
+With the key \Definition{horizontal-label}, the labels stay
horizontal.\par\nobreak
%
\medskip
\begin{Code}[width=10cm]
-$\begin{bNiceMatrix}[xdots/horizontal-labels]
+$\begin{bNiceMatrix}
1 & \hspace*{1cm} & 0 \\[8mm]
- & \emph{\Ddots^{n \text{ times}}} & \\
+ & \emph{\Ddots[horizontal-label]^{n \text{ times}}} & \\
0 & & 1
\end{bNiceMatrix}$
\end{Code}
-$\begin{bNiceMatrix}[xdots/horizontal-labels]
+$\begin{bNiceMatrix}
1 & \hspace*{1cm} & 0 \\[8mm]
- & \Ddots^{n \text{ times}} & \\
+ & \Ddots[horizontal-label]^{n \text{ times}} & \\
0 & & 1
\end{bNiceMatrix}$
+
\subsection{Customisation of the dotted lines}
\label{customisation}
-\index{color!key for the dotted rules}
-\index{radius (key for the dotted rules)}
-\index{inter (key for the dotted rules)}
-\index{line-style (key for the dotted rules)}
-\index{shorten (key for the dotted rules)}
-\index{shorten-end (key for the dotted rules)}
-\index{shorten-start (key for the dotted rules)}
-\index{horizontal-labels (key for the dotted rules)}
+\index{color!key for dotted rules}
+\index{radius (key for dotted rules)}
+\index{inter (key for dotted rules)}
+\index{line-style (key for dotted rules)}
+\index{shorten (key for dotted rules)}
+\index{shorten-end (key for dotted rules)}
+\index{shorten-start (key for dotted rules)}
+\index{horizontal-label(s) (key for dotted rules)}
The dotted lines drawn by |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots|,
|\Hdotsfor| and |\Vdotsfor| (and by the command |\line| in the |\CodeAfter|
@@ -3773,7 +3782,7 @@
which is described p.~\pageref{line-in-code-after}) may be customized by the following
options (specified between square brackets after the command):
\begin{itemize}
-\item |horizontal-labels|;
+\item |horizontal-label(s)|;
\item |color|;
\item |radius|;
\item |shorten-start|, |shorten-end| and |shorten|;
@@ -3781,6 +3790,11 @@
\item |line-style|.
\end{itemize}
+\smallskip
+For an individual command, it's possible to write |horizontal-label| (in the
+singular).
+
+\smallskip
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| (\textsl{xdots} to remind that it works for
@@ -4129,6 +4143,8 @@
|\SubMatrix| available in the |\CodeAfter| (and the |\CodeBefore|). See the
section~\ref{sub-matrix}, p.~\pageref{sub-matrix}.
+
+
\section{The \textbackslash CodeAfter}
\index{CodeAfter@\texttt{\textbackslash CodeAfter}|(}
@@ -4158,7 +4174,7 @@
beginning on p.~\pageref{PGF-nodes}.
\medskip
-Moreover, several special commands are available in the |\CodeAfter|: |line|,
+The |\CodeAfter| provides several special commands: |\line|,
|\SubMatrix|, |\OverBrace|, |\UnderBrace| and |\TikzEveryCell|. We will now
present these commands.
@@ -4558,7 +4574,7 @@
|\OverBrace|) or under the brace (for |\UnderBrace|).
It's possible to use the command |\\| in this third argument in order to format
-the label on several lignes.
+the label on several lines.
\end{itemize}
\bigskip
@@ -4812,7 +4828,7 @@
The package \pkg{nicematrix} also provides a command
\DefinitionCommand{tabularnote} which gives the ability to specify notes that
-will be composed at the end of the array with a width of line equal to the width
+will be composed at the end of the array with a width of text equal to the width
of the array (except the potential exterior columns specified by |first-col| and
|last-col|: cf.~\ref{exterior}, p.~\pageref{exterior}). With no surprise, that
command is available only in the environments |{NiceTabular}|, |{NiceTabular*}|
@@ -5159,6 +5175,7 @@
\ref{s:caption}, p.~\pageref{s:caption}).
+
\section{Other features}
\subsection{The key rounded-corners}
@@ -5568,7 +5585,7 @@
\medskip
When the option |light-syntax| is used, it is not possible to put verbatim
-material (for example with the command |\verb|) in the cells of the
+material (for example with the command \texttt{\textbackslash verb}) in the cells of the
array.\footnote{The reason is that, when the option |light-syntax| is used,
the whole content of the environment is loaded as a TeX argument to be
analyzed. The environment doesn't behave in that case as a standard
@@ -5580,7 +5597,7 @@
The key \Definition{light-syntax-expanded} has the same behaviour as the key
|light-syntax| but the body of the environment is expanded (in the TeX
sens\footnote{More precisely, it's a expansion of type |e| of L3.}) before being
-splitted in lines (but after the extraction of a potential |\CodeAfter|).
+splitted in rows (but after the extraction of a potential |\CodeAfter|).
\subsection{Color of the delimiters}
@@ -5685,7 +5702,7 @@
\medskip
The creation of those nodes needs time and memory. It's possible to desactive
ponctually the creation of those nodes with the key \Definition{no-cell-nodes}
-in order to speed up the compilations. But e careful: those nodes are used
+in order to speed up the compilations. But be careful: those nodes are used
internally but \pkg{nicematrix} for several features. One should use the key
|no-cell-nodes| only when those feateures are not used. Among these are the key
|corners| and the commands for the continuous dotted lines (|\Cdots|, etc.).
@@ -6085,7 +6102,8 @@
key \Definition{create-cell-nodes} of the keyword |\CodeBefore| (in that case,
the nodes are created first before the construction of the array by using
informations written on the |aux| file and created a second time during the
-contruction of the array itself).
+contruction of the array itself; this mechanism is not activated by default for
+efficiency reasons).
\bigskip
Here is an example which uses these nodes in the |\CodeAfter|.
@@ -6463,9 +6481,9 @@
\Vdots & \Ddots & & \\
a+b & \Cdots & a+b & 1
\end{pNiceMatrix}$
-
\end{scope}
+\medskip
It's possible to specify the instruction |\Ddots| which will be drawn first
(and which will be used to draw the other diagonal dotted lines when the
parallelization is in force) with the key \Definition{draw-first}:
@@ -6591,15 +6609,22 @@
% the following requirement is still in force on April 23, 2024
In order to use \pkg{nicematrix} with the class \cls{aastex631}
(of the \emph{American Astronomical Society}), you have to
-add the following lines in the preamble of your document :
+add the following instructions in the preamble of your document :
-\begin{Verbatim}
-\BeforeBegin{NiceTabular}{\let\begin\BeginEnvironment\let\end\EndEnvironment}
-\BeforeBegin{NiceArray}{\let\begin\BeginEnvironment}
-\BeforeBegin{NiceMatrix}{\let\begin\BeginEnvironment}
-\end{Verbatim}
+% With the following construction, we avoid problem of fontification with Emacs
+\begin{scope}\ttfamily \color{gray}
+\textbackslash BeforeBegin\{NiceTabular\}\{\textbackslash
+let\textbackslash begin\textbackslash BeginEnvironment\textbackslash
+let\textbackslash end\textbackslash EndEnvironment\}
+\textbackslash BeforeBegin\{NiceArray\}\{\textbackslash
+let\textbackslash begin\textbackslash BeginEnvironment\}
+\textbackslash BeforeBegin\{NiceMatrix\}\{\textbackslash
+let\textbackslash begin\textbackslash BeginEnvironment\}
+\end{scope}
+
+
\medskip
The package \pkg{nicematrix} is not fully compatible with the packages and classes
of LuaTeX-ja: the detection of the empty corners (cf. p.~\pageref{corners})
@@ -6721,13 +6746,15 @@
In the following example, we use the key |tikz| to hatch a row of the tabular.
Remark that you use the key |transparent| of the command |\Block| in order to
have the rules drawn in the block.\footnote{By default, the rules are not
-drawn in the blocks created by the command |\Block|: cf.~section~\ref{rules}
-p.~\pageref{rules}}
+drawn in the blocks created by the command |\Block| (cf.~section~\ref{rules}
+p.~\pageref{rules}): with the key |transparent|, they are drawn (the block
+becomes \emph{transparent} to the exterior rules).}
\index{transparent (key of \texttt{\textbackslash Block})|textit}
\index{columncolor@\texttt{\textbackslash columncolor}!command of
\texttt{\textbackslash CodeBefore}|textit}
+\medskip
\begin{Code}
\begin{NiceTabular}{ccc}[hvlines]
@@ -6759,8 +6786,8 @@
\index{tcolorbox@\pkg{tcolorbox} (package)|textit}
Here is an example of use of |{NiceTabular}| within a command |\tcbox| of
-\pkg{tcolorbox}. We have used the key |hvlines-except-borders| in order all
-the rules except on the borders (which are, of course, added by \pkg{tcolorbox})
+\pkg{tcolorbox}. We have used the key |hvlines-except-borders| in order to draw all
+the rules, except on the borders (which are, of course, added by \pkg{tcolorbox}).
\medskip
\begin{Code}
@@ -6991,7 +7018,7 @@
\index{code-for-last-col|textit}
\begin{Verbatim}
-$\begin{pNiceArray}{*6c|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
+$\begin{pNiceArray}{*6{c}|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
1 & 1 & 1 &\Cdots & & 1 & 0 & \\
0 & 1 & 0 &\Cdots & & 0 & & L_2 \gets L_2-L_1 \\
0 & 0 & 1 &\Ddots & & \Vdots & & L_3 \gets L_3-L_1 \\
@@ -7002,7 +7029,7 @@
\end{Verbatim}
-\[\begin{pNiceArray}{*6c|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
+\[\begin{pNiceArray}{*6{c}|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
1 & 1 & 1 &\Cdots & & 1 & 0 & \\
0 & 1 & 0 &\Cdots & & 0 & & L_2 \gets L_2-L_1 \\
0 & 0 & 1 &\Ddots & & \Vdots & & L_3 \gets L_3-L_1 \\
@@ -7024,7 +7051,6 @@
\index{line-style (key for the dotted rules)|textit}
\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}]
@@ -7048,7 +7074,6 @@
\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}]
@@ -7697,7 +7722,7 @@
\medskip
That example and the following ones require TikZ (by default, \pkg{nicematrix}
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:
+|fit|. The following instructions in the preamble of your document do the job:
\begin{verbatim}
\usepackage{tikz}
\usetikzlibrary{fit}
@@ -7726,7 +7751,7 @@
$\begin{bNiceMatrix}
\emph{\CodeBefore [create-cell-nodes]
- \tikz \node [highlight = (2-1) (2-3)] {} ;
+ \tikz \node [highlight = (2-1) (2-last)] {} ;
\Body}
0 & \Cdots & 0 \\
1 & \Cdots & 1 \\
@@ -7738,7 +7763,7 @@
\[\begin{bNiceMatrix}
\CodeBefore [create-cell-nodes]
- \tikz \node [highlight = (2-1) (2-3)] {} ;
+ \tikz \node [highlight = (2-1) (2-last)] {} ;
\Body
0 & \Cdots & 0 \\
1 & \Cdots & 1 \\
@@ -7754,9 +7779,9 @@
\begin{pNiceArray}{ccc}[last-col, margin = 2pt]
\CodeBefore [create-cell-nodes]
\begin{tikzpicture}
- \emph{\node [highlight = (1-1) (1-3)] {} ;
- \node [highlight = (2-1) (2-3)] {} ;
- \node [highlight = (3-1) (3-3)] {} ;}
+ \emph{\node [highlight = (1-1) (1-last)] {} ;
+ \node [highlight = (2-1) (2-last)] {} ;
+ \node [highlight = (3-1) (3-last)] {} ;}
\end{tikzpicture}
\Body
a & a + b & a + b + c & L_1 \\
@@ -7769,9 +7794,9 @@
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt]
\CodeBefore [create-cell-nodes]
\begin{tikzpicture}
- \node [highlight = (1-1) (1-3)] {} ;
- \node [highlight = (2-1) (2-3)] {} ;
- \node [highlight = (3-1) (3-3)] {} ;
+ \node [highlight = (1-1) (1-last)] {} ;
+ \node [highlight = (2-1) (2-last)] {} ;
+ \node [highlight = (3-1) (3-last)] {} ;
\end{tikzpicture}
\Body
a & a + b & a + b + c & L_1 \\
@@ -7791,9 +7816,9 @@
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt, create-medium-nodes]
\CodeBefore [create-cell-nodes]
\begin{tikzpicture} \emph{[name suffix = -medium]}
- \node [highlight = (1-1) (1-3)] {} ;
- \node [highlight = (2-1) (2-3)] {} ;
- \node [highlight = (3-1) (3-3)] {} ;
+ \node [highlight = (1-1) (1-last)] {} ;
+ \node [highlight = (2-1) (2-last)] {} ;
+ \node [highlight = (3-1) (3-last)] {} ;
\end{tikzpicture}
\Body
a & a + b & a + b + c & L_1 \\
@@ -7806,9 +7831,9 @@
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt, create-medium-nodes]
\CodeBefore [create-cell-nodes]
\begin{tikzpicture} [name suffix = -medium]
- \node [highlight = (1-1) (1-3)] {} ;
- \node [highlight = (2-1) (2-3)] {} ;
- \node [highlight = (3-1) (3-3)] {} ;
+ \node [highlight = (1-1) (1-last)] {} ;
+ \node [highlight = (2-1) (2-last)] {} ;
+ \node [highlight = (3-1) (3-last)] {} ;
\end{tikzpicture}
\Body
a & a + b & a + b + c & L_1 \\
@@ -7981,7 +8006,14 @@
\vspace{1cm}
\section{History}
-The successive versions of the file |nicematrix.sty| provided by TeXLive are available on the
+The development of the package \pkg{nicematrix} is done in the following GitHub
+depot:\par\nobreak
+
+\nolinkurl{https://github.com/fpantigny/nicematrix}
+
+\medskip
+The successive versions of the file |nicematrix.sty| provided by TeXLive are
+also available on the
\textsc{svn} server of TeXLive:\par\nobreak
\smallskip
@@ -8183,7 +8215,7 @@
Correction of a bug with the columns |V| of \pkg{varwidth}.
Correction of a bug: the use of |\hdottedline| and |:| in the preamble of the
-array (of another letter specified by |letter-for-dotted-lines|) was
+array (or another letter specified by |letter-for-dotted-lines|) was
incompatible with the key |xdots/line-style|.
\subsection*{Changes between versions 6.2 and 6.3}
@@ -8196,7 +8228,7 @@
\subsection*{Changes between versions 6.1 and 6.2}
-Better compatibility with the classes \cls{revtex4-1} and \cls{revtex4-2}.
+Better compatibility with the classes \cls{revtex4-1} (deprecated) and \cls{revtex4-2}.
Key |vlines-in-sub-matrix|.
@@ -8215,14 +8247,15 @@
\newpage
+
\tableofcontents
+
\end{document}
% \endinput
% Local Variables:
-% TeX-fold-mode: t
-% TeX-fold-preserve-comments: nil
+% LaTeX-verbatim-environments-local: ("Code")
% fill-column: 80
% End:
Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx 2025-04-28 19:47:40 UTC (rev 75043)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx 2025-04-28 19:48:18 UTC (rev 75044)
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{7.1b}
-\def\myfiledate{2025/03/30}
+\def\myfileversion{7.1c}
+\def\myfiledate{2025/04/28}
%
%
%<*batchfile>
@@ -29,6 +29,7 @@
\preamble
+
Copyright (C) 2018-2025 by F. Pantigny
-----------------------------------
@@ -154,14 +155,13 @@
{ \msg_fatal:nn { nicematrix } { latex-too-old } }
% \end{macrocode}
%
-
%
% \begin{macrocode}
-\ProvideDocumentCommand{\IfPackageLoadedT}{mm}
- {\IfPackageLoadedTF{#1}{#2}{}}
+\ProvideDocumentCommand { \IfPackageLoadedT } { m m }
+ { \IfPackageLoadedTF { #1 } { #2 } { } }
-\ProvideDocumentCommand{\IfPackageLoadedF}{mm}
- {\IfPackageLoadedTF{#1}{}{#2}}
+\ProvideDocumentCommand { \IfPackageLoadedF } { m m }
+ { \IfPackageLoadedTF { #1 } { } { #2 } }
% \end{macrocode}
%
% \bigskip
@@ -218,7 +218,11 @@
% warning on Overleaf. The argument is given by curryfication.
% \begin{macrocode}
\cs_new_protected:Npn \@@_error_or_warning:n
- { \bool_if:NTF \g_@@_messages_for_Overleaf_bool \@@_warning:n \@@_error:n }
+ {
+ \bool_if:NTF \g_@@_messages_for_Overleaf_bool
+ { \@@_warning:n }
+ { \@@_error:n }
+ }
% \end{macrocode}
%
% We try to detect whether the compilation is done on Overleaf. We use
@@ -256,12 +260,6 @@
}
% \end{macrocode}
%
-% \bigskip
-% We will delete in the future the following lines which are only a security.
-% \begin{macrocode}
-\cs_set:Npn \int_if_zero:NT #1 { \int_compare:nNnT #1 = \c_zero_int }
-\cs_set:Npn \int_if_zero:NTF #1 { \int_compare:nNnTF #1 = \c_zero_int }
-% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
@@ -359,7 +357,6 @@
%
% \begin{macrocode}
\cs_generate_variant:Nn \seq_set_split:Nnn { N o }
-\cs_generate_variant:Nn \str_lowercase:n { o }
\cs_generate_variant:Nn \str_set:Nn { N o }
\cs_generate_variant:Nn \tl_build_put_right:Nn { N o }
\prg_generate_conditional_variant:Nnn \clist_if_in:Nn { N e } { T , F, TF }
@@ -401,15 +398,15 @@
%
% 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. At the date April 2024, the current
+% way incompatible with our programmation. At the date April 2025, the current
% version \cls{revtex4-2} is 4.2f (compatible with \pkg{booktabs}).
%
% \begin{macrocode}
\IfClassLoadedTF { revtex4-1 }
- { \bool_const:Nn \c_@@_revtex_bool \c_true_bool }
+ { \bool_const:Nn \c_@@_revtex_bool { \c_true_bool } }
{
\IfClassLoadedTF { revtex4-2 }
- { \bool_const:Nn \c_@@_revtex_bool \c_true_bool }
+ { \bool_const:Nn \c_@@_revtex_bool { \c_true_bool } }
{
% \end{macrocode}
% Maybe one of the previous classes will be loaded inside another class... We
@@ -416,8 +413,8 @@
% try to detect that situation.
% \begin{macrocode}
\cs_if_exist:NT \rvtx at ifformat@geq
- { \bool_const:Nn \c_@@_revtex_bool \c_true_bool }
- { \bool_const:Nn \c_@@_revtex_bool \c_false_bool }
+ { \bool_const:Nn \c_@@_revtex_bool { \c_true_bool } }
+ { \bool_const:Nn \c_@@_revtex_bool { \c_false_bool } }
}
}
% \end{macrocode}
@@ -456,14 +453,14 @@
{
\mathinner
{
- \tex_mkern:D 1 mu
+ \mkern 1 mu
\box_move_up:nn { 1 pt } { \hbox { . } }
- \tex_mkern:D 2 mu
+ \mkern 2 mu
\box_move_up:nn { 4 pt } { \hbox { . } }
- \tex_mkern:D 2 mu
+ \mkern 2 mu
\box_move_up:nn { 7 pt }
{ \vbox:n { \kern 7 pt \hbox { . } } }
- \tex_mkern:D 1 mu
+ \mkern 1 mu
}
}
% \end{macrocode}
@@ -481,11 +478,11 @@
\hook_gput_code:nnn { begindocument } { . }
{
\IfPackageLoadedT { booktabs }
- { \iow_now:Nn \@mainaux \nicematrix at redefine@check at rerun }
+ { \iow_now:Nn \@mainaux { \nicematrix at redefine@check at rerun } }
}
\cs_set_protected:Npn \nicematrix at redefine@check at rerun
{
- \cs_set_eq:NN \@@_old_pgfutil at check@rerun \pgfutil at check@rerun
+ \let \@@_old_pgfutil at check@rerun \pgfutil at check@rerun
% \end{macrocode}
% The new version of |\pgfutil at check@rerun| will not check the PGF nodes whose
% names start with |nm-| (which is the prefix for the nodes created by
@@ -496,7 +493,7 @@
% \end{macrocode}
% |\str_if_eq:ee(TF)| is faster than |\str_if_eq:nn(TF)|.
% \begin{macrocode}
- \str_if_eq:eeF { nm- } { \tl_range:nnn { ##1 } 1 3 }
+ \str_if_eq:eeF { nm- } { \tl_range:nnn { ##1 } { 1 } { 3 } }
{ \@@_old_pgfutil at check@rerun { ##1 } { ##2 } }
}
}
@@ -508,30 +505,67 @@
% \begin{macrocode}
\hook_gput_code:nnn { begindocument } { . }
{
- \IfPackageLoadedF { colortbl }
+ \cs_set_protected:Npe \@@_everycr:
+ {
+ \IfPackageLoadedTF { colortbl } { \CT at everycr } { \everycr }
+ { \noalign { \@@_in_everycr: } }
+ }
+ \IfPackageLoadedTF { colortbl }
+ {
+ \cs_set_eq:NN \@@_old_cellcolor: \cellcolor
+ \cs_set_eq:NN \@@_old_rowcolor: \rowcolor
+ \cs_new_protected:Npn \@@_revert_colortbl:
+ {
+ \hook_gput_code:nnn { env / tabular / begin } { nicematrix }
+ {
+ \cs_set_eq:NN \cellcolor \@@_old_cellcolor:
+ \cs_set_eq:NN \rowcolor \@@_old_rowcolor:
+ }
+ }
+% \end{macrocode}
+% When \pkg{colortbl} is used, we have to catch the tokens |\columncolor| in the
+% preamble because, otherwise, \pkg{colortbl} will catch them and the colored
+% panels won't be drawn by \pkg{nicematrix} but by \pkg{colortbl} (with an
+% output which is not perfect).
+% \begin{macrocode}
+ \cs_new_protected:Npn \@@_replace_columncolor:
+ {
+ \tl_replace_all:Nnn \g_@@_array_preamble_tl
+ { \columncolor }
+ { \@@_columncolor_preamble }
+% \end{macrocode}
+% |\@@_column_preamble|, despite its name, will be defined with
+% |\NewDocumentCommand| because it takes in an optional argument between square
+% brackets in first position for the colorimetric space.
+% \begin{macrocode}
+ }
+ }
{
+ \cs_new_protected:Npn \@@_revert_colortbl: { }
+ \cs_new_protected:Npn \@@_replace_columncolor:
+ { \cs_set_eq:NN \columncolor \@@_columncolor_preamble }
% \end{macrocode}
% The command |\CT at 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.
% \begin{macrocode}
- \cs_set_protected:Npn \CT at arc@ { }
- \cs_set_nopar:Npn \arrayrulecolor #1 # { \CT at arc { #1 } }
- \cs_set_nopar:Npn \CT at arc #1 #2
+ \def \CT at arc@ { }
+ \def \arrayrulecolor #1 # { \CT at arc { #1 } }
+ \def \CT at arc #1 #2
{
- \dim_compare:nNnT \baselineskip = \c_zero_dim \noalign
+ \dim_compare:nNnT { \baselineskip } = { \c_zero_dim } { \noalign }
{ \cs_gset_nopar:Npn \CT at arc@ { \color #1 { #2 } } }
}
% \end{macrocode}
% Idem for |\CT at drs@|.
% \begin{macrocode}
- \cs_set_nopar:Npn \doublerulesepcolor #1 # { \CT at drs { #1 } }
- \cs_set_nopar:Npn \CT at drs #1 #2
+ \def \doublerulesepcolor #1 # { \CT at drs { #1 } }
+ \def \CT at drs #1 #2
{
- \dim_compare:nNnT \baselineskip = \c_zero_dim \noalign
+ \dim_compare:nNnT { \baselineskip } = { \c_zero_dim } { \noalign }
{ \cs_gset:Npn \CT at drsc@ { \color #1 { #2 } } }
}
- \cs_set_nopar:Npn \hline
+ \def \hline
{
\noalign { \ifnum 0 = `} \fi
\cs_set_eq:NN \hskip \vskip
@@ -546,15 +580,15 @@
% \end{macrocode}
%
% \bigskip
-% We have to redefine |\cline| for several reasons. The command |\@@_cline| will
+% We have to redefine |\cline| for several reasons. The command |\@@_cline:| will
% be linked to |\cline| in the beginning of |{NiceArrayWithDelims}|. The
% following commands must \emph{not} be protected.
% \begin{macrocode}
-\cs_set_nopar:Npn \@@_standard_cline #1 { \@@_standard_cline:w #1 \q_stop }
+\cs_set_nopar:Npn \@@_standard_cline: #1 { \@@_standard_cline:w #1 \q_stop }
\cs_set_nopar:Npn \@@_standard_cline:w #1-#2 \q_stop
{
- \int_if_zero:nT \l_@@_first_col_int { \omit & }
- \int_compare:nNnT { #1 } > \c_one_int
+ \int_if_zero:nT { \l_@@_first_col_int } { \omit & }
+ \int_compare:nNnT { #1 } > { \c_one_int }
{ \multispan { \int_eval:n { #1 - 1 } } & }
\multispan { \int_eval:n { #2 - #1 + 1 } }
{
@@ -575,7 +609,7 @@
% \begin{macrocode}
\everycr { }
\cr
- \noalign { \skip_vertical:N -\arrayrulewidth }
+ \noalign { \skip_vertical:n { - \arrayrulewidth } }
}
% \end{macrocode}
%
@@ -584,7 +618,7 @@
% to |\arrayrulewidth| as does |\hline|. It will be loaded excepted if the key
% |standard-cline| has been used.
% \begin{macrocode}
-\cs_set:Npn \@@_cline
+\cs_set:Npn \@@_cline:
% \end{macrocode}
% We have to act in a fully expandable way since there may be |\noalign| (in the
% |\multispan|) to detect. That's why we use |\@@_cline_i:en|.
@@ -604,7 +638,7 @@
{ \@@_cline_iii:w #1|#2-#2 \q_stop }
{ \@@_cline_ii:w #1|#2-#3 \q_stop }
}
-\cs_set:Npn \@@_cline_ii:w #1|#2-#3-\q_stop
+\cs_set:Npn \@@_cline_ii:w #1|#2-#3- \q_stop
{ \@@_cline_iii:w #1|#2-#3 \q_stop }
\cs_set:Npn \@@_cline_iii:w #1|#2-#3 \q_stop
{
@@ -640,27 +674,27 @@
%
% \bigskip
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_set_CT at arc@:n { o }
-\cs_new_protected:Npn \@@_set_CT at arc@:n #1
+\cs_new_protected:Npn \@@_set_CTarc:n #1
{
\tl_if_blank:nF { #1 }
{
\tl_if_head_eq_meaning:nNTF { #1 } [
- { \cs_set_nopar:Npn \CT at arc@ { \color #1 } }
- { \cs_set_nopar:Npn \CT at arc@ { \color { #1 } } }
+ { \def \CT at arc@ { \color #1 } }
+ { \def \CT at arc@ { \color { #1 } } }
}
}
+\cs_generate_variant:Nn \@@_set_CTarc:n { o }
% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_set_CT at drsc@:n { o }
-\cs_new_protected:Npn \@@_set_CT at drsc@:n #1
+\cs_new_protected:Npn \@@_set_CTdrsc:n #1
{
\tl_if_head_eq_meaning:nNTF { #1 } [
- { \cs_set_nopar:Npn \CT at drsc@ { \color #1 } }
- { \cs_set_nopar:Npn \CT at drsc@ { \color { #1 } } }
+ { \def \CT at drsc@ { \color #1 } }
+ { \def \CT at drsc@ { \color { #1 } } }
}
+\cs_generate_variant:Nn \@@_set_CTdrsc:n { o }
% \end{macrocode}
%
% \bigskip
@@ -667,7 +701,6 @@
% The following command must \emph{not} be protected since it will be used to
% write instructions in the |\g_@@_pre_code_before_tl|.
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_exp_color_arg:Nn { N o }
\cs_new:Npn \@@_exp_color_arg:Nn #1 #2
{
\tl_if_head_eq_meaning:nNTF { #2 } [
@@ -674,13 +707,14 @@
{ #1 #2 }
{ #1 { #2 } }
}
+\cs_generate_variant:Nn \@@_exp_color_arg:Nn { N o }
% \end{macrocode}
%
% The following command must be protected because of its use of the command |\color|.
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_color:n { o }
\cs_new_protected:Npn \@@_color:n #1
{ \tl_if_blank:nF { #1 } { \@@_exp_color_arg:Nn \color { #1 } } }
+\cs_generate_variant:Nn \@@_color:n { o }
% \end{macrocode}
%
%
@@ -698,7 +732,26 @@
}
% \end{macrocode}
%
+% \bigskip
+% \bigskip
+% The L3 programming layer provides scratch dimensions |\l_tmpa_dim| and
+% |\l_tmpb_dim|. We create several more in the same spirit.
+% \begin{macrocode}
+\dim_new:N \l_@@_tmpc_dim
+\dim_new:N \l_@@_tmpd_dim
+\dim_new:N \l_@@_tmpe_dim
+\dim_new:N \l_@@_tmpf_dim
+% \end{macrocode}
%
+% \begin{macrocode}
+\tl_new:N \l_@@_tmpc_tl
+\tl_new:N \l_@@_tmpd_tl
+% \end{macrocode}
+%
+% \begin{macrocode}
+\int_new:N \l_@@_tmpc_int
+% \end{macrocode}
+%
% \bigskip
% \section{Parameters}
%
@@ -867,12 +920,12 @@
% \end{macrocode}
%
% \bigskip
-% The sequence |\g_@@_names_seq| will be the list of all the names of
+% The clist |\g_@@_names_clist| will be the list of all the names of
% environments used (via the option |name|) in the document: two environments
% must not have the same name. However, it's possible to use the option
% |allow-duplicate-names|.
% \begin{macrocode}
-\seq_new:N \g_@@_names_seq
+\clist_new:N \g_@@_names_clist
% \end{macrocode}
%
% \bigskip
@@ -890,6 +943,13 @@
% \end{macrocode}
%
% \bigskip
+% \begin{macrocode}
+\bool_new:N \l_@@_initial_open_bool
+\bool_new:N \l_@@_final_open_bool
+% \end{macrocode}
+%
+%
+% \bigskip
% If the user uses |{NiceTabular*}|, the width of the tabular (in the first
% argument of the environment |{NiceTabular*}|) will be stored in the following
% dimension.
@@ -927,7 +987,7 @@
% \bigskip
% In a cell, it will be possible to know whether we are in a cell of a column of
% type |X| thanks to that flag (the |X| columns of \pkg{nicematrix} are inspired
-% by those of \pkg{tabularx}).
+% by those of \pkg{tabularx}). You will use that flag for the blocks.
% \begin{macrocode}
\bool_new:N \l_@@_X_bool
% \end{macrocode}
@@ -946,7 +1006,7 @@
% We will write in |\g_@@_aux_tl| all the instructions that we have to write on
% the |aux| file for the current environment. The contain of that token list
% will be written on the |aux| file at the end of the environment (in an
-% instruction |\tl_gset:cn { c_@@_ \int_use:N \g_@@_env_int _ tl }|).
+% instruction |\tl_gset:cn { g_@@_ \int_use:N \g_@@_env_int _ tl }|).
% \begin{macrocode}
\tl_new:N \g_@@_aux_tl
% \end{macrocode}
@@ -1156,18 +1216,17 @@
% \end{macrocode}
%
% \bigskip
-% The sum of the weights of all the |X|-columns in the preamble. The weight of a
-% |X|-column is given as an optional argument between square brackets. The
-% default value, of course, is $1$.
+% The sum of the weights of all the |X|-columns in the preamble.
% \begin{macrocode}
-\int_new:N \g_@@_total_X_weight_int
+\fp_new:N \g_@@_total_X_weight_fp
% \end{macrocode}
-%
+%
+% \bigskip
% If there is at least one |X|-column in the preamble of the array, the
% following flag will be raised via the |aux| file. The length
-% |l_@@_x_columns_dim| will be the width of |X|-columns of weight $1$ (the width
-% of a column of weigth $n$ will be that dimension multiplied by~$n$). That
-% value is computed after the construction of the array during the first
+% |l_@@_x_columns_dim| will be the width of |X|-columns of weight $1.0$ (the
+% width of a column of weight $x$ will be that dimension multiplied by~$x$).
+% That value is computed after the construction of the array during the first
% compilation in order to be used in the following run.
% \begin{macrocode}
\bool_new:N \l_@@_X_columns_aux_bool
@@ -1174,7 +1233,6 @@
\dim_new:N \l_@@_X_columns_dim
% \end{macrocode}
%
-%
% \bigskip
% This boolean will be used only to detect in an expandable way whether we are
% at the beginning of the (potential) column zero, in order to raise an error if
@@ -1226,15 +1284,6 @@
\dim_new:N \l_@@_y_final_dim
% \end{macrocode}
%
-% \bigskip
-% The L3 programming layer provides scratch dimensions |\l_tmpa_dim| and
-% |\l_tmpb_dim|. We create several more in the same spirit.
-% \begin{macrocode}
-\dim_new:N \l_@@_tmpc_dim
-\dim_new:N \l_@@_tmpd_dim
-\dim_new:N \l_@@_tmpe_dim
-\dim_new:N \l_@@_tmpf_dim
-% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
@@ -1321,7 +1370,6 @@
% \begin{macrocode}
\seq_new:N \g_@@_pos_of_stroken_blocks_seq
% \end{macrocode}
-%
%
% \medskip
% If the user has used the key |corners|, all the cells which are in an (empty)
@@ -1360,6 +1408,30 @@
% \end{macrocode}
%
% \medskip
+% By default, the diagonal lines will be parallelized\footnote{It's possible to
+% use the option |parallelize-diags| to disable this parallelization.}. There
+% are two types of diagonals lines: the $|\Ddots|$ diagonals and the |\Iddots|
+% diagonals. We have to count both types in order to know whether a diagonal is
+% the first of its type in the current |{NiceArray}| environment.
+% \begin{macrocode}
+\int_new:N \g_@@_ddots_int
+\int_new:N \g_@@_iddots_int
+% \end{macrocode}
+%
+% The dimensions |\g_@@_delta_x_one_dim| and |\g_@@_delta_y_one_dim| will
+% contain the $\Delta_x$ and $\Delta_y$ of the first |\Ddots| diagonal. We have
+% to store these values in order to draw the others |\Ddots| diagonals parallel
+% to the first one. Similarly |\g_@@_delta_x_two_dim| and
+% |\g_@@_delta_y_two_dim| are the $\Delta_x$ and $\Delta_y$ of the first
+% |\Iddots| diagonal.
+% \begin{macrocode}
+\dim_new:N \g_@@_delta_x_one_dim
+\dim_new:N \g_@@_delta_y_one_dim
+\dim_new:N \g_@@_delta_x_two_dim
+\dim_new:N \g_@@_delta_y_two_dim
+% \end{macrocode}
+%
+% \medskip
% The following counters will be used when searching the extremities of a dotted
% line (we need these counters because of the potential ``open'' lines in the
% |\SubMatrix|---the |\SubMatrix| in the |code-before|).
@@ -1369,7 +1441,16 @@
\int_new:N \l_@@_col_min_int
\int_new:N \l_@@_col_max_int
% \end{macrocode}
+%
% \medskip
+% \begin{macrocode}
+\int_new:N \l_@@_initial_i_int
+\int_new:N \l_@@_initial_j_int
+\int_new:N \l_@@_final_i_int
+\int_new:N \l_@@_final_j_int
+% \end{macrocode}
+%
+% \medskip
% The following counters will be used when drawing the rules.
% \begin{macrocode}
\int_new:N \l_@@_start_int
@@ -1548,7 +1629,7 @@
% the value will be~$0$.
% \begin{macrocode}
\int_new:N \l_@@_first_row_int
-\int_set:Nn \l_@@_first_row_int 1
+\int_set_eq:NN \l_@@_first_row_int \c_one_int
% \end{macrocode}
%
% \medskip
@@ -1636,13 +1717,13 @@
%
% \medskip
% \begin{macrocode}
-\cs_new_protected:Npn \@@_cut_on_hyphen:w #1-#2\q_stop
+\cs_new_protected:Npn \@@_cut_on_hyphen:w #1-#2 \q_stop
{
% \end{macrocode}
-% Here, we use |\cs_set_nopar:Npn| instead of |\tl_set:Nn| for efficiency only.
+% Here, we use |\def| instead of |\tl_set:Nn| for efficiency only.
% \begin{macrocode}
- \cs_set_nopar:Npn \l_tmpa_tl { #1 }
- \cs_set_nopar:Npn \l_tmpb_tl { #2 }
+ \def \l_tmpa_tl { #1 }
+ \def \l_tmpb_tl { #2 }
}
% \end{macrocode}
%
@@ -1666,12 +1747,12 @@
{ \@@_cut_on_hyphen:w ##1 \q_stop }
{
% \end{macrocode}
-% Here, we use |\cs_set_nopar:Npn| instead of |\tl_set:Nn| for efficiency only.
+% Here, we use |\def| instead of |\tl_set:Nn| for efficiency only.
% \begin{macrocode}
- \cs_set_nopar:Npn \l_tmpa_tl { ##1 }
- \cs_set_nopar:Npn \l_tmpb_tl { ##1 }
+ \def \l_tmpa_tl { ##1 }
+ \def \l_tmpb_tl { ##1 }
}
- \int_step_inline:nnn \l_tmpa_tl \l_tmpb_tl
+ \int_step_inline:nnn { \l_tmpa_tl } { \l_tmpb_tl }
{ \clist_put_right:Nn \l_tmpa_clist { ####1 } }
}
\tl_set_eq:NN #1 \l_tmpa_clist
@@ -1864,9 +1945,9 @@
% \begin{macrocode}
\NewDocumentCommand \tabularnote { o m }
{
- \bool_lazy_or:nnT { \cs_if_exist_p:N \@captype } \l_@@_in_env_bool
+ \bool_lazy_or:nnT { \cs_if_exist_p:N \@captype } { \l_@@_in_env_bool }
{
- \bool_lazy_and:nnTF { ! \l_@@_tabular_bool } \l_@@_in_env_bool
+ \bool_lazy_and:nnTF { ! \l_@@_tabular_bool } { \l_@@_in_env_bool }
{ \@@_error:n { tabularnote~forbidden } }
{
\bool_if:NTF \l_@@_in_caption_bool
@@ -1935,10 +2016,10 @@
\seq_map_break:
}
}
- \int_if_zero:nF \l_tmpa_int
+ \int_if_zero:nF { \l_tmpa_int }
{ \int_add:Nn \l_tmpa_int \g_@@_notes_caption_int }
}
- \int_if_zero:nT \l_tmpa_int
+ \int_if_zero:nT { \l_tmpa_int }
{
\seq_gput_right:Nn \g_@@_notes_seq { { #1 } { #2 } }
\tl_if_novalue:nT { #1 } { \int_gincr:N \c at tabularnote }
@@ -1951,9 +2032,9 @@
{
\int_eval:n
{
- \int_if_zero:nTF \l_tmpa_int
- \c at tabularnote
- \l_tmpa_int
+ \int_if_zero:nTF { \l_tmpa_int }
+ { \c at tabularnote }
+ { \l_tmpa_int }
}
}
}
@@ -1992,7 +2073,7 @@
% \begin{macrocode}
\int_gincr:N \g_@@_tabularnote_int
\refstepcounter { tabularnote }
- \int_compare:nNnT \l_tmpa_int = \c at tabularnote
+ \int_compare:nNnT { \l_tmpa_int } = { \c at tabularnote }
{ \int_gincr:N \c at tabularnote }
\seq_clear:N \l_@@_notes_labels_seq
\bool_lazy_or:nnTF
@@ -2026,7 +2107,7 @@
{
\bool_if:NTF \g_@@_caption_finished_bool
{
- \int_compare:nNnT \c at tabularnote = \g_@@_notes_caption_int
+ \int_compare:nNnT { \c at tabularnote } = { \g_@@_notes_caption_int }
{ \int_gzero:N \c at tabularnote }
% \end{macrocode}
% Now, we try to detect duplicate notes in the caption.
@@ -2289,15 +2370,6 @@
% \end{macrocode}
%
% \bigskip
-% \begin{macrocode}
-\dim_new:N \l_@@_notes_above_space_dim
-\hook_gput_code:nnn { begindocument } { . }
- { \dim_set:Nn \l_@@_notes_above_space_dim { 1 mm } }
-% \end{macrocode}
-% We use a hook only by security in case \cls{revtex4-1} is used (even though it
-% is obsolete).
-%
-% \bigskip
% The flag |\l_@@_nullify_dots_bool| corresponds to the option |nullify-dots|.
% When the flag is down, the instructions like |\vdots| are inserted within a
% |\hphantom| (and so the constructed matrix has exactly the same size as a
@@ -2310,8 +2382,7 @@
% \medskip
% When the key |respect-arraystretch| is used, the following command will be nullified.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_reset_arraystretch:
- { \cs_set_nopar:Npn \arraystretch { 1 } }
+\cs_new_protected:Npn \@@_reset_arraystretch: { \def \arraystretch { 1 } }
% \end{macrocode}
%
%
@@ -2325,9 +2396,11 @@
%
% \bigskip
% The following boolean corresponds to the key |create-cell-nodes| of the
-% keyword |\CodeBefore|.
+% keyword |\CodeBefore|. When that key is used the ``cell nodes'' will be created
+% before the |\CodeBefore| but, of course, they are \emph{always} available in
+% the main tabular and after!
% \begin{macrocode}
-\bool_new:N \g_@@_recreate_cell_nodes_bool
+\bool_new:N \g_@@_create_cell_nodes_bool
% \end{macrocode}
%
% \bigskip
@@ -2435,6 +2508,8 @@
shorten .value_required:n = true ,
horizontal-labels .bool_set:N = \l_@@_xdots_h_labels_bool ,
horizontal-labels .default:n = true ,
+ horizontal-label .bool_set:N = \l_@@_xdots_h_labels_bool ,
+ horizontal-label .default:n = true ,
line-style .code:n =
{
\bool_lazy_or:nnTF
@@ -2503,7 +2578,7 @@
&-in-blocks .meta:n = ampersand-in-blocks ,
no-cell-nodes .code:n =
\bool_set_true:N \l_@@_no_cell_nodes_bool
- \cs_set_protected:Npn \@@_node_for_cell:
+ \cs_set_protected:Npn \@@_node_cell:
{ \set at color \box_use_drop:N \l_@@_cell_box } ,
no-cell-nodes .value_forbidden:n = true ,
rounded-corners .dim_set:N = \l_@@_tab_rounded_corners_dim ,
@@ -2560,7 +2635,7 @@
% We write directly a command for the automata which reads the preamble provided
% by the final user.
% \begin{macrocode}
- { \cs_set_eq:cN { @@ _ #1 } \@@_make_preamble_vlism:n }
+ { \cs_set_eq:cN { @@ _ #1 : } \@@_make_preamble_vlism:n }
}
{ \@@_error:n { One~letter~allowed } }
} ,
@@ -2656,11 +2731,10 @@
% \begin{macrocode}
\legacy_if:nF { measuring@ }
{
- \str_set:Ne \l_tmpa_str { #1 }
- \seq_if_in:NoTF \g_@@_names_seq \l_tmpa_str
+ \str_set:Ne \l_@@_name_str { #1 }
+ \clist_if_in:NoTF \g_@@_names_clist \l_@@_name_str
{ \@@_error:nn { Duplicate~name } { #1 } }
- { \seq_gput_left:No \g_@@_names_seq \l_tmpa_str }
- \str_set_eq:NN \l_@@_name_str \l_tmpa_str
+ { \clist_gpush:No \g_@@_names_clist \l_@@_name_str }
} ,
name .value_required:n = true ,
code-after .tl_gset:N = \g_nicematrix_code_after_tl ,
@@ -3025,8 +3099,11 @@
% the |\everycr| because some packages, like \pkg{arydshln}, create special rows
% in the |\halign| that we don't want to take into account.
% \begin{macrocode}
- \int_compare:nNnT \c at jCol = \c_one_int
- { \int_compare:nNnT \l_@@_first_col_int = \c_one_int \@@_begin_of_row: }
+ \int_compare:nNnT { \c at jCol } = { \c_one_int }
+ {
+ \int_compare:nNnT { \l_@@_first_col_int } = { \c_one_int }
+ { \@@_begin_of_row: }
+ }
% \end{macrocode}
% The content of the cell is composed in the box |\l_@@_cell_box|. The
% |\hbox_set_end:| corresponding to this |\hbox_set:Nw| is in the
@@ -3052,9 +3129,9 @@
% \begin{Verbatim}
% \cs_new_protected:Npn \@@_tuning_first_row:
% {
-% \int_if_zero:nT \c at iRow
+% \int_if_zero:nT { \c at iRow }
% {
-% \int_compare:nNnT \c at jCol > 0
+% \int_if_zero:nF { \c at jCol }
% {
% \l_@@_code_for_first_row_tl
% \xglobal \colorlet { nicematrix-first-row } { . }
@@ -3082,7 +3159,7 @@
% \begin{Verbatim}
% \cs_new_protected:Npn \@@_tuning_last_row:
% {
-% \int_compare:nNnT \c at iRow = \l_@@_last_row_int
+% \int_compare:nNnT { \c at iRow } = { \l_@@_last_row_int }
% {
% \l_@@_code_for_last_row_tl
% \xglobal \colorlet { nicematrix-last-row } { . }
@@ -3094,7 +3171,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_tuning_last_row:
{
- \if_int_compare:w \c at iRow = \l_@@_last_row_int
+ \if_int_compare:w \c at iRow = \l_@@_last_row_int
\l_@@_code_for_last_row_tl
\xglobal \colorlet { nicematrix-last-row } { . }
\fi:
@@ -3101,7 +3178,7 @@
}
% \end{macrocode}
%
-% A different value will be provided to the following command when the key
+% A different value will be provided to the following commands when the key
% |small| is in force.
% \begin{macrocode}
\cs_set_eq:NN \@@_tuning_key_small: \prg_do_nothing:
@@ -3111,7 +3188,7 @@
% \begin{macrocode}
\cs_set_nopar:Npn \@@_tuning_not_tabular_begin:
{
- \m at th % added 2024/11/21
+ \m at th
\c_math_toggle_token
% \end{macrocode}
% A special value is provided by the following control sequence when the key
@@ -3147,7 +3224,7 @@
\endpgfpicture
}
% \end{macrocode}
-% Remark: If the key |recreate-cell-nodes| of the |\CodeBefore| is used, then we
+% Remark: If the key |create-cell-nodes| of the |\CodeBefore| is used, then we
% will add some lines to that command.
%
%
@@ -3159,17 +3236,20 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_update_for_first_and_last_row:
{
- \int_if_zero:nTF \c at iRow
+ \int_if_zero:nTF { \c at iRow }
{
- \dim_compare:nNnT { \box_dp:N \l_@@_cell_box } > \g_@@_dp_row_zero_dim
+ \dim_compare:nNnT
+ { \box_dp:N \l_@@_cell_box } > { \g_@@_dp_row_zero_dim }
{ \dim_gset:Nn \g_@@_dp_row_zero_dim { \box_dp:N \l_@@_cell_box } }
- \dim_compare:nNnT { \box_ht:N \l_@@_cell_box } > \g_@@_ht_row_zero_dim
+ \dim_compare:nNnT
+ { \box_ht:N \l_@@_cell_box } > { \g_@@_ht_row_zero_dim }
{ \dim_gset:Nn \g_@@_ht_row_zero_dim { \box_ht:N \l_@@_cell_box } }
}
{
- \int_compare:nNnT \c at iRow = \c_one_int
+ \int_compare:nNnT { \c at iRow } = { \c_one_int }
{
- \dim_compare:nNnT { \box_ht:N \l_@@_cell_box } > \g_@@_ht_row_one_dim
+ \dim_compare:nNnT
+ { \box_ht:N \l_@@_cell_box } > { \g_@@_ht_row_one_dim }
{ \dim_gset:Nn \g_@@_ht_row_one_dim { \box_ht:N \l_@@_cell_box } }
}
}
@@ -3184,7 +3264,7 @@
{
\hbox_set:Nn \l_@@_cell_box
{
- \m at th % add 2024/11/21
+ \m at th
\c_math_toggle_token
\vcenter { \box_use:N \l_@@_cell_box }
\c_math_toggle_token
@@ -3191,7 +3271,7 @@
}
}
{
- \int_compare:nNnT \c at iRow = \l_@@_last_row_int
+ \int_compare:nNnT { \c at iRow } = { \l_@@_last_row_int }
{
\vbox_set_top:Nn \l_@@_cell_box
{
@@ -3209,22 +3289,22 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_adjust_size_box:
{
- \dim_compare:nNnT \g_@@_blocks_wd_dim > \c_zero_dim
+ \dim_compare:nNnT { \g_@@_blocks_wd_dim } > { \c_zero_dim }
{
\box_set_wd:Nn \l_@@_cell_box
- { \dim_max:nn { \box_wd:N \l_@@_cell_box } \g_@@_blocks_wd_dim }
+ { \dim_max:nn { \box_wd:N \l_@@_cell_box } { \g_@@_blocks_wd_dim } }
\dim_gzero:N \g_@@_blocks_wd_dim
}
- \dim_compare:nNnT \g_@@_blocks_dp_dim > \c_zero_dim
+ \dim_compare:nNnT { \g_@@_blocks_dp_dim } > { \c_zero_dim }
{
\box_set_dp:Nn \l_@@_cell_box
- { \dim_max:nn { \box_dp:N \l_@@_cell_box } \g_@@_blocks_dp_dim }
+ { \dim_max:nn { \box_dp:N \l_@@_cell_box } { \g_@@_blocks_dp_dim } }
\dim_gzero:N \g_@@_blocks_dp_dim
}
- \dim_compare:nNnT \g_@@_blocks_ht_dim > \c_zero_dim
+ \dim_compare:nNnT { \g_@@_blocks_ht_dim } > { \c_zero_dim }
{
\box_set_ht:Nn \l_@@_cell_box
- { \dim_max:nn { \box_ht:N \l_@@_cell_box } \g_@@_blocks_ht_dim }
+ { \dim_max:nn { \box_ht:N \l_@@_cell_box } { \g_@@_blocks_ht_dim } }
\dim_gzero:N \g_@@_blocks_ht_dim
}
}
@@ -3251,7 +3331,7 @@
% composition in order to modify that box.
% \begin{macrocode}
\g_@@_cell_after_hook_tl
- \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box:
+ \bool_if:NT \g_@@_rotate_bool { \@@_rotate_cell_box: }
\@@_adjust_size_box:
% \end{macrocode}
%
@@ -3305,14 +3385,14 @@
{ \box_use_drop:N \l_@@_cell_box }
{
\bool_if:NTF \g_@@_not_empty_cell_bool
- \@@_print_node_cell:
+ { \@@_print_node_cell: }
{
- \dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > \c_zero_dim
- \@@_print_node_cell:
+ \dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > { \c_zero_dim }
+ { \@@_print_node_cell: }
{ \box_use_drop:N \l_@@_cell_box }
}
}
- \int_compare:nNnT \c at jCol > \g_@@_col_total_int
+ \int_compare:nNnT { \c at jCol } > { \g_@@_col_total_int }
{ \int_gset_eq:NN \g_@@_col_total_int \c at jCol }
\bool_gset_false:N \g_@@_empty_cell_bool
\bool_gset_false:N \g_@@_not_empty_cell_bool
@@ -3325,7 +3405,7 @@
\cs_new_protected:Npn \@@_update_max_cell_width:
{
\dim_gset:Nn \g_@@_max_cell_width_dim
- { \dim_max:nn \g_@@_max_cell_width_dim { \box_wd:N \l_@@_cell_box } }
+ { \dim_max:nn { \g_@@_max_cell_width_dim } { \box_wd:N \l_@@_cell_box } }
}
% \end{macrocode}
%
@@ -3364,7 +3444,7 @@
%
% \bigskip
% In the cells of a column of type |S| (of \pkg{siunitx}), we have to wrap the
-% command |\@@_node_for_cell:| inside a command of \pkg{siunitx} to inforce the
+% command |\@@_node_cell:| inside a command of \pkg{siunitx} to inforce the
% correct horizontal alignment. In the cells of the columns with other columns
% type, we don't have to do that job. That's why we create a socket with its
% default plug (|identity|) and a plug when we have to do the wrapping.
@@ -3376,14 +3456,46 @@
{
__siunitx_table_align_
\bool_if:NTF \l__siunitx_table_text_bool
- \l__siunitx_table_align_text_tl
- \l__siunitx_table_align_number_tl
+ { \l__siunitx_table_align_text_tl }
+ { \l__siunitx_table_align_number_tl }
:n
}
{ #1 }
}
+% \end{macrocode}
+%
+% \bigskip
+% Now, a socket which deal with |create-cell-nodes| of the keyword
+% |\CodeBefore|. When that key is used the ``cell nodes'' will be created before
+% the |\CodeBefore| but, of course, they are \emph{always} available in the main
+% tabular and after!
+% \begin{macrocode}
+\socket_new:nn { nicematrix / create-cell-nodes } { 1 }
+\socket_new_plug:nnn { nicematrix / create-cell-nodes } { active }
+ {
+ \box_move_up:nn { \box_ht:N \l_@@_cell_box }
+ \hbox:n
+ {
+ \pgfsys at markposition
+ { \@@_env: - \int_use:N \c at iRow - \int_use:N \c at jCol - NW }
+ }
+ #1
+ \box_move_down:nn { \box_dp:N \l_@@_cell_box }
+ \hbox:n
+ {
+ \pgfsys at markposition
+ { \@@_env: - \int_use:N \c at iRow - \int_use:N \c at jCol - SE }
+ }
+ }
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
\cs_new_protected:Npn \@@_print_node_cell:
- { \socket_use:nn { nicematrix / siunitx-wrap } { \@@_node_for_cell: } }
+ {
+ \socket_use:nn { nicematrix / siunitx-wrap }
+ { \socket_use:nn { nicematrix / create-cell-nodes } \@@_node_cell: }
+ }
% \end{macrocode}
%
% \bigskip
@@ -3390,7 +3502,7 @@
% The following command creates the \textsc{pgf} name of the node with, of
% course, |\l_@@_cell_box| as the content.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_node_for_cell:
+\cs_new_protected:Npn \@@_node_cell:
{
\pgfpicture
\pgfsetbaseline \c_zero_dim
@@ -3405,7 +3517,7 @@
% necessary only with XeLaTeX and not with the other engines (we don't know why).
% \begin{macrocode}
\set at color
- \box_use_drop:N \l_@@_cell_box
+ \box_use:N \l_@@_cell_box
}
{ \@@_env: - \int_use:N \c at iRow - \int_use:N \c at jCol }
{ \l_@@_pgf_node_code_tl }
@@ -3419,62 +3531,6 @@
}
% \end{macrocode}
%
-% \medskip
-% As its name says, the following command is a patch for the command
-% |\@@_node_for_cell:|. This patch will be appended on the left of
-% |\@@_node_for_the_cell:| when the construction of the cell nodes (of the form
-% |(i-j)|) in the |\CodeBefore| is required.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_node_for_cell:n #1
- {
- \cs_new_protected:Npn \@@_patch_node_for_cell:
- {
- \hbox_set:Nn \l_@@_cell_box
- {
- \box_move_up:nn { \box_ht:N \l_@@_cell_box}
- \hbox_overlap_left:n
- {
- \pgfsys at markposition
- { \@@_env: - \int_use:N \c at iRow - \int_use:N \c at jCol - NW }
-% \end{macrocode}
-% In the |#1|, we will put an adjustment which is needed when the compilation is
-% done with XeLaTeX or with the classical way |latex|, |dvips|, |ps2pdf| or
-% Adobe Distiller (I don't known why this adjustement is mandatory...). See the
-% use of that command |\@@_patch_node_for_cell:n| in a |\AtBeginDocument| just
-% below.
-% \begin{macrocode}
- #1
- }
- \box_use:N \l_@@_cell_box
- \box_move_down:nn { \box_dp:N \l_@@_cell_box }
- \hbox_overlap_left:n
- {
- \pgfsys at markposition
- { \@@_env: - \int_use:N \c at iRow - \int_use:N \c at jCol - SE }
- #1
- }
- }
- }
- }
-% \end{macrocode}
-%
-% \bigskip
-% We have no explanation for the different behaviour between the TeX engines...
-% We put the following instructions in a |\AtBeginDocument| because you use
-% |\sys_if_output_div_p:| and that test is available only when a backend is
-% loaded (and we don't want to force the loading of a backend with
-% |\sys_ensure_backend:|).
-% \begin{macrocode}
-\AtBeginDocument
- {
- \bool_lazy_or:nnTF \sys_if_engine_xetex_p: \sys_if_output_dvi_p:
- {
- \@@_patch_node_for_cell:n
- { \skip_horizontal:n { 0.5 \box_wd:N \l_@@_cell_box } }
- }
- { \@@_patch_node_for_cell:n { } }
- }
-% \end{macrocode}
%
%
% \interitem
@@ -3520,7 +3576,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_instruction_of_type:nnn #1 #2 #3
{
- \bool_if:nTF { #1 } \tl_gput_left:ce \tl_gput_right:ce
+ \bool_if:nTF { #1 } { \tl_gput_left:ce } { \tl_gput_right:ce }
{ g_@@_ #2 _ lines _ tl }
{
\use:c { @@ _ draw _ #2 : nnn }
@@ -3533,14 +3589,13 @@
%
% \bigskip
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_array:n { o }
\cs_new_protected:Npn \@@_array:n
{
% \begin{macrocode}
\dim_set:Nn \col at sep
- { \bool_if:NTF \l_@@_tabular_bool \tabcolsep \arraycolsep }
- \dim_compare:nNnTF \l_@@_tabular_width_dim = \c_zero_dim
- { \cs_set_nopar:Npn \@halignto { } }
+ { \bool_if:NTF \l_@@_tabular_bool { \tabcolsep } { \arraycolsep } }
+ \dim_compare:nNnTF { \l_@@_tabular_width_dim } = { \c_zero_dim }
+ { \def \@halignto { } }
{ \cs_set_nopar:Npe \@halignto { to \dim_use:N \l_@@_tabular_width_dim } }
% \end{macrocode}
% It \pkg{colortbl} is loaded, |\@tabarray| has been redefined to incorporate
@@ -3554,8 +3609,9 @@
% fully expandable and we need something fully expandable here.
% |\str_if_eq:ee(TF)| is faster than |\str_if_eq:nn(TF)|.
% \begin{macrocode}
- [ \str_if_eq:eeTF \l_@@_baseline_tl c c t ]
+ [ \str_if_eq:eeTF \l_@@_baseline_tl { c } { c } { t } ]
}
+\cs_generate_variant:Nn \@@_array:n { o }
% \end{macrocode}
%
% \medskip
@@ -3567,7 +3623,11 @@
% \begin{macrocode}
\bool_if:nTF
{ \c_@@_recent_array_bool && ! \c_@@_revtex_bool }
- { \cs_set_eq:NN \@@_old_ar at ialign: \ar at ialign }
+% \end{macrocode}
+% We use here a |\cs_set_eq:cN| instead of a |\cs_set_eq:NN| in order to avoid a
+% message when |explcheck| is used on |nicematrix.sty|.
+% \begin{macrocode}
+ { \cs_set_eq:cN { @@_old_ar at ialign: } \ar at ialign }
{ \cs_set_eq:NN \@@_old_ialign: \ialign }
% \end{macrocode}
%
@@ -3577,7 +3637,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_create_row_node:
{
- \int_compare:nNnT \c at iRow > \g_@@_last_row_node_int
+ \int_compare:nNnT { \c at iRow } > { \g_@@_last_row_node_int }
{
\int_gset_eq:NN \g_@@_last_row_node_int \c at iRow
\@@_create_row_node_i:
@@ -3651,9 +3711,9 @@
% row'' and that we are before that ``first row'', i.e. just before the
% beginning of the array.
% \begin{macrocode}
- \int_compare:nNnT \c at iRow > { -1 }
+ \int_compare:nNnT { \c at iRow } > { -1 }
{
- \int_compare:nNnF \c at iRow = \l_@@_last_row_int
+ \int_compare:nNnF { \c at iRow } = { \l_@@_last_row_int }
% \end{macrocode}
%
% \begin{macrocode}
@@ -3673,34 +3733,17 @@
% \begin{macrocode}
\cs_set_protected:Npn \@@_renew_dots:
{
- \cs_set_eq:NN \ldots \@@_Ldots
- \cs_set_eq:NN \cdots \@@_Cdots
- \cs_set_eq:NN \vdots \@@_Vdots
- \cs_set_eq:NN \ddots \@@_Ddots
- \cs_set_eq:NN \iddots \@@_Iddots
- \cs_set_eq:NN \dots \@@_Ldots
+ \cs_set_eq:NN \ldots \@@_Ldots:
+ \cs_set_eq:NN \cdots \@@_Cdots:
+ \cs_set_eq:NN \vdots \@@_Vdots:
+ \cs_set_eq:NN \ddots \@@_Ddots:
+ \cs_set_eq:NN \iddots \@@_Iddots:
+ \cs_set_eq:NN \dots \@@_Ldots:
\cs_set_eq:NN \hdotsfor \@@_Hdotsfor:
}
% \end{macrocode}
%
%
-% \bigskip
-% The following code has been simplified in the version 6.29a.
-% \begin{macrocode}
-\hook_gput_code:nnn { begindocument } { . }
- {
- \IfPackageLoadedTF { colortbl }
- {
- \cs_set_protected:Npn \@@_everycr:
- { \CT at everycr { \noalign { \@@_in_everycr: } } }
- }
- {
- \cs_new_protected:Npn \@@_everycr:
- { \everycr { \noalign { \@@_in_everycr: } } }
- }
- }
-% \end{macrocode}
-%
% If \pkg{booktabs} is loaded, we have to patch the macro |\@BTnormal| which is
% a macro of \pkg{booktabs}. The macro |\@BTnormal| draws an horizontal rule but
% it occurs after a vertical skip done by a low level TeX command. When this
@@ -3720,6 +3763,8 @@
{ \tl_put_left:Nn \@BTnormal \@@_create_row_node_i: }
}
{ \cs_new_protected:Npn \@@_patch_booktabs: { } }
+% \end{macrocode}
+% \begin{macrocode}
}
% \end{macrocode}
%
@@ -3756,9 +3801,9 @@
% \end{macrocode}
%
% \bigskip
-% The number of letters |X| in the preamble of the array.
+% The total weight of the letters |X| in the preamble of the array.
% \begin{macrocode}
- \int_gzero:N \g_@@_total_X_weight_int
+ \fp_gzero:N \g_@@_total_X_weight_fp
% \end{macrocode}
%
% \begin{macrocode}
@@ -3776,7 +3821,7 @@
{
% \end{macrocode}
% \begin{macrocode}
- \cs_set_nopar:Npn \arraystretch { 0.47 }
+ \def \arraystretch { 0.47 }
\dim_set:Nn \arraycolsep { 1.45 pt }
% \end{macrocode}
% By default, |\@@_tuning_key_small:| is no-op.
@@ -3786,8 +3831,12 @@
% \end{macrocode}
%
% \bigskip
+% The boolean |\g_@@_create_cell_nodes_bool| corresponds to the key
+% |create-cell-nodes| of the keyword |\CodeBefore|. When that key is used the
+% ``cell nodes'' will be created before the |\CodeBefore| but, of course, they
+% are \emph{always} available in the main tabular and after!
% \begin{macrocode}
- \bool_if:NT \g_@@_recreate_cell_nodes_bool
+ \bool_if:NT \g_@@_create_cell_nodes_bool
{
\tl_put_right:Nn \@@_begin_of_row:
{
@@ -3794,6 +3843,7 @@
\pgfsys at markposition
{ \@@_env: - row - \int_use:N \c at iRow - base }
}
+ \socket_assign_plug:nn { nicematrix / create-cell-nodes } { active }
}
% \end{macrocode}
%
@@ -3806,7 +3856,7 @@
\bool_if:nTF
{ \c_@@_recent_array_bool && ! \c_@@_revtex_bool }
{
- \cs_set_nopar:Npn \ar at ialign
+ \def \ar at ialign
{
\bool_if:NT \c_@@_testphase_table_bool
\tbl_init_cell_data_for_table:
@@ -3816,9 +3866,11 @@
%
% After its first use, the definition of |\ar at ialign| will revert
% automatically to its default definition. With this programmation, we will
-% have, in the cells of the array, a clean version of |\ar at ialign|.
+% have, in the cells of the array, a clean version of |\ar at ialign|. We use
+% |\cs_set_eq:Nc| instead of |\cs_set_eq:NN| in order to avoid a message when
+% |explcheck| is used on |nicematrix.sty|.
% \begin{macrocode}
- \cs_set_eq:NN \ar at ialign \@@_old_ar at ialign:
+ \cs_set_eq:Nc \ar at ialign { @@_old_ar at ialign: }
\halign
}
}
@@ -3831,7 +3883,7 @@
% \pkg{array}, that is to say without the |\ar at ialign|.
% \begin{macrocode}
{
- \cs_set_nopar:Npn \ialign
+ \def \ialign
{
\@@_some_initialization:
\dim_zero:N \tabskip
@@ -3862,19 +3914,19 @@
% |\Cdots|, etc. give the same spacing (except when the option |nullify-dots| is
% used).
% \begin{macrocode}
- \cs_set_eq:NN \@@_old_ldots \ldots
- \cs_set_eq:NN \@@_old_cdots \cdots
- \cs_set_eq:NN \@@_old_vdots \vdots
- \cs_set_eq:NN \@@_old_ddots \ddots
- \cs_set_eq:NN \@@_old_iddots \iddots
+ \cs_set_eq:NN \@@_old_ldots: \ldots
+ \cs_set_eq:NN \@@_old_cdots: \cdots
+ \cs_set_eq:NN \@@_old_vdots: \vdots
+ \cs_set_eq:NN \@@_old_ddots: \ddots
+ \cs_set_eq:NN \@@_old_iddots: \iddots
\bool_if:NTF \l_@@_standard_cline_bool
- { \cs_set_eq:NN \cline \@@_standard_cline }
- { \cs_set_eq:NN \cline \@@_cline }
- \cs_set_eq:NN \Ldots \@@_Ldots
- \cs_set_eq:NN \Cdots \@@_Cdots
- \cs_set_eq:NN \Vdots \@@_Vdots
- \cs_set_eq:NN \Ddots \@@_Ddots
- \cs_set_eq:NN \Iddots \@@_Iddots
+ { \cs_set_eq:NN \cline \@@_standard_cline: }
+ { \cs_set_eq:NN \cline \@@_cline: }
+ \cs_set_eq:NN \Ldots \@@_Ldots:
+ \cs_set_eq:NN \Cdots \@@_Cdots:
+ \cs_set_eq:NN \Vdots \@@_Vdots:
+ \cs_set_eq:NN \Ddots \@@_Ddots:
+ \cs_set_eq:NN \Iddots \@@_Iddots:
\cs_set_eq:NN \Hline \@@_Hline:
\cs_set_eq:NN \Hspace \@@_Hspace:
\cs_set_eq:NN \Hdotsfor \@@_Hdotsfor:
@@ -3898,11 +3950,11 @@
\cs_set_eq:NN \rowcolor \@@_rowcolor_tabular
\cs_set_eq:NN \rowcolors \@@_rowcolors_tabular
\cs_set_eq:NN \rowlistcolors \@@_rowlistcolors_tabular
- \int_compare:nNnT \l_@@_first_row_int > \c_zero_int
+ \int_compare:nNnT { \l_@@_first_row_int } > { \c_zero_int }
{ \cs_set_eq:NN \@@_tuning_first_row: \prg_do_nothing: }
- \int_compare:nNnT \l_@@_last_row_int < \c_zero_int
+ \int_compare:nNnT { \l_@@_last_row_int } < { \c_zero_int }
{ \cs_set_eq:NN \@@_tuning_last_row: \prg_do_nothing: }
- \bool_if:NT \l_@@_renew_dots_bool \@@_renew_dots:
+ \bool_if:NT \l_@@_renew_dots_bool { \@@_renew_dots: }
% \end{macrocode}
% We redefine |\multicolumn| and, since we want |\multicolumn| to be available
% in the potential environments |{tabular}| nested in the environments of
@@ -3911,7 +3963,7 @@
% \begin{macrocode}
\cs_set_eq:NN \multicolumn \@@_multicolumn:nnn
\hook_gput_code:nnn { env / tabular / begin } { nicematrix }
- { \cs_set_eq:NN \multicolumn \@@_old_multicolumn }
+ { \cs_set_eq:NN \multicolumn \@@_old_multicolumn: }
\@@_revert_colortbl:
% \end{macrocode}
% If there is one or several commands |\tabularnote| in the caption specified
@@ -4016,16 +4068,16 @@
% user have used one of those keys without value, we provide now the right value
% as read on the |aux| file (of course, it's possible only after the first compilation).
% \begin{macrocode}
- \int_compare:nNnT \l_@@_last_row_int = { -1 }
+ \int_compare:nNnT { \l_@@_last_row_int } = { -1 }
{
\bool_set_true:N \l_@@_last_row_without_value_bool
\bool_if:NT \g_@@_aux_found_bool
- { \int_set:Nn \l_@@_last_row_int { \seq_item:Nn \g_@@_size_seq 3 } }
+ { \int_set:Nn \l_@@_last_row_int { \seq_item:Nn \g_@@_size_seq { 3 } } }
}
- \int_compare:nNnT \l_@@_last_col_int = { -1 }
+ \int_compare:nNnT { \l_@@_last_col_int } = { -1 }
{
\bool_if:NT \g_@@_aux_found_bool
- { \int_set:Nn \l_@@_last_col_int { \seq_item:Nn \g_@@_size_seq 6 } }
+ { \int_set:Nn \l_@@_last_col_int { \seq_item:Nn \g_@@_size_seq { 6 } } }
}
% \end{macrocode}
%
@@ -4033,13 +4085,13 @@
% If there is an exterior row, we patch a command used in |\@@_cell_begin:| in order to
% keep track of some dimensions needed to the construction of that ``last row''.
% \begin{macrocode}
- \int_compare:nNnT \l_@@_last_row_int > { -2 }
+ \int_compare:nNnT { \l_@@_last_row_int } > { -2 }
{
\tl_put_right:Nn \@@_update_for_first_and_last_row:
{
- \dim_compare:nNnT \g_@@_ht_last_row_dim < { \box_ht:N \l_@@_cell_box }
+ \dim_compare:nNnT { \g_@@_ht_last_row_dim } < { \box_ht:N \l_@@_cell_box }
{ \dim_gset:Nn \g_@@_ht_last_row_dim { \box_ht:N \l_@@_cell_box } }
- \dim_compare:nNnT \g_@@_dp_last_row_dim < { \box_dp:N \l_@@_cell_box }
+ \dim_compare:nNnT { \g_@@_dp_last_row_dim } < { \box_dp:N \l_@@_cell_box }
{ \dim_gset:Nn \g_@@_dp_last_row_dim { \box_dp:N \l_@@_cell_box } }
}
}
@@ -4054,7 +4106,7 @@
% \bigskip
% Now the |\CodeBefore|.
% \begin{macrocode}
- \bool_if:NT \l_@@_code_before_bool \@@_exec_code_before:
+ \bool_if:NT \l_@@_code_before_bool { \@@_exec_code_before: }
% \end{macrocode}
%
% \bigskip
@@ -4118,7 +4170,7 @@
}
{
\dim_gset:Nn \l_@@_left_delim_dim
- { 2 \bool_if:NTF \l_@@_tabular_bool \tabcolsep \arraycolsep }
+ { 2 \bool_if:NTF \l_@@_tabular_bool { \tabcolsep } { \arraycolsep } }
\dim_gset_eq:NN \l_@@_right_delim_dim \l_@@_left_delim_dim
}
% \end{macrocode}
@@ -4159,7 +4211,7 @@
\tl_set:Nn \l_tmpa_tl { #1 }
\int_compare:nNnT { \char_value_catcode:n { 60 } } = { 13 }
{ \@@_rescan_for_spanish:N \l_tmpa_tl }
- \tl_gput_left:No \g_@@_pre_code_before_tl \l_tmpa_tl
+ \tl_gput_left:No \g_@@_pre_code_before_tl \l_tmpa_tl
\bool_set_true:N \l_@@_code_before_bool
% \end{macrocode}
% We go on with |\@@_pre_array:| which will (among other) execute the
@@ -4189,10 +4241,10 @@
% (with potentially a last exterior row) and |\g_@@_col_total_int| is the number
% of the last column (with potentially a last exterior column).
% \begin{macrocode}
- \int_set:Nn \c at iRow { \seq_item:Nn \g_@@_size_seq 2 }
- \int_set:Nn \c at jCol { \seq_item:Nn \g_@@_size_seq 5 }
- \int_set_eq:NN \g_@@_row_total_int { \seq_item:Nn \g_@@_size_seq 3 }
- \int_set_eq:NN \g_@@_col_total_int { \seq_item:Nn \g_@@_size_seq 6 }
+ \int_set:Nn \c at iRow { \seq_item:Nn \g_@@_size_seq { 2 } }
+ \int_set:Nn \c at jCol { \seq_item:Nn \g_@@_size_seq { 5 } }
+ \int_set:Nn \g_@@_row_total_int { \seq_item:Nn \g_@@_size_seq { 3 } }
+ \int_set:Nn \g_@@_col_total_int { \seq_item:Nn \g_@@_size_seq { 6 } }
% \end{macrocode}
%
%
@@ -4207,7 +4259,7 @@
% \end{macrocode}
% First, the recreation of the |row| nodes.
% \begin{macrocode}
- \int_step_inline:nnn \l_@@_first_row_int { \g_@@_row_total_int + 1 }
+ \int_step_inline:nnn { \l_@@_first_row_int } { \g_@@_row_total_int + 1 }
{
\pgfsys at getposition { \@@_env: - row - ##1 } \@@_node_position:
\pgfcoordinate { \@@_env: - row - ##1 }
@@ -4216,7 +4268,7 @@
% \end{macrocode}
% Now, the recreation of the |col| nodes.
% \begin{macrocode}
- \int_step_inline:nnn \l_@@_first_col_int { \g_@@_col_total_int + 1 }
+ \int_step_inline:nnn { \l_@@_first_col_int } { \g_@@_col_total_int + 1 }
{
\pgfsys at getposition { \@@_env: - col - ##1 } \@@_node_position:
\pgfcoordinate { \@@_env: - col - ##1 }
@@ -4233,7 +4285,7 @@
% Now, the creation of the cell nodes |(i-j)|, and, maybe also the ``medium
% nodes'' and the ``large nodes''.
% \begin{macrocode}
- \bool_if:NT \g_@@_recreate_cell_nodes_bool \@@_recreate_cell_nodes:
+ \bool_if:NT \g_@@_create_cell_nodes_bool { \@@_recreate_cell_nodes: }
\endpgfpicture
% \end{macrocode}
%
@@ -4290,7 +4342,7 @@
% the corresponding cells by the other coloring commands of \pkg{nicematrix}.
% \begin{macrocode}
\@@_add_to_colors_seq:nn { { nocolor } } { }
- \bool_gset_false:N \g_@@_recreate_cell_nodes_bool
+ \bool_gset_false:N \g_@@_create_cell_nodes_bool
\group_begin:
% \end{macrocode}
%
@@ -4297,7 +4349,7 @@
% We compose the |\CodeBefore| in math mode in order to nullify the spaces put
% by the user between instructions in the |\CodeBefore|.
% \begin{macrocode}
- \bool_if:NT \l_@@_tabular_bool \c_math_toggle_token
+ \bool_if:NT \l_@@_tabular_bool { \c_math_toggle_token }
% \end{macrocode}
%
% \bigskip
@@ -4328,10 +4380,8 @@
\@@_actually_color:
\l_@@_code_before_tl
\q_stop
- \bool_if:NT \l_@@_tabular_bool \c_math_toggle_token
+ \bool_if:NT \l_@@_tabular_bool { \c_math_toggle_token }
\group_end:
- \bool_if:NT \g_@@_recreate_cell_nodes_bool
- { \tl_put_left:Nn \@@_node_for_cell: \@@_patch_node_for_cell: }
}
% \end{macrocode}
%
@@ -4339,7 +4389,7 @@
% \begin{macrocode}
\keys_define:nn { nicematrix / CodeBefore }
{
- create-cell-nodes .bool_gset:N = \g_@@_recreate_cell_nodes_bool ,
+ create-cell-nodes .bool_gset:N = \g_@@_create_cell_nodes_bool ,
create-cell-nodes .default:n = true ,
sub-matrix .code:n = \keys_set:nn { nicematrix / sub-matrix } { #1 } ,
sub-matrix .value_required:n = true ,
@@ -4383,12 +4433,12 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_recreate_cell_nodes:
{
- \int_step_inline:nnn \l_@@_first_row_int \g_@@_row_total_int
+ \int_step_inline:nnn { \l_@@_first_row_int } { \g_@@_row_total_int }
{
\pgfsys at getposition { \@@_env: - ##1 - base } \@@_node_position:
\pgfcoordinate { \@@_env: - row - ##1 - base }
{ \pgfpointdiff \@@_picture_position: \@@_node_position: }
- \int_step_inline:nnn \l_@@_first_col_int \g_@@_col_total_int
+ \int_step_inline:nnn { \l_@@_first_col_int } { \g_@@_col_total_int }
{
\cs_if_exist:cT
{ pgf @ sys @ pdf @ mark @ pos @ \@@_env: - ##1 - ####1 - NW }
@@ -4406,22 +4456,33 @@
}
}
}
- \int_step_inline:nn \c at iRow
+ \@@_create_extra_nodes:
+ \@@_create_aliases_last:
+ }
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_create_aliases_last:
+ {
+ \int_step_inline:nn { \c at iRow }
{
\pgfnodealias
{ \@@_env: - ##1 - last }
{ \@@_env: - ##1 - \int_use:N \c at jCol }
}
- \int_step_inline:nn \c at jCol
+ \int_step_inline:nn { \c at jCol }
{
\pgfnodealias
{ \@@_env: - last - ##1 }
{ \@@_env: - \int_use:N \c at iRow - ##1 }
}
- \@@_create_extra_nodes:
+ \pgfnodealias % added 2025-04-05
+ { \@@_env: - last - last }
+ { \@@_env: - \int_use:N \c at iRow - \int_use:N \c at jCol }
}
% \end{macrocode}
-%
+%
% \bigskip
% \begin{macrocode}
\cs_new_protected:Npn \@@_create_blocks_nodes:
@@ -4493,12 +4554,12 @@
\NewDocumentEnvironment { NiceArrayWithDelims }
{ m m O { } m ! O { } t \CodeBefore }
{
- \bool_if:NT \c_@@_revtex_bool \@@_patch_for_revtex:
+ \bool_if:NT \c_@@_revtex_bool { \@@_patch_for_revtex: }
% \end{macrocode}
%
% \begin{macrocode}
\@@_provide_pgfsyspdfmark:
- \bool_if:NT \g_@@_footnote_bool \savenotes
+ \bool_if:NT \g_@@_footnote_bool { \savenotes }
% \end{macrocode}
%
% The aim of the following |\bgroup| (the corresponding |\egroup| is, of course,
@@ -4520,14 +4581,14 @@
% \bigskip
% \begin{macrocode}
\int_gzero:N \g_@@_block_box_int
- \dim_zero:N \g_@@_width_last_col_dim
- \dim_zero:N \g_@@_width_first_col_dim
+ \dim_gzero:N \g_@@_width_last_col_dim
+ \dim_gzero:N \g_@@_width_first_col_dim
\bool_gset_false:N \g_@@_row_of_col_done_bool
\str_if_empty:NT \g_@@_name_env_str
{ \str_gset:Nn \g_@@_name_env_str { NiceArrayWithDelims } }
\bool_if:NTF \l_@@_tabular_bool
- \mode_leave_vertical:
- \@@_test_if_math_mode:
+ { \mode_leave_vertical: }
+ { \@@_test_if_math_mode: }
\bool_if:NT \l_@@_in_env_bool { \@@_fatal:n { Yet~in~env } }
\bool_set_true:N \l_@@_in_env_bool
% \end{macrocode}
@@ -4539,7 +4600,7 @@
% the beginning of arrays done by \pkg{colortbl}. Of course, we restore the
% value of |\CT at arc@| at the end of our environment.
% \begin{macrocode}
- \cs_gset_eq:NN \@@_old_CT at arc@ \CT at arc@
+ \cs_gset_eq:cN { @@_old_CT at arc@ } \CT at arc@
% \end{macrocode}
%
% We deactivate Tikz externalization because we will use \textsc{pgf} pictures
@@ -4564,7 +4625,7 @@
% \end{macrocode}
%
%
-% The sequence |\g_@@_blocks_seq| will contain the carateristics of the blocks
+% The sequence |\g_@@_blocks_seq| will contain the charateristics of the blocks
% (specified by |\Block|) of the array. The sequence |\g_@@_pos_of_blocks_seq|
% will contain only the position of the blocks.
% \begin{macrocode}
@@ -4585,10 +4646,10 @@
% We load all the informations written in the |aux| file during previous
% compilations corresponding to the current environment.
% \begin{macrocode}
- \tl_if_exist:cTF { c_@@ _ \int_use:N \g_@@_env_int _ tl }
+ \tl_if_exist:cTF { g_@@ _ \int_use:N \g_@@_env_int _ tl }
{
\bool_gset_true:N \g_@@_aux_found_bool
- \use:c { c_@@ _ \int_use:N \g_@@_env_int _ tl }
+ \use:c { g_@@ _ \int_use:N \g_@@_env_int _ tl }
}
{ \bool_gset_false:N \g_@@_aux_found_bool }
% \end{macrocode}
@@ -4620,7 +4681,7 @@
%
% \bigskip
% \begin{macrocode}
- \@@_set_CT at arc@:o \l_@@_rules_color_tl
+ \@@_set_CTarc:o \l_@@_rules_color_tl
% \end{macrocode}
%
% \bigskip
@@ -4632,7 +4693,7 @@
% command |\@@_CodeBefore_Body:w|. After that job, the command |\@@_CodeBefore_Body:w|
% will go on with |\@@_pre_array:|.
% \begin{macrocode}
- \bool_if:nTF { #6 } \@@_CodeBefore_Body:w \@@_pre_array:
+ \bool_if:nTF { #6 } { \@@_CodeBefore_Body:w } { \@@_pre_array: }
}
% \end{macrocode}
%
@@ -4647,11 +4708,11 @@
\skip_horizontal:N \l_@@_extra_right_margin_dim
% awful workaround
- \int_compare:nNnT \g_@@_col_total_int = \c_one_int
+ \int_if_zero:nT { \g_@@_col_total_int }
{
- \dim_compare:nNnT \l_@@_columns_width_dim > \c_zero_dim
+ \dim_compare:nNnT { \l_@@_columns_width_dim } > { \c_zero_dim }
{
- \skip_horizontal:N - \l_@@_columns_width_dim
+ \skip_horizontal:n { - \l_@@_columns_width_dim }
\bool_if:NTF \l_@@_tabular_bool
{ \skip_horizontal:n { - 2 \tabcolsep } }
{ \skip_horizontal:n { - 2 \arraycolsep } }
@@ -4668,7 +4729,7 @@
% \begin{macrocode}
\bool_if:NT \l_@@_width_used_bool
{
- \int_if_zero:nT \g_@@_total_X_weight_int
+ \fp_compare:nNnT { \g_@@_total_X_weight_fp } = { \c_zero_fp }
{ \@@_error_or_warning:n { width~without~X~columns } }
}
% \end{macrocode}
@@ -4676,11 +4737,11 @@
% \bigskip
% Now, if there is at least one |X|-column in the environment, we compute the
% width that those columns will have (in the next compilation). In fact,
-% |l_@@_X_columns_dim| will be the width of a column of weight $1$. For a
-% |X|-column of weight~$n$, the width will be |\l_@@_X_columns_dim| multiplied
-% by~$n$.
+% |l_@@_X_columns_dim| will be the width of a column of weight $1.0$. For a
+% |X|-column of weight~$x$, the width will be |\l_@@_X_columns_dim| multiplied
+% by~$x$.
% \begin{macrocode}
- \int_compare:nNnT \g_@@_total_X_weight_int > \c_zero_int
+ \fp_compare:nNnT { \g_@@_total_X_weight_fp } > { \c_zero_fp }
{ \@@_compute_width_X: }
% \end{macrocode}
%
@@ -4689,11 +4750,11 @@
% given value is correct (since we have just constructed the array, we know the
% actual number of rows of the array).
% \begin{macrocode}
- \int_compare:nNnT \l_@@_last_row_int > { -2 }
+ \int_compare:nNnT { \l_@@_last_row_int } > { -2 }
{
\bool_if:NF \l_@@_last_row_without_value_bool
{
- \int_compare:nNnF \l_@@_last_row_int = \c at iRow
+ \int_compare:nNnF { \l_@@_last_row_int } = { \c at iRow }
{
\@@_error:n { Wrong~last~row }
\int_gset_eq:NN \l_@@_last_row_int \c at iRow
@@ -4712,7 +4773,7 @@
\bool_if:NTF \g_@@_last_col_found_bool
{ \int_gdecr:N \c at jCol }
{
- \int_compare:nNnT \l_@@_last_col_int > { -1 }
+ \int_compare:nNnT { \l_@@_last_col_int } > { -1 }
{ \@@_error:n { last~col~not~used } }
}
% \end{macrocode}
@@ -4721,7 +4782,8 @@
% same principle.
% \begin{macrocode}
\int_gset_eq:NN \g_@@_row_total_int \c at iRow
- \int_compare:nNnT \l_@@_last_row_int > { -1 } { \int_gdecr:N \c at iRow }
+ \int_compare:nNnT { \l_@@_last_row_int } > { -1 }
+ { \int_gdecr:N \c at iRow }
% \end{macrocode}
%
%
@@ -4731,7 +4793,7 @@
% column'' has been constructed in an overlapping position and that we have
% computed its width in |\g_@@_width_first_col_dim|: see p.~\pageref{overlap-left}).
% \begin{macrocode}
- \int_if_zero:nT \l_@@_first_col_int
+ \int_if_zero:nT { \l_@@_first_col_int }
{ \skip_horizontal:N \g_@@_width_first_col_dim }
% \end{macrocode}
%
@@ -4741,11 +4803,11 @@
\bool_if:nTF { ! \g_@@_delims_bool }
{
\str_if_eq:eeTF \l_@@_baseline_tl { c }
- \@@_use_arraybox_with_notes_c:
+ { \@@_use_arraybox_with_notes_c: }
{
\str_if_eq:eeTF \l_@@_baseline_tl { b }
- \@@_use_arraybox_with_notes_b:
- \@@_use_arraybox_with_notes:
+ { \@@_use_arraybox_with_notes_b: }
+ { \@@_use_arraybox_with_notes: }
}
}
% \end{macrocode}
@@ -4755,7 +4817,7 @@
% |first-row| is used).
% \begin{macrocode}
{
- \int_if_zero:nTF \l_@@_first_row_int
+ \int_if_zero:nTF { \l_@@_first_row_int }
{
\dim_set_eq:NN \l_tmpa_dim \g_@@_dp_row_zero_dim
\dim_add:Nn \l_tmpa_dim \g_@@_ht_row_zero_dim
@@ -4770,7 +4832,7 @@
% the user have not set the value with the option |last row| (and we are in the
% first compilation).}
% \begin{macrocode}
- \int_compare:nNnTF \l_@@_last_row_int > { -2 }
+ \int_compare:nNnTF { \l_@@_last_row_int } > { -2 }
{
\dim_set_eq:NN \l_tmpb_dim \g_@@_ht_last_row_dim
\dim_add:Nn \l_tmpb_dim \g_@@_dp_last_row_dim
@@ -4781,9 +4843,9 @@
% \begin{macrocode}
\hbox_set:Nn \l_tmpa_box
{
- \m at th % added 2024/11/21
+ \m at th
\c_math_toggle_token
- \@@_color:o \l_@@_delimiters_color_tl
+ \@@_color:o \l_@@_delimiters_color_tl
\exp_after:wN \left \g_@@_left_delim_tl
\vcenter
{
@@ -4791,23 +4853,22 @@
% We take into account the ``first row'' (we have previously computed its total
% height in |\l_tmpa_dim|). The |\hbox:n| (or |\hbox|) is necessary here.
% \begin{macrocode}
- \skip_vertical:n { -\l_tmpa_dim - \arrayrulewidth }
+ \skip_vertical:n { - \l_tmpa_dim - \arrayrulewidth }
\hbox
{
\bool_if:NTF \l_@@_tabular_bool
- { \skip_horizontal:N -\tabcolsep }
- { \skip_horizontal:N -\arraycolsep }
+ { \skip_horizontal:n { - \tabcolsep } }
+ { \skip_horizontal:n { - \arraycolsep } }
\@@_use_arraybox_with_notes_c:
\bool_if:NTF \l_@@_tabular_bool
- { \skip_horizontal:N -\tabcolsep }
- { \skip_horizontal:N -\arraycolsep }
+ { \skip_horizontal:n { - \tabcolsep } }
+ { \skip_horizontal:n { - \arraycolsep } }
}
% \end{macrocode}
% We take into account the ``last row'' (we have previously computed its total
% height in |\l_tmpb_dim|).
% \begin{macrocode}
- \skip_vertical:N -\l_tmpb_dim
- \skip_vertical:N \arrayrulewidth
+ \skip_vertical:n { - \l_tmpb_dim + \arrayrulewidth }
}
\exp_after:wN \right \g_@@_right_delim_tl
\c_math_toggle_token
@@ -4822,8 +4883,8 @@
\bool_if:NTF \l_@@_delimiters_max_width_bool
{
\@@_put_box_in_flow_bis:nn
- \g_@@_left_delim_tl
- \g_@@_right_delim_tl
+ { \g_@@_left_delim_tl }
+ { \g_@@_right_delim_tl }
}
\@@_put_box_in_flow:
}
@@ -4837,7 +4898,7 @@
{ \skip_horizontal:N \g_@@_width_last_col_dim }
\bool_if:NT \l_@@_preamble_bool
{
- \int_compare:nNnT \c at jCol < \g_@@_static_num_of_col_int
+ \int_compare:nNnT { \c at jCol } < { \g_@@_static_num_of_col_int }
{ \@@_warning_gredirect_none:n { columns~not~used } }
}
\@@_after_array:
@@ -4857,7 +4918,8 @@
\iow_now:Nn \@mainaux { \char_set_catcode_space:n { 32 } }
\iow_now:Ne \@mainaux
{
- \tl_gset:cn { c_@@_ \int_use:N \g_@@_env_int _ tl }
+ \tl_gclear_new:c { g_@@_ \int_use:N \g_@@_env_int _ tl }
+ \tl_gset:cn { g_@@_ \int_use:N \g_@@_env_int _ tl }
{ \exp_not:o \g_@@_aux_tl }
}
\iow_now:Nn \@mainaux { \ExplSyntaxOff }
@@ -4865,7 +4927,7 @@
%
% \bigskip
% \begin{macrocode}
- \bool_if:NT \g_@@_footnote_bool \endsavenotes
+ \bool_if:NT \g_@@_footnote_bool { \endsavenotes }
}
% \end{macrocode}
% This is the end of the environment |{NiceArrayWithDelims}|.
@@ -4875,9 +4937,9 @@
% The following command will be used only once. We have written that command for
% legibility. If there is at least one |X|-column in the environment, we compute
% the width that those columns will have (in the next compilation). In fact,
-% |l_@@_X_columns_dim| will be the width of a column of weight $1$. For a
-% |X|-column of weight~$n$, the width will be |\l_@@_X_columns_dim| multiplied
-% by~$n$.
+% |l_@@_X_columns_dim| will be the width of a column of weight $1.0$. For a
+% |X|-column of weight~$x$, the width will be |\l_@@_X_columns_dim| multiplied
+% by~$x$.
% \begin{macrocode}
\cs_new_protected:Npn \@@_compute_width_X:
{
@@ -4897,8 +4959,14 @@
{
\dim_eval:n
{
- ( \l_@@_width_dim - \box_wd:N \l_@@_the_array_box )
- / \int_use:N \g_@@_total_X_weight_int
+ \fp_to_dim:n
+ {
+ (
+ \dim_eval:n
+ { \l_@@_width_dim - \box_wd:N \l_@@_the_array_box }
+ )
+ / \fp_use:N \g_@@_total_X_weight_fp
+ }
+ \l_@@_X_columns_dim
}
}
@@ -4970,7 +5038,7 @@
% Now, we actually make the preamble (which will be given to |{array}|). It will
% be stored in |\g_@@_array_preamble_tl|.
% \begin{macrocode}
- \exp_last_unbraced:No \@@_rec_preamble:n \g_@@_user_preamble_tl \@@_stop:
+ \exp_last_unbraced:No \@@_rec_preamble:n \g_@@_user_preamble_tl \s_stop
\int_gset_eq:NN \g_@@_static_num_of_col_int \c at jCol
% \end{macrocode}
%
@@ -4980,33 +5048,6 @@
}
% \end{macrocode}
%
-% \bigskip
-% \begin{macrocode}
-\hook_gput_code:nnn { begindocument } { . }
- {
- \IfPackageLoadedTF { colortbl }
- {
-% \end{macrocode}
-% When \pkg{colortbl} is used, we have to catch the tokens |\columncolor| in the
-% preamble because, otherwise, \pkg{colortbl} will catch them and the colored
-% panels won't be drawn by \pkg{nicematrix} but by \pkg{colortbl} (with an
-% output which is not perfect).
-% \begin{macrocode}
- \regex_const:Nn \c_@@_columncolor_regex { \c { columncolor } }
- \cs_new_protected:Npn \@@_replace_columncolor:
- {
- \regex_replace_all:NnN
- \c_@@_columncolor_regex
- { \c { @@_columncolor_preamble } }
- \g_@@_array_preamble_tl
- }
- }
- {
- \cs_new_protected:Npn \@@_replace_columncolor:
- { \cs_set_eq:NN \columncolor \@@_columncolor_preamble }
- }
- }
-% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
@@ -5035,7 +5076,7 @@
% \bigskip
% We complete the preamble with the potential ``exterior columns'' (on both sides).
% \begin{macrocode}
- \int_if_zero:nTF \l_@@_first_col_int
+ \int_if_zero:nTF { \l_@@_first_col_int }
{ \tl_gput_left:No \g_@@_array_preamble_tl \c_@@_preamble_first_col_tl }
{
\bool_if:NF \g_@@_delims_bool
@@ -5050,7 +5091,7 @@
}
}
}
- \int_compare:nNnTF \l_@@_last_col_int > { -1 }
+ \int_compare:nNnTF { \l_@@_last_col_int } > { -1 }
{ \tl_gput_right:No \g_@@_array_preamble_tl \c_@@_preamble_last_col_tl }
{
\bool_if:NF \g_@@_delims_bool
@@ -5071,7 +5112,7 @@
% possible to do that in |{NiceTabular*}| (we control that with the value of
% |\l_@@_tabular_width_dim|).
% \begin{macrocode}
- \dim_compare:nNnT \l_@@_tabular_width_dim = \c_zero_dim
+ \dim_compare:nNnT { \l_@@_tabular_width_dim } = { \c_zero_dim }
{
% \end{macrocode}
% If the tagging of the tabulars is done (part of the Tagging Project), you
@@ -5103,8 +5144,8 @@
% an easy way to insert the letter at some places in the code that we will add to
% |\g_@@_array_preamble_tl|.}
% \begin{macrocode}
- \cs_if_exist:cTF { @@ _ \token_to_str:N #1 }
- { \use:c { @@ _ \token_to_str:N #1 } { #1 } }
+ \cs_if_exist:cTF { @@ _ \token_to_str:N #1 : }
+ { \use:c { @@ _ \token_to_str:N #1 : } { #1 } }
{
% \end{macrocode}
% Now, the columns defined by |\newcolumntype| of \pkg{array}.
@@ -5115,9 +5156,6 @@
\exp_last_unbraced:No \@@_rec_preamble:n \l_tmpb_tl
}
{
-% \end{macrocode}
-%
-% \begin{macrocode}
\str_if_eq:nnTF { #1 } { S }
{ \@@_fatal:n { unknown~column~type~S } }
{ \@@_fatal:nn { unknown~column~type } { #1 } }
@@ -5131,7 +5169,7 @@
% \bigskip
% For |c|, |l| and |r|
% \begin{macrocode}
-\cs_new_protected:Npn \@@_c #1
+\cs_new_protected:Npn \@@_c: #1
{
\tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl
\tl_gclear:N \g_@@_pre_cell_tl
@@ -5146,7 +5184,7 @@
}
% \end{macrocode}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_l #1
+\cs_new_protected:Npn \@@_l: #1
{
\tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl
\tl_gclear:N \g_@@_pre_cell_tl
@@ -5161,7 +5199,7 @@
}
% \end{macrocode}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_r #1
+\cs_new_protected:Npn \@@_r: #1
{
\tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl
\tl_gclear:N \g_@@_pre_cell_tl
@@ -5179,12 +5217,12 @@
% \medskip
% For |!| and |@|
% \begin{macrocode}
-\cs_new_protected:cpn { @@ _ \token_to_str:N ! } #1 #2
+\cs_new_protected:cpn { @@ _ \token_to_str:N ! : } #1 #2
{
\tl_gput_right:Nn \g_@@_array_preamble_tl { #1 { #2 } }
\@@_rec_preamble:n
}
-\cs_set_eq:cc { @@ _ \token_to_str:N @ } { @@ _ \token_to_str:N ! }
+\cs_set_eq:cc { @@ _ \token_to_str:N @ : } { @@ _ \token_to_str:N ! : }
% \end{macrocode}
%
%
@@ -5191,7 +5229,7 @@
% \medskip
% For \verb+|+
% \begin{macrocode}
-\cs_new_protected:cpn { @@ _ | } #1
+\cs_new_protected:cpn { @@ _ | : } #1
{
% \end{macrocode}
% |\l_tmpa_int| is the number of successive occurrences of \verb+|+
@@ -5205,7 +5243,7 @@
\cs_new_protected:Npn \@@_make_preamble_i_i:n #1
{
\str_if_eq:nnTF { #1 } { | }
- { \use:c { @@ _ | } | }
+ { \use:c { @@ _ | : } | }
{ \@@_make_preamble_i_ii:nn { } #1 }
}
% \end{macrocode}
@@ -5248,7 +5286,7 @@
% \begin{macrocode}
}
\int_zero:N \l_tmpa_int
- \str_if_eq:nnT { #1 } { \@@_stop: } { \bool_gset_true:N \g_tmpb_bool }
+ \str_if_eq:nnT { #1 } { \s_stop } { \bool_gset_true:N \g_tmpb_bool }
\@@_rec_preamble:n #1
}
% \end{macrocode}
@@ -5255,7 +5293,7 @@
%
% \bigskip
% \begin{macrocode}
-\cs_new_protected:cpn { @@ _ > } #1 #2
+\cs_new_protected:cpn { @@ _ > : } #1 #2
{
\tl_gput_right:Nn \g_@@_pre_cell_tl { > { #2 } }
\@@_rec_preamble:n
@@ -5295,7 +5333,7 @@
% \medskip
% For |p| but also |b| and |m|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_p #1
+\cs_new_protected:Npn \@@_p: #1
{
\str_set:Nn \l_@@_vpos_col_str { #1 }
% \end{macrocode}
@@ -5304,8 +5342,8 @@
% \begin{macrocode}
\@@_make_preamble_ii_i:n
}
-\cs_set_eq:NN \@@_b \@@_p
-\cs_set_eq:NN \@@_m \@@_p
+\cs_set_eq:NN \@@_b: \@@_p:
+\cs_set_eq:NN \@@_m: \@@_p:
% \end{macrocode}
%
% \begin{macrocode}
@@ -5369,15 +5407,18 @@
{ \tl_clear:N \exp_not:N \l_@@_hpos_cell_tl }
{
% \end{macrocode}
-% Here, we use |\cs_set_nopar:Npn| instead of |\tl_set:Nn| for efficiency only.
+% Here, we use |\def| instead of |\tl_set:Nn| for efficiency only.
% \begin{macrocode}
- \cs_set_nopar:Npn \exp_not:N \l_@@_hpos_cell_tl
- { \str_lowercase:o \l_@@_hpos_col_str }
+ \def \exp_not:N \l_@@_hpos_cell_tl
+ { \str_lowercase:f { \l_@@_hpos_col_str } }
}
\IfPackageLoadedTF { ragged2e }
{
\str_case:on \l_@@_hpos_col_str
{
+% \end{macrocode}
+% The following |\exp_not:N| are mandatory.
+% \begin{macrocode}
c { \exp_not:N \Centering }
l { \exp_not:N \RaggedRight }
r { \exp_not:N \RaggedLeft }
@@ -5406,7 +5447,7 @@
% \end{macrocode}
% We use |\str_lowercase:n| to convert |R| to |r|, etc.
% \begin{macrocode}
- { \str_lowercase:o \l_@@_hpos_col_str }
+ { \str_lowercase:f \l_@@_hpos_col_str }
}
}
% \end{macrocode}
@@ -5478,7 +5519,7 @@
\vrule height \box_ht:N \@arstrutbox width \c_zero_dim
\everypar { }
}
- \bool_if:NT \c_@@_testphase_table_bool \tagpdfparaOn
+ \bool_if:NT \c_@@_testphase_table_bool { \tagpdfparaOn }
% \end{macrocode}
% Now, the potential code for the horizontal position of the content of the cell
% (|\centering|, |\raggedright|, |\RaggedRight|, etc.).
@@ -5505,7 +5546,7 @@
% \begin{macrocode}
#4
\@@_cell_end:
- \bool_if:NT \c_@@_testphase_table_bool \tag_struct_end:
+ \bool_if:NT \c_@@_testphase_table_bool { \tag_struct_end: }
}
}
}
@@ -5526,10 +5567,10 @@
% \begin{macrocode}
\group_align_safe_begin:
\peek_meaning:NTF &
- \@@_the_cell_is_empty:
+ { \@@_the_cell_is_empty: }
{
\peek_meaning:NTF \\
- \@@_the_cell_is_empty:
+ { \@@_the_cell_is_empty: }
{
\peek_meaning:NTF \crcr
\@@_the_cell_is_empty:
@@ -5581,7 +5622,7 @@
% \begin{macrocode}
\tl_gput_right:Nn \g_@@_cell_after_hook_tl
{
- \int_compare:nNnT
+ \dim_compare:nNnT
{ \box_ht:N \l_@@_cell_box }
>
% \end{macrocode}
@@ -5608,7 +5649,7 @@
% \medskip
% For |V| (similar to the |V| of \pkg{varwidth}).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_V #1 #2
+\cs_new_protected:Npn \@@_V: #1 #2
{
\str_if_eq:nnTF { #1 } { [ }
{ \@@_make_preamble_V_i:w [ }
@@ -5633,8 +5674,8 @@
% \medskip
% For |w| and |W|
% \begin{macrocode}
-\cs_new_protected:Npn \@@_w { \@@_make_preamble_w:nnnn { } }
-\cs_new_protected:Npn \@@_W { \@@_make_preamble_w:nnnn { \@@_special_W: } }
+\cs_new_protected:Npn \@@_w: { \@@_make_preamble_w:nnnn { } }
+\cs_new_protected:Npn \@@_W: { \@@_make_preamble_w:nnnn { \@@_special_W: } }
% \end{macrocode}
%
% |#1| is a special argument: empty for |w| and equal to |\@@_special_W:| for |W|;
@@ -5705,7 +5746,7 @@
\dim_set:Nn \l_@@_col_width_dim { #4 }
\hbox_set:Nw \l_@@_cell_box
\@@_cell_begin:
- \cs_set_nopar:Npn \l_@@_hpos_cell_tl { #3 }
+ \tl_set:Nn \l_@@_hpos_cell_tl { #3 }
}
c
< {
@@ -5728,7 +5769,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_special_W:
{
- \dim_compare:nNnT { \box_wd:N \l_@@_cell_box } > \l_@@_col_width_dim
+ \dim_compare:nNnT { \box_wd:N \l_@@_cell_box } > { \l_@@_col_width_dim }
{ \@@_warning:n { W~warning } }
}
% \end{macrocode}
@@ -5736,7 +5777,7 @@
% \medskip
% For |S| (of \pkg{siunitx}).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_S #1 #2
+\cs_new_protected:Npn \@@_S: #1 #2
{
\str_if_eq:nnTF { #2 } { [ }
{ \@@_make_preamble_S:w [ }
@@ -5760,7 +5801,7 @@
> {
% \end{macrocode}
% In the cells of a column of type |S|, we have to wrap the command
-% |\@@_node_for_cell:| for the horizontal alignment of the content of the cell
+% |\@@_node_cell:| for the horizontal alignment of the content of the cell
% (\pkg{siunitx} has done a job but it's without effect since we have to put the
% content in a box for the PGF/TikZ node and that's why we have to do the job of
% horizontal alignement once again).
@@ -5785,8 +5826,8 @@
\tl_gput_right:Ne \g_@@_cell_after_hook_tl
{
\bool_if:NTF \l__siunitx_table_text_bool
- \bool_set_true:N
- \bool_set_false:N
+ { \bool_set_true:N }
+ { \bool_set_false:N }
\l__siunitx_table_text_bool
}
\@@_cell_end:
@@ -5804,7 +5845,7 @@
% \medskip
% For |(|, |[| and |\{|.
% \begin{macrocode}
-\cs_new_protected:cpn { @@ _ \token_to_str:N ( } #1 #2
+\cs_new_protected:cpn { @@ _ \token_to_str:N ( : } #1 #2
{
\bool_if:NT \l_@@_small_bool { \@@_fatal:n { Delimiter~with~small } }
% \end{macrocode}
@@ -5811,7 +5852,7 @@
% If we are before the column 1 and not in |{NiceArray}|, we reserve space for
% the left delimiter.
% \begin{macrocode}
- \int_if_zero:nTF \c at jCol
+ \int_if_zero:nTF { \c at jCol }
{
\tl_if_eq:NNTF \g_@@_left_delim_tl \c_@@_dot_tl
{
@@ -5830,8 +5871,8 @@
}
{ \@@_make_preamble_iv:nn { #1 } { #2 } }
}
-\cs_set_eq:cc { @@ _ \token_to_str:N [ } { @@ _ \token_to_str:N ( }
-\cs_set_eq:cc { @@ _ \token_to_str:N \{ } { @@ _ \token_to_str:N ( }
+\cs_set_eq:cc { @@ _ \token_to_str:N [ : } { @@ _ \token_to_str:N ( : }
+\cs_set_eq:cc { @@ _ \token_to_str:N \{ : } { @@ _ \token_to_str:N ( : }
% \end{macrocode}
%
% \begin{macrocode}
@@ -5850,8 +5891,8 @@
%
% In fact, if would be possible to define |\left| and |\right| as no-op.
% \begin{macrocode}
-\cs_new_protected:cpn { @@ _ \token_to_str:N \left } #1
- { \use:c { @@ _ \token_to_str:N ( } }
+\cs_new_protected:cpn { @@ _ \token_to_str:N \left : } #1
+ { \use:c { @@ _ \token_to_str:N ( : } }
% \end{macrocode}
%
% \bigskip
@@ -5862,13 +5903,13 @@
% considered as the right delimiter of the environment if the environment is
% |{NiceArray}|).
% \begin{macrocode}
-\cs_new_protected:cpn { @@ _ \token_to_str:N ) } #1 #2
+\cs_new_protected:cpn { @@ _ \token_to_str:N ) : } #1 #2
{
\bool_if:NT \l_@@_small_bool { \@@_fatal:n { Delimiter~with~small } }
\tl_if_in:nnTF { ) ] \} } { #2 }
{ \@@_make_preamble_v:nnn #1 #2 }
{
- \str_if_eq:nnTF { \@@_stop: } { #2 }
+ \str_if_eq:nnTF { \s_stop } { #2 }
{
\tl_if_eq:NNTF \g_@@_right_delim_tl \c_@@_dot_tl
{ \tl_gset:Nn \g_@@_right_delim_tl { #1 } }
@@ -5888,14 +5929,14 @@
}
}
}
-\cs_set_eq:cc { @@ _ \token_to_str:N ] } { @@ _ \token_to_str:N ) }
-\cs_set_eq:cc { @@ _ \token_to_str:N \} } { @@ _ \token_to_str:N ) }
+\cs_set_eq:cc { @@ _ \token_to_str:N ] : } { @@ _ \token_to_str:N ) : }
+\cs_set_eq:cc { @@ _ \token_to_str:N \} : } { @@ _ \token_to_str:N ) : }
% \end{macrocode}
%
% \begin{macrocode}
\cs_new_protected:Npn \@@_make_preamble_v:nnn #1 #2 #3
{
- \str_if_eq:nnTF { \@@_stop: } { #3 }
+ \str_if_eq:nnTF { \s_stop } { #3 }
{
\tl_if_eq:NNTF \g_@@_right_delim_tl \c_@@_dot_tl
{
@@ -5922,8 +5963,8 @@
%
% \medskip
% \begin{macrocode}
-\cs_new_protected:cpn { @@ _ \token_to_str:N \right } #1
- { \use:c { @@ _ \token_to_str:N ) } }
+\cs_new_protected:cpn { @@ _ \token_to_str:N \right : } #1
+ { \use:c { @@ _ \token_to_str:N ) : } }
% \end{macrocode}
%
%
@@ -5936,10 +5977,10 @@
\cs_new_protected:Npn \@@_rec_preamble_after_col:n #1
{
\str_if_eq:nnTF { #1 } { < }
- \@@_rec_preamble_after_col_i:n
+ { \@@_rec_preamble_after_col_i:n }
{
\str_if_eq:nnTF { #1 } { @ }
- \@@_rec_preamble_after_col_ii:n
+ { \@@_rec_preamble_after_col_ii:n }
{
\str_if_eq:eeTF \l_@@_vlines_clist { all }
{
@@ -5993,7 +6034,7 @@
%
% \bigskip
% \begin{macrocode}
-\cs_new_protected:cpn { @@ _ * } #1 #2 #3
+\cs_new_protected:cpn { @@ _ * : } #1 #2 #3
{
\tl_clear:N \l_tmpa_tl
\int_step_inline:nn { #2 } { \tl_put_right:Nn \l_tmpa_tl { #3 } }
@@ -6005,7 +6046,8 @@
% The token |\NC at find| is at the head of the definition of the columns type done
% by |\newcolumntype|. We wan't that token to be no-op here.
% \begin{macrocode}
-\cs_new_protected:cpn { @@ _ \token_to_str:N \NC at find } #1 { \@@_rec_preamble:n }
+\cs_new_protected:cpn { @@ _ \token_to_str:N \NC at find : } #1
+ { \@@_rec_preamble:n }
% \end{macrocode}
%
% \bigskip
@@ -6013,7 +6055,7 @@
% (between square brackets). That's why we test whether there is a |[| after the
% letter |X|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_X #1 #2
+\cs_new_protected:Npn \@@_X: #1 #2
{
\str_if_eq:nnTF { #2 } { [ }
{ \@@_make_preamble_X:w [ }
@@ -6031,11 +6073,17 @@
% \medskip
% The following set of keys is for the specifier |X| in the preamble of the
% array. Such specifier may have as keys all the keys of
-% |{ nicematrix / p-column }| but also a key as 1, 2, 3, etc. The following set
-% of keys will be used to retrieve that value (in the counter |\l_@@_weight_int|).
+% |{ nicematrix / % p-column }| but also a key which corresponds to a positive
+% number (1, 2, 0.5, etc.) which is the \emph{weight} of the columns. The
+% following set of keys will be used to retrieve that value and store it in |\l_tmpa_fp|.
% \begin{macrocode}
\keys_define:nn { nicematrix / X-column }
- { unknown .code:n = \int_set:Nn \l_@@_weight_int { \l_keys_key_str } }
+ {
+ unknown .code:n =
+ \regex_match:nVTF { \A[0-9]*\.?[0-9]*\Z } \l_keys_key_str
+ { \fp_set:Nn \l_tmpa_fp { \l_keys_key_str } }
+ { \@@_error_or_warning:n { invalid~weight } }
+ }
% \end{macrocode}
%
%
@@ -6058,38 +6106,47 @@
\str_set:Nn \l_@@_vpos_col_str { p }
% \end{macrocode}
%
-% The integer |\l_@@_weight_int| will be the weight of the |X| column (the
-% initial value is $1$). The user may specify a different value (such as $2$,
-% $3$, etc.) by putting that value in the optional argument of the specifier.
-% The weights of the |X| columns are used in the computation of the actual width
-% of those columns as in \pkg{tabu} (now obsolete) or \pkg{tabularray}.
+% We will store in |\l_tmpa_fp| the weight of the column (|\l_tmpa_fp| also
+% appears in |{nicematrix/X-column}| and the error message |invalid~weight|.
% \begin{macrocode}
- \int_zero_new:N \l_@@_weight_int
- \int_set_eq:NN \l_@@_weight_int \c_one_int
+ \fp_set:Nn \l_tmpa_fp { 1.0 }
+% \end{macrocode}
+%
+% \begin{macrocode}
\@@_keys_p_column:n { #1 }
% \end{macrocode}
-% The unknown keys are put in |\l_tmpa_tl|
+% The unknown keys have been stored by |\@@_keys_p_column:n| in |\l_tmpa_tl| and
+% we use them right now in the set of keys |nicematrix/X-column| in order to
+% retrieve the potential weight explicitely provided by the final user.
+%
% \begin{macrocode}
\keys_set:no { nicematrix / X-column } \l_tmpa_tl
- \int_compare:nNnT \l_@@_weight_int < \c_zero_int
- {
- \@@_error_or_warning:n { negative~weight }
- \int_set:Nn \l_@@_weight_int { - \l_@@_weight_int }
- }
- \int_gadd:Nn \g_@@_total_X_weight_int \l_@@_weight_int
% \end{macrocode}
+% Now, the weight of the column is stored in |\l_tmpa_tl|.
+% \begin{macrocode}
+ \fp_gadd:Nn \g_@@_total_X_weight_fp \l_tmpa_fp
+% \end{macrocode}
%
-% We test whether we know the width of the |X|-columns by reading the |aux| file
-% (after the first compilation, the width of the |X|-columns is computed and
-% written in the |aux| file).
+% We test whether we know the actual width of the |X|-columns by reading the
+% |aux| file (after the first compilation, the width of the |X|-columns is
+% computed and written in the |aux| file).
% \begin{macrocode}
\bool_if:NTF \l_@@_X_columns_aux_bool
{
\@@_make_preamble_ii_iv:nnn
- { \l_@@_weight_int \l_@@_X_columns_dim }
+% \end{macrocode}
+% Of course, the weight of a column depend of its weight (in |\l_tmpa_fp|).
+% \begin{macrocode}
+ { \fp_use:N \l_tmpa_fp \l_@@_X_columns_dim }
{ minipage }
{ \@@_no_update_width: }
}
+% \end{macrocode}
+% In the current compilation, we don't known the actual width of the X column.
+% However, you have to construct the cells of that column! By convention, we
+% have decided to compose in a |{minipage}| of width 5~cm even though we will
+% nullify |\l_@@_cell_box| after its composition.
+% \begin{macrocode}
{
\tl_gput_right:Nn \g_@@_array_preamble_tl
{
@@ -6150,10 +6207,10 @@
% \end{macrocode}
%
% \medskip
-% The token |\@@_stop:| is a marker that we have inserted to mark the end of the
+% The token |\s_stop| is a marker that we have inserted to mark the end of the
% preamble (as provided by the final user) that we have inserted in the TeX flow.
% \begin{macrocode}
-\cs_set_eq:cN { @@ _ \token_to_str:N \@@_stop: } \use_none:n
+\cs_set_eq:cN { @@ _ \token_to_str:N \s_stop : } \use_none:n
% \end{macrocode}
%
% \medskip
@@ -6160,14 +6217,18 @@
% The following lines try to catch some errors (when the final user has
% forgotten the preamble of its environment).
% \begin{macrocode}
-\cs_new_protected:cpn { @@ _ \token_to_str:N \hline }
+\cs_new_protected:cpn { @@ _ \token_to_str:N \hline : }
{ \@@_fatal:n { Preamble~forgotten } }
-\cs_set_eq:cc { @@ _ \token_to_str:N \Hline } { @@ _ \token_to_str:N \hline }
-\cs_set_eq:cc { @@ _ \token_to_str:N \toprule } { @@ _ \token_to_str:N \hline }
-\cs_set_eq:cc { @@ _ \token_to_str:N \Block } { @@ _ \token_to_str:N \hline }
-\cs_set_eq:cc { @@ _ \token_to_str:N \CodeBefore } { @@ _ \token_to_str:N \hline }
-\cs_set_eq:cc { @@ _ \token_to_str:N \RowStyle } { @@ _ \token_to_str:N \hline }
-\cs_set_eq:cc { @@ _ \token_to_str:N \diagbox } { @@ _ \token_to_str:N \hline }
+\cs_set_eq:cc { @@ _ \token_to_str:N \Hline : } { @@ _ \token_to_str:N \hline : }
+\cs_set_eq:cc { @@ _ \token_to_str:N \toprule : }
+ { @@ _ \token_to_str:N \hline : }
+\cs_set_eq:cc { @@ _ \token_to_str:N \Block : } { @@ _ \token_to_str:N \hline : }
+\cs_set_eq:cc { @@ _ \token_to_str:N \CodeBefore : }
+ { @@ _ \token_to_str:N \hline : }
+\cs_set_eq:cc { @@ _ \token_to_str:N \RowStyle : }
+ { @@ _ \token_to_str:N \hline : }
+\cs_set_eq:cc { @@ _ \token_to_str:N \diagbox : }
+ { @@ _ \token_to_str:N \hline : }
% \end{macrocode}
%
% \bigskip
@@ -6190,7 +6251,7 @@
\begingroup
\bool_if:NT \c_@@_testphase_table_bool
{ \tbl_update_multicolumn_cell_data:n { #1 } }
- \cs_set_nopar:Npn \@addamp
+ \def \@addamp
{ \legacy_if:nTF { @firstamp } { \@firstampfalse } { \@preamerr 5 } }
% \end{macrocode}
%
@@ -6217,7 +6278,7 @@
% Now, we do a treatment specific to \pkg{nicematrix} which has no equivalent
% in the original definition of |\multicolumn|.
% \begin{macrocode}
- \int_compare:nNnT { #1 } > \c_one_int
+ \int_compare:nNnT { #1 } > { \c_one_int }
{
\seq_gput_left:Ne \g_@@_multicolumn_cells_seq
{ \int_use:N \c at iRow - \int_eval:n { \c at jCol + 1 } }
@@ -6225,13 +6286,13 @@
\seq_gput_right:Ne \g_@@_pos_of_blocks_seq
{
{
- \int_if_zero:nTF \c at jCol
+ \int_if_zero:nTF { \c at jCol }
{ \int_eval:n { \c at iRow + 1 } }
{ \int_use:N \c at iRow }
}
{ \int_eval:n { \c at jCol + 1 } }
{
- \int_if_zero:nTF \c at jCol
+ \int_if_zero:nTF { \c at jCol }
{ \int_eval:n { \c at iRow + 1 } }
{ \int_use:N \c at iRow }
}
@@ -6257,7 +6318,7 @@
{ \int_use:N \c at iRow - \int_use:N \c at jCol }
{ \int_use:N \c at iRow - \int_eval:n { \c at jCol + #1 } }
}
- \ignorespaces
+ \ignorespaces
}
% \end{macrocode}
%
@@ -6264,7 +6325,7 @@
% \medskip
% The following lines were in the original definition of |\multicolumn|.
% \begin{macrocode}
- \cs_set_nopar:Npn \@sharp { #3 }
+ \def \@sharp { #3 }
\@arstrut
\@preamble
\null
@@ -6274,7 +6335,7 @@
% We add some lines.
% \begin{macrocode}
\int_gadd:Nn \c at jCol { #1 - 1 }
- \int_compare:nNnT \c at jCol > \g_@@_col_total_int
+ \int_compare:nNnT { \c at jCol } > { \g_@@_col_total_int }
{ \int_gset_eq:NN \g_@@_col_total_int \c at jCol }
\ignorespaces
}
@@ -6328,7 +6389,7 @@
{
\tl_gput_right:Nn \g_@@_preamble_tl
{
- > { \@@_cell_begin: \cs_set_nopar:Npn \l_@@_hpos_cell_tl { #1 } }
+ > { \@@_cell_begin: \tl_set:Nn \l_@@_hpos_cell_tl { #1 } }
#1
< \@@_cell_end:
}
@@ -6400,13 +6461,13 @@
\dim_set:Nn \l_@@_col_width_dim { #4 }
\hbox_set:Nw \l_@@_cell_box
\@@_cell_begin:
- \cs_set_nopar:Npn \l_@@_hpos_cell_tl { #3 }
+ \tl_set:Nn \l_@@_hpos_cell_tl { #3 }
}
c
< {
\@@_cell_end:
\hbox_set_end:
- \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box:
+ \bool_if:NT \g_@@_rotate_bool { \@@_rotate_cell_box: }
#1
\@@_adjust_size_box:
\makebox [ #4 ] [ #3 ] { \box_use_drop:N \l_@@_cell_box }
@@ -6426,7 +6487,7 @@
\cs_new_protected:Npn \@@_make_m_preamble_x:n #1
{
\str_if_eq:nnTF { #1 } { < }
- \@@_make_m_preamble_ix:n
+ { \@@_make_m_preamble_ix:n }
{ \@@_make_m_preamble:n { #1 } }
}
% \end{macrocode}
@@ -6455,7 +6516,7 @@
\box_set_dp:Nn \l_tmpa_box { \box_dp:N \l_tmpa_box + \l_tmpb_dim }
\str_if_eq:eeTF \l_@@_baseline_tl { c }
{ \box_use_drop:N \l_tmpa_box }
- \@@_put_box_in_flow_i:
+ { \@@_put_box_in_flow_i: }
}
% \end{macrocode}
%
@@ -6492,13 +6553,13 @@
\str_if_eq:eeTF \l_@@_baseline_tl { t }
{ \int_set_eq:NN \l_tmpa_int \c_one_int }
{
- \str_if_eq:onTF \l_@@_baseline_tl { b }
+ \str_if_eq:onTF \l_@@_baseline_tl { b }
{ \int_set_eq:NN \l_tmpa_int \c at iRow }
{ \int_set:Nn \l_tmpa_int \l_@@_baseline_tl }
}
\bool_lazy_or:nnT
- { \int_compare_p:nNn \l_tmpa_int < \l_@@_first_row_int }
- { \int_compare_p:nNn \l_tmpa_int > \g_@@_row_total_int }
+ { \int_compare_p:nNn { \l_tmpa_int } < { \l_@@_first_row_int } }
+ { \int_compare_p:nNn { \l_tmpa_int } > { \g_@@_row_total_int } }
{
\@@_error:n { bad~value~for~baseline }
\int_set_eq:NN \l_tmpa_int \c_one_int
@@ -6534,7 +6595,7 @@
% \begin{macrocode}
\bool_if:NT \l_@@_NiceMatrix_without_vlines_bool
{
- \int_compare:nNnT \c at jCol > \c_one_int
+ \int_compare:nNnT { \c at jCol } > { \c_one_int }
{
\box_set_wd:Nn \l_@@_the_array_box
{ \box_wd:N \l_@@_the_array_box - \arraycolsep }
@@ -6560,7 +6621,7 @@
% tabular notes for which the command |\tabularnote| has been used without its
% optional argument (between square brackets).
% \begin{macrocode}
- \int_compare:nNnT \g_@@_notes_caption_int > \c_zero_int
+ \int_compare:nNnT { \g_@@_notes_caption_int } > { \c_zero_int }
{
\tl_gput_right:Ne \g_@@_aux_tl
{
@@ -6586,7 +6647,7 @@
% for the blocks.
% \begin{macrocode}
\@@_create_extra_nodes:
- \seq_if_empty:NF \g_@@_blocks_seq \@@_draw_blocks:
+ \seq_if_empty:NF \g_@@_blocks_seq { \@@_draw_blocks: }
}
% \end{macrocode}
% We don't do the following test with |\c at tabularnote| because the value of that
@@ -6598,11 +6659,11 @@
{
{ ! \seq_if_empty_p:N \g_@@_notes_seq }
{ ! \seq_if_empty_p:N \g_@@_notes_in_caption_seq }
- { ! \tl_if_empty_p:o \g_@@_tabularnote_tl }
+ { ! \tl_if_empty_p:o \g_@@_tabularnote_tl }
}
\@@_insert_tabularnotes:
\cs_set_eq:NN \tabularnote \@@_tabularnote_error:n
- \bool_if:NF \l_@@_caption_above_bool \@@_insert_caption:
+ \bool_if:NF \l_@@_caption_above_bool { \@@_insert_caption: }
\end { minipage }
}
% \end{macrocode}
@@ -6693,7 +6754,7 @@
% the |\unskip| are designed to give the ability to put a |\bottomrule| at the
% end of the notes with a good vertical space.
% \begin{macrocode}
- \int_compare:nNnT \c at tabularnote > \c_zero_int
+ \int_compare:nNnT { \c at tabularnote } > { \c_zero_int }
{
\bool_if:NTF \l_@@_notes_para_bool
{
@@ -6771,7 +6832,7 @@
\dim_gsub:Nn \g_tmpa_dim \pgf at y
\endpgfpicture
\dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
- \int_if_zero:nT \l_@@_first_row_int
+ \int_if_zero:nT { \l_@@_first_row_int }
{
\dim_gadd:Nn \g_tmpa_dim \g_@@_ht_row_zero_dim
\dim_gadd:Nn \g_tmpa_dim \g_@@_dp_row_zero_dim
@@ -6789,7 +6850,7 @@
% We convert a value of |t| to a value of |1|.
% \begin{macrocode}
\str_if_eq:eeT \l_@@_baseline_tl { t }
- { \cs_set_nopar:Npn \l_@@_baseline_tl { 1 } }
+ { \tl_set:Nn \l_@@_baseline_tl { 1 } }
% \end{macrocode}
% Now, we convert the value of |\l_@@_baseline_tl| (which should represent an
% integer) to an integer stored in |\l_tmpa_int|.
@@ -6803,7 +6864,7 @@
{
\str_range:Nnn
\l_@@_baseline_tl
- 6
+ { 6 }
{ \tl_count:o \l_@@_baseline_tl }
}
\@@_qpoint:n { row - \int_use:N \l_tmpa_int }
@@ -6811,8 +6872,8 @@
{
\int_set:Nn \l_tmpa_int \l_@@_baseline_tl
\bool_lazy_or:nnT
- { \int_compare_p:nNn \l_tmpa_int < \l_@@_first_row_int }
- { \int_compare_p:nNn \l_tmpa_int > \g_@@_row_total_int }
+ { \int_compare_p:nNn { \l_tmpa_int } < { \l_@@_first_row_int } }
+ { \int_compare_p:nNn { \l_tmpa_int } > { \g_@@_row_total_int } }
{
\@@_error:n { bad~value~for~baseline }
\int_set:Nn \l_tmpa_int 1
@@ -6822,7 +6883,7 @@
\dim_gsub:Nn \g_tmpa_dim \pgf at y
\endpgfpicture
\dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
- \int_if_zero:nT \l_@@_first_row_int
+ \int_if_zero:nT { \l_@@_first_row_int }
{
\dim_gadd:Nn \g_tmpa_dim \g_@@_ht_row_zero_dim
\dim_gadd:Nn \g_tmpa_dim \g_@@_dp_row_zero_dim
@@ -6880,11 +6941,9 @@
% Now, we can put the box in the TeX flow with the horizontal adjustments on
% both sides.
% \begin{macrocode}
- \skip_horizontal:N \l_@@_left_delim_dim
- \skip_horizontal:N -\l_@@_real_left_delim_dim
+ \skip_horizontal:n { \l_@@_left_delim_dim - \l_@@_real_left_delim_dim }
\@@_put_box_in_flow:
- \skip_horizontal:N \l_@@_right_delim_dim
- \skip_horizontal:N -\l_@@_real_right_delim_dim
+ \skip_horizontal:n { \l_@@_right_delim_dim - \l_@@_real_right_delim_dim }
}
% \end{macrocode}
%
@@ -6900,7 +6959,7 @@
% First, we test whether the environment is empty. If it is empty, we raise a
% fatal error (it's only a security). In order to detect whether it is empty, we
% test whether the next token is |\end| and, if it's the case, we test if this
-% is the end of the environment (if it is not, an standard error will be raised
+% is the end of the environment (if it is not, a standard error will be raised
% by LaTeX for incorrect nested environments).
% \begin{macrocode}
{
@@ -6907,7 +6966,7 @@
\peek_remove_spaces:n
{
\peek_meaning:NTF \end
- \@@_analyze_end:Nn
+ { \@@_analyze_end:Nn }
{
\@@_transform_preamble:
% \end{macrocode}
@@ -6971,7 +7030,7 @@
%
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_light_syntax_i:w #1\CodeAfter #2\q_stop
+\cs_new_protected:Npn \@@_light_syntax_i:w #1\CodeAfter #2 \q_stop
{
\tl_gput_right:Nn \g_nicematrix_code_after_tl { #2 }
% \end{macrocode}
@@ -6984,8 +7043,8 @@
% \begin{macrocode}
\tl_set_rescan:Nno \l_@@_end_of_row_tl { } \l_@@_end_of_row_tl
\bool_if:NTF \l_@@_light_syntax_expanded_bool
- \seq_set_split:Nee
- \seq_set_split:Non
+ { \seq_set_split:Nee }
+ { \seq_set_split:Non }
\l_@@_rows_seq \l_@@_end_of_row_tl { #1 }
% \end{macrocode}
% We delete the last row if it is empty.
@@ -6999,7 +7058,7 @@
% value. We do it, and so, if the token list |\l_@@_code_for_last_row_tl| is not
% empty, we will use directly where it should be.
% \begin{macrocode}
- \int_compare:nNnT \l_@@_last_row_int = { -1 }
+ \int_compare:nNnT { \l_@@_last_row_int } = { -1 }
{ \int_set:Nn \l_@@_last_row_int { \seq_count:N \l_@@_rows_seq } }
% \end{macrocode}
%
@@ -7016,7 +7075,7 @@
% First, we treat the first row.
% \begin{macrocode}
\seq_pop_left:NN \l_@@_rows_seq \l_tmpa_tl
- \@@_line_with_light_syntax:o \l_tmpa_tl
+ \@@_line_with_light_syntax:o \l_tmpa_tl
% \end{macrocode}
% Now, the other rows (with the same treatment, excepted that we have to insert
% |\\| between the rows).
@@ -7030,7 +7089,7 @@
% \end{macrocode}
%
% \begin{macrocode}
- \int_compare:nNnT \l_@@_last_col_int = { -1 }
+ \int_compare:nNnT { \l_@@_last_col_int } = { -1 }
{
\int_set:Nn \l_@@_last_col_int
{ \l_@@_nb_cols_int - 1 + \l_@@_first_col_int }
@@ -7054,7 +7113,6 @@
% \end{macrocode}
%
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_line_with_light_syntax:n { o }
\cs_new_protected:Npn \@@_line_with_light_syntax:n #1
{
\seq_clear_new:N \l_@@_cells_seq
@@ -7062,7 +7120,7 @@
\int_set:Nn \l_@@_nb_cols_int
{
\int_max:nn
- \l_@@_nb_cols_int
+ { \l_@@_nb_cols_int }
{ \seq_count:N \l_@@_cells_seq }
}
\seq_pop_left:NN \l_@@_cells_seq \l_tmpa_tl
@@ -7070,6 +7128,7 @@
\seq_map_inline:Nn \l_@@_cells_seq
{ \tl_build_put_right:Nn \l_@@_new_body_tl { & ##1 } }
}
+\cs_generate_variant:Nn \@@_line_with_light_syntax:n { o }
% \end{macrocode}
%
%
@@ -7099,7 +7158,7 @@
\cs_new:Npn \@@_create_col_nodes:
{
\crcr
- \int_if_zero:nT \l_@@_first_col_int
+ \int_if_zero:nT { \l_@@_first_col_int }
{
\omit
\hbox_overlap_left:n
@@ -7112,8 +7171,7 @@
\str_if_empty:NF \l_@@_name_str
{ \pgfnodealias { \l_@@_name_str - col - 0 } { \@@_env: - col - 0 } }
\endpgfpicture
- \skip_horizontal:N 2\col at sep
- \skip_horizontal:N \g_@@_width_first_col_dim
+ \skip_horizontal:n { 2 \col at sep + \g_@@_width_first_col_dim }
}
&
}
@@ -7126,15 +7184,15 @@
% First, we put a |col| node on the left of the first column (of course, we
% have to do that \emph{after} the |\omit|).
% \begin{macrocode}
- \int_if_zero:nTF \l_@@_first_col_int
+ \int_if_zero:nTF { \l_@@_first_col_int }
{
\bool_if:NT \l_@@_code_before_bool
{
\hbox
{
- \skip_horizontal:N -0.5\arrayrulewidth
+ \skip_horizontal:n { -0.5 \arrayrulewidth }
\pgfsys at markposition { \@@_env: - col - 1 }
- \skip_horizontal:N 0.5\arrayrulewidth
+ \skip_horizontal:n { 0.5 \arrayrulewidth }
}
}
\pgfpicture
@@ -7150,9 +7208,9 @@
{
\hbox
{
- \skip_horizontal:N 0.5\arrayrulewidth
+ \skip_horizontal:n { 0.5 \arrayrulewidth }
\pgfsys at markposition { \@@_env: - col - 1 }
- \skip_horizontal:N -0.5\arrayrulewidth
+ \skip_horizontal:n { -0.5 \arrayrulewidth }
}
}
\pgfpicture
@@ -7176,10 +7234,10 @@
% \begin{macrocode}
\skip_gset:Nn \g_tmpa_skip { 0 pt~plus 1 fill }
\bool_if:NF \l_@@_auto_columns_width_bool
- { \dim_compare:nNnT \l_@@_columns_width_dim > \c_zero_dim }
+ { \dim_compare:nNnT { \l_@@_columns_width_dim } > { \c_zero_dim } }
{
\bool_lazy_and:nnTF
- \l_@@_auto_columns_width_bool
+ { \l_@@_auto_columns_width_bool }
{ \bool_not_p:n \l_@@_block_auto_columns_width_bool }
{ \skip_gadd:Nn \g_tmpa_skip \g_@@_max_cell_width_dim }
{ \skip_gadd:Nn \g_tmpa_skip \l_@@_columns_width_dim }
@@ -7192,9 +7250,9 @@
{
\hbox
{
- \skip_horizontal:N -0.5\arrayrulewidth
+ \skip_horizontal:n { -0.5 \arrayrulewidth }
\pgfsys at markposition { \@@_env: - col - 2 }
- \skip_horizontal:N 0.5\arrayrulewidth
+ \skip_horizontal:n { 0.5 \arrayrulewidth }
}
}
\pgfpicture
@@ -7211,8 +7269,8 @@
% \begin{macrocode}
\int_gset_eq:NN \g_tmpa_int \c_one_int
\bool_if:NTF \g_@@_last_col_found_bool
- { \prg_replicate:nn { \int_max:nn { \g_@@_col_total_int - 3 } \c_zero_int } }
- { \prg_replicate:nn { \int_max:nn { \g_@@_col_total_int - 2 } \c_zero_int } }
+ { \prg_replicate:nn { \int_max:nn { \g_@@_col_total_int - 3 } { 0 } } }
+ { \prg_replicate:nn { \int_max:nn { \g_@@_col_total_int - 2 } { 0 } } }
{
&
\omit
@@ -7226,10 +7284,10 @@
{
\hbox
{
- \skip_horizontal:N -0.5\arrayrulewidth
+ \skip_horizontal:n { -0.5 \arrayrulewidth }
\pgfsys at markposition
{ \@@_env: - col - \int_eval:n { \g_tmpa_int + 1 } }
- \skip_horizontal:N 0.5\arrayrulewidth
+ \skip_horizontal:n { 0.5 \arrayrulewidth }
}
}
% \end{macrocode}
@@ -7257,7 +7315,7 @@
% The two following lines have been added on 2021-12-15 to solve a bug
% mentionned by Joao Luis Soares by mail.
% \begin{macrocode}
- \int_if_zero:nT \g_@@_col_total_int
+ \int_if_zero:nT { \g_@@_col_total_int }
{ \skip_gset:Nn \g_tmpa_skip { 0 pt~plus 1 fill } }
\skip_horizontal:N \g_tmpa_skip
\int_gincr:N \g_tmpa_int
@@ -7269,12 +7327,12 @@
\l_@@_exterior_arraycolsep_bool
\l_@@_bar_at_end_of_pream_bool
}
- { \skip_horizontal:N -\col at sep }
+ { \skip_horizontal:n { - \col at sep } }
\bool_if:NT \l_@@_code_before_bool
{
\hbox
{
- \skip_horizontal:N -0.5\arrayrulewidth
+ \skip_horizontal:n { -0.5 \arrayrulewidth }
% \end{macrocode}
% With an environment |{Matrix}|, you want to remove the exterior |\arraycolsep|
% but we don't know the number of columns (since there is no preamble) and
@@ -7282,10 +7340,10 @@
% a |\arraycolsep| now.
% \begin{macrocode}
\bool_if:NT \l_@@_NiceMatrix_without_vlines_bool
- { \skip_horizontal:N -\arraycolsep }
+ { \skip_horizontal:n { - \arraycolsep } }
\pgfsys at markposition
{ \@@_env: - col - \int_eval:n { \g_tmpa_int + 1 } }
- \skip_horizontal:N 0.5\arrayrulewidth
+ \skip_horizontal:n { 0.5 \arrayrulewidth }
\bool_if:NT \l_@@_NiceMatrix_without_vlines_bool
{ \skip_horizontal:N \arraycolsep }
}
@@ -7369,11 +7427,11 @@
% We insert |\l_@@_code_for_first_col_tl|... but we don't insert it in the
% potential ``first row'' and in the potential ``last row''.
% \begin{macrocode}
- \int_compare:nNnT \c at iRow > \c_zero_int
+ \int_compare:nNnT { \c at iRow } > { \c_zero_int }
{
\bool_lazy_or:nnT
- { \int_compare_p:nNn \l_@@_last_row_int < \c_zero_int }
- { \int_compare_p:nNn \c at iRow < \l_@@_last_row_int }
+ { \int_compare_p:nNn { \l_@@_last_row_int } < { \c_zero_int } }
+ { \int_compare_p:nNn { \c at iRow } < { \l_@@_last_row_int } }
{
\l_@@_code_for_first_col_tl
\xglobal \colorlet { nicematrix-first-col } { . }
@@ -7389,7 +7447,7 @@
{
\@@_math_toggle:
\hbox_set_end:
- \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box:
+ \bool_if:NT \g_@@_rotate_bool { \@@_rotate_cell_box: }
\@@_adjust_size_box:
\@@_update_for_first_and_last_row:
% \end{macrocode}
@@ -7397,7 +7455,7 @@
% after the construction of the array.
% \begin{macrocode}
\dim_gset:Nn \g_@@_width_first_col_dim
- { \dim_max:nn \g_@@_width_first_col_dim { \box_wd:N \l_@@_cell_box } }
+ { \dim_max:nn { \g_@@_width_first_col_dim } { \box_wd:N \l_@@_cell_box } }
% \end{macrocode}
% The content of the cell is inserted in an overlapping position.
% \label{overlap-left}
@@ -7404,8 +7462,8 @@
% \begin{macrocode}
\hbox_overlap_left:n
{
- \dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > \c_zero_dim
- \@@_node_for_cell:
+ \dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > { \c_zero_dim }
+ { \@@_node_cell: }
{ \box_use_drop:N \l_@@_cell_box }
\skip_horizontal:N \l_@@_left_delim_dim
\skip_horizontal:N \l_@@_left_margin_dim
@@ -7412,7 +7470,7 @@
\skip_horizontal:N \l_@@_extra_left_margin_dim
}
\bool_gset_false:N \g_@@_empty_cell_bool
- \skip_horizontal:N -2\col at sep
+ \skip_horizontal:n { -2 \col at sep }
}
}
% \end{macrocode}
@@ -7446,11 +7504,11 @@
% We insert |\l_@@_code_for_last_col_tl|... but we don't insert it in the
% potential ``first row'' and in the potential ``last row''.
% \begin{macrocode}
- \int_compare:nNnT \c at iRow > \c_zero_int
+ \int_compare:nNnT { \c at iRow } > { \c_zero_int }
{
\bool_lazy_or:nnT
- { \int_compare_p:nNn \l_@@_last_row_int < \c_zero_int }
- { \int_compare_p:nNn \c at iRow < \l_@@_last_row_int }
+ { \int_compare_p:nNn { \l_@@_last_row_int } < { \c_zero_int } }
+ { \int_compare_p:nNn { \c at iRow } < { \l_@@_last_row_int } }
{
\l_@@_code_for_last_col_tl
\xglobal \colorlet { nicematrix-last-col } { . }
@@ -7462,7 +7520,7 @@
{
\@@_math_toggle:
\hbox_set_end:
- \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box:
+ \bool_if:NT \g_@@_rotate_bool { \@@_rotate_cell_box: }
\@@_adjust_size_box:
\@@_update_for_first_and_last_row:
% \end{macrocode}
@@ -7470,8 +7528,8 @@
% after the construction of the array.
% \begin{macrocode}
\dim_gset:Nn \g_@@_width_last_col_dim
- { \dim_max:nn \g_@@_width_last_col_dim { \box_wd:N \l_@@_cell_box } }
- \skip_horizontal:N -2\col at sep
+ { \dim_max:nn { \g_@@_width_last_col_dim } { \box_wd:N \l_@@_cell_box } }
+ \skip_horizontal:n { -2 \col at sep }
% \end{macrocode}
% The content of the cell is inserted in an overlapping position.
% \label{overlap-right}
@@ -7478,12 +7536,12 @@
% \begin{macrocode}
\hbox_overlap_right:n
{
- \dim_compare:nNnT { \box_wd:N \l_@@_cell_box } > \c_zero_dim
+ \dim_compare:nNnT { \box_wd:N \l_@@_cell_box } > { \c_zero_dim }
{
\skip_horizontal:N \l_@@_right_delim_dim
\skip_horizontal:N \l_@@_right_margin_dim
\skip_horizontal:N \l_@@_extra_right_margin_dim
- \@@_node_for_cell:
+ \@@_node_cell:
}
}
\bool_gset_false:N \g_@@_empty_cell_bool
@@ -7508,7 +7566,7 @@
% \begin{macrocode}
\NiceArrayWithDelims . .
}
- { \endNiceArrayWithDelims }
+ { \endNiceArrayWithDelims }
% \end{macrocode}
%
%
@@ -7516,7 +7574,7 @@
% We create the variants of the environment |{NiceArrayWithDelims}|.
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_def_env:nnn #1 #2 #3
+\cs_new_protected:Npn \@@_def_env:NNN #1 #2 #3
{
\NewDocumentEnvironment { #1 NiceArray } { }
{
@@ -7531,11 +7589,11 @@
% \end{macrocode}
%
% \begin{macrocode}
-\@@_def_env:nnn p ( )
-\@@_def_env:nnn b [ ]
-\@@_def_env:nnn B \{ \}
-\@@_def_env:nnn v | |
-\@@_def_env:nnn V \| \|
+\@@_def_env:NNN p ( )
+\@@_def_env:NNN b [ ]
+\@@_def_env:NNN B \{ \}
+\@@_def_env:NNN v | |
+\@@_def_env:NNN V \| \|
% \end{macrocode}
%
%
@@ -7544,7 +7602,6 @@
%
%
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_begin_of_NiceMatrix:nn { n o }
\cs_new_protected:Npn \@@_begin_of_NiceMatrix:nn #1 #2
{
\bool_set_false:N \l_@@_preamble_bool
@@ -7571,6 +7628,7 @@
\tl_set:Nn \l_tmpb_tl { \use:c { #1 NiceArray } }
\exp_args:No \l_tmpb_tl \l_tmpa_tl
}
+\cs_generate_variant:Nn \@@_begin_of_NiceMatrix:nn { n o }
% \end{macrocode}
%
%
@@ -7581,13 +7639,13 @@
{
\bool_gset_true:N \g_@@_delims_bool
\str_gset:Nn \g_@@_name_env_str { #1 NiceMatrix }
- \int_if_zero:nT \l_@@_last_col_int
+ \int_if_zero:nT { \l_@@_last_col_int }
{
\bool_set_true:N \l_@@_last_col_without_value_bool
\int_set:Nn \l_@@_last_col_int { -1 }
}
\keys_set:nn { nicematrix / NiceMatrix } { ##1 }
- \@@_begin_of_NiceMatrix:no { #1 } \l_@@_columns_type_tl
+ \@@_begin_of_NiceMatrix:no { #1 } { \l_@@_columns_type_tl }
}
{ \use:c { end #1 NiceArray } }
}
@@ -7599,7 +7657,7 @@
\NewDocumentEnvironment { NiceMatrix } { ! O { } }
{
\str_gset:Nn \g_@@_name_env_str { NiceMatrix }
- \int_if_zero:nT \l_@@_last_col_int
+ \int_if_zero:nT { \l_@@_last_col_int }
{
\bool_set_true:N \l_@@_last_col_without_value_bool
\int_set:Nn \l_@@_last_col_int { -1 }
@@ -7609,7 +7667,7 @@
{ \clist_if_empty_p:N \l_@@_vlines_clist }
{ \l_@@_except_borders_bool }
{ \bool_set_true:N \l_@@_NiceMatrix_without_vlines_bool }
- \@@_begin_of_NiceMatrix:no { } \l_@@_columns_type_tl
+ \@@_begin_of_NiceMatrix:no { } { \l_@@_columns_type_tl }
}
{ \endNiceArray }
% \end{macrocode}
@@ -7632,7 +7690,7 @@
% If the dimension |\l_@@_width_dim| is equal to $0$~pt, that means that it has
% not been set by a previous use of |\NiceMatrixOptions|.
% \begin{macrocode}
- \dim_compare:nNnT \l_@@_width_dim = \c_zero_dim
+ \dim_compare:nNnT { \l_@@_width_dim } = { \c_zero_dim }
{ \dim_set_eq:NN \l_@@_width_dim \linewidth }
\str_gset:Nn \g_@@_name_env_str { NiceTabular }
\keys_set:nn { nicematrix / NiceTabular } { #1 , #3 }
@@ -7681,7 +7739,6 @@
\NewDocumentEnvironment { NiceTabularX } { m O { } m ! O { } }
{
\str_gset:Nn \g_@@_name_env_str { NiceTabularX }
- \dim_zero_new:N \l_@@_width_dim
\dim_set:Nn \l_@@_width_dim { #1 }
\keys_set:nn { nicematrix / NiceTabular } { #2 , #4 }
\@@_settings_for_tabular:
@@ -7689,7 +7746,7 @@
}
{
\endNiceArray
- \int_if_zero:nT \g_@@_total_X_weight_int
+ \fp_compare:nNnT { \g_@@_total_X_weight_fp } = { \c_zero_fp }
{ \@@_error:n { NiceTabularX~without~X } }
}
% \end{macrocode}
@@ -7720,8 +7777,8 @@
{
\bool_lazy_all:nT
{
- { \int_compare_p:nNn \l_@@_tab_rounded_corners_dim > \c_zero_dim }
- \l_@@_hvlines_bool
+ { \dim_compare_p:nNn { \l_@@_tab_rounded_corners_dim } > { \c_zero_dim } }
+ { \l_@@_hvlines_bool }
{ ! \g_@@_delims_bool }
{ ! \l_@@_except_borders_bool }
}
@@ -7836,33 +7893,8 @@
% and the last column.
% \begin{macrocode}
\pgfpicture
- \int_step_inline:nn \c at iRow
- {
- \pgfnodealias
- { \@@_env: - ##1 - last }
- { \@@_env: - ##1 - \int_use:N \c at jCol }
- }
- \int_step_inline:nn \c at jCol
- {
- \pgfnodealias
- { \@@_env: - last - ##1 }
- { \@@_env: - \int_use:N \c at iRow - ##1 }
- }
- \str_if_empty:NF \l_@@_name_str
- {
- \int_step_inline:nn \c at iRow
- {
- \pgfnodealias
- { \l_@@_name_str - ##1 - last }
- { \@@_env: - ##1 - \int_use:N \c at jCol }
- }
- \int_step_inline:nn \c at jCol
- {
- \pgfnodealias
- { \l_@@_name_str - last - ##1 }
- { \@@_env: - \int_use:N \c at iRow - ##1 }
- }
- }
+ \@@_create_aliases_last:
+ \str_if_empty:NF \l_@@_name_str { \@@_create_alias_nodes: }
\endpgfpicture
% \end{macrocode}
%
@@ -7874,8 +7906,8 @@
% \begin{macrocode}
\bool_if:NT \l_@@_parallelize_diags_bool
{
- \int_gzero_new:N \g_@@_ddots_int
- \int_gzero_new:N \g_@@_iddots_int
+ \int_gzero:N \g_@@_ddots_int
+ \int_gzero:N \g_@@_iddots_int
% \end{macrocode}
%
% The dimensions |\g_@@_delta_x_one_dim| and |\g_@@_delta_y_one_dim| will
@@ -7885,18 +7917,14 @@
% |\g_@@_delta_y_two_dim| are the $\Delta_x$ and $\Delta_y$ of the first
% |\Iddots| diagonal.
% \begin{macrocode}
- \dim_gzero_new:N \g_@@_delta_x_one_dim
- \dim_gzero_new:N \g_@@_delta_y_one_dim
- \dim_gzero_new:N \g_@@_delta_x_two_dim
- \dim_gzero_new:N \g_@@_delta_y_two_dim
+ \dim_gzero:N \g_@@_delta_x_one_dim
+ \dim_gzero:N \g_@@_delta_y_one_dim
+ \dim_gzero:N \g_@@_delta_x_two_dim
+ \dim_gzero:N \g_@@_delta_y_two_dim
}
% \end{macrocode}
%
% \begin{macrocode}
- \int_zero_new:N \l_@@_initial_i_int
- \int_zero_new:N \l_@@_initial_j_int
- \int_zero_new:N \l_@@_final_i_int
- \int_zero_new:N \l_@@_final_j_int
\bool_set_false:N \l_@@_initial_open_bool
\bool_set_false:N \l_@@_final_open_bool
% \end{macrocode}
@@ -7906,21 +7934,8 @@
% |\hdottedline| and |\vdottedline| and also for all the other dotted lines when
% |line-style| is equal to |standard|, which is the initial value) are changed.
% \begin{macrocode}
- \bool_if:NT \l_@@_small_bool
- {
- \dim_set:Nn \l_@@_xdots_radius_dim { 0.7 \l_@@_xdots_radius_dim }
- \dim_set:Nn \l_@@_xdots_inter_dim { 0.55 \l_@@_xdots_inter_dim }
+ \bool_if:NT \l_@@_small_bool { \@@_tuning_key_small_for_dots: }
% \end{macrocode}
-% The dimensions |\l_@@_xdots_shorten_start_dim| and
-% |\l_@@_xdots_shorten_start_dim| correspond to the options
-% |xdots/shorten-start| and |xdots/shorten-end| available to the user.
-% \begin{macrocode}
- \dim_set:Nn \l_@@_xdots_shorten_start_dim
- { 0.6 \l_@@_xdots_shorten_start_dim }
- \dim_set:Nn \l_@@_xdots_shorten_end_dim
- { 0.6 \l_@@_xdots_shorten_end_dim }
- }
-% \end{macrocode}
%
% \bigskip
% Now, we actually draw the dotted lines (specified by |\Cdots|, |\Vdots|,
@@ -7953,8 +7968,8 @@
%
% \begin{macrocode}
\@@_deal_with_rounded_corners:
- \clist_if_empty:NF \l_@@_hlines_clist \@@_draw_hlines:
- \clist_if_empty:NF \l_@@_vlines_clist \@@_draw_vlines:
+ \clist_if_empty:NF \l_@@_hlines_clist { \@@_draw_hlines: }
+ \clist_if_empty:NF \l_@@_vlines_clist { \@@_draw_vlines: }
% \end{macrocode}
%
% \bigskip
@@ -7982,8 +7997,7 @@
\cs_set_eq:NN \line \@@_line
% \end{macrocode}
% The LaTeX-style boolean |\ifmeasuring@| is used by \pkg{amsmath} during the
-% phase of measure in environments such as |{align}|, etc. We save a little time
-% by avoiding executing the |\g_@@_pre_code_after_tl| during that stage.
+% phase of measure in environments such as |{align}|, etc.
% \begin{macrocode}
\legacy_if:nF { measuring@ } { \g_@@_pre_code_after_tl }
\tl_gclear:N \g_@@_pre_code_after_tl
@@ -8067,6 +8081,24 @@
% \end{macrocode}
%
% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_tuning_key_small_for_dots:
+ {
+ \dim_set:Nn \l_@@_xdots_radius_dim { 0.7 \l_@@_xdots_radius_dim }
+ \dim_set:Nn \l_@@_xdots_inter_dim { 0.55 \l_@@_xdots_inter_dim }
+% \end{macrocode}
+% The dimensions |\l_@@_xdots_shorten_start_dim| and
+% |\l_@@_xdots_shorten_start_dim| correspond to the options
+% |xdots/shorten-start| and |xdots/shorten-end| available to the user.
+% \begin{macrocode}
+ \dim_set:Nn \l_@@_xdots_shorten_start_dim
+ { 0.6 \l_@@_xdots_shorten_start_dim }
+ \dim_set:Nn \l_@@_xdots_shorten_end_dim
+ { 0.6 \l_@@_xdots_shorten_end_dim }
+ }
+% \end{macrocode}
+%
+% \bigskip
% The following command will extract the potential options (between square
% brackets) at the beginning of the |\CodeAfter| (that is to say, when
% |\CodeAfter| is used, the options of that ``command'' |\CodeAfter|). Idem for
@@ -8077,6 +8109,27 @@
% \end{macrocode}
%
%
+% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_create_alias_nodes:
+ {
+ \int_step_inline:nn { \c at iRow }
+ {
+ \pgfnodealias
+ { \l_@@_name_str - ##1 - last }
+ { \@@_env: - ##1 - \int_use:N \c at jCol }
+ }
+ \int_step_inline:nn { \c at jCol }
+ {
+ \pgfnodealias
+ { \l_@@_name_str - last - ##1 }
+ { \@@_env: - \int_use:N \c at iRow - ##1 }
+ }
+ \pgfnodealias % added 2025-04-05
+ { \l_@@_name_str - last - last }
+ { \@@_env: - \int_use:N \c at iRow - \int_use:N \c at jCol }
+ }
+% \end{macrocode}
%
% \bigskip
% We remind that the first mandatory argument of the command |\Block| is the
@@ -8196,7 +8249,7 @@
{
\pgfpicture
\pgfrememberpicturepositiononpagetrue
- \int_step_inline:nn { \int_max:nn \c at iRow \c at jCol }
+ \int_step_inline:nn { \int_max:nn { \c at iRow } { \c at jCol } }
{
\@@_qpoint:n { col - \int_min:nn { ##1 } { \c at jCol + 1 } }
\dim_set_eq:NN \l_tmpa_dim \pgf at x
@@ -8221,7 +8274,7 @@
% Now, the last node. Of course, that is only a |coordinate| because there is
% not |.5| anchor for that node.
% \begin{macrocode}
- \int_set:Nn \l_tmpa_int { \int_max:nn \c at iRow \c at jCol + 1 }
+ \int_set:Nn \l_tmpa_int { \int_max:nn { \c at iRow } { \c at jCol } + 1 }
\@@_qpoint:n { row - \int_min:nn { \l_tmpa_int } { \c at iRow + 1 } }
\dim_set_eq:NN \l_tmpa_dim \pgf at y
\@@_qpoint:n { col - \int_min:nn { \l_tmpa_int } { \c at jCol + 1 } }
@@ -8229,7 +8282,7 @@
{ \@@_env: - \int_use:N \l_tmpa_int } { \pgfpoint \pgf at x \l_tmpa_dim }
\pgfnodealias
{ \@@_env: - last }
- { \@@_env: - \int_eval:n { \int_max:nn \c at iRow \c at jCol + 1 } }
+ { \@@_env: - \int_eval:n { \int_max:nn { \c at iRow } { \c at jCol } + 1 } }
\str_if_empty:NF \l_@@_name_str
{
\pgfnodealias
@@ -8498,9 +8551,9 @@
% Be careful: with |\Iddots|, |\l_@@_final_j_int| is inferior to
% |\l_@@_initial_j_int|. That's why we use |\int_min:nn| and |\int_max:nn|.
% \begin{macrocode}
- { \int_min:nn \l_@@_initial_j_int \l_@@_final_j_int }
+ { \int_min:nn { \l_@@_initial_j_int } { \l_@@_final_j_int } }
{ \int_use:N \l_@@_final_i_int }
- { \int_max:nn \l_@@_initial_j_int \l_@@_final_j_int }
+ { \int_max:nn { \l_@@_initial_j_int } { \l_@@_final_j_int } }
{ } % for the name of the block
}
}
@@ -8640,7 +8693,7 @@
\cs_new_protected:Npn \@@_open_x_initial_dim:
{
\dim_set_eq:NN \l_@@_x_initial_dim \c_max_dim
- \int_step_inline:nnn \l_@@_first_row_int \g_@@_row_total_int
+ \int_step_inline:nnn { \l_@@_first_row_int } { \g_@@_row_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \@@_env: - ##1 - \int_use:N \l_@@_initial_j_int }
@@ -8649,7 +8702,7 @@
{ \@@_env: - ##1 - \int_use:N \l_@@_initial_j_int }
{ west }
\dim_set:Nn \l_@@_x_initial_dim
- { \dim_min:nn \l_@@_x_initial_dim \pgf at x }
+ { \dim_min:nn { \l_@@_x_initial_dim } { \pgf at x } }
}
}
% \end{macrocode}
@@ -8656,7 +8709,7 @@
% If, in fact, all the cells of the column are empty (no PGF/Tikz nodes in
% those cells).
% \begin{macrocode}
- \dim_compare:nNnT \l_@@_x_initial_dim = \c_max_dim
+ \dim_compare:nNnT { \l_@@_x_initial_dim } = { \c_max_dim }
{
\@@_qpoint:n { col - \int_use:N \l_@@_initial_j_int }
\dim_set_eq:NN \l_@@_x_initial_dim \pgf at x
@@ -8669,7 +8722,7 @@
\cs_new_protected:Npn \@@_open_x_final_dim:
{
\dim_set:Nn \l_@@_x_final_dim { - \c_max_dim }
- \int_step_inline:nnn \l_@@_first_row_int \g_@@_row_total_int
+ \int_step_inline:nnn { \l_@@_first_row_int } { \g_@@_row_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \@@_env: - ##1 - \int_use:N \l_@@_final_j_int }
@@ -8677,8 +8730,8 @@
\pgfpointanchor
{ \@@_env: - ##1 - \int_use:N \l_@@_final_j_int }
{ east }
- \dim_compare:nNnT \pgf at x > \l_@@_x_final_dim
- { \dim_set_eq:NN \l_@@_x_final_dim \pgf at x }
+ \dim_compare:nNnT { \pgf at x } > { \l_@@_x_final_dim }
+ { \dim_set_eq:NN \l_@@_x_final_dim \pgf at x }
}
}
% \end{macrocode}
@@ -8685,7 +8738,7 @@
% If, in fact, all the cells of the columns are empty (no PGF/Tikz nodes in
% those cells).
% \begin{macrocode}
- \dim_compare:nNnT \l_@@_x_final_dim = { - \c_max_dim }
+ \dim_compare:nNnT { \l_@@_x_final_dim } = { - \c_max_dim }
{
\@@_qpoint:n { col - \int_eval:n { \l_@@_final_j_int + 1 } }
\dim_set_eq:NN \l_@@_x_final_dim \pgf at x
@@ -8721,7 +8774,7 @@
% be (after the construction of the array) the number of that ``last row'' even
% if the option |last-row| has been used without value.
% \begin{macrocode}
- \int_compare:nNnT { #1 } = \l_@@_last_row_int
+ \int_compare:nNnT { #1 } = { \l_@@_last_row_int }
{ \color { nicematrix-last-row } }
}
\keys_set:nn { nicematrix / xdots } { #3 }
@@ -8772,7 +8825,7 @@
{
\l_@@_initial_open_bool
\l_@@_final_open_bool
- { \int_compare_p:nNn \l_@@_initial_i_int = \l_@@_last_row_int }
+ { \int_compare_p:nNn { \l_@@_initial_i_int } = { \l_@@_last_row_int } }
}
{
\dim_add:Nn \l_@@_y_initial_dim \c_@@_shift_Ldots_last_row_dim
@@ -8800,7 +8853,7 @@
\@@_adjust_to_submatrix:nn { #1 } { #2 }
\cs_if_free:cT { @@ _ dotted _ #1 - #2 }
{
- \@@_find_extremities_of_line:nnnn { #1 } { #2 } 0 1
+ \@@_find_extremities_of_line:nnnn { #1 } { #2 } { 0 } { 1 }
% \end{macrocode}
% The previous command may have changed the current environment by marking some
% cells as ``dotted'', but, fortunately, it is outside the group for the options
@@ -8816,7 +8869,7 @@
% be (after the construction of the array) the number of that ``last row'' even
% if the option |last-row| has been used without value.
% \begin{macrocode}
- \int_compare:nNnT { #1 } = \l_@@_last_row_int
+ \int_compare:nNnT { #1 } = { \l_@@_last_row_int }
{ \color { nicematrix-last-row } }
}
\keys_set:nn { nicematrix / xdots } { #3 }
@@ -8849,8 +8902,8 @@
{ \@@_open_x_final_dim: }
{ \@@_set_final_coords_from_anchor:n { mid~west } }
\bool_lazy_and:nnTF
- \l_@@_initial_open_bool
- \l_@@_final_open_bool
+ { \l_@@_initial_open_bool }
+ { \l_@@_final_open_bool }
{
\@@_qpoint:n { row - \int_use:N \l_@@_initial_i_int }
\dim_set_eq:NN \l_tmpa_dim \pgf at y
@@ -8872,7 +8925,7 @@
\cs_new_protected:Npn \@@_open_y_initial_dim:
{
\dim_set:Nn \l_@@_y_initial_dim { - \c_max_dim }
- \int_step_inline:nnn \l_@@_first_col_int \g_@@_col_total_int
+ \int_step_inline:nnn { \l_@@_first_col_int } { \g_@@_col_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \@@_env: - \int_use:N \l_@@_initial_i_int - ##1 }
@@ -8880,11 +8933,11 @@
\pgfpointanchor
{ \@@_env: - \int_use:N \l_@@_initial_i_int - ##1 }
{ north }
- \dim_compare:nNnT \pgf at y > \l_@@_y_initial_dim
+ \dim_compare:nNnT { \pgf at y } > { \l_@@_y_initial_dim }
{ \dim_set_eq:NN \l_@@_y_initial_dim \pgf at y }
}
}
- \dim_compare:nNnT \l_@@_y_initial_dim = { - \c_max_dim }
+ \dim_compare:nNnT { \l_@@_y_initial_dim } = { - \c_max_dim }
{
\@@_qpoint:n { row - \int_use:N \l_@@_initial_i_int - base }
\dim_set:Nn \l_@@_y_initial_dim
@@ -8904,7 +8957,7 @@
\cs_new_protected:Npn \@@_open_y_final_dim:
{
\dim_set_eq:NN \l_@@_y_final_dim \c_max_dim
- \int_step_inline:nnn \l_@@_first_col_int \g_@@_col_total_int
+ \int_step_inline:nnn { \l_@@_first_col_int } { \g_@@_col_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \@@_env: - \int_use:N \l_@@_final_i_int - ##1 }
@@ -8912,11 +8965,11 @@
\pgfpointanchor
{ \@@_env: - \int_use:N \l_@@_final_i_int - ##1 }
{ south }
- \dim_compare:nNnT \pgf at y < \l_@@_y_final_dim
+ \dim_compare:nNnT { \pgf at y } < { \l_@@_y_final_dim }
{ \dim_set_eq:NN \l_@@_y_final_dim \pgf at y }
}
}
- \dim_compare:nNnT \l_@@_y_final_dim = \c_max_dim
+ \dim_compare:nNnT { \l_@@_y_final_dim } = { \c_max_dim }
{
\@@_qpoint:n { row - \int_use:N \l_@@_final_i_int - base }
\dim_set:Nn \l_@@_y_final_dim
@@ -8933,7 +8986,7 @@
\@@_adjust_to_submatrix:nn { #1 } { #2 }
\cs_if_free:cT { @@ _ dotted _ #1 - #2 }
{
- \@@_find_extremities_of_line:nnnn { #1 } { #2 } 1 0
+ \@@_find_extremities_of_line:nnnn { #1 } { #2 } { 1 } { 0 }
% \end{macrocode}
% The previous command may have changed the current environment by marking some
% cells as ``dotted'', but, fortunately, it is outside the group for the options
@@ -8944,7 +8997,7 @@
\int_if_zero:nTF { #2 }
{ \color { nicematrix-first-col } }
{
- \int_compare:nNnT { #2 } = \l_@@_last_col_int
+ \int_compare:nNnT { #2 } = { \l_@@_last_col_int }
{ \color { nicematrix-last-col } }
}
\keys_set:nn { nicematrix / xdots } { #3 }
@@ -8974,7 +9027,7 @@
%
% First, the case of a dotted line open on both sides.
% \begin{macrocode}
- \bool_lazy_and:nnTF \l_@@_initial_open_bool \l_@@_final_open_bool
+ \bool_lazy_and:nnTF { \l_@@_initial_open_bool } { \l_@@_final_open_bool }
% \end{macrocode}
%
% We have to determine the $x$-value of the vertical rule that we will have
@@ -8983,7 +9036,7 @@
{
\@@_open_y_initial_dim:
\@@_open_y_final_dim:
- \int_if_zero:nTF \l_@@_initial_j_int
+ \int_if_zero:nTF { \l_@@_initial_j_int }
% \end{macrocode}
% We have a dotted line open on both sides in the ``first column''.
% \begin{macrocode}
@@ -8996,8 +9049,11 @@
}
{
\bool_lazy_and:nnTF
- { \int_compare_p:nNn \l_@@_last_col_int > { -2 } }
- { \int_compare_p:nNn \l_@@_initial_j_int = \g_@@_col_total_int }
+ { \int_compare_p:nNn { \l_@@_last_col_int } > { -2 } }
+ {
+ \int_compare_p:nNn
+ { \l_@@_initial_j_int } = { \g_@@_col_total_int }
+ }
% \end{macrocode}
% We have a dotted line open on both sides in the ``last column''.
% \begin{macrocode}
@@ -9035,7 +9091,10 @@
\@@_set_initial_coords_from_anchor:n { south~west }
\@@_set_final_coords_from_anchor:n { north~west }
\bool_set:Nn \l_tmpa_bool
- { \dim_compare_p:nNn \l_@@_x_initial_dim = \l_@@_x_final_dim }
+ {
+ \dim_compare_p:nNn
+ { \l_@@_x_initial_dim } = { \l_@@_x_final_dim }
+ }
}
}
% \end{macrocode}
@@ -9051,7 +9110,7 @@
{
\@@_set_initial_coords_from_anchor:n { south }
\bool_if:NTF \l_@@_final_open_bool
- \@@_open_y_final_dim:
+ { \@@_open_y_final_dim: }
% \end{macrocode}
% Now the case where both extremities are closed. The first conditional tests
% whether the column is of type |c| or may be considered as if.
@@ -9058,11 +9117,11 @@
% \begin{macrocode}
{
\@@_set_final_coords_from_anchor:n { north }
- \dim_compare:nNnF \l_@@_x_initial_dim = \l_@@_x_final_dim
+ \dim_compare:nNnF { \l_@@_x_initial_dim } = { \l_@@_x_final_dim }
{
\dim_set:Nn \l_@@_x_initial_dim
{
- \bool_if:NTF \l_tmpa_bool \dim_min:nn \dim_max:nn
+ \bool_if:NTF \l_tmpa_bool { \dim_min:nn } { \dim_max:nn }
\l_@@_x_initial_dim \l_@@_x_final_dim
}
}
@@ -9087,7 +9146,7 @@
\@@_adjust_to_submatrix:nn { #1 } { #2 }
\cs_if_free:cT { @@ _ dotted _ #1 - #2 }
{
- \@@_find_extremities_of_line:nnnn { #1 } { #2 } 1 1
+ \@@_find_extremities_of_line:nnnn { #1 } { #2 } { 1 } { 1 }
% \end{macrocode}
% The previous command may have changed the current environment by marking some
% cells as ``dotted'', but, fortunately, it is outside the group for the options
@@ -9141,7 +9200,7 @@
% We test if the diagonal line is the first one (the counter |\g_@@_ddots_int|
% is created for this usage).
% \begin{macrocode}
- \int_compare:nNnTF \g_@@_ddots_int = \c_one_int
+ \int_compare:nNnTF { \g_@@_ddots_int } = { \c_one_int }
% \end{macrocode}
% If the diagonal line is the first one, we have no adjustment of the line to do
% but we store the $\Delta_x$ and the $\Delta_y$ of the line because these
@@ -9159,7 +9218,7 @@
% extremity of the line by modifying the coordinate |\l_@@_x_initial_dim|.
% \begin{macrocode}
{
- \dim_compare:nNnF \g_@@_delta_x_one_dim = \c_zero_dim
+ \dim_compare:nNnF { \g_@@_delta_x_one_dim } = { \c_zero_dim }
{
\dim_set:Nn \l_@@_y_final_dim
{
@@ -9185,7 +9244,7 @@
\@@_adjust_to_submatrix:nn { #1 } { #2 }
\cs_if_free:cT { @@ _ dotted _ #1 - #2 }
{
- \@@_find_extremities_of_line:nnnn { #1 } { #2 } 1 { -1 }
+ \@@_find_extremities_of_line:nnnn { #1 } { #2 } { 1 } { -1 }
% \end{macrocode}
% The previous command may have changed the current environment by marking some
% cells as ``dotted'', but, fortunately, it is outside the group for the options
@@ -9230,7 +9289,7 @@
\bool_if:NT \l_@@_parallelize_diags_bool
{
\int_gincr:N \g_@@_iddots_int
- \int_compare:nNnTF \g_@@_iddots_int = \c_one_int
+ \int_compare:nNnTF { \g_@@_iddots_int } = { \c_one_int }
{
\dim_gset:Nn \g_@@_delta_x_two_dim
{ \l_@@_x_final_dim - \l_@@_x_initial_dim }
@@ -9238,7 +9297,7 @@
{ \l_@@_y_final_dim - \l_@@_y_initial_dim }
}
{
- \dim_compare:nNnF \g_@@_delta_x_two_dim = \c_zero_dim
+ \dim_compare:nNnF { \g_@@_delta_x_two_dim } = { \c_zero_dim }
{
\dim_set:Nn \l_@@_y_final_dim
{
@@ -9277,9 +9336,9 @@
\pgf at relevantforpicturesizefalse
\bool_lazy_or:nnTF
{ \tl_if_eq_p:NN \l_@@_xdots_line_style_tl \c_@@_standard_tl }
- \l_@@_dotted_bool
- \@@_draw_standard_dotted_line:
- \@@_draw_unstandard_dotted_line:
+ { \l_@@_dotted_bool }
+ { \@@_draw_standard_dotted_line: }
+ { \@@_draw_unstandard_dotted_line: }
}
% \end{macrocode}
%
@@ -9300,7 +9359,6 @@
% \smallskip
% The argument of |\@@_draw_unstandard_dotted_line:n| is, in fact, the list of options.
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_draw_unstandard_dotted_line:n { o }
\cs_new_protected:Npn \@@_draw_unstandard_dotted_line:n #1
{
\@@_draw_unstandard_dotted_line:nooo
@@ -9309,6 +9367,7 @@
\l_@@_xdots_down_tl
\l_@@_xdots_middle_tl
}
+\cs_generate_variant:Nn \@@_draw_unstandard_dotted_line:n { o }
% \end{macrocode}
%
%
@@ -9336,7 +9395,6 @@
%
% \bigskip
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_draw_unstandard_dotted_line:nnnn { n o o o }
\cs_new_protected:Npn \@@_draw_unstandard_dotted_line:nnnn #1 #2 #3 #4
{
% \end{macrocode}
@@ -9369,9 +9427,9 @@
% we should also write something in the |aux| file to say that one more
% compilation should be done.
% \begin{macrocode}
- \dim_compare:nNnT \l_@@_l_dim < \c_@@_max_l_dim
+ \dim_compare:nNnT { \l_@@_l_dim } < { \c_@@_max_l_dim }
{
- \dim_compare:nNnT \l_@@_l_dim > { 1 pt }
+ \dim_compare:nNnT { \l_@@_l_dim } > { 1 pt }
\@@_draw_unstandard_dotted_line_i:
}
% \end{macrocode}
@@ -9403,6 +9461,7 @@
( \l_@@_x_final_dim , \l_@@_y_final_dim ) ;
\end { scope }
}
+\cs_generate_variant:Nn \@@_draw_unstandard_dotted_line:nnnn { n o o o }
% \end{macrocode}
%
% \begin{macrocode}
@@ -9471,10 +9530,10 @@
% we should also write something in the |aux| file to say that one more
% compilation should be done.
% \begin{macrocode}
- \dim_compare:nNnT \l_@@_l_dim < \c_@@_max_l_dim
+ \dim_compare:nNnT { \l_@@_l_dim } < { \c_@@_max_l_dim }
{
- \dim_compare:nNnT \l_@@_l_dim > { 1 pt }
- \@@_draw_standard_dotted_line_i:
+ \dim_compare:nNnT { \l_@@_l_dim } > { 1 pt }
+ { \@@_draw_standard_dotted_line_i: }
}
\group_end:
% \end{macrocode}
@@ -9485,7 +9544,7 @@
{ \tl_if_empty_p:N \l_@@_xdots_down_tl }
{ \tl_if_empty_p:N \l_@@_xdots_middle_tl }
}
- \l_@@_labels_standard_dotted_line:
+ { \@@_labels_standard_dotted_line: }
}
% \end{macrocode}
%
@@ -9507,7 +9566,7 @@
- \l_@@_xdots_shorten_start_dim
- \l_@@_xdots_shorten_end_dim
}
- \l_@@_xdots_inter_dim
+ { \l_@@_xdots_inter_dim }
}
% \end{macrocode}
%
@@ -9553,7 +9612,7 @@
{ 2 \l_@@_l_dim }
}
\pgf at relevantforpicturesizefalse
- \int_step_inline:nnn \c_zero_int \l_tmpa_int
+ \int_step_inline:nnn { \c_zero_int } { \l_tmpa_int }
{
\pgfpathcircle
{ \pgfpoint \l_@@_x_initial_dim \l_@@_y_initial_dim }
@@ -9567,7 +9626,7 @@
%
% \bigskip
% \begin{macrocode}
-\cs_new_protected:Npn \l_@@_labels_standard_dotted_line:
+\cs_new_protected:Npn \@@_labels_standard_dotted_line:
{
\pgfscope
\pgftransformshift
@@ -9582,7 +9641,7 @@
(
\l_@@_y_final_dim - \l_@@_y_initial_dim ,
\l_@@_x_final_dim - \l_@@_x_initial_dim
- )
+ )
}
\pgftransformrotate { \fp_use:N \l_tmpa_fp }
\bool_if:NF \l_@@_xdots_h_labels_bool { \fp_zero:N \l_tmpa_fp }
@@ -9648,8 +9707,8 @@
% \section{User commands available in the new environments}
%
%
-% The commands |\@@_Ldots|, |\@@_Cdots|, |\@@_Vdots|, |\@@_Ddots| and
-% |\@@_Iddots| will be linked to |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots| and
+% The commands |\@@_Ldots:|, |\@@_Cdots:|, |\@@_Vdots:|, |\@@_Ddots:| and
+% |\@@_Iddots:| will be linked to |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots| and
% |\Iddots| in the environments |{NiceArray}| (the other environments of
% \pkg{nicematrix} rely upon |{NiceArray}|).
%
@@ -9666,24 +9725,27 @@
% \begin{macrocode}
\hook_gput_code:nnn { begindocument } { . }
{
- \cs_set_nopar:Npn \l_@@_argspec_tl { m E { _ ^ : } { { } { } { } } }
- \tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl
- \cs_new_protected:Npn \@@_Ldots
+% \end{macrocode}
+% We rescan the \emph{argspec} in order the correct catcode of |_| in the main
+% document (and that's why we are in a |\AtBeginDocument|).
+% \begin{macrocode}
+ \tl_set_rescan:Nnn \l_@@_argspec_tl { } { m E { _ ^ : } { { } { } { } } }
+ \cs_new_protected:Npn \@@_Ldots:
{ \@@_collect_options:n { \@@_Ldots_i } }
- \exp_args:NNo \NewDocumentCommand \@@_Ldots_i \l_@@_argspec_tl
+ \exp_args:NNo \NewDocumentCommand \@@_Ldots_i \l_@@_argspec_tl
{
- \int_if_zero:nTF \c at jCol
- { \@@_error:nn { in~first~col } \Ldots }
+ \int_if_zero:nTF { \c at jCol }
+ { \@@_error:nn { in~first~col } { \Ldots } }
{
- \int_compare:nNnTF \c at jCol = \l_@@_last_col_int
- { \@@_error:nn { in~last~col } \Ldots }
+ \int_compare:nNnTF { \c at jCol } = { \l_@@_last_col_int }
+ { \@@_error:nn { in~last~col } { \Ldots } }
{
- \@@_instruction_of_type:nnn \c_false_bool { Ldots }
+ \@@_instruction_of_type:nnn { \c_false_bool } { Ldots }
{ #1 , down = #2 , up = #3 , middle = #4 }
}
}
\bool_if:NF \l_@@_nullify_dots_bool
- { \phantom { \ensuremath { \@@_old_ldots } } }
+ { \phantom { \ensuremath { \@@_old_ldots: } } }
\bool_gset_true:N \g_@@_empty_cell_bool
}
% \end{macrocode}
@@ -9690,22 +9752,22 @@
%
% \bigskip
% \begin{macrocode}
- \cs_new_protected:Npn \@@_Cdots
+ \cs_new_protected:Npn \@@_Cdots:
{ \@@_collect_options:n { \@@_Cdots_i } }
\exp_args:NNo \NewDocumentCommand \@@_Cdots_i \l_@@_argspec_tl
{
- \int_if_zero:nTF \c at jCol
- { \@@_error:nn { in~first~col } \Cdots }
+ \int_if_zero:nTF { \c at jCol }
+ { \@@_error:nn { in~first~col } { \Cdots } }
{
- \int_compare:nNnTF \c at jCol = \l_@@_last_col_int
- { \@@_error:nn { in~last~col } \Cdots }
+ \int_compare:nNnTF { \c at jCol } = { \l_@@_last_col_int }
+ { \@@_error:nn { in~last~col } { \Cdots } }
{
- \@@_instruction_of_type:nnn \c_false_bool { Cdots }
+ \@@_instruction_of_type:nnn { \c_false_bool } { Cdots }
{ #1 , down = #2 , up = #3 , middle = #4 }
}
}
\bool_if:NF \l_@@_nullify_dots_bool
- { \phantom { \ensuremath { \@@_old_cdots } } }
+ { \phantom { \ensuremath { \@@_old_cdots: } } }
\bool_gset_true:N \g_@@_empty_cell_bool
}
% \end{macrocode}
@@ -9712,22 +9774,22 @@
%
% \bigskip
% \begin{macrocode}
- \cs_new_protected:Npn \@@_Vdots
+ \cs_new_protected:Npn \@@_Vdots:
{ \@@_collect_options:n { \@@_Vdots_i } }
\exp_args:NNo \NewDocumentCommand \@@_Vdots_i \l_@@_argspec_tl
{
- \int_if_zero:nTF \c at iRow
- { \@@_error:nn { in~first~row } \Vdots }
+ \int_if_zero:nTF { \c at iRow }
+ { \@@_error:nn { in~first~row } { \Vdots } }
{
- \int_compare:nNnTF \c at iRow = \l_@@_last_row_int
- { \@@_error:nn { in~last~row } \Vdots }
+ \int_compare:nNnTF { \c at iRow } = { \l_@@_last_row_int }
+ { \@@_error:nn { in~last~row } { \Vdots } }
{
- \@@_instruction_of_type:nnn \c_false_bool { Vdots }
+ \@@_instruction_of_type:nnn { \c_false_bool } { Vdots }
{ #1 , down = #2 , up = #3 , middle = #4 }
}
}
\bool_if:NF \l_@@_nullify_dots_bool
- { \phantom { \ensuremath { \@@_old_vdots } } }
+ { \phantom { \ensuremath { \@@_old_vdots: } } }
\bool_gset_true:N \g_@@_empty_cell_bool
}
% \end{macrocode}
@@ -9735,20 +9797,20 @@
%
% \bigskip
% \begin{macrocode}
- \cs_new_protected:Npn \@@_Ddots
+ \cs_new_protected:Npn \@@_Ddots:
{ \@@_collect_options:n { \@@_Ddots_i } }
\exp_args:NNo \NewDocumentCommand \@@_Ddots_i \l_@@_argspec_tl
{
\int_case:nnF \c at iRow
{
- 0 { \@@_error:nn { in~first~row } \Ddots }
- \l_@@_last_row_int { \@@_error:nn { in~last~row } \Ddots }
+ 0 { \@@_error:nn { in~first~row } { \Ddots } }
+ \l_@@_last_row_int { \@@_error:nn { in~last~row } { \Ddots } }
}
{
\int_case:nnF \c at jCol
{
- 0 { \@@_error:nn { in~first~col } \Ddots }
- \l_@@_last_col_int { \@@_error:nn { in~last~col } \Ddots }
+ 0 { \@@_error:nn { in~first~col } { \Ddots } }
+ \l_@@_last_col_int { \@@_error:nn { in~last~col } { \Ddots } }
}
{
\keys_set_known:nn { nicematrix / Ddots } { #1 }
@@ -9758,7 +9820,7 @@
}
\bool_if:NF \l_@@_nullify_dots_bool
- { \phantom { \ensuremath { \@@_old_ddots } } }
+ { \phantom { \ensuremath { \@@_old_ddots: } } }
\bool_gset_true:N \g_@@_empty_cell_bool
}
% \end{macrocode}
@@ -9765,29 +9827,29 @@
%
% \bigskip
% \begin{macrocode}
- \cs_new_protected:Npn \@@_Iddots
+ \cs_new_protected:Npn \@@_Iddots:
{ \@@_collect_options:n { \@@_Iddots_i } }
\exp_args:NNo \NewDocumentCommand \@@_Iddots_i \l_@@_argspec_tl
{
\int_case:nnF \c at iRow
{
- 0 { \@@_error:nn { in~first~row } \Iddots }
- \l_@@_last_row_int { \@@_error:nn { in~last~row } \Iddots }
+ 0 { \@@_error:nn { in~first~row } { \Iddots } }
+ \l_@@_last_row_int { \@@_error:nn { in~last~row } { \Iddots } }
}
{
\int_case:nnF \c at jCol
{
- 0 { \@@_error:nn { in~first~col } \Iddots }
- \l_@@_last_col_int { \@@_error:nn { in~last~col } \Iddots }
+ 0 { \@@_error:nn { in~first~col } { \Iddots } }
+ \l_@@_last_col_int { \@@_error:nn { in~last~col } { \Iddots } }
}
{
\keys_set_known:nn { nicematrix / Ddots } { #1 }
- \@@_instruction_of_type:nnn \l_@@_draw_first_bool { Iddots }
+ \@@_instruction_of_type:nnn { \l_@@_draw_first_bool } { Iddots }
{ #1 , down = #2 , up = #3 , middle = #4 }
}
}
\bool_if:NF \l_@@_nullify_dots_bool
- { \phantom { \ensuremath { \@@_old_iddots } } }
+ { \phantom { \ensuremath { \@@_old_iddots: } } }
\bool_gset_true:N \g_@@_empty_cell_bool
}
}
@@ -9822,7 +9884,7 @@
% We will patch the environment |{tabular}| to go back to the previous value of
% |\multicolumn|.
% \begin{macrocode}
-\cs_set_eq:NN \@@_old_multicolumn \multicolumn
+\cs_set_eq:NN \@@_old_multicolumn: \multicolumn
% \end{macrocode}
%
%
@@ -9838,25 +9900,25 @@
\cs_new:Npn \@@_Hdotsfor:
{
\bool_lazy_and:nnTF
- { \int_if_zero_p:n \c at jCol }
- { \int_if_zero_p:n \l_@@_first_col_int }
+ { \int_if_zero_p:n { \c at jCol } }
+ { \int_if_zero_p:n { \l_@@_first_col_int } }
{
\bool_if:NTF \g_@@_after_col_zero_bool
{
\multicolumn { 1 } { c } { }
- \@@_Hdotsfor_i
+ \@@_Hdotsfor_i:
}
{ \@@_fatal:n { Hdotsfor~in~col~0 } }
}
{
\multicolumn { 1 } { c } { }
- \@@_Hdotsfor_i
+ \@@_Hdotsfor_i:
}
}
% \end{macrocode}
%
%
-% The command |\@@_Hdotsfor_i| is defined with |\NewDocumentCommand| because it
+% The command |\@@_Hdotsfor_i:| is defined with |\NewDocumentCommand| because it
% has an optional argument. Note that such a command defined by
% |\NewDocumentCommand| is protected and that's why we have put the
% |\multicolumn| before (in the definition of |\@@_Hdotsfor:|).
@@ -9863,15 +9925,18 @@
% \begin{macrocode}
\hook_gput_code:nnn { begindocument } { . }
{
- \cs_set_nopar:Npn \l_@@_argspec_tl { m m O { } E { _ ^ : } { { } { } { } } }
- \tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl
% \end{macrocode}
% We don't put |!| before the last optionnal argument for homogeneity with
% |\Cdots|, etc. which have only one optional argument.
% \begin{macrocode}
- \cs_new_protected:Npn \@@_Hdotsfor_i
+ \cs_new_protected:Npn \@@_Hdotsfor_i:
{ \@@_collect_options:n { \@@_Hdotsfor_ii } }
- \exp_args:NNo \NewDocumentCommand \@@_Hdotsfor_ii \l_@@_argspec_tl
+% \end{macrocode}
+% We rescan the \emph{argspec} in order the correct catcode of |_| in the main
+% document (and that's why we are in a |\AtBeginDocument|).
+% \begin{macrocode}
+ \tl_set_rescan:Nnn \l_tmpa_tl { } { m m O { } E { _ ^ : } { { } { } { } } }
+ \exp_args:NNo \NewDocumentCommand \@@_Hdotsfor_ii \l_tmpa_tl
{
\tl_gput_right:Ne \g_@@_HVdotsfor_lines_tl
{
@@ -9910,7 +9975,7 @@
% \end{macrocode}
% For the column, it's a bit more complicated.
% \begin{macrocode}
- \int_compare:nNnTF { #2 } = \c_one_int
+ \int_compare:nNnTF { #2 } = { \c_one_int }
{
\int_set_eq:NN \l_@@_initial_j_int \c_one_int
\bool_set_true:N \l_@@_initial_open_bool
@@ -9928,7 +9993,7 @@
\bool_set_true:N \l_@@_initial_open_bool
}
}
- \int_compare:nNnTF { #2 + #3 -1 } = \c at jCol
+ \int_compare:nNnTF { #2 + #3 -1 } = { \c at jCol }
{
\int_set:Nn \l_@@_final_j_int { #2 + #3 - 1 }
\bool_set_true:N \l_@@_final_open_bool
@@ -9954,10 +10019,9 @@
\int_if_zero:nTF { #1 }
{ \color { nicematrix-first-row } }
{
- \int_compare:nNnT { #1 } = \g_@@_row_total_int
+ \int_compare:nNnT { #1 } = { \g_@@_row_total_int }
{ \color { nicematrix-last-row } }
}
-
\keys_set:nn { nicematrix / xdots } { #4 }
\@@_color:o \l_@@_xdots_color_tl
\@@_actually_draw_Ldots:
@@ -9979,11 +10043,14 @@
% \begin{macrocode}
\hook_gput_code:nnn { begindocument } { . }
{
- \cs_set_nopar:Npn \l_@@_argspec_tl { m m O { } E { _ ^ : } { { } { } { } } }
- \tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl
\cs_new_protected:Npn \@@_Vdotsfor:
{ \@@_collect_options:n { \@@_Vdotsfor_i } }
- \exp_args:NNo \NewDocumentCommand \@@_Vdotsfor_i \l_@@_argspec_tl
+% \end{macrocode}
+% We rescan the \emph{argspec} in order the correct catcode of |_| in the main
+% document (and that's why we are in a |\AtBeginDocument|).
+% \begin{macrocode}
+ \tl_set_rescan:Nnn \l_tmpa_tl { } { m m O { } E { _ ^ : } { { } { } { } } }
+ \exp_args:NNo \NewDocumentCommand \@@_Vdotsfor_i \l_tmpa_tl
{
\bool_gset_true:N \g_@@_empty_cell_bool
\tl_gput_right:Ne \g_@@_HVdotsfor_lines_tl
@@ -10017,7 +10084,7 @@
% \end{macrocode}
% For the row, it's a bit more complicated.
% \begin{macrocode}
- \int_compare:nNnTF { #1 } = \c_one_int
+ \int_compare:nNnTF { #1 } = { \c_one_int }
{
\int_set_eq:NN \l_@@_initial_i_int \c_one_int
\bool_set_true:N \l_@@_initial_open_bool
@@ -10035,7 +10102,7 @@
\bool_set_true:N \l_@@_initial_open_bool
}
}
- \int_compare:nNnTF { #1 + #3 -1 } = \c at iRow
+ \int_compare:nNnTF { #1 + #3 -1 } = { \c at iRow }
{
\int_set:Nn \l_@@_final_i_int { #1 + #3 - 1 }
\bool_set_true:N \l_@@_final_open_bool
@@ -10061,7 +10128,7 @@
\int_if_zero:nTF { #2 }
{ \color { nicematrix-first-col } }
{
- \int_compare:nNnT { #2 } = \g_@@_col_total_int
+ \int_compare:nNnT { #2 } = { \g_@@_col_total_int }
{ \color { nicematrix-last-col } }
}
\keys_set:nn { nicematrix / xdots } { #4 }
@@ -10088,11 +10155,9 @@
% \begin{macrocode}
\NewDocumentCommand \@@_rotate: { O { } }
{
- \peek_remove_spaces:n
- {
- \bool_gset_true:N \g_@@_rotate_bool
- \keys_set:nn { nicematrix / rotate } { #1 }
- }
+ \bool_gset_true:N \g_@@_rotate_bool
+ \keys_set:nn { nicematrix / rotate } { #1 }
+ \ignorespaces
}
% \end{macrocode}
%
@@ -10146,10 +10211,13 @@
% \begin{macrocode}
\hook_gput_code:nnn { begindocument } { . }
{
- \cs_set_nopar:Npn \l_@@_argspec_tl
+% \end{macrocode}
+% We rescan the \emph{argspec} in order the correct catcode of |_| in the main
+% document (and that's why we are in a |\AtBeginDocument|).
+% \begin{macrocode}
+ \tl_set_rescan:Nnn \l_tmpa_tl { }
{ O { } m m ! O { } E { _ ^ : } { { } { } { } } }
- \tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl
- \exp_args:NNo \NewDocumentCommand \@@_line \l_@@_argspec_tl
+ \exp_args:NNo \NewDocumentCommand \@@_line \l_tmpa_tl
{
\group_begin:
\keys_set:nn { nicematrix / xdots } { #1 , #4 , down = #5 , up = #6 }
@@ -10243,20 +10311,16 @@
% |\@@_if_row_less_then:nn| is \emph{not} protected.
%
% |#1| is the first row \emph{after} the scope of the instructions in |#2|
-% \begin{macrocode}
-\cs_new:Npn \@@_if_row_less_than:nn #1 #2
- { \int_compare:nNnT { \c at iRow } < { #1 } { #2 } }
-% \end{macrocode}
%
+% However, both arguments are implicit because they are taken by curryfication.
% \begin{macrocode}
-\cs_new:Npn \@@_if_col_greater_than:nn #1 #2
- { \int_compare:nNnF { \c at jCol } < { #1 } { #2 } }
+\cs_new:Npn \@@_if_row_less_than:nn { \int_compare:nNnT { \c at iRow } < }
+\cs_new:Npn \@@_if_col_greater_than:nn { \int_compare:nNnF { \c at jCol } < }
% \end{macrocode}
%
% \bigskip
% |\@@_put_in_row_style| will be used several times in |\RowStyle|.
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_put_in_row_style:n { e }
\cs_set_protected:Npn \@@_put_in_row_style:n #1
{
\tl_gput_right:Ne \g_@@_row_style_tl
@@ -10280,6 +10344,7 @@
}
}
}
+\cs_generate_variant:Nn \@@_put_in_row_style:n { e }
% \end{macrocode}
% \medskip
% \begin{macrocode}
@@ -10330,7 +10395,7 @@
\dim_zero:N \l_tmpb_dim
\keys_set:nn { nicematrix / RowStyle } { #1 }
% \end{macrocode}
-% If the key |rowcolor| (of its alias |fill|) has been used.
+% If the key |fill| (or its alias |rowcolor|) has been used.
% \begin{macrocode}
\tl_if_empty:NF \l_@@_fill_tl
{
@@ -10338,33 +10403,15 @@
\tl_gput_right:Ne \g_@@_pre_code_before_tl
{
% \end{macrocode}
-% First, the case when the command |\RowStyle| is \emph{not} issued in the first
-% column of the array. In that case, the commande applies to the end of the row
-% in the row where the command |\RowStyle| is issued, but in the other whole
-% rows, if the key |nb-rows| is used.
+% The command |\@@_exp_color_arg:No| is \emph{fully expandable}.
% \begin{macrocode}
- \int_compare:nNnTF \c at jCol > \c_one_int
+ \@@_exp_color_arg:No \@@_roundedrectanglecolor \l_@@_fill_tl
+ { \int_use:N \c at iRow - \int_use:N \c at jCol }
{
-% \end{macrocode}
-% First, the end of the current row (we remind that |\RowStyle| applies to the
-% \emph{end} of the current row). The command |\@@_exp_color_arg:No| is
-% \emph{fully expandable}.
-% \begin{macrocode}
- \@@_exp_color_arg:No \@@_roundedrectanglecolor \l_@@_fill_tl
- { \int_use:N \c at iRow - \int_use:N \c at jCol }
- { \int_use:N \c at iRow - * }
- { \dim_use:N \l_@@_rounded_corners_dim }
-% \end{macrocode}
-% Then, the other rows (if there are several rows).
-% \begin{macrocode}
- \int_compare:nNnT \l_@@_key_nb_rows_int > \c_one_int
- { \@@_rounded_from_row:n { \c at iRow + 1 } }
+ \int_eval:n { \c at iRow + \l_@@_key_nb_rows_int - 1 }
+ - *
}
-% \end{macrocode}
-% Now, directly all the rows in the case of a command |\RowStyle| issued in the
-% first column of the array.
-% \begin{macrocode}
- { \@@_rounded_from_row:n { \c at iRow } }
+ { \dim_use:N \l_@@_rounded_corners_dim }
}
}
\@@_put_in_row_style:n { \exp_not:n { #2 } }
@@ -10371,7 +10418,7 @@
% \end{macrocode}
% |\l_tmpa_dim| is the value of the key |cell-space-top-limit| of |\RowStyle|.
% \begin{macrocode}
- \dim_compare:nNnT \l_tmpa_dim > \c_zero_dim
+ \dim_compare:nNnT { \l_tmpa_dim } > { \c_zero_dim }
{
\@@_put_in_row_style:e
{
@@ -10378,7 +10425,7 @@
\tl_gput_right:Nn \exp_not:N \g_@@_cell_after_hook_tl
{
% \end{macrocode}
-% It's not possible to chanage the following code by using |\dim_set_eq:NN|
+% It's not possible to change the following code by using |\dim_set_eq:NN|
% (because of expansion).
% \begin{macrocode}
\dim_set:Nn \l_@@_cell_space_top_limit_dim
@@ -10389,7 +10436,7 @@
% \end{macrocode}
% |\l_tmpb_dim| is the value of the key |cell-space-bottom-limit| of |\RowStyle|.
% \begin{macrocode}
- \dim_compare:nNnT \l_tmpb_dim > \c_zero_dim
+ \dim_compare:nNnT { \l_tmpb_dim } > { \c_zero_dim }
{
\@@_put_in_row_style:e
{
@@ -10488,8 +10535,6 @@
% |\CodeBefore| (and we recall that a loop of \pkg{pgffor} is encapsulated in a
% group).
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_add_to_colors_seq:nn { e }
-\cs_generate_variant:Nn \@@_add_to_colors_seq:nn { e e }
\cs_new_protected:Npn \@@_add_to_colors_seq:nn #1 #2
{
% \end{macrocode}
@@ -10511,7 +10556,7 @@
% \begin{macrocode}
{ \str_if_eq:eeT { #1 } { ##2 } { \int_set:Nn \l_tmpa_int { ##1 } } }
}
- \int_if_zero:nTF \l_tmpa_int
+ \int_if_zero:nTF { \l_tmpa_int }
% \end{macrocode}
% First, the case where the color is a \emph{new} color (not in the sequence).
% \begin{macrocode}
@@ -10525,6 +10570,8 @@
% \begin{macrocode}
{ \tl_gput_right:ce { g_@@_color _ \int_use:N \l_tmpa_int _tl } { #2 } }
}
+\cs_generate_variant:Nn \@@_add_to_colors_seq:nn { e }
+\cs_generate_variant:Nn \@@_add_to_colors_seq:nn { e e }
% \end{macrocode}
%
%
@@ -10533,7 +10580,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_clip_with_rounded_corners:
{
- \dim_compare:nNnT \l_@@_tab_rounded_corners_dim > \c_zero_dim
+ \dim_compare:nNnT { \l_@@_tab_rounded_corners_dim } > { \c_zero_dim }
{
% \end{macrocode}
% The TeX group is for |\pgfsetcornersarced| (whose scope is the TeX scope).
@@ -10566,7 +10613,7 @@
\pgfpointadd
{
\@@_qpoint:n
- { \int_eval:n { \int_max:nn \c at iRow \c at jCol + 1 } }
+ { \int_eval:n { \int_max:nn { \c at iRow } { \c at jCol } + 1 } }
}
{ \pgfpoint \c_zero_dim { 0.5 \arrayrulewidth } }
}
@@ -10578,7 +10625,7 @@
\pgfpointadd
{
\@@_qpoint:n
- { \int_eval:n { \int_max:nn \c at iRow \c at jCol + 1 } }
+ { \int_eval:n { \int_max:nn { \c at iRow } { \c at jCol } + 1 } }
}
{ \pgfpoint \c_zero_dim \arrayrulewidth }
}
@@ -10609,7 +10656,7 @@
\@@_clip_with_rounded_corners:
\seq_map_indexed_inline:Nn \g_@@_colors_seq
{
- \int_compare:nNnTF { ##1 } = \c_one_int
+ \int_compare:nNnTF { ##1 } = { \c_one_int }
{
\cs_set_eq:NN \@@_cartesian_path:n \@@_cartesian_path_nocolor:n
\use:c { g_@@_color _ 1 _tl }
@@ -10617,7 +10664,7 @@
}
{
\begin { pgfscope }
- \@@_color_opacity ##2
+ \@@_color_opacity: ##2
\use:c { g_@@_color _ ##1 _tl }
\tl_gclear:c { g_@@_color _ ##1 _tl }
\pgfusepath { fill }
@@ -10633,7 +10680,7 @@
% The following command will extract the potential key |opacity| in its optional
% argument (between square brackets) and (of course) then apply the command |\color|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_color_opacity
+\cs_new_protected:Npn \@@_color_opacity:
{
\peek_meaning:NTF [
{ \@@_color_opacity:w }
@@ -10651,7 +10698,8 @@
\tl_clear:N \l_tmpa_tl
\keys_set_known:nnN { nicematrix / color-opacity } { #1 } \l_tmpb_tl
% \end{macrocode}
-% |\l_tmpa_tl| (if not empty) is now the opacity and |\l_tmpb_tl| (if not empty) is now the colorimetric space.
+% |\l_tmpa_tl| (if not empty) is now the opacity and |\l_tmpb_tl| (if not empty)
+% is now the colorimetric space.
% \begin{macrocode}
\tl_if_empty:NF \l_tmpa_tl { \exp_args:No \pgfsetfillopacity \l_tmpa_tl }
\tl_if_empty:NTF \l_tmpb_tl
@@ -10671,11 +10719,12 @@
% \end{macrocode}
%
% \bigskip
+% Here, we use |\def| instead of |\tl_set:Nn| for efficiency only.
% \begin{macrocode}
\cs_new_protected:Npn \@@_cartesian_color:nn #1 #2
{
- \cs_set_nopar:Npn \l_@@_rows_tl { #1 }
- \cs_set_nopar:Npn \l_@@_cols_tl { #2 }
+ \def \l_@@_rows_tl { #1 }
+ \def \l_@@_cols_tl { #2 }
\@@_cartesian_path:
}
% \end{macrocode}
@@ -10742,8 +10791,6 @@
\cs_new_protected:Npn \@@_rectanglecolor:nnn #1 #2 #3
{
\@@_cut_on_hyphen:w #1 \q_stop
- \tl_clear_new:N \l_@@_tmpc_tl
- \tl_clear_new:N \l_@@_tmpd_tl
\tl_set_eq:NN \l_@@_tmpc_tl \l_tmpa_tl
\tl_set_eq:NN \l_@@_tmpd_tl \l_tmpb_tl
\@@_cut_on_hyphen:w #2 \q_stop
@@ -10772,9 +10819,9 @@
% \begin{macrocode}
\NewDocumentCommand \@@_chessboardcolors { O { } m m }
{
- \int_step_inline:nn \c at iRow
+ \int_step_inline:nn { \c at iRow }
{
- \int_step_inline:nn \c at jCol
+ \int_step_inline:nn { \c at jCol }
{
\int_if_even:nTF { ####1 + ##1 }
{ \@@_cellcolor [ #1 ] { #2 } }
@@ -10830,6 +10877,7 @@
\NewDocumentCommand \@@_rowlistcolors { O { } m m O { } }
{
% \end{macrocode}
+%
% The group is for the options. |\l_@@_colors_seq| will be the list of colors.
% \begin{macrocode}
\group_begin:
@@ -10836,7 +10884,7 @@
\seq_clear_new:N \l_@@_colors_seq
\seq_set_split:Nnn \l_@@_colors_seq { , } { #3 }
\tl_clear_new:N \l_@@_cols_tl
- \cs_set_nopar:Npn \l_@@_cols_tl { - }
+ \tl_set:Nn \l_@@_cols_tl { - }
\keys_set:nn { nicematrix / rowcolors } { #4 }
% \end{macrocode}
% The counter |\l_@@_color_int| will be the rank of the current color in the list of
@@ -10862,7 +10910,7 @@
% \begin{macrocode}
\clist_map_inline:nn { #2 }
{
- \cs_set_nopar:Npn \l_tmpa_tl { ##1 }
+ \tl_set:Nn \l_tmpa_tl { ##1 }
\tl_if_in:NnTF \l_tmpa_tl { - }
{ \@@_cut_on_hyphen:w ##1 \q_stop }
{ \tl_set:No \l_tmpb_tl { \int_use:N \c at iRow } }
@@ -10873,8 +10921,7 @@
% \begin{macrocode}
\int_set:Nn \l_tmpa_int \l_tmpa_tl
\int_set:Nn \l_@@_color_int
- { \bool_if:NTF \l_@@_rowcolors_restart_bool 1 \l_tmpa_tl }
- \int_zero_new:N \l_@@_tmpc_int
+ { \bool_if:NTF \l_@@_rowcolors_restart_bool { 1 } { \l_tmpa_tl } }
\int_set:Nn \l_@@_tmpc_int \l_tmpb_tl
\int_do_until:nNnn \l_tmpa_int > \l_@@_tmpc_int
{
@@ -10895,12 +10942,11 @@
% Now, the last row of the block is computed in |\l_tmpb_int|.
% \begin{macrocode}
}
- \tl_set:No \l_@@_rows_tl
+ \tl_set:Ne \l_@@_rows_tl
{ \int_use:N \l_tmpa_int - \int_use:N \l_tmpb_int }
% \end{macrocode}
% |\l_@@_tmpc_tl| will be the color that we will use.
% \begin{macrocode}
- \tl_clear_new:N \l_@@_color_tl
\tl_set:Ne \l_@@_color_tl
{
\@@_color_index:n
@@ -10956,7 +11002,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_rowcolors_i:nnnnn #1 #2 #3 #4 #5
{
- \int_compare:nNnT { #3 } > \l_tmpb_int
+ \int_compare:nNnT { #3 } > { \l_tmpb_int }
{ \int_set:Nn \l_tmpb_int { #3 } }
}
% \end{macrocode}
@@ -10964,14 +11010,14 @@
%
% \bigskip
% \begin{macrocode}
-\prg_new_conditional:Nnn \@@_not_in_exterior:nnnnn p
+\prg_new_conditional:Nnn \@@_not_in_exterior:nnnnn { p }
{
\int_if_zero:nTF { #4 }
- \prg_return_false:
+ { \prg_return_false: }
{
- \int_compare:nNnTF { #2 } > \c at jCol
- \prg_return_false:
- \prg_return_true:
+ \int_compare:nNnTF { #2 } > { \c at jCol }
+ { \prg_return_false: }
+ { \prg_return_true: }
}
}
% \end{macrocode}
@@ -10980,14 +11026,14 @@
% The following command return |true| when the block intersects the row
% |\l_tmpa_int|.
% \begin{macrocode}
-\prg_new_conditional:Nnn \@@_intersect_our_row:nnnnn p
+\prg_new_conditional:Nnn \@@_intersect_our_row:nnnnn { p }
{
- \int_compare:nNnTF { #1 } > \l_tmpa_int
- \prg_return_false:
+ \int_compare:nNnTF { #1 } > { \l_tmpa_int }
+ { \prg_return_false: }
{
- \int_compare:nNnTF \l_tmpa_int > { #3 }
- \prg_return_false:
- \prg_return_true:
+ \int_compare:nNnTF { \l_tmpa_int } > { #3 }
+ { \prg_return_false: }
+ { \prg_return_true: }
}
}
% \end{macrocode}
@@ -11005,15 +11051,14 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_cartesian_path_normal:n #1
{
- \dim_compare:nNnTF { #1 } = \c_zero_dim
+ \dim_compare:nNnTF { #1 } = { \c_zero_dim }
{
- \bool_if:NTF
- \l_@@_nocolor_used_bool
- \@@_cartesian_path_normal_ii:
+ \bool_if:NTF \l_@@_nocolor_used_bool
+ { \@@_cartesian_path_normal_ii: }
{
\clist_if_empty:NTF \l_@@_corners_cells_clist
{ \@@_cartesian_path_normal_i:n { #1 } }
- \@@_cartesian_path_normal_ii:
+ { \@@_cartesian_path_normal_ii: }
}
}
{ \@@_cartesian_path_normal_i:n { #1 } }
@@ -11033,18 +11078,21 @@
% We begin the loop over the columns.
% \begin{macrocode}
\clist_map_inline:Nn \l_@@_cols_tl
- {
- \cs_set_nopar:Npn \l_tmpa_tl { ##1 }
+ {
+% \end{macrocode}
+% We use |\def| instead of |\tl_set:Nn| for efficiency only.
+% \begin{macrocode}
+ \def \l_tmpa_tl { ##1 }
\tl_if_in:NnTF \l_tmpa_tl { - }
{ \@@_cut_on_hyphen:w ##1 \q_stop }
- { \@@_cut_on_hyphen:w ##1 - ##1 \q_stop }
+ { \def \l_tmpb_tl { ##1 } } % 2025-04-16
\tl_if_empty:NTF \l_tmpa_tl
- { \cs_set_nopar:Npn \l_tmpa_tl { 1 } }
+ { \def \l_tmpa_tl { 1 } }
{
\str_if_eq:eeT \l_tmpa_tl { * }
- { \cs_set_nopar:Npn \l_tmpa_tl { 1 } }
+ { \def \l_tmpa_tl { 1 } }
}
- \int_compare:nNnT \l_tmpa_tl > \g_@@_col_total_int
+ \int_compare:nNnT { \l_tmpa_tl } > { \g_@@_col_total_int }
{ \@@_error:n { Invalid~col~number } }
\tl_if_empty:NTF \l_tmpb_tl
{ \tl_set:No \l_tmpb_tl { \int_use:N \c at jCol } }
@@ -11052,7 +11100,7 @@
\str_if_eq:eeT \l_tmpb_tl { * }
{ \tl_set:No \l_tmpb_tl { \int_use:N \c at jCol } }
}
- \int_compare:nNnT \l_tmpb_tl > \g_@@_col_total_int
+ \int_compare:nNnT { \l_tmpb_tl } > { \g_@@_col_total_int }
{ \tl_set:No \l_tmpb_tl { \int_use:N \g_@@_col_total_int } }
% \end{macrocode}
% |\l_@@_tmpc_tl| will contain the number of column.
@@ -11059,25 +11107,26 @@
% \begin{macrocode}
\tl_set_eq:NN \l_@@_tmpc_tl \l_tmpa_tl
\@@_qpoint:n { col - \l_tmpa_tl }
- \int_compare:nNnTF \l_@@_first_col_int = \l_tmpa_tl
+ \int_compare:nNnTF { \l_@@_first_col_int } = { \l_tmpa_tl }
{ \dim_set:Nn \l_@@_tmpc_dim { \pgf at x - 0.5 \arrayrulewidth } }
{ \dim_set:Nn \l_@@_tmpc_dim { \pgf at x + 0.5 \arrayrulewidth } }
\@@_qpoint:n { col - \int_eval:n { \l_tmpb_tl + 1 } }
\dim_set:Nn \l_tmpa_dim { \pgf at x + 0.5 \arrayrulewidth }
% \end{macrocode}
-% We begin the loop over the rows.
+% We begin the loop over the rows. We use |\def| instead of |\tl_set:Nn| for
+% efficiency only.
% \begin{macrocode}
\clist_map_inline:Nn \l_@@_rows_tl
{
- \cs_set_nopar:Npn \l_tmpa_tl { ####1 }
+ \def \l_tmpa_tl { ####1 }
\tl_if_in:NnTF \l_tmpa_tl { - }
{ \@@_cut_on_hyphen:w ####1 \q_stop }
{ \@@_cut_on_hyphen:w ####1 - ####1 \q_stop }
\tl_if_empty:NTF \l_tmpa_tl
- { \cs_set_nopar:Npn \l_tmpa_tl { 1 } }
+ { \def \l_tmpa_tl { 1 } }
{
\str_if_eq:eeT \l_tmpa_tl { * }
- { \cs_set_nopar:Npn \l_tmpa_tl { 1 } }
+ { \def \l_tmpa_tl { 1 } }
}
\tl_if_empty:NTF \l_tmpb_tl
{ \tl_set:No \l_tmpb_tl { \int_use:N \c at iRow } }
@@ -11085,9 +11134,9 @@
\str_if_eq:eeT \l_tmpb_tl { * }
{ \tl_set:No \l_tmpb_tl { \int_use:N \c at iRow } }
}
- \int_compare:nNnT \l_tmpa_tl > \g_@@_row_total_int
+ \int_compare:nNnT { \l_tmpa_tl } > { \g_@@_row_total_int }
{ \@@_error:n { Invalid~row~number } }
- \int_compare:nNnT \l_tmpb_tl > \g_@@_row_total_int
+ \int_compare:nNnT { \l_tmpb_tl } > { \g_@@_row_total_int }
{ \tl_set:No \l_tmpb_tl { \int_use:N \g_@@_row_total_int } }
% \end{macrocode}
% Now, the numbers of both rows are in |\l_tmpa_tl| and |\l_tmpb_tl|.
@@ -11122,7 +11171,7 @@
\clist_map_inline:Nn \l_@@_cols_tl
{
\@@_qpoint:n { col - ##1 }
- \int_compare:nNnTF \l_@@_first_col_int = { ##1 }
+ \int_compare:nNnTF { \l_@@_first_col_int } = { ##1 }
{ \dim_set:Nn \l_@@_tmpc_dim { \pgf at x - 0.5 \arrayrulewidth } }
{ \dim_set:Nn \l_@@_tmpc_dim { \pgf at x + 0.5 \arrayrulewidth } }
\@@_qpoint:n { col - \int_eval:n { ##1 + 1 } }
@@ -11197,7 +11246,10 @@
\clist_clear:N #1
\clist_map_inline:Nn \l_tmpa_clist
{
- \cs_set_nopar:Npn \l_tmpa_tl { ##1 }
+% \end{macrocode}
+% We use |\def| instead of |\tl_set:Nn| for efficiency only.
+% \begin{macrocode}
+ \def \l_tmpa_tl { ##1 }
\tl_if_in:NnTF \l_tmpa_tl { - }
{ \@@_cut_on_hyphen:w ##1 \q_stop }
{ \@@_cut_on_hyphen:w ##1 - ##1 \q_stop }
@@ -11204,14 +11256,14 @@
\bool_lazy_or:nnT
{ \str_if_eq_p:ee \l_tmpa_tl { * } }
{ \tl_if_blank_p:o \l_tmpa_tl }
- { \cs_set_nopar:Npn \l_tmpa_tl { 1 } }
+ { \def \l_tmpa_tl { 1 } }
\bool_lazy_or:nnT
{ \str_if_eq_p:ee \l_tmpb_tl { * } }
{ \tl_if_blank_p:o \l_tmpb_tl }
{ \tl_set:No \l_tmpb_tl { \int_use:N #2 } }
- \int_compare:nNnT \l_tmpb_tl > #2
+ \int_compare:nNnT { \l_tmpb_tl } > { #2 }
{ \tl_set:No \l_tmpb_tl { \int_use:N #2 } }
- \int_step_inline:nnn \l_tmpa_tl \l_tmpb_tl
+ \int_step_inline:nnn { \l_tmpa_tl } { \l_tmpb_tl }
{ \clist_put_right:Nn #1 { ####1 } }
}
}
@@ -11266,16 +11318,7 @@
% \begin{macrocode}
\NewDocumentCommand { \@@_rowlistcolors_tabular } { O { } m O { } }
{
- \peek_remove_spaces:n
- { \@@_rowlistcolors_tabular:nnn { #1 } { #2 } { #3 } }
- }
% \end{macrocode}
-%
-% \bigskip
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_rowlistcolors_tabular:nnn #1 #2 #3
- {
-% \end{macrocode}
% A use of |\rowlistcolors| in the tabular erases the instructions
% |\rowlistcolors| which are in force. However, it's possible to put \emph{several}
% instructions |\rowlistcolors| in the same row of a tabular: it may be useful
@@ -11288,7 +11331,7 @@
% \begin{macrocode}
\seq_gclear:N \g_tmpa_seq
\seq_map_inline:Nn \g_@@_rowlistcolors_seq
- { \@@_rowlistcolors_tabular_i:nnnn ##1 }
+ { \@@_rowlistcolors_tabular:nnnn ##1 }
\seq_gset_eq:NN \g_@@_rowlistcolors_seq \g_tmpa_seq
% \end{macrocode}
% Now, we add to the sequence |\g_@@_rowlistcolors_seq| (which is the list of
@@ -11302,6 +11345,7 @@
{ \exp_not:n { #2 } }
{ restart , cols = \int_use:N \c at jCol - , \exp_not:n { #3 } }
}
+ \ignorespaces
}
% \end{macrocode}
%
@@ -11322,9 +11366,9 @@
% |\rowlistcolors|).
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_rowlistcolors_tabular_i:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_rowlistcolors_tabular:nnnn #1 #2 #3 #4
{
- \int_compare:nNnTF { #1 } = \c at iRow
+ \int_compare:nNnTF { #1 } = { \c at iRow }
% \end{macrocode}
% We (temporary) keep in memory in |\g_tmpa_seq| the instructions which will
% still be in force after the current instruction (because they have been issued
@@ -11379,7 +11423,7 @@
% With the following line, we test whether the cell is the first one we
% encounter in its column (don't forget that some rows may be incomplete).
% \begin{macrocode}
- \int_compare:nNnT \c at jCol > \g_@@_col_total_int
+ \int_compare:nNnT { \c at jCol } > { \g_@@_col_total_int }
{
% \end{macrocode}
% You use |gput_left| because we want the specification of colors for the
@@ -11397,27 +11441,6 @@
}
% \end{macrocode}
%
-%
-% \bigskip
-% \begin{macrocode}
-\hook_gput_code:nnn { begindocument } { . }
- {
- \IfPackageLoadedTF { colortbl }
- {
- \cs_set_eq:NN \@@_old_cellcolor \cellcolor
- \cs_set_eq:NN \@@_old_rowcolor \rowcolor
- \cs_new_protected:Npn \@@_revert_colortbl:
- {
- \hook_gput_code:nnn { env / tabular / begin } { nicematrix }
- {
- \cs_set_eq:NN \cellcolor \@@_old_cellcolor
- \cs_set_eq:NN \rowcolor \@@_old_rowcolor
- }
- }
- }
- { \cs_new_protected:Npn \@@_revert_colortbl: { } }
- }
-% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
@@ -11474,13 +11497,16 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_OnlyMainNiceMatrix:n #1
{
- \int_if_zero:nTF \l_@@_first_col_int
+ \int_if_zero:nTF { \l_@@_first_col_int }
{ \@@_OnlyMainNiceMatrix_i:n { #1 } }
{
- \int_if_zero:nTF \c at jCol
+ \int_if_zero:nTF { \c at jCol }
{
- \int_compare:nNnF \c at iRow = { -1 }
- { \int_compare:nNnF \c at iRow = { \l_@@_last_row_int - 1 } { #1 } }
+ \int_compare:nNnF { \c at iRow } = { -1 }
+ {
+ \int_compare:nNnF { \c at iRow } = { \l_@@_last_row_int - 1 }
+ { #1 }
+ }
}
{ \@@_OnlyMainNiceMatrix_i:n { #1 } }
}
@@ -11496,11 +11522,11 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_OnlyMainNiceMatrix_i:n #1
{
- \int_if_zero:nF \c at iRow
+ \int_if_zero:nF { \c at iRow }
{
- \int_compare:nNnF \c at iRow = \l_@@_last_row_int
+ \int_compare:nNnF { \c at iRow } = { \l_@@_last_row_int }
{
- \int_compare:nNnT \c at jCol > \c_zero_int
+ \int_compare:nNnT { \c at jCol } > { \c_zero_int }
{ \bool_if:NF \l_@@_in_last_col_bool { #1 } }
}
}
@@ -11527,7 +11553,7 @@
%
% \begin{macrocode}
\NewExpandableDocumentCommand { \@@_TopRule } { }
- { \@@_tikz_booktabs_loaded:nn \TopRule \@@_TopRule_i: }
+ { \@@_tikz_booktabs_loaded:nn { \TopRule } { \@@_TopRule_i: } }
% \end{macrocode}
%
%
@@ -11565,7 +11591,7 @@
%
% \begin{macrocode}
\NewExpandableDocumentCommand { \@@_BottomRule } { }
- { \@@_tikz_booktabs_loaded:nn \BottomRule \@@_BottomRule_i: }
+ { \@@_tikz_booktabs_loaded:nn { \BottomRule } { \@@_BottomRule_i: } }
% \end{macrocode}
%
% \begin{macrocode}
@@ -11606,7 +11632,7 @@
%
% \begin{macrocode}
\NewExpandableDocumentCommand { \@@_MidRule } { }
- { \@@_tikz_booktabs_loaded:nn \MidRule \@@_MidRule_i: }
+ { \@@_tikz_booktabs_loaded:nn { \MidRule } { \@@_MidRule_i: } }
% \end{macrocode}
%
%
@@ -11693,10 +11719,10 @@
% the ability to write |\MyDashedRule[color=red]|.
% \begin{macrocode}
color .code:n =
- \@@_set_CT at arc@:n { #1 }
+ \@@_set_CTarc:n { #1 }
\tl_set:Nn \l_@@_rule_color_tl { #1 } ,
color .value_required:n = true ,
- sep-color .code:n = \@@_set_CT at drsc@:n { #1 } ,
+ sep-color .code:n = \@@_set_CTdrsc:n { #1 } ,
sep-color .value_required:n = true ,
% \end{macrocode}
% If the user uses the key |tikz|, the rule (or more precisely: the different
@@ -11734,7 +11760,7 @@
% specified in the preamble of the environment (for instance, a preamble of
% \verb+|c|c|c|+ but only two columns used).
% \begin{macrocode}
- \int_compare:nNnT \l_@@_position_int < { \c at jCol + 2 }
+ \int_compare:nNnT { \l_@@_position_int } < { \c at jCol + 2 }
\@@_vline_i:
\group_end:
}
@@ -11769,10 +11795,10 @@
{ \@@_test_vline_in_block:nnnnn ##1 }
\seq_map_inline:Nn \g_@@_pos_of_stroken_blocks_seq
{ \@@_test_vline_in_stroken_block:nnnn ##1 }
- \clist_if_empty:NF \l_@@_corners_clist \@@_test_in_corner_v:
+ \clist_if_empty:NF \l_@@_corners_clist { \@@_test_in_corner_v: }
\bool_if:NTF \g_tmpa_bool
{
- \int_if_zero:nT \l_@@_local_start_int
+ \int_if_zero:nT { \l_@@_local_start_int }
% \end{macrocode}
% We keep in memory that we have a rule to draw. |\l_@@_local_start_int| will be
% the starting row of the rule that we will have to draw.
@@ -11780,7 +11806,7 @@
{ \int_set:Nn \l_@@_local_start_int \l_tmpa_tl }
}
{
- \int_compare:nNnT \l_@@_local_start_int > \c_zero_int
+ \int_compare:nNnT { \l_@@_local_start_int } > { \c_zero_int }
{
\int_set:Nn \l_@@_local_end_int { \l_tmpa_tl - 1 }
\@@_vline_ii:
@@ -11788,7 +11814,7 @@
}
}
}
- \int_compare:nNnT \l_@@_local_start_int > \c_zero_int
+ \int_compare:nNnT { \l_@@_local_start_int } > { \c_zero_int }
{
\int_set_eq:NN \l_@@_local_end_int \l_@@_end_int
\@@_vline_ii:
@@ -11800,7 +11826,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_test_in_corner_v:
{
- \int_compare:nNnTF \l_tmpb_tl = { \c at jCol + 1 }
+ \int_compare:nNnTF { \l_tmpb_tl } = { \c at jCol + 1 }
{
\@@_if_in_corner:nT { \l_tmpa_tl - \int_eval:n { \l_tmpb_tl - 1 } }
{ \bool_set_false:N \g_tmpa_bool }
@@ -11808,7 +11834,7 @@
{
\@@_if_in_corner:nT { \l_tmpa_tl - \l_tmpb_tl }
{
- \int_compare:nNnTF \l_tmpb_tl = \c_one_int
+ \int_compare:nNnTF { \l_tmpb_tl } = { \c_one_int }
{ \bool_set_false:N \g_tmpa_bool }
{
\@@_if_in_corner:nT
@@ -11827,11 +11853,11 @@
\tl_clear:N \l_@@_tikz_rule_tl
\keys_set:no { nicematrix / RulesBis } \l_@@_other_keys_tl
\bool_if:NTF \l_@@_dotted_bool
- \@@_vline_iv:
+ { \@@_vline_iv: }
{
\tl_if_empty:NTF \l_@@_tikz_rule_tl
- \@@_vline_iii:
- \@@_vline_v:
+ { \@@_vline_iii: }
+ { \@@_vline_v: }
}
}
% \end{macrocode}
@@ -11860,7 +11886,7 @@
\dim_set_eq:NN \l_@@_tmpc_dim \pgf at y
\bool_lazy_all:nT
{
- { \int_compare_p:nNn \l_@@_multiplicity_int > \c_one_int }
+ { \int_compare_p:nNn { \l_@@_multiplicity_int } > { \c_one_int } }
{ \cs_if_exist_p:N \CT at drsc@ }
{ ! \tl_if_blank_p:o \CT at drsc@ }
}
@@ -11925,7 +11951,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_vline_v:
{
- \begin {tikzpicture }
+ \begin { tikzpicture }
% \end{macrocode}
% By default, the color defined by |\arrayrulecolor| or by |rules/color| will be
% used, but it's still possible to change the color by using the key |color| or,
@@ -11960,10 +11986,14 @@
\cs_new_protected:Npn \@@_draw_vlines:
{
\int_step_inline:nnn
- { \bool_lazy_or:nnTF \g_@@_delims_bool \l_@@_except_borders_bool 2 1 }
{
- \bool_lazy_or:nnTF \g_@@_delims_bool \l_@@_except_borders_bool
- \c at jCol
+ \bool_lazy_or:nnTF { \g_@@_delims_bool } { \l_@@_except_borders_bool }
+ { 2 }
+ { 1 }
+ }
+ {
+ \bool_lazy_or:nnTF { \g_@@_delims_bool } { \l_@@_except_borders_bool }
+ { \c at jCol }
{ \int_eval:n { \c at jCol + 1 } }
}
{
@@ -11989,7 +12019,6 @@
% The group is for the options.
% \begin{macrocode}
\group_begin:
- \int_zero_new:N \l_@@_end_int
\int_set_eq:NN \l_@@_end_int \c at jCol
\keys_set_known:nnN { nicematrix / Rules } { #1 } \l_@@_other_keys_tl
\@@_hline_i:
@@ -12000,8 +12029,8 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_hline_i:
{
- \int_zero_new:N \l_@@_local_start_int
- \int_zero_new:N \l_@@_local_end_int
+ % \int_zero:N \l_@@_local_start_int
+ % \int_zero:N \l_@@_local_end_int
% \end{macrocode}
% |\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
@@ -12032,10 +12061,10 @@
{ \@@_test_hline_in_block:nnnnn ##1 }
\seq_map_inline:Nn \g_@@_pos_of_stroken_blocks_seq
{ \@@_test_hline_in_stroken_block:nnnn ##1 }
- \clist_if_empty:NF \l_@@_corners_clist \@@_test_in_corner_h:
+ \clist_if_empty:NF \l_@@_corners_clist { \@@_test_in_corner_h: }
\bool_if:NTF \g_tmpa_bool
{
- \int_if_zero:nT \l_@@_local_start_int
+ \int_if_zero:nT { \l_@@_local_start_int }
% \end{macrocode}
% We keep in memory that we have a rule to draw. |\l_@@_local_start_int| will be
% the starting row of the rule that we will have to draw.
@@ -12043,7 +12072,7 @@
{ \int_set:Nn \l_@@_local_start_int \l_tmpb_tl }
}
{
- \int_compare:nNnT \l_@@_local_start_int > \c_zero_int
+ \int_compare:nNnT { \l_@@_local_start_int } > { \c_zero_int }
{
\int_set:Nn \l_@@_local_end_int { \l_tmpb_tl - 1 }
\@@_hline_ii:
@@ -12051,7 +12080,7 @@
}
}
}
- \int_compare:nNnT \l_@@_local_start_int > \c_zero_int
+ \int_compare:nNnT { \l_@@_local_start_int } > { \c_zero_int }
{
\int_set_eq:NN \l_@@_local_end_int \l_@@_end_int
\@@_hline_ii:
@@ -12063,7 +12092,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_test_in_corner_h:
{
- \int_compare:nNnTF \l_tmpa_tl = { \c at iRow + 1 }
+ \int_compare:nNnTF { \l_tmpa_tl } = { \c at iRow + 1 }
{
\@@_if_in_corner:nT { \int_eval:n { \l_tmpa_tl - 1 } - \l_tmpb_tl }
{ \bool_set_false:N \g_tmpa_bool }
@@ -12071,7 +12100,7 @@
{
\@@_if_in_corner:nT { \l_tmpa_tl - \l_tmpb_tl }
{
- \int_compare:nNnTF \l_tmpa_tl = \c_one_int
+ \int_compare:nNnTF { \l_tmpa_tl } = { \c_one_int }
{ \bool_set_false:N \g_tmpa_bool }
{
\@@_if_in_corner:nT
@@ -12091,11 +12120,11 @@
\tl_clear:N \l_@@_tikz_rule_tl
\keys_set:no { nicematrix / RulesBis } \l_@@_other_keys_tl
\bool_if:NTF \l_@@_dotted_bool
- \@@_hline_iv:
+ { \@@_hline_iv: }
{
\tl_if_empty:NTF \l_@@_tikz_rule_tl
- \@@_hline_iii:
- \@@_hline_v:
+ { \@@_hline_iii: }
+ { \@@_hline_v: }
}
}
% \end{macrocode}
@@ -12123,7 +12152,7 @@
\dim_set_eq:NN \l_@@_tmpc_dim \pgf at x
\bool_lazy_all:nT
{
- { \int_compare_p:nNn \l_@@_multiplicity_int > \c_one_int }
+ { \int_compare_p:nNn { \l_@@_multiplicity_int } > { \c_one_int } }
{ \cs_if_exist_p:N \CT at drsc@ }
{ ! \tl_if_blank_p:o \CT at drsc@ }
}
@@ -12215,7 +12244,7 @@
\dim_set_eq:NN \l_@@_y_final_dim \l_@@_y_initial_dim
\@@_qpoint:n { col - \int_use:N \l_@@_local_start_int }
\dim_set_eq:NN \l_@@_x_initial_dim \pgf at x
- \int_compare:nNnT \l_@@_local_start_int = \c_one_int
+ \int_compare:nNnT { \l_@@_local_start_int } = { \c_one_int }
{
\dim_sub:Nn \l_@@_x_initial_dim \l_@@_left_margin_dim
\bool_if:NF \g_@@_delims_bool
@@ -12230,7 +12259,7 @@
}
\@@_qpoint:n { col - \int_eval:n { \l_@@_local_end_int + 1 } }
\dim_set_eq:NN \l_@@_x_final_dim \pgf at x
- \int_compare:nNnT \l_@@_local_end_int = \c at jCol
+ \int_compare:nNnT { \l_@@_local_end_int } = { \c at jCol }
{
\dim_add:Nn \l_@@_x_final_dim \l_@@_right_margin_dim
\bool_if:NF \g_@@_delims_bool
@@ -12287,8 +12316,8 @@
\int_step_inline:nnn
{ \bool_lazy_or:nnTF \g_@@_delims_bool \l_@@_except_borders_bool 2 1 }
{
- \bool_lazy_or:nnTF \g_@@_delims_bool \l_@@_except_borders_bool
- \c at iRow
+ \bool_lazy_or:nnTF { \g_@@_delims_bool } { \l_@@_except_borders_bool }
+ { \c at iRow }
{ \int_eval:n { \c at iRow + 1 } }
}
{
@@ -12385,7 +12414,7 @@
{ \str_if_empty_p:N \l_@@_ccommand_str }
}
{ \@@_error:n { No~letter~and~no~command } }
- { \@@_custom_line_i:o \l_@@_other_keys_tl }
+ { \@@_custom_line_i:o \l_@@_other_keys_tl }
}
% \end{macrocode}
%
@@ -12404,7 +12433,6 @@
%
% \bigskip
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_custom_line_i:n { o }
\cs_new_protected:Npn \@@_custom_line_i:n #1
{
% \end{macrocode}
@@ -12426,7 +12454,7 @@
}
\bool_if:NT \l_@@_dotted_rule_bool
{
- \int_compare:nNnT \l_@@_multiplicity_int > \c_one_int
+ \int_compare:nNnT { \l_@@_multiplicity_int } > { \c_one_int }
{ \@@_error:n { key~multiplicity~with~dotted } }
}
\str_if_empty:NF \l_@@_letter_str
@@ -12444,7 +12472,7 @@
% for the letter corresponding at the custom line, will directly use the
% following command that you define in the main hash table of TeX.
% \begin{macrocode}
- \cs_set_nopar:cpn { @@ _ \l_@@_letter_str } ##1
+ \cs_set_nopar:cpn { @@ _ \l_@@_letter_str : } ##1
{ \@@_v_custom_line:n { #1 } }
}
}
@@ -12452,6 +12480,7 @@
\str_if_empty:NF \l_@@_command_str { \@@_h_custom_line:n { #1 } }
\str_if_empty:NF \l_@@_ccommand_str { \@@_c_custom_line:n { #1 } }
}
+\cs_generate_variant:Nn \@@_custom_line_i:n { o }
% \end{macrocode}
%
%
@@ -12649,13 +12678,13 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_test_hline_in_block:nnnnn #1 #2 #3 #4 #5
{
- \int_compare:nNnT \l_tmpa_tl > { #1 }
+ \int_compare:nNnT { \l_tmpa_tl } > { #1 }
{
- \int_compare:nNnT \l_tmpa_tl < { #3 + 1 }
+ \int_compare:nNnT { \l_tmpa_tl } < { #3 + 1 }
{
- \int_compare:nNnT \l_tmpb_tl > { #2 - 1 }
+ \int_compare:nNnT { \l_tmpb_tl } > { #2 - 1 }
{
- \int_compare:nNnT \l_tmpb_tl < { #4 + 1 }
+ \int_compare:nNnT { \l_tmpb_tl } < { #4 + 1 }
{ \bool_gset_false:N \g_tmpa_bool }
}
}
@@ -12667,13 +12696,13 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_test_vline_in_block:nnnnn #1 #2 #3 #4 #5
{
- \int_compare:nNnT \l_tmpa_tl > { #1 - 1 }
+ \int_compare:nNnT { \l_tmpa_tl } > { #1 - 1 }
{
- \int_compare:nNnT \l_tmpa_tl < { #3 + 1 }
+ \int_compare:nNnT { \l_tmpa_tl } < { #3 + 1 }
{
- \int_compare:nNnT \l_tmpb_tl > { #2 }
+ \int_compare:nNnT { \l_tmpb_tl } > { #2 }
{
- \int_compare:nNnT \l_tmpb_tl < { #4 + 1 }
+ \int_compare:nNnT { \l_tmpb_tl } < { #4 + 1 }
{ \bool_gset_false:N \g_tmpa_bool }
}
}
@@ -12684,14 +12713,14 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_test_hline_in_stroken_block:nnnn #1 #2 #3 #4
{
- \int_compare:nNnT \l_tmpb_tl > { #2 - 1 }
+ \int_compare:nNnT { \l_tmpb_tl } > { #2 - 1 }
{
- \int_compare:nNnT \l_tmpb_tl < { #4 + 1 }
+ \int_compare:nNnT { \l_tmpb_tl } < { #4 + 1 }
{
- \int_compare:nNnTF \l_tmpa_tl = { #1 }
+ \int_compare:nNnTF { \l_tmpa_tl } = { #1 }
{ \bool_gset_false:N \g_tmpa_bool }
{
- \int_compare:nNnT \l_tmpa_tl = { #3 + 1 }
+ \int_compare:nNnT { \l_tmpa_tl } = { #3 + 1 }
{ \bool_gset_false:N \g_tmpa_bool }
}
}
@@ -12702,14 +12731,14 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_test_vline_in_stroken_block:nnnn #1 #2 #3 #4
{
- \int_compare:nNnT \l_tmpa_tl > { #1 - 1 }
+ \int_compare:nNnT { \l_tmpa_tl } > { #1 - 1 }
{
- \int_compare:nNnT \l_tmpa_tl < { #3 + 1 }
+ \int_compare:nNnT { \l_tmpa_tl } < { #3 + 1 }
{
- \int_compare:nNnTF \l_tmpb_tl = { #2 }
+ \int_compare:nNnTF { \l_tmpb_tl } = { #2 }
{ \bool_gset_false:N \g_tmpa_bool }
{
- \int_compare:nNnT \l_tmpb_tl = { #4 + 1 }
+ \int_compare:nNnT { \l_tmpb_tl } = { #4 + 1 }
{ \bool_gset_false:N \g_tmpa_bool }
}
}
@@ -12765,7 +12794,7 @@
% \begin{macrocode}
\tl_gput_right:Ne \g_@@_aux_tl
{
- \cs_set_nopar:Npn \exp_not:N \l_@@_corners_cells_clist
+ \clist_set:Nn \exp_not:N \l_@@_corners_cells_clist
{ \l_@@_corners_cells_clist }
}
}
@@ -12790,8 +12819,8 @@
{
\cs_if_exist:cTF
{ @@ _ block _ \int_eval:n { #1 } - \int_eval:n { #2 } }
- \prg_return_true:
- \prg_return_false:
+ { \prg_return_true: }
+ { \prg_return_false: }
}
% \end{macrocode}
%
@@ -12863,13 +12892,13 @@
% \end{macrocode}
% Now, we loop over the rows.
% \begin{macrocode}
- \int_step_inline:nnnn { #1 } { #3 } \l_@@_last_empty_row_int
+ \int_step_inline:nnnn { #1 } { #3 } { \l_@@_last_empty_row_int }
{
% \end{macrocode}
% We treat the row number |##1| with another loop.
% \begin{macrocode}
\bool_set_false:N \l_tmpa_bool
- \int_step_inline:nnnn { #2 } { #4 } \l_@@_last_empty_column_int
+ \int_step_inline:nnnn { #2 } { #4 } { \l_@@_last_empty_column_int }
{
\bool_lazy_or:nnTF
{ \cs_if_exist_p:c { pgf @ sh @ ns @ \@@_env: - ##1 - ####1 } }
@@ -13058,17 +13087,17 @@
{
\int_step_variable:nnNn \l_@@_first_row_int \g_@@_row_total_int \@@_i:
{
- \dim_zero_new:c { l_@@_row_\@@_i: _min_dim }
- \dim_set_eq:cN { l_@@_row_\@@_i: _min_dim } \c_max_dim
- \dim_zero_new:c { l_@@_row_\@@_i: _max_dim }
- \dim_set:cn { l_@@_row_\@@_i: _max_dim } { - \c_max_dim }
+ \dim_zero_new:c { l_@@_row_ \@@_i: _min_dim }
+ \dim_set_eq:cN { l_@@_row_ \@@_i: _min_dim } \c_max_dim
+ \dim_zero_new:c { l_@@_row_ \@@_i: _max_dim }
+ \dim_set:cn { l_@@_row_ \@@_i: _max_dim } { - \c_max_dim }
}
\int_step_variable:nnNn \l_@@_first_col_int \g_@@_col_total_int \@@_j:
{
- \dim_zero_new:c { l_@@_column_\@@_j: _min_dim }
- \dim_set_eq:cN { l_@@_column_\@@_j: _min_dim } \c_max_dim
- \dim_zero_new:c { l_@@_column_\@@_j: _max_dim }
- \dim_set:cn { l_@@_column_\@@_j: _max_dim } { - \c_max_dim }
+ \dim_zero_new:c { l_@@_column_ \@@_j: _min_dim }
+ \dim_set_eq:cN { l_@@_column_ \@@_j: _min_dim } \c_max_dim
+ \dim_zero_new:c { l_@@_column_ \@@_j: _max_dim }
+ \dim_set:cn { l_@@_column_ \@@_j: _max_dim } { - \c_max_dim }
}
% \end{macrocode}
% We begin the two nested loops over the rows and the columns of the array.
@@ -13091,11 +13120,11 @@
% \begin{macrocode}
{
\pgfpointanchor { \@@_env: - \@@_i: - \@@_j: } { south~west }
- \dim_set:cn { l_@@_row_\@@_i: _min_dim}
+ \dim_set:cn { l_@@_row_ \@@_i: _min_dim }
{ \dim_min:vn { l_@@_row _ \@@_i: _min_dim } \pgf at y }
\seq_if_in:NeF \g_@@_multicolumn_cells_seq { \@@_i: - \@@_j: }
{
- \dim_set:cn { l_@@_column _ \@@_j: _min_dim}
+ \dim_set:cn { l_@@_column _ \@@_j: _min_dim }
{ \dim_min:vn { l_@@_column _ \@@_j: _min_dim } \pgf at x }
}
% \end{macrocode}
@@ -13104,11 +13133,11 @@
% \begin{macrocode}
\pgfpointanchor { \@@_env: - \@@_i: - \@@_j: } { north~east }
\dim_set:cn { l_@@_row _ \@@_i: _ max_dim }
- { \dim_max:vn { l_@@_row _ \@@_i: _ max_dim } \pgf at y }
+ { \dim_max:vn { l_@@_row _ \@@_i: _ max_dim } { \pgf at y } }
\seq_if_in:NeF \g_@@_multicolumn_cells_seq { \@@_i: - \@@_j: }
{
\dim_set:cn { l_@@_column _ \@@_j: _ max_dim }
- { \dim_max:vn { l_@@_column _ \@@_j: _max_dim } \pgf at x }
+ { \dim_max:vn { l_@@_column _ \@@_j: _max_dim } { \pgf at x } }
}
}
}
@@ -13156,7 +13185,7 @@
% Now, we can create the ``medium nodes''. We use a command |\@@_create_nodes:|
% because this command will also be used for the creation of the ``large nodes''.
% \begin{macrocode}
- \cs_set_nopar:Npn \l_@@_suffix_tl { -medium }
+ \tl_set:Nn \l_@@_suffix_tl { -medium }
\@@_create_nodes:
\endpgfpicture
}
@@ -13179,7 +13208,7 @@
\pgf at relevantforpicturesizefalse
\@@_computations_for_medium_nodes:
\@@_computations_for_large_nodes:
- \cs_set_nopar:Npn \l_@@_suffix_tl { - large }
+ \tl_set:Nn \l_@@_suffix_tl { - large }
\@@_create_nodes:
\endpgfpicture
}
@@ -13196,10 +13225,10 @@
% Now, we can create the ``medium nodes''. We use a command |\@@_create_nodes:|
% because this command will also be used for the creation of the ``large nodes''.
% \begin{macrocode}
- \cs_set_nopar:Npn \l_@@_suffix_tl { - medium }
+ \tl_set:Nn \l_@@_suffix_tl { - medium }
\@@_create_nodes:
\@@_computations_for_large_nodes:
- \cs_set_nopar:Npn \l_@@_suffix_tl { - large }
+ \tl_set:Nn \l_@@_suffix_tl { - large }
\@@_create_nodes:
\endpgfpicture
}
@@ -13232,7 +13261,7 @@
/ 2
}
\dim_set_eq:cc { l_@@_row _ \int_eval:n { \@@_i: + 1 } _ max _ dim }
- { l_@@_row_\@@_i: _min_dim }
+ { l_@@_row_ \@@_i: _min_dim }
}
\int_step_variable:nNn { \c at jCol - 1 } \@@_j:
{
@@ -13297,6 +13326,21 @@
}
}
}
+ \int_step_inline:nn { \c at iRow }
+ {
+ \pgfnodealias
+ { \@@_env: - ##1 - last \l_@@_suffix_tl }
+ { \@@_env: - ##1 - \int_use:N \c at jCol \l_@@_suffix_tl }
+ }
+ \int_step_inline:nn { \c at jCol }
+ {
+ \pgfnodealias
+ { \@@_env: - last - ##1 \l_@@_suffix_tl }
+ { \@@_env: - \int_use:N \c at iRow - ##1 \l_@@_suffix_tl }
+ }
+ \pgfnodealias % added 2025-04-05
+ { \@@_env: - last - last \l_@@_suffix_tl }
+ { \@@_env: - \int_use:N \c at iRow - \int_use:N \c at jCol \l_@@_suffix_tl }
% \end{macrocode}
% Now, we create the nodes for the cells of the |\multicolumn|. We recall that
% we have stored in |\g_@@_multicolumn_cells_seq| the list of the cells where a
@@ -13338,7 +13382,7 @@
{
\pgfnodealias
{ \l_@@_name_str - \@@_i: - \@@_j: \l_@@_suffix_tl }
- { \int_use:N \g_@@_env_int - \@@_i: - \@@_j: \l_@@_suffix_tl}
+ { \int_use:N \g_@@_env_int - \@@_i: - \@@_j: \l_@@_suffix_tl }
}
}
% \end{macrocode}
@@ -13417,17 +13461,15 @@
% with the syntax $i$|-|$j$) has not been provided by the user, you use |1-1|
% (that is to say a block of only one cell).
% \begin{macrocode}
- \peek_remove_spaces:n
- {
- \tl_if_blank:nTF { #2 }
- { \@@_Block_ii:nnnnn \c_one_int \c_one_int }
- {
- \int_compare:nNnTF { \char_value_catcode:n { 45 } } = { 13 }
- \@@_Block_i_czech \@@_Block_i
- #2 \q_stop
- }
- { #1 } { #3 } { #4 }
+ \tl_if_blank:nTF { #2 }
+ { \@@_Block_ii:nnnnn \c_one_int \c_one_int }
+ {
+ \int_compare:nNnTF { \char_value_catcode:n { 45 } } = { 13 }
+ \@@_Block_i_czech:w \@@_Block_i:w
+ #2 \q_stop
}
+ { #1 } { #3 } { #4 }
+ \ignorespaces
}
% \end{macrocode}
%
@@ -13435,7 +13477,7 @@
% With the following construction, we extract the values of $i$ and $j$ in the
% first mandatory argument of the command.
% \begin{macrocode}
-\cs_new:Npn \@@_Block_i #1-#2 \q_stop { \@@_Block_ii:nnnnn { #1 } { #2 } }
+\cs_new:Npn \@@_Block_i:w #1-#2 \q_stop { \@@_Block_ii:nnnnn { #1 } { #2 } }
% \end{macrocode}
%
% With \pkg{babel} with the key |czech|, the character |-| (hyphen) is active.
@@ -13445,7 +13487,7 @@
% \begin{macrocode}
{
\char_set_catcode_active:N -
- \cs_new:Npn \@@_Block_i_czech #1-#2 \q_stop { \@@_Block_ii:nnnnn { #1 } { #2 } }
+ \cs_new:Npn \@@_Block_i_czech:w #1-#2 \q_stop { \@@_Block_ii:nnnnn { #1 } { #2 } }
}
% \end{macrocode}
%
@@ -13483,7 +13525,7 @@
% \medskip
% If the block is mono-column.
% \begin{macrocode}
- \int_compare:nNnTF \l_tmpb_int = \c_one_int
+ \int_compare:nNnTF { \l_tmpb_int } = { \c_one_int }
{
\tl_if_empty:NTF \l_@@_hpos_cell_tl
{ \str_set_eq:NN \l_@@_hpos_block_str \c_@@_c_str }
@@ -13565,7 +13607,6 @@
% the tokens to put before the potential math mode and before the composition of
% the block and |#5| is the label (=content) of the block.
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_Block_iv:nnnnn { e e }
\cs_new_protected:Npn \@@_Block_iv:nnnnn #1 #2 #3 #4 #5
{
\int_gincr:N \g_@@_block_box_int
@@ -13602,7 +13643,7 @@
% |\documentclass|).
% \begin{macrocode}
\tl_if_empty:NTF \l_@@_color_tl
- { \int_compare:nNnT { #2 } = \c_one_int \set at color }
+ { \int_compare:nNnT { #2 } = { \c_one_int } { \set at color } }
{ \@@_color:o \l_@@_color_tl }
% \end{macrocode}
% If the block is mono-row, we use |\g_@@_row_style_tl| even if it has yet been
@@ -13610,9 +13651,9 @@
% because we want to be able to take into account a potential instruction of
% color of the font in |\g_@@_row_style_tl|.
% \begin{macrocode}
- \int_compare:nNnT { #1 } = \c_one_int
+ \int_compare:nNnT { #1 } = { \c_one_int }
{
- \int_if_zero:nTF \c at iRow
+ \int_if_zero:nTF { \c at iRow }
{
% \end{macrocode}
%
@@ -13644,7 +13685,7 @@
\l_@@_code_for_first_row_tl
}
{
- \int_compare:nNnT \c at iRow = \l_@@_last_row_int
+ \int_compare:nNnT { \c at iRow } = { \l_@@_last_row_int }
{
\cs_set_eq:NN \Block \@@_NullBlock:
\l_@@_code_for_last_row_tl
@@ -13681,12 +13722,15 @@
{
\bool_lazy_all:nTF
{
- { \int_compare_p:nNn { #2 } = \c_one_int }
+ { \int_compare_p:nNn { #2 } = { \c_one_int } }
% \end{macrocode}
% Remind that, when the column has not a fixed width, the dimension
% |\l_@@_col_width_dim| has the conventional value of $-1$~cm.
% \begin{macrocode}
- { ! \dim_compare_p:nNn \l_@@_col_width_dim < \c_zero_dim }
+ {
+ ! \dim_compare_p:nNn
+ { \l_@@_col_width_dim } < { \c_zero_dim }
+ }
{ ! \g_@@_rotate_bool }
}
% \end{macrocode}
@@ -13699,8 +13743,8 @@
% \end{macrocode}
% The |\exp_not:N| is mandatory before |\begin|.
% \begin{macrocode}
- \exp_not:N \begin { minipage }%
- [ \str_lowercase:o \l_@@_vpos_block_str ]
+ \exp_not:N \begin { minipage }
+ [ \str_lowercase:f \l_@@_vpos_block_str ]
{ \l_@@_col_width_dim }
\str_case:on \l_@@_hpos_block_str
{ c \centering r \raggedleft l \raggedright }
@@ -13716,8 +13760,8 @@
{ \tagpdfsetup { table / tagging = presentation } }
\use:e
{
- \exp_not:N \begin { tabular }%
- [ \str_lowercase:o \l_@@_vpos_block_str ]
+ \exp_not:N \begin { tabular }
+ [ \str_lowercase:f \l_@@_vpos_block_str ]
{ @ { } \l_@@_hpos_block_str @ { } }
}
#5
@@ -13732,8 +13776,8 @@
\c_math_toggle_token
\use:e
{
- \exp_not:N \begin { array }%
- [ \str_lowercase:o \l_@@_vpos_block_str ]
+ \exp_not:N \begin { array }
+ [ \str_lowercase:f \l_@@_vpos_block_str ]
{ @ { } \l_@@_hpos_block_str @ { } }
}
#5
@@ -13749,18 +13793,18 @@
% the |\Block|, we do a rotation of the box (and we also adjust the
% baseline of the rotated box).
% \begin{macrocode}
- \bool_if:NT \g_@@_rotate_bool \@@_rotate_box_of_block:
+ \bool_if:NT \g_@@_rotate_bool { \@@_rotate_box_of_block: }
% \end{macrocode}
%
% If we are in a mono-column block, we take into account the width of that block
% for the width of the column.
% \begin{macrocode}
- \int_compare:nNnT { #2 } = \c_one_int
+ \int_compare:nNnT { #2 } = { \c_one_int }
{
\dim_gset:Nn \g_@@_blocks_wd_dim
{
\dim_max:nn
- \g_@@_blocks_wd_dim
+ { \g_@@_blocks_wd_dim }
{
\box_wd:c
{ g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
@@ -13773,7 +13817,7 @@
% uses explicitely an option of vertical position.
% \begin{macrocode}
\bool_lazy_and:nnT
- { \int_compare_p:nNn { #1 } = \c_one_int }
+ { \int_compare_p:nNn { #1 } = { \c_one_int } }
% \end{macrocode}
% If the user has not used a key for the vertical position of the block, then
% |\l_@@_vpos_block_str| remains empty.
@@ -13783,7 +13827,7 @@
\dim_gset:Nn \g_@@_blocks_ht_dim
{
\dim_max:nn
- \g_@@_blocks_ht_dim
+ { \g_@@_blocks_ht_dim }
{
\box_ht:c
{ g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
@@ -13792,7 +13836,7 @@
\dim_gset:Nn \g_@@_blocks_dp_dim
{
\dim_max:nn
- \g_@@_blocks_dp_dim
+ { \g_@@_blocks_dp_dim }
{
\box_dp:c
{ g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
@@ -13819,7 +13863,10 @@
{
\bool_if:NTF \g_@@_rotate_c_bool
{ m }
- { \int_compare:nNnT \c at iRow = \l_@@_last_row_int T }
+ {
+ \int_compare:nNnT { \c at iRow } = { \l_@@_last_row_int }
+ { T }
+ }
}
}
{
@@ -13846,11 +13893,16 @@
{
\str_case:onF \l_@@_vpos_block_str
{ b l B l t r T r }
- { \int_compare:nNnTF \c at iRow = \l_@@_last_row_int r l }
+ {
+ \int_compare:nNnTF { \c at iRow } = { \l_@@_last_row_int }
+ { r }
+ { l }
+ }
}
}
}
}
+\cs_generate_variant:Nn \@@_Block_iv:nnnnn { e e }
% \end{macrocode}
%
% \bigskip
@@ -13862,7 +13914,7 @@
\box_grotate:cn
{ g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
{ 90 }
- \int_compare:nNnT \c at iRow = \l_@@_last_row_int
+ \int_compare:nNnT { \c at iRow } = { \l_@@_last_row_int }
{
\vbox_gset_top:cn
{ g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
@@ -13901,7 +13953,6 @@
% the tokens to put before the math mode and before the composition of the block
% and |#5| is the label (=content) of the block.
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_Block_v:nnnnn { e e }
\cs_new_protected:Npn \@@_Block_v:nnnnn #1 #2 #3 #4 #5
{
\seq_gput_right:Ne \g_@@_blocks_seq
@@ -13968,12 +14019,12 @@
}
}
}
+\cs_generate_variant:Nn \@@_Block_v:nnnnn { e e }
% \end{macrocode}
%
% \bigskip
% The following macro is for the case of a |\Block| which uses the key~|p|.
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_Block_vi:nnnnn { e e }
\cs_new_protected:Npn \@@_Block_vi:nnnnn #1 #2 #3 #4 #5
{
\seq_gput_right:Ne \g_@@_blocks_seq
@@ -13986,6 +14037,7 @@
{ { \exp_not:n { #4 #5 } } }
}
}
+\cs_generate_variant:Nn \@@_Block_vi:nnnnn { e e }
% \end{macrocode}
%
%
@@ -13992,7 +14044,6 @@
% \bigskip
% The following macro is also for the case of a |\Block| which uses the key~|p|.
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_Block_vii:nnnnn { e e }
\cs_new_protected:Npn \@@_Block_vii:nnnnn #1 #2 #3 #4 #5
{
\seq_gput_right:Ne \g_@@_blocks_seq
@@ -14002,6 +14053,7 @@
{ \exp_not:n { #4 #5 } }
}
}
+\cs_generate_variant:Nn \@@_Block_vii:nnnnn { e e }
% \end{macrocode}
%
%
@@ -14116,8 +14168,8 @@
% The integer |\l_@@_last_row_int| will be the last row of the block and
% |\l_@@_last_col_int| its last column.
% \begin{macrocode}
- \int_zero_new:N \l_@@_last_row_int
- \int_zero_new:N \l_@@_last_col_int
+ \int_zero:N \l_@@_last_row_int
+ \int_zero:N \l_@@_last_col_int
% \end{macrocode}
%
% We remind that the first mandatory argument of the command |\Block| is the
@@ -14138,10 +14190,10 @@
% \end{macrocode}
%
% \begin{macrocode}
- \int_compare:nNnTF \l_@@_last_col_int > \g_@@_col_total_int
+ \int_compare:nNnTF { \l_@@_last_col_int } > { \g_@@_col_total_int }
{
\bool_lazy_and:nnTF
- \l_@@_preamble_bool
+ { \l_@@_preamble_bool }
{
\int_compare_p:n
{ \l_@@_last_col_int <= \g_@@_static_num_of_col_int }
@@ -14154,7 +14206,7 @@
{ \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } }
}
{
- \int_compare:nNnTF \l_@@_last_row_int > \g_@@_row_total_int
+ \int_compare:nNnTF { \l_@@_last_row_int } > { \g_@@_row_total_int }
{ \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } }
{
\@@_Block_v:nneenn
@@ -14179,7 +14231,6 @@
% |#5| is a list of \textsl{key=value} options;
% |#6| is the label
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_Block_v:nnnnnn { n n e e }
\cs_new_protected:Npn \@@_Block_v:nnnnnn #1 #2 #3 #4 #5 #6
{
% \end{macrocode}
@@ -14201,7 +14252,7 @@
%
% \begin{macrocode}
\bool_lazy_and:nnT
- \l_@@_vlines_block_bool
+ { \l_@@_vlines_block_bool }
{ ! \l_@@_ampersand_bool }
{
\tl_gput_right:Ne \g_nicematrix_code_after_tl
@@ -14224,7 +14275,7 @@
}
\bool_if:NF \l_@@_transparent_bool
{
- \bool_lazy_and:nnF \l_@@_vlines_block_bool \l_@@_hlines_block_bool
+ \bool_lazy_and:nnF { \l_@@_vlines_block_bool } { \l_@@_hlines_block_bool }
{
% \end{macrocode}
% The sequence of the positions of the blocks (excepted the blocks with the key
@@ -14424,7 +14475,7 @@
% the columns involved in at least one cell of the block. That's why we have to
% do a loop over the rows of the array.
% \begin{macrocode}
- \int_step_inline:nnn \l_@@_first_row_int \g_@@_row_total_int
+ \int_step_inline:nnn { \l_@@_first_row_int } { \g_@@_row_total_int }
{
% \end{macrocode}
% We recall that, when a cell is empty, no (normal) node is created in that
@@ -14445,13 +14496,13 @@
% value |\c_max_dim|. In that case, you use for |\l_tmpb_dim| the value of the
% position of the vertical rule.
% \begin{macrocode}
- \dim_compare:nNnT \l_tmpb_dim = \c_max_dim
+ \dim_compare:nNnT { \l_tmpb_dim } = { \c_max_dim }
{
\@@_qpoint:n { col - #2 }
\dim_set_eq:NN \l_tmpb_dim \pgf at x
}
\dim_set:Nn \l_@@_tmpd_dim { - \c_max_dim }
- \int_step_inline:nnn \l_@@_first_row_int \g_@@_row_total_int
+ \int_step_inline:nnn { \l_@@_first_row_int } { \g_@@_row_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \@@_env: - ##1 - \int_use:N \l_@@_last_col_int }
@@ -14461,11 +14512,12 @@
\pgfpointanchor
{ \@@_env: - ##1 - \int_use:N \l_@@_last_col_int }
{ east }
- \dim_set:Nn \l_@@_tmpd_dim { \dim_max:nn \l_@@_tmpd_dim \pgf at x }
+ \dim_set:Nn \l_@@_tmpd_dim
+ { \dim_max:nn { \l_@@_tmpd_dim } { \pgf at x } }
}
}
}
- \dim_compare:nNnT \l_@@_tmpd_dim = { - \c_max_dim }
+ \dim_compare:nNnT { \l_@@_tmpd_dim } = { - \c_max_dim }
{
\@@_qpoint:n { col - \int_eval:n { \l_@@_last_col_int + 1 } }
\dim_set_eq:NN \l_@@_tmpd_dim \pgf at x
@@ -14519,7 +14571,7 @@
\dim_set:Nn \l_tmpb_dim
{ ( \pgf at x - \l_tmpa_dim ) / \int_use:N \l_@@_split_int }
\bool_lazy_or:nnT
- \l_@@_vlines_block_bool
+ { \l_@@_vlines_block_bool }
{ \str_if_eq_p:ee \l_@@_vlines_clist { all } }
{
\int_step_inline:nn { \l_@@_split_int - 1 }
@@ -14544,11 +14596,11 @@
}
\@@_qpoint:n { row - #1 - base }
\dim_set_eq:NN \l_@@_tmpc_dim \pgf at y
- \int_step_inline:nn \l_@@_split_int
+ \int_step_inline:nn { \l_@@_split_int }
{
\group_begin:
\dim_set:Nn \col at sep
- { \bool_if:NTF \l_@@_tabular_bool \tabcolsep \arraycolsep }
+ { \bool_if:NTF \l_@@_tabular_bool { \tabcolsep } { \arraycolsep } }
\pgftransformshift
{
\pgfpoint
@@ -14606,7 +14658,7 @@
\endpgfpicture
\hbox_set:Nn \l_@@_cell_box
{
- \begin { minipage } [ \str_lowercase:o \l_@@_vpos_block_str ]
+ \begin { minipage } [ \str_lowercase:f \l_@@_vpos_block_str ]
{ \g_tmpb_dim }
\str_case:on \l_@@_hpos_block_str
{ c \centering r \raggedleft l \raggedright j { } }
@@ -14615,7 +14667,7 @@
}
}
{ \hbox_set:Nn \l_@@_cell_box { \set at color #6 } }
- \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box:
+ \bool_if:NT \g_@@_rotate_bool { \@@_rotate_cell_box: }
% \end{macrocode}
%
% \bigskip
@@ -14627,7 +14679,7 @@
\pgf at relevantforpicturesizefalse
\bool_lazy_any:nTF
{
- { \str_if_empty_p:N \l_@@_vpos_block_str } % added 2024/06/29
+ { \str_if_empty_p:N \l_@@_vpos_block_str }
{ \str_if_eq_p:ee \l_@@_vpos_block_str { c } }
{ \str_if_eq_p:ee \l_@@_vpos_block_str { T } }
{ \str_if_eq_p:ee \l_@@_vpos_block_str { B } }
@@ -14645,7 +14697,7 @@
% \begin{macrocode}
\bool_if:nT \g_@@_last_col_found_bool
{
- \int_compare:nNnT { #2 } = \g_@@_col_total_int
+ \int_compare:nNnT { #2 } = { \g_@@_col_total_int }
{ \str_set_eq:NN \l_@@_hpos_block_str \c_@@_l_str }
}
% \end{macrocode}
@@ -14659,7 +14711,7 @@
% We recall that |\l_@@_vpos_block_str| is empty when the user has not used a key
% for the vertical position of the block.
% \begin{macrocode}
- { } { % added 2024-06-29
+ { } {
\str_case:on \l_@@_hpos_block_str
{
c { center }
@@ -14776,6 +14828,7 @@
}
\group_end:
}
+\cs_generate_variant:Nn \@@_Block_v:nnnnnn { n n e e }
% \end{macrocode}
%
%
@@ -14854,9 +14907,9 @@
{ \l_@@_rounded_corners_dim }
}
\@@_cut_on_hyphen:w #2 \q_stop
- \int_compare:nNnF \l_tmpa_tl > \c at iRow
+ \int_compare:nNnF { \l_tmpa_tl } > { \c at iRow }
{
- \int_compare:nNnF \l_tmpb_tl > \c at jCol
+ \int_compare:nNnF { \l_tmpb_tl } > { \c at jCol }
{
\@@_qpoint:n { row - \l_tmpa_tl }
\dim_set_eq:NN \l_tmpb_dim \pgf at y
@@ -14863,9 +14916,9 @@
\@@_qpoint:n { col - \l_tmpb_tl }
\dim_set_eq:NN \l_@@_tmpc_dim \pgf at x
\@@_cut_on_hyphen:w #3 \q_stop
- \int_compare:nNnT \l_tmpa_tl > \c at iRow
+ \int_compare:nNnT { \l_tmpa_tl } > { \c at iRow }
{ \tl_set:No \l_tmpa_tl { \int_use:N \c at iRow } }
- \int_compare:nNnT \l_tmpb_tl > \c at jCol
+ \int_compare:nNnT { \l_tmpb_tl } > { \c at jCol }
{ \tl_set:No \l_tmpb_tl { \int_use:N \c at jCol } }
\@@_qpoint:n { row - \int_eval:n { \l_tmpa_tl + 1 } }
\dim_set_eq:NN \l_tmpa_dim \pgf at y
@@ -14875,7 +14928,7 @@
\pgfpathrectanglecorners
{ \pgfpoint \l_@@_tmpc_dim \l_tmpb_dim }
{ \pgfpoint \l_@@_tmpd_dim \l_tmpa_dim }
- \dim_compare:nNnTF \l_@@_rounded_corners_dim = \c_zero_dim
+ \dim_compare:nNnTF { \l_@@_rounded_corners_dim } = { \c_zero_dim }
{ \pgfusepathqstroke }
{ \pgfusepath { stroke } }
}
@@ -14909,6 +14962,7 @@
\cs_new_protected:Npn \@@_vlines_block:nnn #1 #2 #3
{
\group_begin:
+ \dim_set_eq:NN \l_@@_line_width_dim \arrayrulewidth
\keys_set_known:nn { nicematrix / BlockBorders } { #1 }
\dim_set_eq:NN \arrayrulewidth \l_@@_line_width_dim
\@@_cut_on_hyphen:w #2 \q_stop
@@ -14917,7 +14971,7 @@
\@@_cut_on_hyphen:w #3 \q_stop
\tl_set:Ne \l_tmpa_tl { \int_eval:n { \l_tmpa_tl + 1 } }
\tl_set:Ne \l_tmpb_tl { \int_eval:n { \l_tmpb_tl + 1 } }
- \int_step_inline:nnn \l_@@_tmpd_tl \l_tmpb_tl
+ \int_step_inline:nnn { \l_@@_tmpd_tl } { \l_tmpb_tl }
{
\use:e
{
@@ -14938,6 +14992,7 @@
\cs_new_protected:Npn \@@_hlines_block:nnn #1 #2 #3
{
\group_begin:
+ \dim_set_eq:NN \l_@@_line_width_dim \arrayrulewidth
\keys_set_known:nn { nicematrix / BlockBorders } { #1 }
\dim_set_eq:NN \arrayrulewidth \l_@@_line_width_dim
\@@_cut_on_hyphen:w #2 \q_stop
@@ -14946,7 +15001,7 @@
\@@_cut_on_hyphen:w #3 \q_stop
\tl_set:Ne \l_tmpa_tl { \int_eval:n { \l_tmpa_tl + 1 } }
\tl_set:Ne \l_tmpb_tl { \int_eval:n { \l_tmpb_tl + 1 } }
- \int_step_inline:nnn \l_@@_tmpc_tl \l_tmpa_tl
+ \int_step_inline:nnn { \l_@@_tmpc_tl } { \l_tmpa_tl }
{
\use:e
{
@@ -14973,7 +15028,7 @@
{
\dim_set_eq:NN \l_@@_line_width_dim \arrayrulewidth
\keys_set_known:nn { nicematrix / BlockBorders } { #1 }
- \dim_compare:nNnTF \l_@@_rounded_corners_dim > \c_zero_dim
+ \dim_compare:nNnTF { \l_@@_rounded_corners_dim } > { \c_zero_dim }
{ \@@_error:n { borders~forbidden } }
{
\tl_clear_new:N \l_@@_borders_tikz_tl
@@ -15116,7 +15171,6 @@
% cell and |#4| and |#5| the coordinates of the last cell of the block.
%
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_block_tikz:nnnnn { o }
\cs_new_protected:Npn \@@_block_tikz:nnnnn #1 #2 #3 #4 #5
{
\begin { tikzpicture }
@@ -15150,6 +15204,7 @@
}
\end { tikzpicture }
}
+\cs_generate_variant:Nn \@@_block_tikz:nnnnn { o }
% \end{macrocode}
%
% \medskip
@@ -15241,15 +15296,15 @@
{ * { #4 } { \exp_not:o \l_@@_columns_type_tl } }
[ \exp_not:o \l_tmpa_tl ]
}
- \int_if_zero:nT \l_@@_first_row_int
+ \int_if_zero:nT { \l_@@_first_row_int }
{
- \int_if_zero:nT \l_@@_first_col_int { & }
+ \int_if_zero:nT { \l_@@_first_col_int } { & }
\prg_replicate:nn { #4 - 1 } { & }
- \int_compare:nNnT \l_@@_last_col_int > { -1 } { & } \\
+ \int_compare:nNnT { \l_@@_last_col_int } > { -1 } { & } \\
}
\prg_replicate:nn { #3 }
{
- \int_if_zero:nT \l_@@_first_col_int { & }
+ \int_if_zero:nT { \l_@@_first_col_int } { & }
% \end{macrocode}
% We put |{ }| before |#6| to avoid a hasty expansion of a potential
% |\arabic{iRow}| at the beginning of the row which would result in an incorrect
@@ -15257,13 +15312,13 @@
% of the |\halign|).
% \begin{macrocode}
\prg_replicate:nn { #4 - 1 } { { } #5 & } #5
- \int_compare:nNnT \l_@@_last_col_int > { -1 } { & } \\
+ \int_compare:nNnT { \l_@@_last_col_int } > { -1 } { & } \\
}
- \int_compare:nNnT \l_@@_last_row_int > { -2 }
+ \int_compare:nNnT { \l_@@_last_row_int } > { -2 }
{
- \int_if_zero:nT \l_@@_first_col_int { & }
+ \int_if_zero:nT { \l_@@_first_col_int } { & }
\prg_replicate:nn { #4 - 1 } { & }
- \int_compare:nNnT \l_@@_last_col_int > { -1 } { & } \\
+ \int_compare:nNnT { \l_@@_last_col_int } > { -1 } { & } \\
}
\end { NiceArrayWithDelims }
\group_end:
@@ -15271,7 +15326,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\cs_set_protected:Npn \@@_define_com:nnn #1 #2 #3
+\cs_set_protected:Npn \@@_define_com:NNN #1 #2 #3
{
\cs_set_protected:cpn { #1 AutoNiceMatrix }
{
@@ -15282,13 +15337,6 @@
}
% \end{macrocode}
%
-% \begin{macrocode}
-\@@_define_com:nnn p ( )
-\@@_define_com:nnn b [ ]
-\@@_define_com:nnn v | |
-\@@_define_com:nnn V \| \|
-\@@_define_com:nnn B \{ \}
-% \end{macrocode}
%
% \bigskip
% We define also a command |\AutoNiceMatrix| similar to the environment |{NiceMatrix}|.
@@ -15307,7 +15355,7 @@
% \section{The redefinition of the command \textbackslash dotfill }
%
% \begin{macrocode}
-\cs_set_eq:NN \@@_old_dotfill \dotfill
+\cs_set_eq:NN \@@_old_dotfill: \dotfill
\cs_new_protected:Npn \@@_dotfill:
{
% \end{macrocode}
@@ -15314,7 +15362,7 @@
% First, we insert |\@@_dotfill| (which is the saved version of |\dotfill|) in
% case of use of |\dotfill| ``internally'' in the cell (e.g. |\hbox to 1cm {\dotfill}|).
% \begin{macrocode}
- \@@_old_dotfill
+ \@@_old_dotfill:
\tl_gput_right:Nn \g_@@_cell_after_hook_tl \@@_dotfill_i:
}
% \end{macrocode}
@@ -15324,7 +15372,10 @@
% array, and it will extend, since it is no longer in |\l_@@_cell_box|.
% \begin{macrocode}
\cs_new_protected:Npn \@@_dotfill_i:
- { \dim_compare:nNnT { \box_wd:N \l_@@_cell_box } = \c_zero_dim \@@_old_dotfill }
+ {
+ \dim_compare:nNnT { \box_wd:N \l_@@_cell_box } = { \c_zero_dim }
+ { \@@_old_dotfill: }
+ }
% \end{macrocode}
%
% \bigskip
@@ -15548,7 +15599,7 @@
\bool_if:nTF { #3 }
{ \dim_set_eq:NN \l_tmpa_dim \c_max_dim }
{ \dim_set:Nn \l_tmpa_dim { - \c_max_dim } }
- \int_step_inline:nnn \l_@@_first_row_int \g_@@_row_total_int
+ \int_step_inline:nnn { \l_@@_first_row_int } { \g_@@_row_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \@@_env: - ##1 - #2 }
@@ -15557,7 +15608,13 @@
{ \@@_env: - ##1 - #2 }
{ \bool_if:nTF { #3 } { west } { east } }
\dim_set:Nn \l_tmpa_dim
- { \bool_if:nTF { #3 } \dim_min:nn \dim_max:nn \l_tmpa_dim \pgf at x }
+ {
+ \bool_if:nTF { #3 }
+ { \dim_min:nn }
+ { \dim_max:nn }
+ \l_tmpa_dim
+ { \pgf at x }
+ }
}
}
% \end{macrocode}
@@ -15680,24 +15737,22 @@
% \begin{macrocode}
\NewDocumentCommand \@@_SubMatrix_in_code_before { m m m m ! O { } }
{
- \peek_remove_spaces:n
+ \tl_gput_right:Ne \g_@@_pre_code_after_tl
{
- \tl_gput_right:Ne \g_@@_pre_code_after_tl
- {
- \SubMatrix { #1 } { #2 } { #3 } { #4 }
- [
- delimiters / color = \l_@@_delimiters_color_tl ,
- hlines = \l_@@_submatrix_hlines_clist ,
- vlines = \l_@@_submatrix_vlines_clist ,
- extra-height = \dim_use:N \l_@@_submatrix_extra_height_dim ,
- left-xshift = \dim_use:N \l_@@_submatrix_left_xshift_dim ,
- right-xshift = \dim_use:N \l_@@_submatrix_right_xshift_dim ,
- slim = \bool_to_str:N \l_@@_submatrix_slim_bool ,
- #5
- ]
- }
- \@@_SubMatrix_in_code_before_i { #2 } { #3 }
+ \SubMatrix { #1 } { #2 } { #3 } { #4 }
+ [
+ delimiters / color = \l_@@_delimiters_color_tl ,
+ hlines = \l_@@_submatrix_hlines_clist ,
+ vlines = \l_@@_submatrix_vlines_clist ,
+ extra-height = \dim_use:N \l_@@_submatrix_extra_height_dim ,
+ left-xshift = \dim_use:N \l_@@_submatrix_left_xshift_dim ,
+ right-xshift = \dim_use:N \l_@@_submatrix_right_xshift_dim ,
+ slim = \bool_to_str:N \l_@@_submatrix_slim_bool ,
+ #5
+ ]
}
+ \@@_SubMatrix_in_code_before_i { #2 } { #3 }
+ \ignorespaces
}
% \end{macrocode}
%
@@ -15723,38 +15778,7 @@
}
}
% \end{macrocode}
-%
%
-% \bigskip
-% In the pre-code-after and in the |\CodeAfter| the following command
-% |\@@_SubMatrix| will be linked to |\SubMatrix|.
-% \begin{itemize}
-% \item |#1| is the left delimiter;
-% \item |#2| is the upper-left 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;
-% \item |#6| is the potential subscript;
-% \item |#7| is the potential superscript.
-% \end{itemize}
-% For explanations about the construction with rescanning of the preamble, see
-% the documentation for the user command |\Cdots|.
-% \begin{macrocode}
-\hook_gput_code:nnn { begindocument } { . }
- {
- \cs_set_nopar:Npn \l_@@_argspec_tl { m m m m O { } E { _ ^ } { { } { } } }
- \tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl
- \exp_args:NNo \NewDocumentCommand \@@_SubMatrix \l_@@_argspec_tl
- {
- \peek_remove_spaces:n
- {
- \@@_sub_matrix:nnnnnnn
- { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } { #7 }
- }
- }
- }
-% \end{macrocode}
-%
% \medskip
% The following macro will compute |\l_@@_first_i_tl|, |\l_@@_first_j_tl|,
% |\l_@@_last_i_tl| and |\l_@@_last_j_tl| from the arguments of the command as
@@ -15764,14 +15788,15 @@
{ > { \SplitArgument { 1 } { - } } m > { \SplitArgument { 1 } { - } } m }
{ \@@_compute_i_j:nnnn #1 #2 }
% \end{macrocode}
-%
+%
+% \bigskip
% \begin{macrocode}
\cs_new_protected:Npn \@@_compute_i_j:nnnn #1 #2 #3 #4
{
- \cs_set_nopar:Npn \l_@@_first_i_tl { #1 }
- \cs_set_nopar:Npn \l_@@_first_j_tl { #2 }
- \cs_set_nopar:Npn \l_@@_last_i_tl { #3 }
- \cs_set_nopar:Npn \l_@@_last_j_tl { #4 }
+ \def \l_@@_first_i_tl { #1 }
+ \def \l_@@_first_j_tl { #2 }
+ \def \l_@@_last_i_tl { #3 }
+ \def \l_@@_last_j_tl { #4 }
\tl_if_eq:NnT \l_@@_first_i_tl { last }
{ \tl_set:NV \l_@@_first_i_tl \c at iRow }
\tl_if_eq:NnT \l_@@_first_j_tl { last }
@@ -15783,7 +15808,33 @@
}
% \end{macrocode}
%
+%
+% \bigskip
+% In the pre-code-after and in the |\CodeAfter| the following command
+% |\@@_SubMatrix| will be linked to |\SubMatrix|.
+% \begin{itemize}
+% \item |#1| is the left delimiter;
+% \item |#2| is the upper-left 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;
+% \item |#6| is the potential subscript;
+% \item |#7| is the potential superscript.
+% \end{itemize}
+% For explanations about the construction with rescanning of the preamble, see
+% the documentation for the user command |\Cdots|.
% \begin{macrocode}
+\hook_gput_code:nnn { begindocument } { . }
+ {
+ \tl_set_rescan:Nnn \l_tmpa_tl { } { m m m m O { } E { _ ^ } { { } { } } }
+ \exp_args:NNo \NewDocumentCommand \@@_SubMatrix \l_tmpa_tl
+ { \@@_sub_matrix:nnnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } { #7 } }
+ }
+% \end{macrocode}
+
+%
+%
+% \begin{macrocode}
\cs_new_protected:Npn \@@_sub_matrix:nnnnnnn #1 #2 #3 #4 #5 #6 #7
{
\group_begin:
@@ -15791,11 +15842,11 @@
% The four following token lists correspond to the position of the |\SubMatrix|.
% \begin{macrocode}
\@@_compute_i_j:nn { #2 } { #3 }
- \int_compare:nNnT \l_@@_first_i_tl = \l_@@_last_i_tl
- { \cs_set_nopar:Npn \arraystretch { 1 } }
+ \int_compare:nNnT { \l_@@_first_i_tl } = { \l_@@_last_i_tl }
+ { \def \arraystretch { 1 } }
\bool_lazy_or:nnTF
- { \int_compare_p:nNn \l_@@_last_i_tl > \g_@@_row_total_int }
- { \int_compare_p:nNn \l_@@_last_j_tl > \g_@@_col_total_int }
+ { \int_compare_p:nNn { \l_@@_last_i_tl } > { \g_@@_row_total_int } }
+ { \int_compare_p:nNn { \l_@@_last_j_tl } > { \g_@@_col_total_int } }
{ \@@_error:nn { Construct~too~large } { \SubMatrix } }
{
\str_clear_new:N \l_@@_submatrix_name_str
@@ -15810,14 +15861,14 @@
% The last value of |\int_step_inline:nnn| is provided by currifycation.
% \begin{macrocode}
\bool_if:NTF \l_@@_submatrix_slim_bool
- { \int_step_inline:nnn \l_@@_first_i_tl \l_@@_last_i_tl }
- { \int_step_inline:nnn \l_@@_first_row_int \g_@@_row_total_int }
+ { \int_step_inline:nnn { \l_@@_first_i_tl } { \l_@@_last_i_tl } }
+ { \int_step_inline:nnn { \l_@@_first_row_int } { \g_@@_row_total_int } }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \@@_env: - ##1 - \l_@@_first_j_tl }
{
\pgfpointanchor { \@@_env: - ##1 - \l_@@_first_j_tl } { west }
- \dim_compare:nNnT \pgf at x < \l_@@_x_initial_dim
+ \dim_compare:nNnT { \pgf at x } < { \l_@@_x_initial_dim }
{ \dim_set_eq:NN \l_@@_x_initial_dim \pgf at x }
}
\cs_if_exist:cT
@@ -15824,14 +15875,14 @@
{ pgf @ sh @ ns @ \@@_env: - ##1 - \l_@@_last_j_tl }
{
\pgfpointanchor { \@@_env: - ##1 - \l_@@_last_j_tl } { east }
- \dim_compare:nNnT \pgf at x > \l_@@_x_final_dim
+ \dim_compare:nNnT { \pgf at x } > { \l_@@_x_final_dim }
{ \dim_set_eq:NN \l_@@_x_final_dim \pgf at x }
}
}
- \dim_compare:nNnTF \l_@@_x_initial_dim = \c_max_dim
+ \dim_compare:nNnTF { \l_@@_x_initial_dim } = { \c_max_dim }
{ \@@_error:nn { Impossible~delimiter } { left } }
{
- \dim_compare:nNnTF \l_@@_x_final_dim = { - \c_max_dim }
+ \dim_compare:nNnTF { \l_@@_x_final_dim } = { - \c_max_dim }
{ \@@_error:nn { Impossible~delimiter } { right } }
{ \@@_sub_matrix_i:nnnn { #1 } { #4 } { #6 } { #7 } }
}
@@ -15838,6 +15889,7 @@
\endpgfpicture
}
\group_end:
+ \ignorespaces
}
% \end{macrocode}
%
@@ -15859,7 +15911,7 @@
\@@_qpoint:n { row - \l_@@_last_i_tl - base }
\dim_set:Nn \l_@@_y_final_dim
{ \fp_to_dim:n { \pgf at y - ( \box_dp:N \strutbox ) * \arraystretch } }
- \int_step_inline:nnn \l_@@_first_col_int \g_@@_col_total_int
+ \int_step_inline:nnn { \l_@@_first_col_int } { \g_@@_col_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \@@_env: - \l_@@_first_i_tl - ##1 }
@@ -15866,13 +15918,13 @@
{
\pgfpointanchor { \@@_env: - \l_@@_first_i_tl - ##1 } { north }
\dim_set:Nn \l_@@_y_initial_dim
- { \dim_max:nn \l_@@_y_initial_dim \pgf at y }
+ { \dim_max:nn { \l_@@_y_initial_dim } { \pgf at y } }
}
\cs_if_exist:cT
{ pgf @ sh @ ns @ \@@_env: - \l_@@_last_i_tl - ##1 }
{
\pgfpointanchor { \@@_env: - \l_@@_last_i_tl - ##1 } { south }
- \dim_compare:nNnT \pgf at y < \l_@@_y_final_dim
+ \dim_compare:nNnT { \pgf at y } < { \l_@@_y_final_dim }
{ \dim_set_eq:NN \l_@@_y_final_dim \pgf at y }
}
}
@@ -15884,12 +15936,13 @@
\dim_zero:N \nulldelimiterspace
% \end{macrocode}
%
+%
% \bigskip
% We will draw the rules in the |\SubMatrix|.
% \begin{macrocode}
\group_begin:
\pgfsetlinewidth { 1.1 \arrayrulewidth }
- \@@_set_CT at arc@:o \l_@@_rules_color_tl
+ \@@_set_CTarc:o \l_@@_rules_color_tl
\CT at arc@
% \end{macrocode}
% Now, we draw the potential vertical rules specified in the preamble of the
@@ -15898,7 +15951,7 @@
% \begin{macrocode}
\seq_map_inline:Nn \g_@@_cols_vlism_seq
{
- \int_compare:nNnT \l_@@_first_j_tl < { ##1 }
+ \int_compare:nNnT { \l_@@_first_j_tl } < { ##1 }
{
\int_compare:nNnT
{ ##1 } < { \int_eval:n { \l_@@_last_j_tl + 1 } }
@@ -15925,7 +15978,7 @@
{ \clist_map_inline:Nn \l_@@_submatrix_vlines_clist }
{
\bool_lazy_and:nnTF
- { \int_compare_p:nNn { ##1 } > \c_zero_int }
+ { \int_compare_p:nNn { ##1 } > { \c_zero_int } }
{
\int_compare_p:nNn
{ ##1 } < { \l_@@_last_j_tl - \l_@@_first_j_tl + 1 } }
@@ -15950,7 +16003,7 @@
{ \clist_map_inline:Nn \l_@@_submatrix_hlines_clist }
{
\bool_lazy_and:nnTF
- { \int_compare_p:nNn { ##1 } > \c_zero_int }
+ { \int_compare_p:nNn { ##1 } > { \c_zero_int } }
{
\int_compare_p:nNn
{ ##1 } < { \l_@@_last_i_tl - \l_@@_first_i_tl + 1 } }
@@ -16059,7 +16112,7 @@
% That's why we will patch (locally in the |\SubMatrix|) the command
% |\pgfpointanchor|.
% \begin{macrocode}
-\cs_set_eq:NN \@@_old_pgfpointanchor \pgfpointanchor
+\cs_set_eq:NN \@@_old_pgfpointanchor: \pgfpointanchor
% \end{macrocode}
%
% \bigskip
@@ -16075,7 +16128,7 @@
% and that's why we do a redefinition of |\pgfpointanchor| by curryfication.
% \begin{macrocode}
\cs_new:Npn \@@_pgfpointanchor:n #1
- { \exp_args:Ne \@@_old_pgfpointanchor { \@@_pgfpointanchor_i:n { #1 } } }
+ { \exp_args:Ne \@@_old_pgfpointanchor: { \@@_pgfpointanchor_i:n { #1 } } }
% \end{macrocode}
%
% \medskip
@@ -16123,11 +16176,11 @@
% expandable way to using |\etl_if_in:nnTF| of the package \pkg{etl} but, as of
% now, we do not load \pkg{etl}.
% \begin{macrocode}
-\cs_new:Npn \@@_pgfpointanchor_ii:n #1 { \@@_pgfpointanchor_i:w #1-\q_stop }
+\cs_new:Npn \@@_pgfpointanchor_ii:n #1 { \@@_pgfpointanchor_i:w #1- \q_stop }
% \end{macrocode}
% \bigskip
% \begin{macrocode}
-\cs_new:Npn \@@_pgfpointanchor_i:w #1-#2\q_stop
+\cs_new:Npn \@@_pgfpointanchor_i:w #1-#2 \q_stop
{
% \end{macrocode}
% The command |\str_if_empty:nTF| is ``fully expandable''.
@@ -16295,8 +16348,8 @@
% \begin{macrocode}
\NewDocumentCommand \@@_UnderBrace { O { } m m m O { } }
{
- \peek_remove_spaces:n
- { \@@_brace:nnnnn { #2 } { #3 } { #4 } { #1 , #5 } { under } }
+ \@@_brace:nnnnn { #2 } { #3 } { #4 } { #1 , #5 } { under }
+ \ignorespaces
}
% \end{macrocode}
%
@@ -16303,8 +16356,8 @@
% \begin{macrocode}
\NewDocumentCommand \@@_OverBrace { O { } m m m O { } }
{
- \peek_remove_spaces:n
- { \@@_brace:nnnnn { #2 } { #3 } { #4 } { #1 , #5 } { over } }
+ \@@_brace:nnnnn { #2 } { #3 } { #4 } { #1 , #5 } { over }
+ \ignorespaces
}
% \end{macrocode}
%
@@ -16345,8 +16398,8 @@
% \begin{macrocode}
\@@_compute_i_j:nn { #1 } { #2 }
\bool_lazy_or:nnTF
- { \int_compare_p:nNn \l_@@_last_i_tl > \g_@@_row_total_int }
- { \int_compare_p:nNn \l_@@_last_j_tl > \g_@@_col_total_int }
+ { \int_compare_p:nNn { \l_@@_last_i_tl } > { \g_@@_row_total_int } }
+ { \int_compare_p:nNn { \l_@@_last_j_tl } > { \g_@@_col_total_int } }
{
\str_if_eq:eeTF { #5 } { under }
{ \@@_error:nn { Construct~too~large } { \UnderBrace } }
@@ -16362,7 +16415,7 @@
\bool_if:NT \l_@@_brace_left_shorten_bool
{
\dim_set_eq:NN \l_@@_x_initial_dim \c_max_dim
- \int_step_inline:nnn \l_@@_first_i_tl \l_@@_last_i_tl
+ \int_step_inline:nnn { \l_@@_first_i_tl } { \l_@@_last_i_tl }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \@@_env: - ##1 - \l_@@_first_j_tl }
@@ -16369,7 +16422,7 @@
{
\pgfpointanchor { \@@_env: - ##1 - \l_@@_first_j_tl } { west }
- \dim_compare:nNnT \pgf at x < \l_@@_x_initial_dim
+ \dim_compare:nNnT { \pgf at x } < { \l_@@_x_initial_dim }
{ \dim_set_eq:NN \l_@@_x_initial_dim \pgf at x }
}
}
@@ -16376,7 +16429,7 @@
}
\bool_lazy_or:nnT
{ \bool_not_p:n \l_@@_brace_left_shorten_bool }
- { \dim_compare_p:nNn \l_@@_x_initial_dim = \c_max_dim }
+ { \dim_compare_p:nNn { \l_@@_x_initial_dim } = { \c_max_dim } }
{
\@@_qpoint:n { col - \l_@@_first_j_tl }
\dim_set_eq:NN \l_@@_x_initial_dim \pgf at x
@@ -16384,13 +16437,13 @@
\bool_if:NT \l_@@_brace_right_shorten_bool
{
\dim_set:Nn \l_@@_x_final_dim { - \c_max_dim }
- \int_step_inline:nnn \l_@@_first_i_tl \l_@@_last_i_tl
+ \int_step_inline:nnn { \l_@@_first_i_tl } { \l_@@_last_i_tl }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \@@_env: - ##1 - \l_@@_last_j_tl }
{
\pgfpointanchor { \@@_env: - ##1 - \l_@@_last_j_tl } { east }
- \dim_compare:nNnT \pgf at x > \l_@@_x_final_dim
+ \dim_compare:nNnT { \pgf at x } > { \l_@@_x_final_dim }
{ \dim_set_eq:NN \l_@@_x_final_dim \pgf at x }
}
}
@@ -16397,7 +16450,7 @@
}
\bool_lazy_or:nnT
{ \bool_not_p:n \l_@@_brace_right_shorten_bool }
- { \dim_compare_p:nNn \l_@@_x_final_dim = { - \c_max_dim } }
+ { \dim_compare_p:nNn { \l_@@_x_final_dim } = { - \c_max_dim } }
{
\@@_qpoint:n { col - \int_eval:n { \l_@@_last_j_tl + 1 } }
\dim_set_eq:NN \l_@@_x_final_dim \pgf at x
@@ -16421,8 +16474,8 @@
\pgftransformshift
{
\pgfpoint
- { ( \l_@@_x_initial_dim + \l_@@_x_final_dim) / 2 }
- { \pgf at y + \l_@@_brace_yshift_dim - 3 pt}
+ { ( \l_@@_x_initial_dim + \l_@@_x_final_dim ) / 2 }
+ { \pgf at y + \l_@@_brace_yshift_dim - 3 pt }
}
\pgfnode
{ rectangle }
@@ -16467,7 +16520,7 @@
\pgftransformshift
{
\pgfpoint
- { ( \l_@@_x_initial_dim + \l_@@_x_final_dim) / 2 }
+ { ( \l_@@_x_initial_dim + \l_@@_x_final_dim ) / 2 }
{ \pgf at y - \l_@@_brace_yshift_dim + 3 pt }
}
\pgfnode
@@ -16541,6 +16594,7 @@
\keys_define:nn { nicematrix / Hbrace }
{
color .code:n = ,
+ horizontal-label .code:n = ,
horizontal-labels .code:n = ,
shorten .code:n = ,
shorten-start .code:n = ,
@@ -16556,7 +16610,7 @@
{
\cs_if_exist:cTF { tikz at library@decorations.pathreplacing at loaded }
{ \@@_hbrace:nnn { #1 } { #2 } { #3 } }
- { \@@_error:n { Hbrace~not~allowed } }
+ { \@@_error:nn { Hbrace~not~allowed } { \Hbrace } }
}
% \end{macrocode}
%
@@ -16565,7 +16619,7 @@
% \begin{macrocode}
\cs_new:Npn \@@_hbrace:nnn #1 #2 #3
{
- \int_compare:nNnTF \c at iRow < 1
+ \int_compare:nNnTF { \c at iRow } < { \c_one_int }
{
% \end{macrocode}
% We recall that |\str_if_eq:nnTF| is ``fully expandable''.
@@ -16572,7 +16626,7 @@
% \begin{macrocode}
\str_if_eq:nnTF { #2 } { * }
{
- \NiceMatrixOptions{nullify-dots}
+ \NiceMatrixOptions { nullify-dots }
\Ldots
[
line-style = nicematrix / brace ,
@@ -16595,7 +16649,7 @@
{
\str_if_eq:nnTF { #2 } { * }
{
- \NiceMatrixOptions{nullify-dots}
+ \NiceMatrixOptions { nullify-dots }
\Ldots
[
line-style = nicematrix / mirrored-brace ,
@@ -16626,7 +16680,7 @@
{
\cs_if_exist:cTF { tikz at library@decorations.pathreplacing at loaded }
{ \@@_vbrace:nnn { #1 } { #2 } { #3 } }
- { \@@_error:n { Vbrace~not~allowed } }
+ { \@@_error:nn { Hbrace~not~allowed } { \Vbrace } }
}
% \end{macrocode}
%
@@ -16635,11 +16689,11 @@
% \begin{macrocode}
\cs_new:Npn \@@_vbrace:nnn #1 #2 #3
{
- \int_compare:nNnTF \c at jCol = 0
+ \int_if_zero:nTF { \c at jCol }
{
\str_if_eq:nnTF { #2 } { * }
{
- \NiceMatrixOptions{nullify-dots}
+ \NiceMatrixOptions { nullify-dots }
\Vdots
[
line-style = nicematrix / mirrored-brace ,
@@ -16662,7 +16716,7 @@
{
\str_if_eq:nnTF { #2 } { * }
{
- \NiceMatrixOptions{nullify-dots}
+ \NiceMatrixOptions { nullify-dots }
\Vdots
[
line-style = nicematrix / brace ,
@@ -16697,15 +16751,15 @@
{
not-empty .code:n =
\bool_lazy_or:nnTF
- \l_@@_in_code_after_bool
- \g_@@_recreate_cell_nodes_bool
+ { \l_@@_in_code_after_bool }
+ { \g_@@_create_cell_nodes_bool }
{ \bool_set_true:N \l_@@_not_empty_bool }
{ \@@_error:n { detection~of~empty~cells } } ,
not-empty .value_forbidden:n = true ,
empty .code:n =
\bool_lazy_or:nnTF
- \l_@@_in_code_after_bool
- \g_@@_recreate_cell_nodes_bool
+ { \l_@@_in_code_after_bool }
+ { \g_@@_create_cell_nodes_bool }
{ \bool_set_true:N \l_@@_empty_bool }
{ \@@_error:n { detection~of~empty~cells } } ,
empty .value_forbidden:n = true ,
@@ -16732,24 +16786,24 @@
{ \@@_error:n { TikzEveryCell~without~tikz } }
}
-\tl_new:N \@@_i_tl
-\tl_new:N \@@_j_tl
+\tl_new:N \l_@@_i_tl
+\tl_new:N \l_@@_j_tl
\cs_new_protected:Nn \@@_all_the_cells:
{
- \int_step_variable:nNn \c at iRow \@@_i_tl
+ \int_step_inline:nn \c at iRow
{
- \int_step_variable:nNn \c at jCol \@@_j_tl
+ \int_step_inline:nn \c at jCol
{
- \cs_if_exist:cF { cell - \@@_i_tl - \@@_j_tl }
+ \cs_if_exist:cF { cell - ##1 - ####1 }
{
\clist_if_in:NeF \l_@@_corners_cells_clist
- { \@@_i_tl - \@@_j_tl }
+ { ##1 - ####1 }
{
\bool_set_false:N \l_tmpa_bool
\cs_if_exist:cTF
- { pgf @ sh @ ns @ \@@_env: - \@@_i_tl - \@@_j_tl }
+ { pgf @ sh @ ns @ \@@_env: - ##1 - ####1 }
{
\bool_if:NF \l_@@_empty_bool
{ \bool_set_true:N \l_tmpa_bool }
@@ -16761,7 +16815,7 @@
\bool_if:NT \l_tmpa_bool
{
\@@_block_tikz:onnnn
- \l_tmpa_tl \@@_i_tl \@@_j_tl \@@_i_tl \@@_j_tl
+ \l_tmpa_tl { ##1 } { ####1 } { ##1 } { ####1 }
}
}
}
@@ -16805,7 +16859,7 @@
{ \@@_qpoint:n { 1 } }
{
\@@_qpoint:n
- { \int_eval:n { \int_max:nn \c at iRow \c at jCol + 1 } }
+ { \int_eval:n { \int_max:nn { \c at iRow } { \c at jCol } + 1 } }
}
\pgfsetfillopacity { 0.75 }
\pgfsetfillcolor { white }
@@ -16815,7 +16869,7 @@
\dim_gzero_new:N \g_@@_tmpc_dim
\dim_gzero_new:N \g_@@_tmpd_dim
\dim_gzero_new:N \g_@@_tmpe_dim
- \int_step_inline:nn \c at iRow
+ \int_step_inline:nn { \c at iRow }
{
\bool_if:NTF \l_@@_in_code_after_bool
{
@@ -16832,7 +16886,7 @@
\bool_if:NTF \l_@@_in_code_after_bool
{ \endpgfpicture }
{ \end { pgfpicture } }
- \int_step_inline:nn \c at jCol
+ \int_step_inline:nn { \c at jCol }
{
\hbox_set:Nn \l_tmpa_box
{
@@ -16922,7 +16976,7 @@
% \begin{macrocode}
\msg_new:nnnn { nicematrix } { Unknown~key~for~package }
{
- You~have~used~the~key~'\l_keys_key_str'~when~loading~nicematrix~
+ You~have~used~the~key~' \l_keys_key_str '~when~loading~nicematrix~
but~that~key~is~unknown. \\
It~will~be~ignored. \\
For~a~list~of~the~available~keys,~type~H~<return>.
@@ -17046,11 +17100,11 @@
% \section{Error messages of the package}
%
% \begin{macrocode}
-\bool_if:NTF \g_@@_messages_for_Overleaf_bool
- { \str_const:Nn \c_@@_available_keys_str { } }
+\str_const:Ne \c_@@_available_keys_str
{
- \str_const:Nn \c_@@_available_keys_str
+ \bool_if:nTF { ! \g_@@_messages_for_Overleaf_bool }
{ For~a~list~of~the~available~keys,~type~H~<return>. }
+ { }
}
% \end{macrocode}
%
@@ -17076,9 +17130,9 @@
{
\seq_if_in:NoF \g_@@_types_of_matrix_seq \g_@@_name_env_str
{ \@@_fatal:nn { too~much~cols~for~array } }
- \int_compare:nNnT \l_@@_last_col_int = { -2 }
+ \int_compare:nNnT { \l_@@_last_col_int } = { -2 }
{ \@@_fatal:n { too~much~cols~for~matrix } }
- \int_compare:nNnT \l_@@_last_col_int = { -1 }
+ \int_compare:nNnT { \l_@@_last_col_int } = { -1 }
{ \@@_fatal:n { too~much~cols~for~matrix } }
\bool_if:NF \l_@@_last_col_without_value_bool
{ \@@_fatal:n { too~much~cols~for~matrix~with~last~col } }
@@ -17091,7 +17145,7 @@
\cs_new:Npn \@@_message_hdotsfor:
{
\tl_if_empty:oF \g_@@_HVdotsfor_lines_tl
- { ~Maybe~your~use~of~\token_to_str:N \Hdotsfor\ is~incorrect.}
+ { ~Maybe~your~use~of~ \token_to_str:N \Hdotsfor \ is~incorrect. }
}
% \end{macrocode}
%
@@ -17099,7 +17153,7 @@
\@@_msg_new:nn { hvlines,~rounded-corners~and~corners }
{
Incompatible~options.\\
- You~should~not~use~'hvlines',~'rounded-corners'~and~'corners'~at~this~time.\\
+ You~should~not~use~'hvlines',~'rounded-corners'~and~'corners'~at~the~same~time.\\
The~output~will~not~be~reliable.
}
% \end{macrocode}
@@ -17116,12 +17170,10 @@
% \end{macrocode}
%
% \begin{macrocode}
-\@@_msg_new:nn { negative~weight }
+\@@_msg_new:nn { invalid~weight }
{
- Negative~weight.\\
- The~weight~of~the~'X'~columns~must~be~positive~and~you~have~used~
- the~value~'\int_use:N \l_@@_weight_int'.\\
- The~absolute~value~will~be~used.
+ Unknown~key.\\
+ The~key~' \l_keys_key_str '~of~your~column~X~is~unknown~and~will~be~ignored.
}
% \end{macrocode}
%
@@ -17130,7 +17182,8 @@
{
Column~not~used.\\
The~key~'last-col'~is~in~force~but~you~have~not~used~that~last~column~
- in~your~\@@_full_name_env:.~However,~you~can~go~on.
+ in~your~\@@_full_name_env: .~
+ However,~you~can~go~on.
}
% \end{macrocode}
%
@@ -17138,10 +17191,11 @@
\@@_msg_new:nn { too~much~cols~for~matrix~with~last~col }
{
Too~much~columns.\\
- In~the~row~\int_eval:n { \c at iRow },~
+ In~the~row~ \int_eval:n { \c at iRow },~
you~try~to~use~more~columns~
- than~allowed~by~your~\@@_full_name_env:.\@@_message_hdotsfor:\
- The~maximal~number~of~columns~is~\int_eval:n { \l_@@_last_col_int - 1 }~
+ than~allowed~by~your~ \@@_full_name_env: .
+ \@@_message_hdotsfor: \
+ The~maximal~number~of~columns~is~ \int_eval:n { \l_@@_last_col_int - 1 }~
(plus~the~exterior~columns).~This~error~is~fatal.
}
% \end{macrocode}
@@ -17151,13 +17205,14 @@
\@@_msg_new:nn { too~much~cols~for~matrix }
{
Too~much~columns.\\
- In~the~row~\int_eval:n { \c at iRow },~
- you~try~to~use~more~columns~than~allowed~by~your~
- \@@_full_name_env:.\@@_message_hdotsfor:\ Recall~that~the~maximal~
- number~of~columns~for~a~matrix~(excepted~the~potential~exterior~
- columns)~is~fixed~by~the~LaTeX~counter~'MaxMatrixCols'.~
- Its~current~value~is~\int_use:N \c at MaxMatrixCols\ (use~
- \token_to_str:N \setcounter\ to~change~that~value).~
+ In~the~row~ \int_eval:n { \c at iRow } ,~
+ you~try~to~use~more~columns~than~allowed~by~your~ \@@_full_name_env: .
+ \@@_message_hdotsfor: \
+ Recall~that~the~maximal~number~of~columns~for~a~matrix~
+ (excepted~the~potential~exterior~columns)~is~fixed~by~the~
+ LaTeX~counter~'MaxMatrixCols'.~
+ Its~current~value~is~ \int_use:N \c at MaxMatrixCols \
+ (use~ \token_to_str:N \setcounter \ to~change~that~value).~
This~error~is~fatal.
}
% \end{macrocode}
@@ -17167,14 +17222,14 @@
\@@_msg_new:nn { too~much~cols~for~array }
{
Too~much~columns.\\
- In~the~row~\int_eval:n { \c at iRow },~
+ In~the~row~ \int_eval:n { \c at iRow } ,~
~you~try~to~use~more~columns~than~allowed~by~your~
- \@@_full_name_env:.\@@_message_hdotsfor:\ The~maximal~number~of~columns~is~
- \int_use:N \g_@@_static_num_of_col_int\
+ \@@_full_name_env: . \@@_message_hdotsfor: \ The~maximal~number~of~columns~is~
+ \int_use:N \g_@@_static_num_of_col_int \
\bool_if:nT
- { \int_compare_p:nNn \l_@@_first_col_int = 0 || \g_@@_last_col_found_bool }
+ { \int_compare_p:n { \l_@@_first_col_int = 0 } || \g_@@_last_col_found_bool }
{ ~(plus~the~exterior~ones) }
- since~the~preamble~is~'\g_@@_user_preamble_tl'.\\
+ since~the~preamble~is~' \g_@@_user_preamble_tl '.\\
This~error~is~fatal.
}
% \end{macrocode}
@@ -17184,9 +17239,9 @@
\@@_msg_new:nn { columns~not~used }
{
Columns~not~used.\\
- The~preamble~of~your~\@@_full_name_env:\ is~'\g_@@_user_preamble_tl'.~
- It~announces~\int_use:N
- \g_@@_static_num_of_col_int\ columns~but~you~only~used~\int_use:N \c at jCol.\\
+ The~preamble~of~your~ \@@_full_name_env: \ is~' \g_@@_user_preamble_tl '.~
+ It~announces~ \int_use:N \g_@@_static_num_of_col_int \
+ columns~but~you~only~used~ \int_use:N \c at jCol .\\
The~columns~you~did~not~used~won't~be~created.\\
You~won't~have~similar~warning~till~the~end~of~the~document.
}
@@ -17196,7 +17251,7 @@
\@@_msg_new:nn { empty~preamble }
{
Empty~preamble.\\
- The~preamble~of~your~\@@_full_name_env:\ is~empty.\\
+ The~preamble~of~your~ \@@_full_name_env: \ is~empty.\\
This~error~is~fatal.
}
% \end{macrocode}
@@ -17261,7 +17316,7 @@
{
Key~caption~forbidden.\\
You~can't~use~the~key~'caption'~because~you~are~not~in~a~floating~
- environment.~This~key~will~be~ignored.
+ environment~(such~as~\{table\}).~This~key~will~be~ignored.
}
% \end{macrocode}
%
@@ -17325,7 +17380,7 @@
{
Identical~tabular~notes.\\
You~can't~put~several~notes~with~the~same~content~in~
- \token_to_str:N \caption\ (but~you~can~in~the~main~tabular).\\
+ \token_to_str:N \caption \ (but~you~can~in~the~main~tabular).\\
If~you~go~on,~the~output~will~probably~be~erroneous.
}
% \end{macrocode}
@@ -17333,12 +17388,12 @@
% \begin{macrocode}
\@@_msg_new:nn { tabularnote~below~the~tabular }
{
- \token_to_str:N \tabularnote\ forbidden\\
- You~can't~use~\token_to_str:N \tabularnote\ in~the~caption~
+ \token_to_str:N \tabularnote \ forbidden\\
+ You~can't~use~ \token_to_str:N \tabularnote \ in~the~caption~
of~your~tabular~because~the~caption~will~be~composed~below~
the~tabular.~If~you~want~the~caption~above~the~tabular~use~the~
- key~'caption-above'~in~\token_to_str:N \NiceMatrixOptions.\\
- Your~\token_to_str:N \tabularnote\ will~be~discarded~and~
+ key~'caption-above'~in~ \token_to_str:N \NiceMatrixOptions .\\
+ Your~ \token_to_str:N \tabularnote \ will~be~discarded~and~
no~similar~error~will~raised~in~this~document.
}
% \end{macrocode}
@@ -17348,7 +17403,7 @@
{
Unknown~key.\\
There~is~only~two~keys~available~here:~width~and~color.\\
- Your~key~'\l_keys_key_str'~will~be~ignored.
+ Your~key~' \l_keys_key_str '~will~be~ignored.
}
% \end{macrocode}
%
@@ -17356,10 +17411,10 @@
\@@_msg_new:nn { Unknown~key~for~Hbrace }
{
Unknown~key.\\
- You~have~used~the~key~'\l_keys_key_str'~but~the~only~
- keys~allowed~for~the~commands~\token_to_str:N \Hbrace\
- and~\token_to_str:N \Vbrace\ are:~'color',~
- 'horizontal-labels',~'shorten'~'shorten-end'~
+ You~have~used~the~key~' \l_keys_key_str '~but~the~only~
+ keys~allowed~for~the~commands~ \token_to_str:N \Hbrace \
+ and~ \token_to_str:N \Vbrace \ are:~'color',~
+ 'horizontal-label(s)',~'shorten'~'shorten-end'~
and~'shorten-start'.
}
% \end{macrocode}
@@ -17370,7 +17425,7 @@
Unknown~key.\\
There~is~only~two~keys~available~here:~
'empty'~and~'not-empty'.\\
- Your~key~'\l_keys_key_str'~will~be~ignored.
+ Your~key~' \l_keys_key_str '~will~be~ignored.
}
% \end{macrocode}
%
@@ -17379,7 +17434,7 @@
{
Unknown~key.\\
The~only~key~available~here~is~'c'.\\
- Your~key~'\l_keys_key_str'~will~be~ignored.
+ Your~key~' \l_keys_key_str '~will~be~ignored.
}
% \end{macrocode}
%
@@ -17387,7 +17442,7 @@
\@@_msg_new:nnn { Unknown~key~for~custom-line }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~in~a~'custom-line'.~
+ The~key~' \l_keys_key_str '~is~unknown~in~a~'custom-line'.~
It~you~go~on,~you~will~probably~have~other~errors. \\
\c_@@_available_keys_str
}
@@ -17408,13 +17463,13 @@
\@@_msg_new:nnn { Unknown~key~for~xdots }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~a~command~for~drawing~dotted~rules.\\
+ The~key~' \l_keys_key_str '~is~unknown~for~a~command~for~drawing~dotted~rules.\\
\c_@@_available_keys_str
}
{
The~available~keys~are~(in~alphabetic~order):~
'color',~
- 'horizontal-labels',~
+ 'horizontal(s)-labels',~
'inter',~
'line-style',~
'radius',~
@@ -17429,7 +17484,7 @@
{
Unknown~key.\\
As~for~now,~there~is~only~two~keys~available~here:~'cols'~and~'respect-blocks'~
- (and~you~try~to~use~'\l_keys_key_str')\\
+ (and~you~try~to~use~' \l_keys_key_str ')\\
That~key~will~be~ignored.
}
% \end{macrocode}
@@ -17437,7 +17492,7 @@
% \begin{macrocode}
\@@_msg_new:nn { label~without~caption }
{
- You~can't~use~the~key~'label'~in~your~'{NiceTabular}'~because~
+ You~can't~use~the~key~'label'~in~your~\{NiceTabular\}~because~
you~have~not~used~the~key~'caption'.~The~key~'label'~will~be~ignored.
}
% \end{macrocode}
@@ -17446,8 +17501,8 @@
% \begin{macrocode}
\@@_msg_new:nn { W~warning }
{
- Line~\msg_line_number:.~The~cell~is~too~wide~for~your~column~'W'~
- (row~\int_use:N \c at iRow).
+ Line~ \msg_line_number: .~The~cell~is~too~wide~for~your~column~'W'~
+ (row~ \int_use:N \c at iRow ).
}
% \end{macrocode}
%
@@ -17455,7 +17510,7 @@
\@@_msg_new:nn { Construct~too~large }
{
Construct~too~large.\\
- Your~command~\token_to_str:N #1
+ Your~command~ \token_to_str:N #1
can't~be~drawn~because~your~matrix~is~too~small.\\
That~command~will~be~ignored.
}
@@ -17467,7 +17522,8 @@
Problem~with~'underscore'.\\
The~package~'underscore'~should~be~loaded~before~'nicematrix'.~
You~can~go~on~but~you~won't~be~able~to~write~something~such~as:\\
- '\token_to_str:N \Cdots\token_to_str:N _{n~\token_to_str:N \text{~times}}'.
+ ' \token_to_str:N \Cdots \token_to_str:N _
+ \{ n \token_to_str:N \text \{ ~times \} \}'.
}
% \end{macrocode}
%
@@ -17476,7 +17532,7 @@
\@@_msg_new:nn { ampersand~in~light-syntax }
{
Ampersand~forbidden.\\
- You~can't~use~an~ampersand~(\token_to_str:N &)~to~separate~columns~because~
+ You~can't~use~an~ampersand~( \token_to_str:N &)~to~separate~columns~because~
~the~key~'light-syntax'~is~in~force.~This~error~is~fatal.
}
% \end{macrocode}
@@ -17485,9 +17541,9 @@
\@@_msg_new:nn { double-backslash~in~light-syntax }
{
Double~backslash~forbidden.\\
- You~can't~use~\token_to_str:N
- \\~to~separate~rows~because~the~key~'light-syntax'~
- is~in~force.~You~must~use~the~character~'\l_@@_end_of_row_tl'~
+ You~can't~use~ \token_to_str:N \\
+ ~to~separate~rows~because~the~key~'light-syntax'~
+ is~in~force.~You~must~use~the~character~' \l_@@_end_of_row_tl '~
(set~by~the~key~'end-of-row').~This~error~is~fatal.
}
% \end{macrocode}
@@ -17497,8 +17553,8 @@
{
Incompatible~keys.\\
You~can't~use~the~keys~'hlines',~'vlines'~or~'hvlines'~for~a~
- '\token_to_str:N \Block'~when~the~key~'color'~or~'draw'~is~used.\\
- However,~you~can~put~several~commands~\token_to_str:N \Block.\\
+ \token_to_str:N \Block \ when~the~key~'color'~or~'draw'~is~used.\\
+ However,~you~can~put~several~commands~ \token_to_str:N \Block.\\
Your~key~will~be~discarded.
}
% \end{macrocode}
@@ -17507,9 +17563,9 @@
\@@_msg_new:nn { bad~value~for~baseline }
{
Bad~value~for~baseline.\\
- The~value~given~to~'baseline'~(\int_use:N \l_tmpa_int)~is~not~
+ The~value~given~to~'baseline'~( \int_use:N \l_tmpa_int )~is~not~
valid.~The~value~must~be~between~\int_use:N \l_@@_first_row_int\ and~
- \int_use:N \g_@@_row_total_int\ or~equal~to~'t',~'c'~or~'b'~or~of~
+ \int_use:N \g_@@_row_total_int \ or~equal~to~'t',~'c'~or~'b'~or~of~
the~form~'line-i'.\\
A~value~of~1~will~be~used.
}
@@ -17520,8 +17576,8 @@
{
Problem~with~'not-empty'\\
For~technical~reasons,~you~must~activate~
- 'create-cell-nodes'~in~\token_to_str:N \CodeBefore\
- in~order~to~use~the~key~'\l_keys_key_str'.\\
+ 'create-cell-nodes'~in~ \token_to_str:N \CodeBefore \
+ in~order~to~use~the~key~' \l_keys_key_str '.\\
That~key~will~be~ignored.
}
% \end{macrocode}
@@ -17539,8 +17595,8 @@
\@@_msg_new:nn { Invalid~name }
{
Invalid~name.\\
- You~can't~give~the~name~'\l_keys_value_tl'~to~a~\token_to_str:N
- \SubMatrix\ of~your~\@@_full_name_env:.\\
+ You~can't~give~the~name~' \l_keys_value_tl '~to~a~ \token_to_str:N
+ \SubMatrix \ of~your~ \@@_full_name_env: .\\
A~name~must~be~accepted~by~the~regular~expression~[A-Za-z][A-Za-z0-9]*.\\
This~key~will~be~ignored.
}
@@ -17550,11 +17606,12 @@
\@@_msg_new:nn { Hbrace~not~allowed }
{
Command~not~allowed.\\
- You~can't~use~the~command~\token_to_str:N \Hbrace\
- because~you~have~not~loaded~TikZ~
- and~the~TikZ~library~'decorations.pathreplacing'.\\
- Use:~\token_to_str:N \usepackage\{tikz\}~
- \token_to_str:N \usetikzlibrary \{ decorations.pathreplacing \} \\
+ You~can't~use~the~command~ \token_to_str:N #1
+ because~you~have~not~loaded~
+ \IfPackageLoadedTF { tikz }
+ { the~TikZ~library~'decorations.pathreplacing'.~Use~ }
+ { TikZ.~ Use:~ \token_to_str:N \usepackage \{tikz\}~and~ }
+ \token_to_str:N \usetikzlibrary \{decorations.pathreplacing\}. \\
That~command~will~be~ignored.
}
% \end{macrocode}
@@ -17563,11 +17620,11 @@
\@@_msg_new:nn { Vbrace~not~allowed }
{
Command~not~allowed.\\
- You~can't~use~the~command~\token_to_str:N \Vbrace\
+ You~can't~use~the~command~ \token_to_str:N \Vbrace \
because~you~have~not~loaded~TikZ~
and~the~TikZ~library~'decorations.pathreplacing'.\\
- Use:~\token_to_str:N \usepackage\{tikz\}~
- \token_to_str:N \usetikzlibrary \{ decorations.pathreplacing \} \\
+ Use: ~\token_to_str:N \usepackage \{tikz\}~
+ \token_to_str:N \usetikzlibrary \{decorations.pathreplacing\} \\
That~command~will~be~ignored.
}
% \end{macrocode}
@@ -17577,7 +17634,7 @@
{
Wrong~line.\\
You~try~to~draw~a~#1~line~of~number~'#2'~in~a~
- \token_to_str:N \SubMatrix\ of~your~\@@_full_name_env:\ but~that~
+ \token_to_str:N \SubMatrix \ of~your~ \@@_full_name_env: \ but~that~
number~is~not~valid.~It~will~be~ignored.
}
% \end{macrocode}
@@ -17587,11 +17644,11 @@
{
Impossible~delimiter.\\
It's~impossible~to~draw~the~#1~delimiter~of~your~
- \token_to_str:N \SubMatrix\ because~all~the~cells~are~empty~
+ \token_to_str:N \SubMatrix \ because~all~the~cells~are~empty~
in~that~column.
\bool_if:NT \l_@@_submatrix_slim_bool
{ ~Maybe~you~should~try~without~the~key~'slim'. } \\
- This~\token_to_str:N \SubMatrix\ will~be~ignored.
+ This~ \token_to_str:N \SubMatrix \ will~be~ignored.
}
% \end{macrocode}
%
@@ -17599,7 +17656,7 @@
\@@_msg_new:nnn { width~without~X~columns }
{
You~have~used~the~key~'width'~but~you~have~put~no~'X'~column~in~
- the~preamble~('\g_@@_user_preamble_tl')~of~your~\@@_full_name_env:.\\
+ the~preamble~(' \g_@@_user_preamble_tl ')~of~your~ \@@_full_name_env: .\\
That~key~will~be~ignored.
}
{
@@ -17606,7 +17663,7 @@
This~message~is~the~message~'width~without~X~columns'~
of~the~module~'nicematrix'.~
The~experimented~users~can~disable~that~message~with~
- \token_to_str:N \msg_redirect_name:nnn.\\
+ \token_to_str:N \msg_redirect_name:nnn .\\
}
% \end{macrocode}
@@ -17625,7 +17682,7 @@
\@@_msg_new:nn { empty~environment }
{
Empty~environment.\\
- Your~\@@_full_name_env:\ is~empty.~This~error~is~fatal.
+ Your~ \@@_full_name_env: \ is~empty.~This~error~is~fatal.
}
% \end{macrocode}
%
@@ -17656,7 +17713,7 @@
{
Wrong~name.\\
You~must~use~only~one~letter~as~value~for~the~key~'letter'~(and~you~
- have~used~'\l_@@_letter_str').\\
+ have~used~' \l_@@_letter_str ').\\
It~will~be~ignored.
}
% \end{macrocode}
@@ -17665,7 +17722,8 @@
\@@_msg_new:nn { Delimiter~with~small }
{
Delimiter~forbidden.\\
- You~can't~put~a~delimiter~in~the~preamble~of~your~\@@_full_name_env:\
+ You~can't~put~a~delimiter~in~the~preamble~of~your~
+ \@@_full_name_env: \
because~the~key~'small'~is~in~force.\\
This~error~is~fatal.
}
@@ -17675,10 +17733,10 @@
\@@_msg_new:nn { unknown~cell~for~line~in~CodeAfter }
{
Unknown~cell.\\
- Your~command~\token_to_str:N\line\{#1\}\{#2\}~in~
- the~\token_to_str:N \CodeAfter\ of~your~\@@_full_name_env:\
+ Your~command~ \token_to_str:N \line \{ #1 \} \{ #2 \}~in~
+ the~ \token_to_str:N \CodeAfter \ of~your~ \@@_full_name_env: \
can't~be~executed~because~a~cell~doesn't~exist.\\
- This~command~\token_to_str:N \line\ will~be~ignored.
+ This~command~ \token_to_str:N \line \ will~be~ignored.
}
% \end{macrocode}
%
@@ -17687,15 +17745,15 @@
\@@_msg_new:nnn { Duplicate~name~for~SubMatrix }
{
Duplicate~name.\\
- The~name~'#1'~is~already~used~for~a~\token_to_str:N \SubMatrix\
- in~this~\@@_full_name_env:.\\
+ The~name~'#1'~is~already~used~for~a~ \token_to_str:N \SubMatrix \
+ in~this~ \@@_full_name_env: .\\
This~key~will~be~ignored.\\
\bool_if:NF \g_@@_messages_for_Overleaf_bool
{ For~a~list~of~the~names~already~used,~type~H~<return>. }
}
{
- The~names~already~defined~in~this~\@@_full_name_env:\ are:~
- \seq_use:Nnnn \g_@@_submatrix_names_seq { ~and~ } { ,~ } { ~and~ }.
+ The~names~already~defined~in~this~ \@@_full_name_env: \ are:~
+ \seq_use:Nnnn \g_@@_submatrix_names_seq { ~and~ } { ,~ } { ~and~ } .
}
% \end{macrocode}
%
@@ -17703,9 +17761,9 @@
\@@_msg_new:nn { r~or~l~with~preamble }
{
Erroneous~use.\\
- You~can't~use~the~key~'\l_keys_key_str'~in~your~\@@_full_name_env:.~
+ You~can't~use~the~key~' \l_keys_key_str '~in~your~ \@@_full_name_env: .~
You~must~specify~the~alignment~of~your~columns~with~the~preamble~of~
- your~\@@_full_name_env:.\\
+ your~ \@@_full_name_env: .\\
This~key~will~be~ignored.
}
% \end{macrocode}
@@ -17714,7 +17772,7 @@
\@@_msg_new:nn { Hdotsfor~in~col~0 }
{
Erroneous~use.\\
- You~can't~use~\token_to_str:N \Hdotsfor\ in~an~exterior~column~of~
+ You~can't~use~ \token_to_str:N \Hdotsfor \ in~an~exterior~column~of~
the~array.~This~error~is~fatal.
}
% \end{macrocode}
@@ -17733,12 +17791,12 @@
\@@_msg_new:nn { bad~border }
{
Bad~border.\\
- \l_keys_key_str\space~is~an~incorrect~specification~for~a~border~
- (in~the~key~'borders'~of~the~command~\token_to_str:N \Block).~
+ \l_keys_key_str \space ~is~an~incorrect~specification~for~a~border~
+ (in~the~key~'borders'~of~the~command~ \token_to_str:N \Block ).~
The~available~values~are:~left,~right,~top~and~bottom~(and~you~can~
also~use~the~key~'tikz'
\IfPackageLoadedF { tikz }
- {~if~you~load~the~LaTeX~package~'tikz'}).\\
+ { ~if~you~load~the~LaTeX~package~'tikz' } ).\\
This~specification~of~border~will~be~ignored.
}
% \end{macrocode}
@@ -17747,7 +17805,7 @@
\@@_msg_new:nn { TikzEveryCell~without~tikz }
{
TikZ~not~loaded.\\
- You~can't~use~\token_to_str:N \TikzEveryCell\
+ You~can't~use~ \token_to_str:N \TikzEveryCell \
because~you~have~not~loaded~tikz.~
This~command~will~be~ignored.
}
@@ -17757,8 +17815,8 @@
\@@_msg_new:nn { tikz~key~without~tikz }
{
TikZ~not~loaded.\\
- You~can't~use~the~key~'tikz'~for~the~command~'\token_to_str:N
- \Block'~because~you~have~not~loaded~tikz.~
+ You~can't~use~the~key~'tikz'~for~the~command~' \token_to_str:N
+ \Block '~because~you~have~not~loaded~tikz.~
This~key~will~be~ignored.
}
% \end{macrocode}
@@ -17767,10 +17825,10 @@
\@@_msg_new:nn { last-col~non~empty~for~NiceArray }
{
Erroneous~use.\\
- In~the~\@@_full_name_env:,~you~must~use~the~key~
+ In~the~ \@@_full_name_env: ,~you~must~use~the~key~
'last-col'~without~value.\\
However,~you~can~go~on~for~this~time~
- (the~value~'\l_keys_value_tl'~will~be~ignored).
+ (the~value~' \l_keys_value_tl '~will~be~ignored).
}
% \end{macrocode}
%
@@ -17778,11 +17836,11 @@
% \begin{macrocode}
\@@_msg_new:nn { last-col~non~empty~for~NiceMatrixOptions }
{
- Erroneous~use.\\
- In~\token_to_str:N \NiceMatrixOptions,~you~must~use~the~key~
- 'last-col'~without~value.\\
+ Erroneous~use. \\
+ In~\token_to_str:N \NiceMatrixOptions ,~you~must~use~the~key~
+ 'last-col'~without~value. \\
However,~you~can~go~on~for~this~time~
- (the~value~'\l_keys_value_tl'~will~be~ignored).
+ (the~value~' \l_keys_value_tl '~will~be~ignored).
}
% \end{macrocode}
%
@@ -17790,7 +17848,7 @@
% \begin{macrocode}
\@@_msg_new:nn { Block~too~large~1 }
{
- Block~too~large.\\
+ Block~too~large. \\
You~try~to~draw~a~block~in~the~cell~#1-#2~of~your~matrix~but~the~matrix~is~
too~small~for~that~block. \\
This~block~and~maybe~others~will~be~ignored.
@@ -17800,12 +17858,12 @@
% \begin{macrocode}
\@@_msg_new:nn { Block~too~large~2 }
{
- Block~too~large.\\
- The~preamble~of~your~\@@_full_name_env:\ announces~\int_use:N
- \g_@@_static_num_of_col_int\
- columns~but~you~use~only~\int_use:N \c at jCol\ and~that's~why~a~block~
+ Block~too~large. \\
+ The~preamble~of~your~ \@@_full_name_env: \ announces~ \int_use:N
+ \g_@@_static_num_of_col_int \
+ columns~but~you~use~only~ \int_use:N \c at jCol \ and~that's~why~a~block~
specified~in~the~cell~#1-#2~can't~be~drawn.~You~should~add~some~ampersands~
- (&)~at~the~end~of~the~first~row~of~your~\@@_full_name_env:.\\
+ (&)~at~the~end~of~the~first~row~of~your~ \@@_full_name_env: . \\
This~block~and~maybe~others~will~be~ignored.
}
% \end{macrocode}
@@ -17814,8 +17872,8 @@
% \begin{macrocode}
\@@_msg_new:nn { unknown~column~type }
{
- Bad~column~type.\\
- The~column~type~'#1'~in~your~\@@_full_name_env:\
+ Bad~column~type. \\
+ The~column~type~'#1'~in~your~ \@@_full_name_env: \
is~unknown. \\
This~error~is~fatal.
}
@@ -17824,8 +17882,8 @@
% \begin{macrocode}
\@@_msg_new:nn { unknown~column~type~S }
{
- Bad~column~type.\\
- The~column~type~'S'~in~your~\@@_full_name_env:\ is~unknown. \\
+ Bad~column~type. \\
+ The~column~type~'S'~in~your~ \@@_full_name_env: \ is~unknown. \\
If~you~want~to~use~the~column~type~'S'~of~siunitx,~you~should~
load~that~package. \\
This~error~is~fatal.
@@ -17835,12 +17893,12 @@
% \begin{macrocode}
\@@_msg_new:nn { tabularnote~forbidden }
{
- Forbidden~command.\\
- You~can't~use~the~command~\token_to_str:N\tabularnote\
+ Forbidden~command. \\
+ You~can't~use~the~command~ \token_to_str:N \tabularnote \
~here.~This~command~is~available~only~in~
\{NiceTabular\},~\{NiceTabular*\}~and~\{NiceTabularX\}~or~in~
- the~argument~of~a~command~\token_to_str:N \caption\ included~
- in~an~environment~{table}. \\
+ the~argument~of~a~command~\token_to_str:N \caption \ included~
+ in~an~environment~\{table\}. \\
This~command~will~be~ignored.
}
% \end{macrocode}
@@ -17849,7 +17907,7 @@
\@@_msg_new:nn { borders~forbidden }
{
Forbidden~key.\\
- You~can't~use~the~key~'borders'~of~the~command~\token_to_str:N \Block\
+ You~can't~use~the~key~'borders'~of~the~command~ \token_to_str:N \Block \
because~the~option~'rounded-corners'~
is~in~force~with~a~non-zero~value.\\
This~key~will~be~ignored.
@@ -17869,10 +17927,10 @@
% \begin{macrocode}
\@@_msg_new:nn { enumitem~not~loaded }
{
- enumitem~not~loaded.\\
- You~can't~use~the~command~\token_to_str:N\tabularnote\
- ~because~you~haven't~loaded~'enumitem'.\\
- All~the~commands~\token_to_str:N\tabularnote\ will~be~
+ enumitem~not~loaded. \\
+ You~can't~use~the~command~ \token_to_str:N \tabularnote \
+ ~because~you~haven't~loaded~'enumitem'. \\
+ All~the~commands~ \token_to_str:N \tabularnote \ will~be~
ignored~in~the~document.
}
% \end{macrocode}
@@ -17880,7 +17938,7 @@
% \begin{macrocode}
\@@_msg_new:nn { tikz~without~tikz }
{
- Tikz~not~loaded.\\
+ Tikz~not~loaded. \\
You~can't~use~the~key~'tikz'~here~because~Tikz~is~not~
loaded.~If~you~go~on,~that~key~will~be~ignored.
}
@@ -17889,7 +17947,7 @@
% \begin{macrocode}
\@@_msg_new:nn { tikz~in~custom-line~without~tikz }
{
- Tikz~not~loaded.\\
+ Tikz~not~loaded. \\
You~have~used~the~key~'tikz'~in~the~definition~of~a~
customized~line~(with~'custom-line')~but~tikz~is~not~loaded.~
You~can~go~on~but~you~will~have~another~error~if~you~actually~
@@ -17900,9 +17958,9 @@
% \begin{macrocode}
\@@_msg_new:nn { tikz~in~borders~without~tikz }
{
- Tikz~not~loaded.\\
+ Tikz~not~loaded. \\
You~have~used~the~key~'tikz'~in~a~key~'borders'~(of~a~
- command~'\token_to_str:N\Block')~but~tikz~is~not~loaded.~
+ command~' \token_to_str:N \Block ')~but~tikz~is~not~loaded.~
That~key~will~be~ignored.
}
% \end{macrocode}
@@ -17921,9 +17979,9 @@
\@@_msg_new:nn { Wrong~last~row }
{
Wrong~number.\\
- You~have~used~'last-row=\int_use:N \l_@@_last_row_int'~but~your~
- \@@_full_name_env:\ seems~to~have~\int_use:N \c at iRow \ rows.~
- If~you~go~on,~the~value~of~\int_use:N \c at iRow \ will~be~used~for~
+ You~have~used~'last-row= \int_use:N \l_@@_last_row_int '~but~your~
+ \@@_full_name_env: \ seems~to~have~ \int_use:N \c at iRow \ rows.~
+ If~you~go~on,~the~value~of~ \int_use:N \c at iRow \ will~be~used~for~
last~row.~You~can~avoid~this~problem~by~using~'last-row'~
without~value~(more~compilations~might~be~necessary).
}
@@ -17943,8 +18001,8 @@
\@@_msg_new:nn { Outside~math~mode }
{
Outside~math~mode.\\
- The~\@@_full_name_env:\ can~be~used~only~in~math~mode~
- (and~not~in~\token_to_str:N \vcenter).\\
+ The~\@@_full_name_env: \ can~be~used~only~in~math~mode~
+ (and~not~in~ \token_to_str:N \vcenter ).\\
This~error~is~fatal.
}
% \end{macrocode}
@@ -17953,8 +18011,8 @@
\@@_msg_new:nn { One~letter~allowed }
{
Bad~name.\\
- The~value~of~key~'\l_keys_key_str'~must~be~of~length~1~and~
- you~have~used~'\l_keys_value_tl'.\\
+ The~value~of~key~' \l_keys_key_str '~must~be~of~length~1~and~
+ you~have~used~' \l_keys_value_tl '.\\
It~will~be~ignored.
}
% \end{macrocode}
@@ -17962,10 +18020,10 @@
% \begin{macrocode}
\@@_msg_new:nn { TabularNote~in~CodeAfter }
{
- Environment~{TabularNote}~forbidden.\\
- You~must~use~{TabularNote}~at~the~end~of~your~{NiceTabular}~
- but~*before*~the~\token_to_str:N \CodeAfter.\\
- This~environment~{TabularNote}~will~be~ignored.
+ Environment~\{TabularNote\}~forbidden.\\
+ You~must~use~\{TabularNote\}~at~the~end~of~your~\{NiceTabular\}~
+ but~*before*~the~ \token_to_str:N \CodeAfter . \\
+ This~environment~\{TabularNote\}~will~be~ignored.
}
% \end{macrocode}
%
@@ -17983,7 +18041,7 @@
\@@_msg_new:nnn { Unknow~key~for~RulesBis }
{
Unknown~key.\\
- Your~key~'\l_keys_key_str'~is~unknown~for~a~rule.\\
+ Your~key~' \l_keys_key_str '~is~unknown~for~a~rule.\\
\c_@@_available_keys_str
}
{
@@ -18000,9 +18058,10 @@
% \begin{macrocode}
\@@_msg_new:nnn { Unknown~key~for~Block }
{
- Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~command~\token_to_str:N
- \Block.\\ It~will~be~ignored. \\
+ Unknown~key. \\
+ The~key~' \l_keys_key_str '~is~unknown~for~the~command~
+ \token_to_str:N \Block . \\
+ It~will~be~ignored. \\
\c_@@_available_keys_str
}
{
@@ -18018,8 +18077,8 @@
\@@_msg_new:nnn { Unknown~key~for~Brace }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~commands~\token_to_str:N
- \UnderBrace\ and~\token_to_str:N \OverBrace.\\
+ The~key~' \l_keys_key_str '~is~unknown~for~the~commands~
+ \token_to_str:N \UnderBrace \ and~ \token_to_str:N \OverBrace . \\
It~will~be~ignored. \\
\c_@@_available_keys_str
}
@@ -18034,7 +18093,7 @@
\@@_msg_new:nnn { Unknown~key~for~CodeAfter }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown.\\
+ The~key~' \l_keys_key_str '~is~unknown.\\
It~will~be~ignored. \\
\c_@@_available_keys_str
}
@@ -18044,7 +18103,7 @@
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.
+ The~latter~is~for~the~command~ \token_to_str:N \line .
}
% \end{macrocode}
%
@@ -18052,7 +18111,7 @@
\@@_msg_new:nnn { Unknown~key~for~CodeBefore }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown.\\
+ The~key~' \l_keys_key_str '~is~unknown.\\
It~will~be~ignored. \\
\c_@@_available_keys_str
}
@@ -18068,7 +18127,7 @@
\@@_msg_new:nnn { Unknown~key~for~SubMatrix }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown.\\
+ The~key~' \l_keys_key_str '~is~unknown.\\
That~key~will~be~ignored. \\
\c_@@_available_keys_str
}
@@ -18092,7 +18151,7 @@
\@@_msg_new:nnn { Unknown~key~for~notes }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown.\\
+ The~key~' \l_keys_key_str '~is~unknown.\\
That~key~will~be~ignored. \\
\c_@@_available_keys_str
}
@@ -18115,8 +18174,8 @@
\@@_msg_new:nnn { Unknown~key~for~RowStyle }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~command~
- \token_to_str:N \RowStyle. \\
+ The~key~' \l_keys_key_str '~is~unknown~for~the~command~
+ \token_to_str:N \RowStyle . \\
That~key~will~be~ignored. \\
\c_@@_available_keys_str
}
@@ -18128,7 +18187,7 @@
cell-space-limits,~
color,~
fill~(alias:~rowcolor),~
- nb-rows,
+ nb-rows,~
opacity~and~
rounded-corners.
}
@@ -18138,8 +18197,8 @@
\@@_msg_new:nnn { Unknown~key~for~NiceMatrixOptions }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~command~
- \token_to_str:N \NiceMatrixOptions. \\
+ The~key~' \l_keys_key_str '~is~unknown~for~the~command~
+ \token_to_str:N \NiceMatrixOptions . \\
That~key~will~be~ignored. \\
\c_@@_available_keys_str
}
@@ -18198,7 +18257,7 @@
\@@_msg_new:nnn { Unknown~key~for~NiceArray }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~environment~
+ The~key~' \l_keys_key_str '~is~unknown~for~the~environment~
\{NiceArray\}. \\
That~key~will~be~ignored. \\
\c_@@_available_keys_str
@@ -18263,8 +18322,8 @@
\@@_msg_new:nnn { Unknown~key~for~NiceMatrix }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~
- \@@_full_name_env:. \\
+ The~key~' \l_keys_key_str '~is~unknown~for~the~
+ \@@_full_name_env: . \\
That~key~will~be~ignored. \\
\c_@@_available_keys_str
}
@@ -18327,7 +18386,7 @@
\@@_msg_new:nnn { Unknown~key~for~NiceTabular }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~environment~
+ The~key~' \l_keys_key_str '~is~unknown~for~the~environment~
\{NiceTabular\}. \\
That~key~will~be~ignored. \\
\c_@@_available_keys_str
@@ -18394,18 +18453,18 @@
\@@_msg_new:nnn { Duplicate~name }
{
Duplicate~name.\\
- The~name~'\l_keys_value_tl'~is~already~used~and~you~shouldn't~use~
+ The~name~' \l_keys_value_tl '~is~already~used~and~you~shouldn't~use~
the~same~environment~name~twice.~You~can~go~on,~but,~
maybe,~you~will~have~incorrect~results~especially~
if~you~use~'columns-width=auto'.~If~you~don't~want~to~see~this~
message~again,~use~the~key~'allow-duplicate-names'~in~
- '\token_to_str:N \NiceMatrixOptions'.\\
+ ' \token_to_str:N \NiceMatrixOptions '.\\
\bool_if:NF \g_@@_messages_for_Overleaf_bool
{ For~a~list~of~the~names~already~used,~type~H~<return>. }
}
{
The~names~already~defined~in~this~document~are:~
- \seq_use:Nnnn \g_@@_names_seq { ~and~ } { ,~ } { ~and~ }.
+ \clist_use:Nnnn \g_@@_names_clist { ~and~ } { ,~ } { ~and~ } .
}
% \end{macrocode}
%
@@ -18422,7 +18481,7 @@
\@@_msg_new:nn { NiceTabularX~without~X }
{
NiceTabularX~without~X.\\
- You~should~not~use~{NiceTabularX}~without~X~columns.\\
+ You~should~not~use~\{NiceTabularX\}~without~X~columns.\\
However,~you~can~go~on.
}
% \end{macrocode}
@@ -18432,7 +18491,7 @@
{
Preamble~forgotten.\\
You~have~probably~forgotten~the~preamble~of~your~
- \@@_full_name_env:. \\
+ \@@_full_name_env: . \\
This~error~is~fatal.
}
% \end{macrocode}
@@ -18441,7 +18500,7 @@
\@@_msg_new:nn { Invalid~col~number }
{
Invalid~column~number.\\
- A~color~instruction~in~the~\token_to_str:N \CodeBefore\
+ A~color~instruction~in~the~ \token_to_str:N \CodeBefore \
specifies~a~column~which~is~outside~the~array.~It~will~be~ignored.
}
% \end{macrocode}
@@ -18450,18 +18509,24 @@
\@@_msg_new:nn { Invalid~row~number }
{
Invalid~row~number.\\
- A~color~instruction~in~the~\token_to_str:N \CodeBefore\
+ A~color~instruction~in~the~ \token_to_str:N \CodeBefore \
specifies~a~row~which~is~outside~the~array.~It~will~be~ignored.
}
% \end{macrocode}
%
+% \begin{macrocode}
+\@@_define_com:NNN p ( )
+\@@_define_com:NNN b [ ]
+\@@_define_com:NNN v | |
+\@@_define_com:NNN V \| \|
+\@@_define_com:NNN B \{ \}
+% \end{macrocode}
+%
% \newpage
% \tableofcontents
%
% \endinput
% Local Variables:
-% TeX-fold-mode: t
-% TeX-fold-preserve-comments: nil
% fill-column: 80
% End:
Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty 2025-04-28 19:47:40 UTC (rev 75043)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty 2025-04-28 19:48:18 UTC (rev 75044)
@@ -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{7.1b}
-\def\myfiledate{2025/03/30}
+\def\myfileversion{7.1c}
+\def\myfiledate{2025/04/28}
\RequirePackage{pgfcore}
\usepgfmodule{shapes}
\ProvidesExplPackage
@@ -37,12 +37,11 @@
{ 2023-11-01 }
{ }
{ \msg_fatal:nn { nicematrix } { latex-too-old } }
+\ProvideDocumentCommand { \IfPackageLoadedT } { m m }
+ { \IfPackageLoadedTF { #1 } { #2 } { } }
-\ProvideDocumentCommand{\IfPackageLoadedT}{mm}
- {\IfPackageLoadedTF{#1}{#2}{}}
-
-\ProvideDocumentCommand{\IfPackageLoadedF}{mm}
- {\IfPackageLoadedTF{#1}{}{#2}}
+\ProvideDocumentCommand { \IfPackageLoadedF } { m m }
+ { \IfPackageLoadedTF { #1 } { } { #2 } }
\RequirePackage { amsmath }
\RequirePackage { array }
\bool_const:Nn \c__nicematrix_recent_array_bool
@@ -64,7 +63,11 @@
{ \msg_new:nnnn { nicematrix } { #1 } { #2 } { #3 } }
}
\cs_new_protected:Npn \__nicematrix_error_or_warning:n
- { \bool_if:NTF \g__nicematrix_messages_for_Overleaf_bool \__nicematrix_warning:n \__nicematrix_error:n }
+ {
+ \bool_if:NTF \g__nicematrix_messages_for_Overleaf_bool
+ { \__nicematrix_warning:n }
+ { \__nicematrix_error:n }
+ }
\bool_new:N \g__nicematrix_messages_for_Overleaf_bool
\bool_gset:Nn \g__nicematrix_messages_for_Overleaf_bool
{
@@ -90,8 +93,6 @@
\__nicematrix_warning:n { #1 }
\__nicematrix_gredirect_none:n { #1 }
}
-\cs_set:Npn \int_if_zero:NT #1 { \int_compare:nNnT #1 = \c_zero_int }
-\cs_set:Npn \int_if_zero:NTF #1 { \int_compare:nNnTF #1 = \c_zero_int }
\__nicematrix_msg_new:nn { mdwtab~loaded }
{
The~packages~'mdwtab'~and~'nicematrix'~are~incompatible.~
@@ -128,7 +129,6 @@
\str_const:Nn \c__nicematrix_l_str { l }
\tl_new:N \l__nicematrix_argspec_tl
\cs_generate_variant:Nn \seq_set_split:Nnn { N o }
-\cs_generate_variant:Nn \str_lowercase:n { o }
\cs_generate_variant:Nn \str_set:Nn { N o }
\cs_generate_variant:Nn \tl_build_put_right:Nn { N o }
\prg_generate_conditional_variant:Nnn \clist_if_in:Nn { N e } { T , F, TF }
@@ -149,14 +149,14 @@
}
}
\IfClassLoadedTF { revtex4-1 }
- { \bool_const:Nn \c__nicematrix_revtex_bool \c_true_bool }
+ { \bool_const:Nn \c__nicematrix_revtex_bool { \c_true_bool } }
{
\IfClassLoadedTF { revtex4-2 }
- { \bool_const:Nn \c__nicematrix_revtex_bool \c_true_bool }
+ { \bool_const:Nn \c__nicematrix_revtex_bool { \c_true_bool } }
{
\cs_if_exist:NT \rvtx at ifformat@geq
- { \bool_const:Nn \c__nicematrix_revtex_bool \c_true_bool }
- { \bool_const:Nn \c__nicematrix_revtex_bool \c_false_bool }
+ { \bool_const:Nn \c__nicematrix_revtex_bool { \c_true_bool } }
+ { \bool_const:Nn \c__nicematrix_revtex_bool { \c_false_bool } }
}
}
\cs_new_protected:Npn \__nicematrix_provide_pgfsyspdfmark:
@@ -174,48 +174,74 @@
{
\mathinner
{
- \tex_mkern:D 1 mu
+ \mkern 1 mu
\box_move_up:nn { 1 pt } { \hbox { . } }
- \tex_mkern:D 2 mu
+ \mkern 2 mu
\box_move_up:nn { 4 pt } { \hbox { . } }
- \tex_mkern:D 2 mu
+ \mkern 2 mu
\box_move_up:nn { 7 pt }
{ \vbox:n { \kern 7 pt \hbox { . } } }
- \tex_mkern:D 1 mu
+ \mkern 1 mu
}
}
\hook_gput_code:nnn { begindocument } { . }
{
\IfPackageLoadedT { booktabs }
- { \iow_now:Nn \@mainaux \nicematrix at redefine@check at rerun }
+ { \iow_now:Nn \@mainaux { \nicematrix at redefine@check at rerun } }
}
\cs_set_protected:Npn \nicematrix at redefine@check at rerun
{
- \cs_set_eq:NN \__nicematrix_old_pgfutil at check@rerun \pgfutil at check@rerun
+ \let \__nicematrix_old_pgfutil at check@rerun \pgfutil at check@rerun
\cs_set_protected:Npn \pgfutil at check@rerun ##1 ##2
{
- \str_if_eq:eeF { nm- } { \tl_range:nnn { ##1 } 1 3 }
+ \str_if_eq:eeF { nm- } { \tl_range:nnn { ##1 } { 1 } { 3 } }
{ \__nicematrix_old_pgfutil at check@rerun { ##1 } { ##2 } }
}
}
\hook_gput_code:nnn { begindocument } { . }
{
- \IfPackageLoadedF { colortbl }
+ \cs_set_protected:Npe \__nicematrix_everycr:
{
- \cs_set_protected:Npn \CT at arc@ { }
- \cs_set_nopar:Npn \arrayrulecolor #1 # { \CT at arc { #1 } }
- \cs_set_nopar:Npn \CT at arc #1 #2
+ \IfPackageLoadedTF { colortbl } { \CT at everycr } { \everycr }
+ { \noalign { \__nicematrix_in_everycr: } }
+ }
+ \IfPackageLoadedTF { colortbl }
+ {
+ \cs_set_eq:NN \__nicematrix_old_cellcolor: \cellcolor
+ \cs_set_eq:NN \__nicematrix_old_rowcolor: \rowcolor
+ \cs_new_protected:Npn \__nicematrix_revert_colortbl:
{
- \dim_compare:nNnT \baselineskip = \c_zero_dim \noalign
+ \hook_gput_code:nnn { env / tabular / begin } { nicematrix }
+ {
+ \cs_set_eq:NN \cellcolor \__nicematrix_old_cellcolor:
+ \cs_set_eq:NN \rowcolor \__nicematrix_old_rowcolor:
+ }
+ }
+ \cs_new_protected:Npn \__nicematrix_replace_columncolor:
+ {
+ \tl_replace_all:Nnn \g__nicematrix_array_preamble_tl
+ { \columncolor }
+ { \__nicematrix_columncolor_preamble }
+ }
+ }
+ {
+ \cs_new_protected:Npn \__nicematrix_revert_colortbl: { }
+ \cs_new_protected:Npn \__nicematrix_replace_columncolor:
+ { \cs_set_eq:NN \columncolor \__nicematrix_columncolor_preamble }
+ \def \CT at arc@ { }
+ \def \arrayrulecolor #1 # { \CT at arc { #1 } }
+ \def \CT at arc #1 #2
+ {
+ \dim_compare:nNnT { \baselineskip } = { \c_zero_dim } { \noalign }
{ \cs_gset_nopar:Npn \CT at arc@ { \color #1 { #2 } } }
}
- \cs_set_nopar:Npn \doublerulesepcolor #1 # { \CT at drs { #1 } }
- \cs_set_nopar:Npn \CT at drs #1 #2
+ \def \doublerulesepcolor #1 # { \CT at drs { #1 } }
+ \def \CT at drs #1 #2
{
- \dim_compare:nNnT \baselineskip = \c_zero_dim \noalign
+ \dim_compare:nNnT { \baselineskip } = { \c_zero_dim } { \noalign }
{ \cs_gset:Npn \CT at drsc@ { \color #1 { #2 } } }
}
- \cs_set_nopar:Npn \hline
+ \def \hline
{
\noalign { \ifnum 0 = `} \fi
\cs_set_eq:NN \hskip \vskip
@@ -227,11 +253,11 @@
}
}
}
-\cs_set_nopar:Npn \__nicematrix_standard_cline #1 { \__nicematrix_standard_cline:w #1 \q_stop }
+\cs_set_nopar:Npn \__nicematrix_standard_cline: #1 { \__nicematrix_standard_cline:w #1 \q_stop }
\cs_set_nopar:Npn \__nicematrix_standard_cline:w #1-#2 \q_stop
{
- \int_if_zero:nT \l__nicematrix_first_col_int { \omit & }
- \int_compare:nNnT { #1 } > \c_one_int
+ \int_if_zero:nT { \l__nicematrix_first_col_int } { \omit & }
+ \int_compare:nNnT { #1 } > { \c_one_int }
{ \multispan { \int_eval:n { #1 - 1 } } & }
\multispan { \int_eval:n { #2 - #1 + 1 } }
{
@@ -241,9 +267,9 @@
}
\everycr { }
\cr
- \noalign { \skip_vertical:N -\arrayrulewidth }
+ \noalign { \skip_vertical:n { - \arrayrulewidth } }
}
-\cs_set:Npn \__nicematrix_cline
+\cs_set:Npn \__nicematrix_cline:
{ \__nicematrix_cline_i:en \l__nicematrix_first_col_int }
\cs_set:Npn \__nicematrix_cline_i:nn #1 #2 { \__nicematrix_cline_i:w #1|#2- \q_stop }
\cs_generate_variant:Nn \__nicematrix_cline_i:nn { e }
@@ -253,7 +279,7 @@
{ \__nicematrix_cline_iii:w #1|#2-#2 \q_stop }
{ \__nicematrix_cline_ii:w #1|#2-#3 \q_stop }
}
-\cs_set:Npn \__nicematrix_cline_ii:w #1|#2-#3-\q_stop
+\cs_set:Npn \__nicematrix_cline_ii:w #1|#2-#3- \q_stop
{ \__nicematrix_cline_iii:w #1|#2-#3 \q_stop }
\cs_set:Npn \__nicematrix_cline_iii:w #1|#2-#3 \q_stop
{
@@ -270,24 +296,23 @@
{ \everycr { } \cr }
}
\cs_set_eq:NN \__nicematrix_math_toggle: \c_math_toggle_token
-\cs_generate_variant:Nn \__nicematrix_set_CT at arc@:n { o }
-\cs_new_protected:Npn \__nicematrix_set_CT at arc@:n #1
+\cs_new_protected:Npn \__nicematrix_set_CTarc:n #1
{
\tl_if_blank:nF { #1 }
{
\tl_if_head_eq_meaning:nNTF { #1 } [
- { \cs_set_nopar:Npn \CT at arc@ { \color #1 } }
- { \cs_set_nopar:Npn \CT at arc@ { \color { #1 } } }
+ { \def \CT at arc@ { \color #1 } }
+ { \def \CT at arc@ { \color { #1 } } }
}
}
-\cs_generate_variant:Nn \__nicematrix_set_CT at drsc@:n { o }
-\cs_new_protected:Npn \__nicematrix_set_CT at drsc@:n #1
+\cs_generate_variant:Nn \__nicematrix_set_CTarc:n { o }
+\cs_new_protected:Npn \__nicematrix_set_CTdrsc:n #1
{
\tl_if_head_eq_meaning:nNTF { #1 } [
- { \cs_set_nopar:Npn \CT at drsc@ { \color #1 } }
- { \cs_set_nopar:Npn \CT at drsc@ { \color { #1 } } }
+ { \def \CT at drsc@ { \color #1 } }
+ { \def \CT at drsc@ { \color { #1 } } }
}
-\cs_generate_variant:Nn \__nicematrix_exp_color_arg:Nn { N o }
+\cs_generate_variant:Nn \__nicematrix_set_CTdrsc:n { o }
\cs_new:Npn \__nicematrix_exp_color_arg:Nn #1 #2
{
\tl_if_head_eq_meaning:nNTF { #2 } [
@@ -294,9 +319,10 @@
{ #1 #2 }
{ #1 { #2 } }
}
-\cs_generate_variant:Nn \__nicematrix_color:n { o }
+\cs_generate_variant:Nn \__nicematrix_exp_color_arg:Nn { N o }
\cs_new_protected:Npn \__nicematrix_color:n #1
{ \tl_if_blank:nF { #1 } { \__nicematrix_exp_color_arg:Nn \color { #1 } } }
+\cs_generate_variant:Nn \__nicematrix_color:n { o }
\cs_new_protected:Npn \__nicematrix_rescan_for_spanish:N #1
{
\tl_set_rescan:Nno
@@ -307,6 +333,13 @@
}
#1
}
+\dim_new:N \l__nicematrix_tmpc_dim
+\dim_new:N \l__nicematrix_tmpd_dim
+\dim_new:N \l__nicematrix_tmpe_dim
+\dim_new:N \l__nicematrix_tmpf_dim
+\tl_new:N \l__nicematrix_tmpc_tl
+\tl_new:N \l__nicematrix_tmpd_tl
+\int_new:N \l__nicematrix_tmpc_int
\int_new:N \g__nicematrix_env_int
\cs_new:Npn \__nicematrix_env: { nm - \int_use:N \g__nicematrix_env_int }
\NewExpandableDocumentCommand \NiceMatrixLastEnv { }
@@ -334,10 +367,12 @@
\dim_new:N \g__nicematrix_blocks_ht_dim
\dim_new:N \g__nicematrix_blocks_dp_dim
\dim_new:N \l__nicematrix_width_dim
-\seq_new:N \g__nicematrix_names_seq
+\clist_new:N \g__nicematrix_names_clist
\bool_new:N \l__nicematrix_in_env_bool
\bool_new:N \l__nicematrix_notes_detect_duplicates_bool
\bool_set_true:N \l__nicematrix_notes_detect_duplicates_bool
+\bool_new:N \l__nicematrix_initial_open_bool
+\bool_new:N \l__nicematrix_final_open_bool
\dim_new:N \l__nicematrix_tabular_width_dim
\dim_new:N \l__nicematrix_rule_width_dim
\tl_new:N \l__nicematrix_rule_color_tl
@@ -392,7 +427,7 @@
\int_new:N \l__nicematrix_old_jCol_int
\seq_new:N \l__nicematrix_custom_line_commands_seq
\tl_new:N \l__nicematrix_rules_color_tl
-\int_new:N \g__nicematrix_total_X_weight_int
+\fp_new:N \g__nicematrix_total_X_weight_fp
\bool_new:N \l__nicematrix_X_columns_aux_bool
\dim_new:N \l__nicematrix_X_columns_dim
\bool_new:N \g__nicematrix_after_col_zero_bool
@@ -405,10 +440,6 @@
\dim_new:N \l__nicematrix_y_initial_dim
\dim_new:N \l__nicematrix_x_final_dim
\dim_new:N \l__nicematrix_y_final_dim
-\dim_new:N \l__nicematrix_tmpc_dim
-\dim_new:N \l__nicematrix_tmpd_dim
-\dim_new:N \l__nicematrix_tmpe_dim
-\dim_new:N \l__nicematrix_tmpf_dim
\dim_new:N \g__nicematrix_dp_row_zero_dim
\dim_new:N \g__nicematrix_ht_row_zero_dim
\dim_new:N \g__nicematrix_ht_row_one_dim
@@ -428,10 +459,20 @@
\bool_new:N \l__nicematrix_width_used_bool
\seq_new:N \g__nicematrix_multicolumn_cells_seq
\seq_new:N \g__nicematrix_multicolumn_sizes_seq
+\int_new:N \g__nicematrix_ddots_int
+\int_new:N \g__nicematrix_iddots_int
+\dim_new:N \g__nicematrix_delta_x_one_dim
+\dim_new:N \g__nicematrix_delta_y_one_dim
+\dim_new:N \g__nicematrix_delta_x_two_dim
+\dim_new:N \g__nicematrix_delta_y_two_dim
\int_new:N \l__nicematrix_row_min_int
\int_new:N \l__nicematrix_row_max_int
\int_new:N \l__nicematrix_col_min_int
\int_new:N \l__nicematrix_col_max_int
+\int_new:N \l__nicematrix_initial_i_int
+\int_new:N \l__nicematrix_initial_j_int
+\int_new:N \l__nicematrix_final_i_int
+\int_new:N \l__nicematrix_final_j_int
\int_new:N \l__nicematrix_start_int
\int_set_eq:NN \l__nicematrix_start_int \c_one_int
\int_new:N \l__nicematrix_end_int
@@ -470,7 +511,7 @@
\bool_new:N \l__nicematrix_dotted_bool
\bool_new:N \l__nicematrix_in_caption_bool
\int_new:N \l__nicematrix_first_row_int
-\int_set:Nn \l__nicematrix_first_row_int 1
+\int_set_eq:NN \l__nicematrix_first_row_int \c_one_int
\int_new:N \l__nicematrix_first_col_int
\int_set_eq:NN \l__nicematrix_first_col_int \c_one_int
\int_new:N \l__nicematrix_last_row_int
@@ -481,10 +522,10 @@
\int_set:Nn \l__nicematrix_last_col_int { -2 }
\bool_new:N \g__nicematrix_last_col_found_bool
\bool_new:N \l__nicematrix_in_last_col_bool
-\cs_new_protected:Npn \__nicematrix_cut_on_hyphen:w #1-#2\q_stop
+\cs_new_protected:Npn \__nicematrix_cut_on_hyphen:w #1-#2 \q_stop
{
- \cs_set_nopar:Npn \l_tmpa_tl { #1 }
- \cs_set_nopar:Npn \l_tmpb_tl { #2 }
+ \def \l_tmpa_tl { #1 }
+ \def \l_tmpb_tl { #2 }
}
\cs_new_protected:Npn \__nicematrix_expand_clist:N #1
{
@@ -496,10 +537,10 @@
\tl_if_in:nnTF { ##1 } { - }
{ \__nicematrix_cut_on_hyphen:w ##1 \q_stop }
{
- \cs_set_nopar:Npn \l_tmpa_tl { ##1 }
- \cs_set_nopar:Npn \l_tmpb_tl { ##1 }
+ \def \l_tmpa_tl { ##1 }
+ \def \l_tmpb_tl { ##1 }
}
- \int_step_inline:nnn \l_tmpa_tl \l_tmpb_tl
+ \int_step_inline:nnn { \l_tmpa_tl } { \l_tmpb_tl }
{ \clist_put_right:Nn \l_tmpa_clist { ####1 } }
}
\tl_set_eq:NN #1 \l_tmpa_clist
@@ -553,9 +594,9 @@
}
\NewDocumentCommand \tabularnote { o m }
{
- \bool_lazy_or:nnT { \cs_if_exist_p:N \@captype } \l__nicematrix_in_env_bool
+ \bool_lazy_or:nnT { \cs_if_exist_p:N \@captype } { \l__nicematrix_in_env_bool }
{
- \bool_lazy_and:nnTF { ! \l__nicematrix_tabular_bool } \l__nicematrix_in_env_bool
+ \bool_lazy_and:nnTF { ! \l__nicematrix_tabular_bool } { \l__nicematrix_in_env_bool }
{ \__nicematrix_error:n { tabularnote~forbidden } }
{
\bool_if:NTF \l__nicematrix_in_caption_bool
@@ -593,10 +634,10 @@
\seq_map_break:
}
}
- \int_if_zero:nF \l_tmpa_int
+ \int_if_zero:nF { \l_tmpa_int }
{ \int_add:Nn \l_tmpa_int \g__nicematrix_notes_caption_int }
}
- \int_if_zero:nT \l_tmpa_int
+ \int_if_zero:nT { \l_tmpa_int }
{
\seq_gput_right:Nn \g__nicematrix_notes_seq { { #1 } { #2 } }
\tl_if_novalue:nT { #1 } { \int_gincr:N \c at tabularnote }
@@ -609,9 +650,9 @@
{
\int_eval:n
{
- \int_if_zero:nTF \l_tmpa_int
- \c at tabularnote
- \l_tmpa_int
+ \int_if_zero:nTF { \l_tmpa_int }
+ { \c at tabularnote }
+ { \l_tmpa_int }
}
}
}
@@ -631,7 +672,7 @@
\int_set_eq:NN \l_tmpa_int \c at tabularnote
\int_gincr:N \g__nicematrix_tabularnote_int
\refstepcounter { tabularnote }
- \int_compare:nNnT \l_tmpa_int = \c at tabularnote
+ \int_compare:nNnT { \l_tmpa_int } = { \c at tabularnote }
{ \int_gincr:N \c at tabularnote }
\seq_clear:N \l__nicematrix_notes_labels_seq
\bool_lazy_or:nnTF
@@ -648,7 +689,7 @@
{
\bool_if:NTF \g__nicematrix_caption_finished_bool
{
- \int_compare:nNnT \c at tabularnote = \g__nicematrix_notes_caption_int
+ \int_compare:nNnT { \c at tabularnote } = { \g__nicematrix_notes_caption_int }
{ \int_gzero:N \c at tabularnote }
\seq_if_in:NnF \g__nicematrix_notes_in_caption_seq { { #1 } { #2 } }
{ \__nicematrix_error:n { Identical~notes~in~caption } }
@@ -758,14 +799,10 @@
\bool_new:N \l__nicematrix_parallelize_diags_bool
\bool_set_true:N \l__nicematrix_parallelize_diags_bool
\clist_new:N \l__nicematrix_corners_clist
-\dim_new:N \l__nicematrix_notes_above_space_dim
-\hook_gput_code:nnn { begindocument } { . }
- { \dim_set:Nn \l__nicematrix_notes_above_space_dim { 1 mm } }
\bool_new:N \l__nicematrix_nullify_dots_bool
-\cs_new_protected:Npn \__nicematrix_reset_arraystretch:
- { \cs_set_nopar:Npn \arraystretch { 1 } }
+\cs_new_protected:Npn \__nicematrix_reset_arraystretch: { \def \arraystretch { 1 } }
\bool_new:N \l__nicematrix_auto_columns_width_bool
-\bool_new:N \g__nicematrix_recreate_cell_nodes_bool
+\bool_new:N \g__nicematrix_create_cell_nodes_bool
\str_new:N \l__nicematrix_name_str
\bool_new:N \l__nicematrix_medium_nodes_bool
\bool_new:N \l__nicematrix_large_nodes_bool
@@ -798,6 +835,8 @@
shorten .value_required:n = true ,
horizontal-labels .bool_set:N = \l__nicematrix_xdots_h_labels_bool ,
horizontal-labels .default:n = true ,
+ horizontal-label .bool_set:N = \l__nicematrix_xdots_h_labels_bool ,
+ horizontal-label .default:n = true ,
line-style .code:n =
{
\bool_lazy_or:nnTF
@@ -842,7 +881,7 @@
&-in-blocks .meta:n = ampersand-in-blocks ,
no-cell-nodes .code:n =
\bool_set_true:N \l__nicematrix_no_cell_nodes_bool
- \cs_set_protected:Npn \__nicematrix_node_for_cell:
+ \cs_set_protected:Npn \__nicematrix_node_cell:
{ \set at color \box_use_drop:N \l__nicematrix_cell_box } ,
no-cell-nodes .value_forbidden:n = true ,
rounded-corners .dim_set:N = \l__nicematrix_tab_rounded_corners_dim ,
@@ -895,7 +934,7 @@
{
\tl_if_in:NnTF \c__nicematrix_forbidden_letters_tl { #1 }
{ \__nicematrix_error:nn { Forbidden~letter } { #1 } }
- { \cs_set_eq:cN { __nicematrix _ #1 } \__nicematrix_make_preamble_vlism:n }
+ { \cs_set_eq:cN { __nicematrix _ #1 : } \__nicematrix_make_preamble_vlism:n }
}
{ \__nicematrix_error:n { One~letter~allowed } }
} ,
@@ -964,11 +1003,10 @@
name .code:n =
\legacy_if:nF { measuring@ }
{
- \str_set:Ne \l_tmpa_str { #1 }
- \seq_if_in:NoTF \g__nicematrix_names_seq \l_tmpa_str
+ \str_set:Ne \l__nicematrix_name_str { #1 }
+ \clist_if_in:NoTF \g__nicematrix_names_clist \l__nicematrix_name_str
{ \__nicematrix_error:nn { Duplicate~name } { #1 } }
- { \seq_gput_left:No \g__nicematrix_names_seq \l_tmpa_str }
- \str_set_eq:NN \l__nicematrix_name_str \l_tmpa_str
+ { \clist_gpush:No \g__nicematrix_names_clist \l__nicematrix_name_str }
} ,
name .value_required:n = true ,
code-after .tl_gset:N = \g_nicematrix_code_after_tl ,
@@ -1188,8 +1226,11 @@
\tl_gclear:N \g__nicematrix_cell_after_hook_tl
\cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter_i:
\int_gincr:N \c at jCol
- \int_compare:nNnT \c at jCol = \c_one_int
- { \int_compare:nNnT \l__nicematrix_first_col_int = \c_one_int \__nicematrix_begin_of_row: }
+ \int_compare:nNnT { \c at jCol } = { \c_one_int }
+ {
+ \int_compare:nNnT { \l__nicematrix_first_col_int } = { \c_one_int }
+ { \__nicematrix_begin_of_row: }
+ }
\hbox_set:Nw \l__nicematrix_cell_box
\__nicematrix_tuning_not_tabular_begin:
\__nicematrix_tuning_first_row:
@@ -1215,7 +1256,7 @@
\cs_set_eq:NN \__nicematrix_tuning_key_small: \prg_do_nothing:
\cs_set_nopar:Npn \__nicematrix_tuning_not_tabular_begin:
{
- \m at th % added 2024/11/21
+ \m at th
\c_math_toggle_token
\__nicematrix_tuning_key_small:
}
@@ -1241,17 +1282,20 @@
}
\cs_new_protected:Npn \__nicematrix_update_for_first_and_last_row:
{
- \int_if_zero:nTF \c at iRow
+ \int_if_zero:nTF { \c at iRow }
{
- \dim_compare:nNnT { \box_dp:N \l__nicematrix_cell_box } > \g__nicematrix_dp_row_zero_dim
+ \dim_compare:nNnT
+ { \box_dp:N \l__nicematrix_cell_box } > { \g__nicematrix_dp_row_zero_dim }
{ \dim_gset:Nn \g__nicematrix_dp_row_zero_dim { \box_dp:N \l__nicematrix_cell_box } }
- \dim_compare:nNnT { \box_ht:N \l__nicematrix_cell_box } > \g__nicematrix_ht_row_zero_dim
+ \dim_compare:nNnT
+ { \box_ht:N \l__nicematrix_cell_box } > { \g__nicematrix_ht_row_zero_dim }
{ \dim_gset:Nn \g__nicematrix_ht_row_zero_dim { \box_ht:N \l__nicematrix_cell_box } }
}
{
- \int_compare:nNnT \c at iRow = \c_one_int
+ \int_compare:nNnT { \c at iRow } = { \c_one_int }
{
- \dim_compare:nNnT { \box_ht:N \l__nicematrix_cell_box } > \g__nicematrix_ht_row_one_dim
+ \dim_compare:nNnT
+ { \box_ht:N \l__nicematrix_cell_box } > { \g__nicematrix_ht_row_one_dim }
{ \dim_gset:Nn \g__nicematrix_ht_row_one_dim { \box_ht:N \l__nicematrix_cell_box } }
}
}
@@ -1263,7 +1307,7 @@
{
\hbox_set:Nn \l__nicematrix_cell_box
{
- \m at th % add 2024/11/21
+ \m at th
\c_math_toggle_token
\vcenter { \box_use:N \l__nicematrix_cell_box }
\c_math_toggle_token
@@ -1270,7 +1314,7 @@
}
}
{
- \int_compare:nNnT \c at iRow = \l__nicematrix_last_row_int
+ \int_compare:nNnT { \c at iRow } = { \l__nicematrix_last_row_int }
{
\vbox_set_top:Nn \l__nicematrix_cell_box
{
@@ -1285,22 +1329,22 @@
}
\cs_new_protected:Npn \__nicematrix_adjust_size_box:
{
- \dim_compare:nNnT \g__nicematrix_blocks_wd_dim > \c_zero_dim
+ \dim_compare:nNnT { \g__nicematrix_blocks_wd_dim } > { \c_zero_dim }
{
\box_set_wd:Nn \l__nicematrix_cell_box
- { \dim_max:nn { \box_wd:N \l__nicematrix_cell_box } \g__nicematrix_blocks_wd_dim }
+ { \dim_max:nn { \box_wd:N \l__nicematrix_cell_box } { \g__nicematrix_blocks_wd_dim } }
\dim_gzero:N \g__nicematrix_blocks_wd_dim
}
- \dim_compare:nNnT \g__nicematrix_blocks_dp_dim > \c_zero_dim
+ \dim_compare:nNnT { \g__nicematrix_blocks_dp_dim } > { \c_zero_dim }
{
\box_set_dp:Nn \l__nicematrix_cell_box
- { \dim_max:nn { \box_dp:N \l__nicematrix_cell_box } \g__nicematrix_blocks_dp_dim }
+ { \dim_max:nn { \box_dp:N \l__nicematrix_cell_box } { \g__nicematrix_blocks_dp_dim } }
\dim_gzero:N \g__nicematrix_blocks_dp_dim
}
- \dim_compare:nNnT \g__nicematrix_blocks_ht_dim > \c_zero_dim
+ \dim_compare:nNnT { \g__nicematrix_blocks_ht_dim } > { \c_zero_dim }
{
\box_set_ht:Nn \l__nicematrix_cell_box
- { \dim_max:nn { \box_ht:N \l__nicematrix_cell_box } \g__nicematrix_blocks_ht_dim }
+ { \dim_max:nn { \box_ht:N \l__nicematrix_cell_box } { \g__nicematrix_blocks_ht_dim } }
\dim_gzero:N \g__nicematrix_blocks_ht_dim
}
}
@@ -1313,7 +1357,7 @@
\cs_new_protected:Npn \__nicematrix_cell_end_i:
{
\g__nicematrix_cell_after_hook_tl
- \bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
+ \bool_if:NT \g__nicematrix_rotate_bool { \__nicematrix_rotate_cell_box: }
\__nicematrix_adjust_size_box:
\box_set_ht:Nn \l__nicematrix_cell_box
{ \box_ht:N \l__nicematrix_cell_box + \l__nicematrix_cell_space_top_limit_dim }
@@ -1325,14 +1369,14 @@
{ \box_use_drop:N \l__nicematrix_cell_box }
{
\bool_if:NTF \g__nicematrix_not_empty_cell_bool
- \__nicematrix_print_node_cell:
+ { \__nicematrix_print_node_cell: }
{
- \dim_compare:nNnTF { \box_wd:N \l__nicematrix_cell_box } > \c_zero_dim
- \__nicematrix_print_node_cell:
+ \dim_compare:nNnTF { \box_wd:N \l__nicematrix_cell_box } > { \c_zero_dim }
+ { \__nicematrix_print_node_cell: }
{ \box_use_drop:N \l__nicematrix_cell_box }
}
}
- \int_compare:nNnT \c at jCol > \g__nicematrix_col_total_int
+ \int_compare:nNnT { \c at jCol } > { \g__nicematrix_col_total_int }
{ \int_gset_eq:NN \g__nicematrix_col_total_int \c at jCol }
\bool_gset_false:N \g__nicematrix_empty_cell_bool
\bool_gset_false:N \g__nicematrix_not_empty_cell_bool
@@ -1340,7 +1384,7 @@
\cs_new_protected:Npn \__nicematrix_update_max_cell_width:
{
\dim_gset:Nn \g__nicematrix_max_cell_width_dim
- { \dim_max:nn \g__nicematrix_max_cell_width_dim { \box_wd:N \l__nicematrix_cell_box } }
+ { \dim_max:nn { \g__nicematrix_max_cell_width_dim } { \box_wd:N \l__nicematrix_cell_box } }
}
\cs_new_protected:Npn \__nicematrix_cell_end_for_w_s:
{
@@ -1371,16 +1415,36 @@
{
__siunitx_table_align_
\bool_if:NTF \l__siunitx_table_text_bool
- \l__siunitx_table_align_text_tl
- \l__siunitx_table_align_number_tl
+ { \l__siunitx_table_align_text_tl }
+ { \l__siunitx_table_align_number_tl }
:n
}
{ #1 }
}
+\socket_new:nn { nicematrix / create-cell-nodes } { 1 }
+\socket_new_plug:nnn { nicematrix / create-cell-nodes } { active }
+ {
+ \box_move_up:nn { \box_ht:N \l__nicematrix_cell_box }
+ \hbox:n
+ {
+ \pgfsys at markposition
+ { \__nicematrix_env: - \int_use:N \c at iRow - \int_use:N \c at jCol - NW }
+ }
+ #1
+ \box_move_down:nn { \box_dp:N \l__nicematrix_cell_box }
+ \hbox:n
+ {
+ \pgfsys at markposition
+ { \__nicematrix_env: - \int_use:N \c at iRow - \int_use:N \c at jCol - SE }
+ }
+ }
\cs_new_protected:Npn \__nicematrix_print_node_cell:
- { \socket_use:nn { nicematrix / siunitx-wrap } { \__nicematrix_node_for_cell: } }
-\cs_new_protected:Npn \__nicematrix_node_for_cell:
{
+ \socket_use:nn { nicematrix / siunitx-wrap }
+ { \socket_use:nn { nicematrix / create-cell-nodes } \__nicematrix_node_cell: }
+ }
+\cs_new_protected:Npn \__nicematrix_node_cell:
+ {
\pgfpicture
\pgfsetbaseline \c_zero_dim
\pgfrememberpicturepositiononpagetrue
@@ -1390,7 +1454,7 @@
{ base }
{
\set at color
- \box_use_drop:N \l__nicematrix_cell_box
+ \box_use:N \l__nicematrix_cell_box
}
{ \__nicematrix_env: - \int_use:N \c at iRow - \int_use:N \c at jCol }
{ \l__nicematrix_pgf_node_code_tl }
@@ -1402,42 +1466,9 @@
}
\endpgfpicture
}
-\cs_new_protected:Npn \__nicematrix_patch_node_for_cell:n #1
- {
- \cs_new_protected:Npn \__nicematrix_patch_node_for_cell:
- {
- \hbox_set:Nn \l__nicematrix_cell_box
- {
- \box_move_up:nn { \box_ht:N \l__nicematrix_cell_box}
- \hbox_overlap_left:n
- {
- \pgfsys at markposition
- { \__nicematrix_env: - \int_use:N \c at iRow - \int_use:N \c at jCol - NW }
- #1
- }
- \box_use:N \l__nicematrix_cell_box
- \box_move_down:nn { \box_dp:N \l__nicematrix_cell_box }
- \hbox_overlap_left:n
- {
- \pgfsys at markposition
- { \__nicematrix_env: - \int_use:N \c at iRow - \int_use:N \c at jCol - SE }
- #1
- }
- }
- }
- }
-\AtBeginDocument
- {
- \bool_lazy_or:nnTF \sys_if_engine_xetex_p: \sys_if_output_dvi_p:
- {
- \__nicematrix_patch_node_for_cell:n
- { \skip_horizontal:n { 0.5 \box_wd:N \l__nicematrix_cell_box } }
- }
- { \__nicematrix_patch_node_for_cell:n { } }
- }
\cs_new_protected:Npn \__nicematrix_instruction_of_type:nnn #1 #2 #3
{
- \bool_if:nTF { #1 } \tl_gput_left:ce \tl_gput_right:ce
+ \bool_if:nTF { #1 } { \tl_gput_left:ce } { \tl_gput_right:ce }
{ g__nicematrix_ #2 _ lines _ tl }
{
\use:c { __nicematrix _ draw _ #2 : nnn }
@@ -1446,24 +1477,24 @@
{ \exp_not:n { #3 } }
}
}
-\cs_generate_variant:Nn \__nicematrix_array:n { o }
\cs_new_protected:Npn \__nicematrix_array:n
{
\dim_set:Nn \col at sep
- { \bool_if:NTF \l__nicematrix_tabular_bool \tabcolsep \arraycolsep }
- \dim_compare:nNnTF \l__nicematrix_tabular_width_dim = \c_zero_dim
- { \cs_set_nopar:Npn \@halignto { } }
+ { \bool_if:NTF \l__nicematrix_tabular_bool { \tabcolsep } { \arraycolsep } }
+ \dim_compare:nNnTF { \l__nicematrix_tabular_width_dim } = { \c_zero_dim }
+ { \def \@halignto { } }
{ \cs_set_nopar:Npe \@halignto { to \dim_use:N \l__nicematrix_tabular_width_dim } }
\@tabarray
- [ \str_if_eq:eeTF \l__nicematrix_baseline_tl c c t ]
+ [ \str_if_eq:eeTF \l__nicematrix_baseline_tl { c } { c } { t } ]
}
+\cs_generate_variant:Nn \__nicematrix_array:n { o }
\bool_if:nTF
{ \c__nicematrix_recent_array_bool && ! \c__nicematrix_revtex_bool }
- { \cs_set_eq:NN \__nicematrix_old_ar at ialign: \ar at ialign }
+ { \cs_set_eq:cN { __nicematrix_old_ar at ialign: } \ar at ialign }
{ \cs_set_eq:NN \__nicematrix_old_ialign: \ialign }
\cs_new_protected:Npn \__nicematrix_create_row_node:
{
- \int_compare:nNnT \c at iRow > \g__nicematrix_last_row_node_int
+ \int_compare:nNnT { \c at iRow } > { \g__nicematrix_last_row_node_int }
{
\int_gset_eq:NN \g__nicematrix_last_row_node_int \c at iRow
\__nicematrix_create_row_node_i:
@@ -1517,9 +1548,9 @@
{ \int_eval:n { \c at iRow + 1 } }
}
{
- \int_compare:nNnT \c at iRow > { -1 }
+ \int_compare:nNnT { \c at iRow } > { -1 }
{
- \int_compare:nNnF \c at iRow = \l__nicematrix_last_row_int
+ \int_compare:nNnF { \c at iRow } = { \l__nicematrix_last_row_int }
{ \hrule height \arrayrulewidth width \c_zero_dim }
}
}
@@ -1528,28 +1559,16 @@
}
\cs_set_protected:Npn \__nicematrix_renew_dots:
{
- \cs_set_eq:NN \ldots \__nicematrix_Ldots
- \cs_set_eq:NN \cdots \__nicematrix_Cdots
- \cs_set_eq:NN \vdots \__nicematrix_Vdots
- \cs_set_eq:NN \ddots \__nicematrix_Ddots
- \cs_set_eq:NN \iddots \__nicematrix_Iddots
- \cs_set_eq:NN \dots \__nicematrix_Ldots
+ \cs_set_eq:NN \ldots \__nicematrix_Ldots:
+ \cs_set_eq:NN \cdots \__nicematrix_Cdots:
+ \cs_set_eq:NN \vdots \__nicematrix_Vdots:
+ \cs_set_eq:NN \ddots \__nicematrix_Ddots:
+ \cs_set_eq:NN \iddots \__nicematrix_Iddots:
+ \cs_set_eq:NN \dots \__nicematrix_Ldots:
\cs_set_eq:NN \hdotsfor \__nicematrix_Hdotsfor:
}
\hook_gput_code:nnn { begindocument } { . }
{
- \IfPackageLoadedTF { colortbl }
- {
- \cs_set_protected:Npn \__nicematrix_everycr:
- { \CT at everycr { \noalign { \__nicematrix_in_everycr: } } }
- }
- {
- \cs_new_protected:Npn \__nicematrix_everycr:
- { \everycr { \noalign { \__nicematrix_in_everycr: } } }
- }
- }
-\hook_gput_code:nnn { begindocument } { . }
- {
\IfPackageLoadedTF { booktabs }
{
\cs_new_protected:Npn \__nicematrix_patch_booktabs:
@@ -1569,7 +1588,7 @@
}
\cs_new_protected:Npn \__nicematrix_pre_array_ii:
{
- \int_gzero:N \g__nicematrix_total_X_weight_int
+ \fp_gzero:N \g__nicematrix_total_X_weight_fp
\__nicematrix_expand_clist:N \l__nicematrix_hlines_clist
\__nicematrix_expand_clist:N \l__nicematrix_vlines_clist
\__nicematrix_patch_booktabs:
@@ -1577,11 +1596,11 @@
\normalbaselines
\bool_if:NT \l__nicematrix_small_bool
{
- \cs_set_nopar:Npn \arraystretch { 0.47 }
+ \def \arraystretch { 0.47 }
\dim_set:Nn \arraycolsep { 1.45 pt }
\cs_set_eq:NN \__nicematrix_tuning_key_small: \scriptstyle
}
- \bool_if:NT \g__nicematrix_recreate_cell_nodes_bool
+ \bool_if:NT \g__nicematrix_create_cell_nodes_bool
{
\tl_put_right:Nn \__nicematrix_begin_of_row:
{
@@ -1588,22 +1607,23 @@
\pgfsys at markposition
{ \__nicematrix_env: - row - \int_use:N \c at iRow - base }
}
+ \socket_assign_plug:nn { nicematrix / create-cell-nodes } { active }
}
\bool_if:nTF
{ \c__nicematrix_recent_array_bool && ! \c__nicematrix_revtex_bool }
{
- \cs_set_nopar:Npn \ar at ialign
+ \def \ar at ialign
{
\bool_if:NT \c__nicematrix_testphase_table_bool
\tbl_init_cell_data_for_table:
\__nicematrix_some_initialization:
\dim_zero:N \tabskip
- \cs_set_eq:NN \ar at ialign \__nicematrix_old_ar at ialign:
+ \cs_set_eq:Nc \ar at ialign { __nicematrix_old_ar at ialign: }
\halign
}
}
{
- \cs_set_nopar:Npn \ialign
+ \def \ialign
{
\__nicematrix_some_initialization:
\dim_zero:N \tabskip
@@ -1616,19 +1636,19 @@
\IfPackageLoadedT { colortbl }
{ \cs_set_protected:Npn \CT at setup { } }
}
- \cs_set_eq:NN \__nicematrix_old_ldots \ldots
- \cs_set_eq:NN \__nicematrix_old_cdots \cdots
- \cs_set_eq:NN \__nicematrix_old_vdots \vdots
- \cs_set_eq:NN \__nicematrix_old_ddots \ddots
- \cs_set_eq:NN \__nicematrix_old_iddots \iddots
+ \cs_set_eq:NN \__nicematrix_old_ldots: \ldots
+ \cs_set_eq:NN \__nicematrix_old_cdots: \cdots
+ \cs_set_eq:NN \__nicematrix_old_vdots: \vdots
+ \cs_set_eq:NN \__nicematrix_old_ddots: \ddots
+ \cs_set_eq:NN \__nicematrix_old_iddots: \iddots
\bool_if:NTF \l__nicematrix_standard_cline_bool
- { \cs_set_eq:NN \cline \__nicematrix_standard_cline }
- { \cs_set_eq:NN \cline \__nicematrix_cline }
- \cs_set_eq:NN \Ldots \__nicematrix_Ldots
- \cs_set_eq:NN \Cdots \__nicematrix_Cdots
- \cs_set_eq:NN \Vdots \__nicematrix_Vdots
- \cs_set_eq:NN \Ddots \__nicematrix_Ddots
- \cs_set_eq:NN \Iddots \__nicematrix_Iddots
+ { \cs_set_eq:NN \cline \__nicematrix_standard_cline: }
+ { \cs_set_eq:NN \cline \__nicematrix_cline: }
+ \cs_set_eq:NN \Ldots \__nicematrix_Ldots:
+ \cs_set_eq:NN \Cdots \__nicematrix_Cdots:
+ \cs_set_eq:NN \Vdots \__nicematrix_Vdots:
+ \cs_set_eq:NN \Ddots \__nicematrix_Ddots:
+ \cs_set_eq:NN \Iddots \__nicematrix_Iddots:
\cs_set_eq:NN \Hline \__nicematrix_Hline:
\cs_set_eq:NN \Hspace \__nicematrix_Hspace:
\cs_set_eq:NN \Hdotsfor \__nicematrix_Hdotsfor:
@@ -1652,14 +1672,14 @@
\cs_set_eq:NN \rowcolor \__nicematrix_rowcolor_tabular
\cs_set_eq:NN \rowcolors \__nicematrix_rowcolors_tabular
\cs_set_eq:NN \rowlistcolors \__nicematrix_rowlistcolors_tabular
- \int_compare:nNnT \l__nicematrix_first_row_int > \c_zero_int
+ \int_compare:nNnT { \l__nicematrix_first_row_int } > { \c_zero_int }
{ \cs_set_eq:NN \__nicematrix_tuning_first_row: \prg_do_nothing: }
- \int_compare:nNnT \l__nicematrix_last_row_int < \c_zero_int
+ \int_compare:nNnT { \l__nicematrix_last_row_int } < { \c_zero_int }
{ \cs_set_eq:NN \__nicematrix_tuning_last_row: \prg_do_nothing: }
- \bool_if:NT \l__nicematrix_renew_dots_bool \__nicematrix_renew_dots:
+ \bool_if:NT \l__nicematrix_renew_dots_bool { \__nicematrix_renew_dots: }
\cs_set_eq:NN \multicolumn \__nicematrix_multicolumn:nnn
\hook_gput_code:nnn { env / tabular / begin } { nicematrix }
- { \cs_set_eq:NN \multicolumn \__nicematrix_old_multicolumn }
+ { \cs_set_eq:NN \multicolumn \__nicematrix_old_multicolumn: }
\__nicematrix_revert_colortbl:
\tl_if_exist:NT \l__nicematrix_note_in_caption_tl
{
@@ -1691,30 +1711,30 @@
\int_gzero_new:N \c at iRow
\cs_if_exist:NT \thejCol { \int_set_eq:NN \l__nicematrix_old_jCol_int \c at jCol }
\int_gzero_new:N \c at jCol
- \int_compare:nNnT \l__nicematrix_last_row_int = { -1 }
+ \int_compare:nNnT { \l__nicematrix_last_row_int } = { -1 }
{
\bool_set_true:N \l__nicematrix_last_row_without_value_bool
\bool_if:NT \g__nicematrix_aux_found_bool
- { \int_set:Nn \l__nicematrix_last_row_int { \seq_item:Nn \g__nicematrix_size_seq 3 } }
+ { \int_set:Nn \l__nicematrix_last_row_int { \seq_item:Nn \g__nicematrix_size_seq { 3 } } }
}
- \int_compare:nNnT \l__nicematrix_last_col_int = { -1 }
+ \int_compare:nNnT { \l__nicematrix_last_col_int } = { -1 }
{
\bool_if:NT \g__nicematrix_aux_found_bool
- { \int_set:Nn \l__nicematrix_last_col_int { \seq_item:Nn \g__nicematrix_size_seq 6 } }
+ { \int_set:Nn \l__nicematrix_last_col_int { \seq_item:Nn \g__nicematrix_size_seq { 6 } } }
}
- \int_compare:nNnT \l__nicematrix_last_row_int > { -2 }
+ \int_compare:nNnT { \l__nicematrix_last_row_int } > { -2 }
{
\tl_put_right:Nn \__nicematrix_update_for_first_and_last_row:
{
- \dim_compare:nNnT \g__nicematrix_ht_last_row_dim < { \box_ht:N \l__nicematrix_cell_box }
+ \dim_compare:nNnT { \g__nicematrix_ht_last_row_dim } < { \box_ht:N \l__nicematrix_cell_box }
{ \dim_gset:Nn \g__nicematrix_ht_last_row_dim { \box_ht:N \l__nicematrix_cell_box } }
- \dim_compare:nNnT \g__nicematrix_dp_last_row_dim < { \box_dp:N \l__nicematrix_cell_box }
+ \dim_compare:nNnT { \g__nicematrix_dp_last_row_dim } < { \box_dp:N \l__nicematrix_cell_box }
{ \dim_gset:Nn \g__nicematrix_dp_last_row_dim { \box_dp:N \l__nicematrix_cell_box } }
}
}
\seq_gclear:N \g__nicematrix_cols_vlism_seq
\seq_gclear:N \g__nicematrix_submatrix_seq
- \bool_if:NT \l__nicematrix_code_before_bool \__nicematrix_exec_code_before:
+ \bool_if:NT \l__nicematrix_code_before_bool { \__nicematrix_exec_code_before: }
\seq_gset_eq:NN \g__nicematrix_pos_of_blocks_seq \g__nicematrix_future_pos_of_blocks_seq
\seq_gclear:N \g__nicematrix_future_pos_of_blocks_seq
\seq_gclear_new:N \g__nicematrix_multicolumn_cells_seq
@@ -1733,7 +1753,7 @@
}
{
\dim_gset:Nn \l__nicematrix_left_delim_dim
- { 2 \bool_if:NTF \l__nicematrix_tabular_bool \tabcolsep \arraycolsep }
+ { 2 \bool_if:NTF \l__nicematrix_tabular_bool { \tabcolsep } { \arraycolsep } }
\dim_gset_eq:NN \l__nicematrix_right_delim_dim \l__nicematrix_left_delim_dim
}
\hbox_set:Nw \l__nicematrix_the_array_box
@@ -1758,21 +1778,21 @@
}
\cs_new_protected:Npn \__nicematrix_pre_code_before:
{
- \int_set:Nn \c at iRow { \seq_item:Nn \g__nicematrix_size_seq 2 }
- \int_set:Nn \c at jCol { \seq_item:Nn \g__nicematrix_size_seq 5 }
- \int_set_eq:NN \g__nicematrix_row_total_int { \seq_item:Nn \g__nicematrix_size_seq 3 }
- \int_set_eq:NN \g__nicematrix_col_total_int { \seq_item:Nn \g__nicematrix_size_seq 6 }
+ \int_set:Nn \c at iRow { \seq_item:Nn \g__nicematrix_size_seq { 2 } }
+ \int_set:Nn \c at jCol { \seq_item:Nn \g__nicematrix_size_seq { 5 } }
+ \int_set:Nn \g__nicematrix_row_total_int { \seq_item:Nn \g__nicematrix_size_seq { 3 } }
+ \int_set:Nn \g__nicematrix_col_total_int { \seq_item:Nn \g__nicematrix_size_seq { 6 } }
\pgfsys at markposition { \__nicematrix_env: - position }
\pgfsys at getposition { \__nicematrix_env: - position } \__nicematrix_picture_position:
\pgfpicture
\pgf at relevantforpicturesizefalse
- \int_step_inline:nnn \l__nicematrix_first_row_int { \g__nicematrix_row_total_int + 1 }
+ \int_step_inline:nnn { \l__nicematrix_first_row_int } { \g__nicematrix_row_total_int + 1 }
{
\pgfsys at getposition { \__nicematrix_env: - row - ##1 } \__nicematrix_node_position:
\pgfcoordinate { \__nicematrix_env: - row - ##1 }
{ \pgfpointdiff \__nicematrix_picture_position: \__nicematrix_node_position: }
}
- \int_step_inline:nnn \l__nicematrix_first_col_int { \g__nicematrix_col_total_int + 1 }
+ \int_step_inline:nnn { \l__nicematrix_first_col_int } { \g__nicematrix_col_total_int + 1 }
{
\pgfsys at getposition { \__nicematrix_env: - col - ##1 } \__nicematrix_node_position:
\pgfcoordinate { \__nicematrix_env: - col - ##1 }
@@ -1779,7 +1799,7 @@
{ \pgfpointdiff \__nicematrix_picture_position: \__nicematrix_node_position: }
}
\__nicematrix_create_diag_nodes:
- \bool_if:NT \g__nicematrix_recreate_cell_nodes_bool \__nicematrix_recreate_cell_nodes:
+ \bool_if:NT \g__nicematrix_create_cell_nodes_bool { \__nicematrix_recreate_cell_nodes: }
\endpgfpicture
\__nicematrix_create_blocks_nodes:
\IfPackageLoadedT { tikz }
@@ -1811,9 +1831,9 @@
{ \cs_set_nopar:cpn { __nicematrix _ corner _ ##1 } { } }
\seq_gclear_new:N \g__nicematrix_colors_seq
\__nicematrix_add_to_colors_seq:nn { { nocolor } } { }
- \bool_gset_false:N \g__nicematrix_recreate_cell_nodes_bool
+ \bool_gset_false:N \g__nicematrix_create_cell_nodes_bool
\group_begin:
- \bool_if:NT \l__nicematrix_tabular_bool \c_math_toggle_token
+ \bool_if:NT \l__nicematrix_tabular_bool { \c_math_toggle_token }
\int_compare:nNnT { \char_value_catcode:n { 60 } } = { 13 }
{ \__nicematrix_rescan_for_spanish:N \l__nicematrix_code_before_tl }
\exp_last_unbraced:No \__nicematrix_CodeBefore_keys:
@@ -1821,14 +1841,12 @@
\__nicematrix_actually_color:
\l__nicematrix_code_before_tl
\q_stop
- \bool_if:NT \l__nicematrix_tabular_bool \c_math_toggle_token
+ \bool_if:NT \l__nicematrix_tabular_bool { \c_math_toggle_token }
\group_end:
- \bool_if:NT \g__nicematrix_recreate_cell_nodes_bool
- { \tl_put_left:Nn \__nicematrix_node_for_cell: \__nicematrix_patch_node_for_cell: }
}
\keys_define:nn { nicematrix / CodeBefore }
{
- create-cell-nodes .bool_gset:N = \g__nicematrix_recreate_cell_nodes_bool ,
+ create-cell-nodes .bool_gset:N = \g__nicematrix_create_cell_nodes_bool ,
create-cell-nodes .default:n = true ,
sub-matrix .code:n = \keys_set:nn { nicematrix / sub-matrix } { #1 } ,
sub-matrix .value_required:n = true ,
@@ -1851,12 +1869,12 @@
}
\cs_new_protected:Npn \__nicematrix_recreate_cell_nodes:
{
- \int_step_inline:nnn \l__nicematrix_first_row_int \g__nicematrix_row_total_int
+ \int_step_inline:nnn { \l__nicematrix_first_row_int } { \g__nicematrix_row_total_int }
{
\pgfsys at getposition { \__nicematrix_env: - ##1 - base } \__nicematrix_node_position:
\pgfcoordinate { \__nicematrix_env: - row - ##1 - base }
{ \pgfpointdiff \__nicematrix_picture_position: \__nicematrix_node_position: }
- \int_step_inline:nnn \l__nicematrix_first_col_int \g__nicematrix_col_total_int
+ \int_step_inline:nnn { \l__nicematrix_first_col_int } { \g__nicematrix_col_total_int }
{
\cs_if_exist:cT
{ pgf @ sys @ pdf @ mark @ pos @ \__nicematrix_env: - ##1 - ####1 - NW }
@@ -1874,19 +1892,26 @@
}
}
}
- \int_step_inline:nn \c at iRow
+ \__nicematrix_create_extra_nodes:
+ \__nicematrix_create_aliases_last:
+ }
+\cs_new_protected:Npn \__nicematrix_create_aliases_last:
+ {
+ \int_step_inline:nn { \c at iRow }
{
\pgfnodealias
{ \__nicematrix_env: - ##1 - last }
{ \__nicematrix_env: - ##1 - \int_use:N \c at jCol }
}
- \int_step_inline:nn \c at jCol
+ \int_step_inline:nn { \c at jCol }
{
\pgfnodealias
{ \__nicematrix_env: - last - ##1 }
{ \__nicematrix_env: - \int_use:N \c at iRow - ##1 }
}
- \__nicematrix_create_extra_nodes:
+ \pgfnodealias % added 2025-04-05
+ { \__nicematrix_env: - last - last }
+ { \__nicematrix_env: - \int_use:N \c at iRow - \int_use:N \c at jCol }
}
\cs_new_protected:Npn \__nicematrix_create_blocks_nodes:
{
@@ -1936,9 +1961,9 @@
\NewDocumentEnvironment { NiceArrayWithDelims }
{ m m O { } m ! O { } t \CodeBefore }
{
- \bool_if:NT \c__nicematrix_revtex_bool \__nicematrix_patch_for_revtex:
+ \bool_if:NT \c__nicematrix_revtex_bool { \__nicematrix_patch_for_revtex: }
\__nicematrix_provide_pgfsyspdfmark:
- \bool_if:NT \g__nicematrix_footnote_bool \savenotes
+ \bool_if:NT \g__nicematrix_footnote_bool { \savenotes }
\bgroup
\tl_gset:Nn \g__nicematrix_left_delim_tl { #1 }
\tl_gset:Nn \g__nicematrix_right_delim_tl { #2 }
@@ -1945,17 +1970,17 @@
\tl_gset:Nn \g__nicematrix_user_preamble_tl { #4 }
\tl_if_empty:NT \g__nicematrix_user_preamble_tl { \__nicematrix_fatal:n { empty~preamble } }
\int_gzero:N \g__nicematrix_block_box_int
- \dim_zero:N \g__nicematrix_width_last_col_dim
- \dim_zero:N \g__nicematrix_width_first_col_dim
+ \dim_gzero:N \g__nicematrix_width_last_col_dim
+ \dim_gzero:N \g__nicematrix_width_first_col_dim
\bool_gset_false:N \g__nicematrix_row_of_col_done_bool
\str_if_empty:NT \g__nicematrix_name_env_str
{ \str_gset:Nn \g__nicematrix_name_env_str { NiceArrayWithDelims } }
\bool_if:NTF \l__nicematrix_tabular_bool
- \mode_leave_vertical:
- \__nicematrix_test_if_math_mode:
+ { \mode_leave_vertical: }
+ { \__nicematrix_test_if_math_mode: }
\bool_if:NT \l__nicematrix_in_env_bool { \__nicematrix_fatal:n { Yet~in~env } }
\bool_set_true:N \l__nicematrix_in_env_bool
- \cs_gset_eq:NN \__nicematrix_old_CT at arc@ \CT at arc@
+ \cs_gset_eq:cN { __nicematrix_old_CT at arc@ } \CT at arc@
\cs_if_exist:NT \tikz at library@external at loaded
{
\tikzexternaldisable
@@ -1971,10 +1996,10 @@
\seq_gclear:N \g__nicematrix_pos_of_xdots_seq
\tl_gclear_new:N \g__nicematrix_code_before_tl
\tl_gclear:N \g__nicematrix_row_style_tl
- \tl_if_exist:cTF { c__nicematrix _ \int_use:N \g__nicematrix_env_int _ tl }
+ \tl_if_exist:cTF { g__nicematrix _ \int_use:N \g__nicematrix_env_int _ tl }
{
\bool_gset_true:N \g__nicematrix_aux_found_bool
- \use:c { c__nicematrix _ \int_use:N \g__nicematrix_env_int _ tl }
+ \use:c { g__nicematrix _ \int_use:N \g__nicematrix_env_int _ tl }
}
{ \bool_gset_false:N \g__nicematrix_aux_found_bool }
\tl_gclear:N \g__nicematrix_aux_tl
@@ -1989,8 +2014,8 @@
{ \keys_set:nn { nicematrix / pNiceArray } }
{ \keys_set:nn { nicematrix / NiceArray } }
{ #3 , #5 }
- \__nicematrix_set_CT at arc@:o \l__nicematrix_rules_color_tl
- \bool_if:nTF { #6 } \__nicematrix_CodeBefore_Body:w \__nicematrix_pre_array:
+ \__nicematrix_set_CTarc:o \l__nicematrix_rules_color_tl
+ \bool_if:nTF { #6 } { \__nicematrix_CodeBefore_Body:w } { \__nicematrix_pre_array: }
}
{
\bool_if:NTF \l__nicematrix_light_syntax_bool
@@ -2001,11 +2026,11 @@
\skip_horizontal:N \l__nicematrix_extra_right_margin_dim
% awful workaround
- \int_compare:nNnT \g__nicematrix_col_total_int = \c_one_int
+ \int_if_zero:nT { \g__nicematrix_col_total_int }
{
- \dim_compare:nNnT \l__nicematrix_columns_width_dim > \c_zero_dim
+ \dim_compare:nNnT { \l__nicematrix_columns_width_dim } > { \c_zero_dim }
{
- \skip_horizontal:N - \l__nicematrix_columns_width_dim
+ \skip_horizontal:n { - \l__nicematrix_columns_width_dim }
\bool_if:NTF \l__nicematrix_tabular_bool
{ \skip_horizontal:n { - 2 \tabcolsep } }
{ \skip_horizontal:n { - 2 \arraycolsep } }
@@ -2016,16 +2041,16 @@
{ \UseTaggingSocket { tbl / hmode / end } }
\bool_if:NT \l__nicematrix_width_used_bool
{
- \int_if_zero:nT \g__nicematrix_total_X_weight_int
+ \fp_compare:nNnT { \g__nicematrix_total_X_weight_fp } = { \c_zero_fp }
{ \__nicematrix_error_or_warning:n { width~without~X~columns } }
}
- \int_compare:nNnT \g__nicematrix_total_X_weight_int > \c_zero_int
+ \fp_compare:nNnT { \g__nicematrix_total_X_weight_fp } > { \c_zero_fp }
{ \__nicematrix_compute_width_X: }
- \int_compare:nNnT \l__nicematrix_last_row_int > { -2 }
+ \int_compare:nNnT { \l__nicematrix_last_row_int } > { -2 }
{
\bool_if:NF \l__nicematrix_last_row_without_value_bool
{
- \int_compare:nNnF \l__nicematrix_last_row_int = \c at iRow
+ \int_compare:nNnF { \l__nicematrix_last_row_int } = { \c at iRow }
{
\__nicematrix_error:n { Wrong~last~row }
\int_gset_eq:NN \l__nicematrix_last_row_int \c at iRow
@@ -2036,31 +2061,32 @@
\bool_if:NTF \g__nicematrix_last_col_found_bool
{ \int_gdecr:N \c at jCol }
{
- \int_compare:nNnT \l__nicematrix_last_col_int > { -1 }
+ \int_compare:nNnT { \l__nicematrix_last_col_int } > { -1 }
{ \__nicematrix_error:n { last~col~not~used } }
}
\int_gset_eq:NN \g__nicematrix_row_total_int \c at iRow
- \int_compare:nNnT \l__nicematrix_last_row_int > { -1 } { \int_gdecr:N \c at iRow }
- \int_if_zero:nT \l__nicematrix_first_col_int
+ \int_compare:nNnT { \l__nicematrix_last_row_int } > { -1 }
+ { \int_gdecr:N \c at iRow }
+ \int_if_zero:nT { \l__nicematrix_first_col_int }
{ \skip_horizontal:N \g__nicematrix_width_first_col_dim }
\bool_if:nTF { ! \g__nicematrix_delims_bool }
{
\str_if_eq:eeTF \l__nicematrix_baseline_tl { c }
- \__nicematrix_use_arraybox_with_notes_c:
+ { \__nicematrix_use_arraybox_with_notes_c: }
{
\str_if_eq:eeTF \l__nicematrix_baseline_tl { b }
- \__nicematrix_use_arraybox_with_notes_b:
- \__nicematrix_use_arraybox_with_notes:
+ { \__nicematrix_use_arraybox_with_notes_b: }
+ { \__nicematrix_use_arraybox_with_notes: }
}
}
{
- \int_if_zero:nTF \l__nicematrix_first_row_int
+ \int_if_zero:nTF { \l__nicematrix_first_row_int }
{
\dim_set_eq:NN \l_tmpa_dim \g__nicematrix_dp_row_zero_dim
\dim_add:Nn \l_tmpa_dim \g__nicematrix_ht_row_zero_dim
}
{ \dim_zero:N \l_tmpa_dim }
- \int_compare:nNnTF \l__nicematrix_last_row_int > { -2 }
+ \int_compare:nNnTF { \l__nicematrix_last_row_int } > { -2 }
{
\dim_set_eq:NN \l_tmpb_dim \g__nicematrix_ht_last_row_dim
\dim_add:Nn \l_tmpb_dim \g__nicematrix_dp_last_row_dim
@@ -2068,25 +2094,24 @@
{ \dim_zero:N \l_tmpb_dim }
\hbox_set:Nn \l_tmpa_box
{
- \m at th % added 2024/11/21
+ \m at th
\c_math_toggle_token
\__nicematrix_color:o \l__nicematrix_delimiters_color_tl
\exp_after:wN \left \g__nicematrix_left_delim_tl
\vcenter
{
- \skip_vertical:n { -\l_tmpa_dim - \arrayrulewidth }
+ \skip_vertical:n { - \l_tmpa_dim - \arrayrulewidth }
\hbox
{
\bool_if:NTF \l__nicematrix_tabular_bool
- { \skip_horizontal:N -\tabcolsep }
- { \skip_horizontal:N -\arraycolsep }
+ { \skip_horizontal:n { - \tabcolsep } }
+ { \skip_horizontal:n { - \arraycolsep } }
\__nicematrix_use_arraybox_with_notes_c:
\bool_if:NTF \l__nicematrix_tabular_bool
- { \skip_horizontal:N -\tabcolsep }
- { \skip_horizontal:N -\arraycolsep }
+ { \skip_horizontal:n { - \tabcolsep } }
+ { \skip_horizontal:n { - \arraycolsep } }
}
- \skip_vertical:N -\l_tmpb_dim
- \skip_vertical:N \arrayrulewidth
+ \skip_vertical:n { - \l_tmpb_dim + \arrayrulewidth }
}
\exp_after:wN \right \g__nicematrix_right_delim_tl
\c_math_toggle_token
@@ -2094,8 +2119,8 @@
\bool_if:NTF \l__nicematrix_delimiters_max_width_bool
{
\__nicematrix_put_box_in_flow_bis:nn
- \g__nicematrix_left_delim_tl
- \g__nicematrix_right_delim_tl
+ { \g__nicematrix_left_delim_tl }
+ { \g__nicematrix_right_delim_tl }
}
\__nicematrix_put_box_in_flow:
}
@@ -2103,7 +2128,7 @@
{ \skip_horizontal:N \g__nicematrix_width_last_col_dim }
\bool_if:NT \l__nicematrix_preamble_bool
{
- \int_compare:nNnT \c at jCol < \g__nicematrix_static_num_of_col_int
+ \int_compare:nNnT { \c at jCol } < { \g__nicematrix_static_num_of_col_int }
{ \__nicematrix_warning_gredirect_none:n { columns~not~used } }
}
\__nicematrix_after_array:
@@ -2112,11 +2137,12 @@
\iow_now:Nn \@mainaux { \char_set_catcode_space:n { 32 } }
\iow_now:Ne \@mainaux
{
- \tl_gset:cn { c__nicematrix_ \int_use:N \g__nicematrix_env_int _ tl }
+ \tl_gclear_new:c { g__nicematrix_ \int_use:N \g__nicematrix_env_int _ tl }
+ \tl_gset:cn { g__nicematrix_ \int_use:N \g__nicematrix_env_int _ tl }
{ \exp_not:o \g__nicematrix_aux_tl }
}
\iow_now:Nn \@mainaux { \ExplSyntaxOff }
- \bool_if:NT \g__nicematrix_footnote_bool \endsavenotes
+ \bool_if:NT \g__nicematrix_footnote_bool { \endsavenotes }
}
\cs_new_protected:Npn \__nicematrix_compute_width_X:
{
@@ -2136,8 +2162,14 @@
{
\dim_eval:n
{
- ( \l__nicematrix_width_dim - \box_wd:N \l__nicematrix_the_array_box )
- / \int_use:N \g__nicematrix_total_X_weight_int
+ \fp_to_dim:n
+ {
+ (
+ \dim_eval:n
+ { \l__nicematrix_width_dim - \box_wd:N \l__nicematrix_the_array_box }
+ )
+ / \fp_use:N \g__nicematrix_total_X_weight_fp
+ }
+ \l__nicematrix_X_columns_dim
}
}
@@ -2169,28 +2201,10 @@
{ ! { \skip_horizontal:N \arrayrulewidth } }
}
}
- \exp_last_unbraced:No \__nicematrix_rec_preamble:n \g__nicematrix_user_preamble_tl \__nicematrix_stop:
+ \exp_last_unbraced:No \__nicematrix_rec_preamble:n \g__nicematrix_user_preamble_tl \s_stop
\int_gset_eq:NN \g__nicematrix_static_num_of_col_int \c at jCol
\__nicematrix_replace_columncolor:
}
-\hook_gput_code:nnn { begindocument } { . }
- {
- \IfPackageLoadedTF { colortbl }
- {
- \regex_const:Nn \c__nicematrix_columncolor_regex { \c { columncolor } }
- \cs_new_protected:Npn \__nicematrix_replace_columncolor:
- {
- \regex_replace_all:NnN
- \c__nicematrix_columncolor_regex
- { \c { __nicematrix_columncolor_preamble } }
- \g__nicematrix_array_preamble_tl
- }
- }
- {
- \cs_new_protected:Npn \__nicematrix_replace_columncolor:
- { \cs_set_eq:NN \columncolor \__nicematrix_columncolor_preamble }
- }
- }
\cs_new_protected:Npn \__nicematrix_transform_preamble_ii:
{
\tl_if_eq:NNTF \g__nicematrix_left_delim_tl \c__nicematrix_dot_tl
@@ -2200,7 +2214,7 @@
}
{ \bool_gset_true:N \g__nicematrix_delims_bool }
\bool_if:NT \g_tmpb_bool { \bool_set_true:N \l__nicematrix_bar_at_end_of_pream_bool }
- \int_if_zero:nTF \l__nicematrix_first_col_int
+ \int_if_zero:nTF { \l__nicematrix_first_col_int }
{ \tl_gput_left:No \g__nicematrix_array_preamble_tl \c__nicematrix_preamble_first_col_tl }
{
\bool_if:NF \g__nicematrix_delims_bool
@@ -2215,7 +2229,7 @@
}
}
}
- \int_compare:nNnTF \l__nicematrix_last_col_int > { -1 }
+ \int_compare:nNnTF { \l__nicematrix_last_col_int } > { -1 }
{ \tl_gput_right:No \g__nicematrix_array_preamble_tl \c__nicematrix_preamble_last_col_tl }
{
\bool_if:NF \g__nicematrix_delims_bool
@@ -2230,7 +2244,7 @@
}
}
}
- \dim_compare:nNnT \l__nicematrix_tabular_width_dim = \c_zero_dim
+ \dim_compare:nNnT { \l__nicematrix_tabular_width_dim } = { \c_zero_dim }
{
\bool_if:NF \c__nicematrix_testphase_table_bool
{
@@ -2241,8 +2255,8 @@
}
\cs_new_protected:Npn \__nicematrix_rec_preamble:n #1
{
- \cs_if_exist:cTF { __nicematrix _ \token_to_str:N #1 }
- { \use:c { __nicematrix _ \token_to_str:N #1 } { #1 } }
+ \cs_if_exist:cTF { __nicematrix _ \token_to_str:N #1 : }
+ { \use:c { __nicematrix _ \token_to_str:N #1 : } { #1 } }
{
\cs_if_exist:cTF { NC @ find @ #1 }
{
@@ -2256,7 +2270,7 @@
}
}
}
-\cs_new_protected:Npn \__nicematrix_c #1
+\cs_new_protected:Npn \__nicematrix_c: #1
{
\tl_gput_right:No \g__nicematrix_array_preamble_tl \g__nicematrix_pre_cell_tl
\tl_gclear:N \g__nicematrix_pre_cell_tl
@@ -2265,7 +2279,7 @@
\int_gincr:N \c at jCol
\__nicematrix_rec_preamble_after_col:n
}
-\cs_new_protected:Npn \__nicematrix_l #1
+\cs_new_protected:Npn \__nicematrix_l: #1
{
\tl_gput_right:No \g__nicematrix_array_preamble_tl \g__nicematrix_pre_cell_tl
\tl_gclear:N \g__nicematrix_pre_cell_tl
@@ -2278,7 +2292,7 @@
\int_gincr:N \c at jCol
\__nicematrix_rec_preamble_after_col:n
}
-\cs_new_protected:Npn \__nicematrix_r #1
+\cs_new_protected:Npn \__nicematrix_r: #1
{
\tl_gput_right:No \g__nicematrix_array_preamble_tl \g__nicematrix_pre_cell_tl
\tl_gclear:N \g__nicematrix_pre_cell_tl
@@ -2291,13 +2305,13 @@
\int_gincr:N \c at jCol
\__nicematrix_rec_preamble_after_col:n
}
-\cs_new_protected:cpn { __nicematrix _ \token_to_str:N ! } #1 #2
+\cs_new_protected:cpn { __nicematrix _ \token_to_str:N ! : } #1 #2
{
\tl_gput_right:Nn \g__nicematrix_array_preamble_tl { #1 { #2 } }
\__nicematrix_rec_preamble:n
}
-\cs_set_eq:cc { __nicematrix _ \token_to_str:N @ } { __nicematrix _ \token_to_str:N ! }
-\cs_new_protected:cpn { __nicematrix _ | } #1
+\cs_set_eq:cc { __nicematrix _ \token_to_str:N @ : } { __nicematrix _ \token_to_str:N ! : }
+\cs_new_protected:cpn { __nicematrix _ | : } #1
{
\int_incr:N \l_tmpa_int
\__nicematrix_make_preamble_i_i:n
@@ -2305,7 +2319,7 @@
\cs_new_protected:Npn \__nicematrix_make_preamble_i_i:n #1
{
\str_if_eq:nnTF { #1 } { | }
- { \use:c { __nicematrix _ | } | }
+ { \use:c { __nicematrix _ | : } | }
{ \__nicematrix_make_preamble_i_ii:nn { } #1 }
}
\cs_new_protected:Npn \__nicematrix_make_preamble_i_ii:nn #1 #2
@@ -2334,10 +2348,10 @@
}
}
\int_zero:N \l_tmpa_int
- \str_if_eq:nnT { #1 } { \__nicematrix_stop: } { \bool_gset_true:N \g_tmpb_bool }
+ \str_if_eq:nnT { #1 } { \s_stop } { \bool_gset_true:N \g_tmpb_bool }
\__nicematrix_rec_preamble:n #1
}
-\cs_new_protected:cpn { __nicematrix _ > } #1 #2
+\cs_new_protected:cpn { __nicematrix _ > : } #1 #2
{
\tl_gput_right:Nn \g__nicematrix_pre_cell_tl { > { #2 } }
\__nicematrix_rec_preamble:n
@@ -2361,13 +2375,13 @@
b .code:n = \str_set:Nn \l__nicematrix_vpos_col_str { b } ,
b .value_forbidden:n = true
}
-\cs_new_protected:Npn \__nicematrix_p #1
+\cs_new_protected:Npn \__nicematrix_p: #1
{
\str_set:Nn \l__nicematrix_vpos_col_str { #1 }
\__nicematrix_make_preamble_ii_i:n
}
-\cs_set_eq:NN \__nicematrix_b \__nicematrix_p
-\cs_set_eq:NN \__nicematrix_m \__nicematrix_p
+\cs_set_eq:NN \__nicematrix_b: \__nicematrix_p:
+\cs_set_eq:NN \__nicematrix_m: \__nicematrix_p:
\cs_new_protected:Npn \__nicematrix_make_preamble_ii_i:n #1
{
\str_if_eq:nnTF { #1 } { [ }
@@ -2395,8 +2409,8 @@
\str_if_eq:eeTF \l__nicematrix_hpos_col_str { j }
{ \tl_clear:N \exp_not:N \l__nicematrix_hpos_cell_tl }
{
- \cs_set_nopar:Npn \exp_not:N \l__nicematrix_hpos_cell_tl
- { \str_lowercase:o \l__nicematrix_hpos_col_str }
+ \def \exp_not:N \l__nicematrix_hpos_cell_tl
+ { \str_lowercase:f { \l__nicematrix_hpos_col_str } }
}
\IfPackageLoadedTF { ragged2e }
{
@@ -2427,7 +2441,7 @@
{ j } { c }
{ si } { c }
}
- { \str_lowercase:o \l__nicematrix_hpos_col_str }
+ { \str_lowercase:f \l__nicematrix_hpos_col_str }
}
}
\int_gincr:N \c at jCol
@@ -2456,7 +2470,7 @@
\vrule height \box_ht:N \@arstrutbox width \c_zero_dim
\everypar { }
}
- \bool_if:NT \c__nicematrix_testphase_table_bool \tagpdfparaOn
+ \bool_if:NT \c__nicematrix_testphase_table_bool { \tagpdfparaOn }
#3
\g__nicematrix_row_style_tl
\arraybackslash
@@ -2469,7 +2483,7 @@
\use:c { end #7 }
#4
\__nicematrix_cell_end:
- \bool_if:NT \c__nicematrix_testphase_table_bool \tag_struct_end:
+ \bool_if:NT \c__nicematrix_testphase_table_bool { \tag_struct_end: }
}
}
}
@@ -2477,10 +2491,10 @@
{
\group_align_safe_begin:
\peek_meaning:NTF &
- \__nicematrix_the_cell_is_empty:
+ { \__nicematrix_the_cell_is_empty: }
{
\peek_meaning:NTF \\
- \__nicematrix_the_cell_is_empty:
+ { \__nicematrix_the_cell_is_empty: }
{
\peek_meaning:NTF \crcr
\__nicematrix_the_cell_is_empty:
@@ -2506,7 +2520,7 @@
{
\tl_gput_right:Nn \g__nicematrix_cell_after_hook_tl
{
- \int_compare:nNnT
+ \dim_compare:nNnT
{ \box_ht:N \l__nicematrix_cell_box }
>
{ \box_ht:N \strutbox }
@@ -2523,7 +2537,7 @@
}
}
}
-\cs_new_protected:Npn \__nicematrix_V #1 #2
+\cs_new_protected:Npn \__nicematrix_V: #1 #2
{
\str_if_eq:nnTF { #1 } { [ }
{ \__nicematrix_make_preamble_V_i:w [ }
@@ -2543,8 +2557,8 @@
\__nicematrix_make_preamble_ii_iv:nnn { #2 } { minipage } { }
}
}
-\cs_new_protected:Npn \__nicematrix_w { \__nicematrix_make_preamble_w:nnnn { } }
-\cs_new_protected:Npn \__nicematrix_W { \__nicematrix_make_preamble_w:nnnn { \__nicematrix_special_W: } }
+\cs_new_protected:Npn \__nicematrix_w: { \__nicematrix_make_preamble_w:nnnn { } }
+\cs_new_protected:Npn \__nicematrix_W: { \__nicematrix_make_preamble_w:nnnn { \__nicematrix_special_W: } }
\cs_new_protected:Npn \__nicematrix_make_preamble_w:nnnn #1 #2 #3 #4
{
\str_if_eq:nnTF { #3 } { s }
@@ -2583,7 +2597,7 @@
\dim_set:Nn \l__nicematrix_col_width_dim { #4 }
\hbox_set:Nw \l__nicematrix_cell_box
\__nicematrix_cell_begin:
- \cs_set_nopar:Npn \l__nicematrix_hpos_cell_tl { #3 }
+ \tl_set:Nn \l__nicematrix_hpos_cell_tl { #3 }
}
c
< {
@@ -2599,10 +2613,10 @@
}
\cs_new_protected:Npn \__nicematrix_special_W:
{
- \dim_compare:nNnT { \box_wd:N \l__nicematrix_cell_box } > \l__nicematrix_col_width_dim
+ \dim_compare:nNnT { \box_wd:N \l__nicematrix_cell_box } > { \l__nicematrix_col_width_dim }
{ \__nicematrix_warning:n { W~warning } }
}
-\cs_new_protected:Npn \__nicematrix_S #1 #2
+\cs_new_protected:Npn \__nicematrix_S: #1 #2
{
\str_if_eq:nnTF { #2 } { [ }
{ \__nicematrix_make_preamble_S:w [ }
@@ -2630,8 +2644,8 @@
\tl_gput_right:Ne \g__nicematrix_cell_after_hook_tl
{
\bool_if:NTF \l__siunitx_table_text_bool
- \bool_set_true:N
- \bool_set_false:N
+ { \bool_set_true:N }
+ { \bool_set_false:N }
\l__siunitx_table_text_bool
}
\__nicematrix_cell_end:
@@ -2640,10 +2654,10 @@
\int_gincr:N \c at jCol
\__nicematrix_rec_preamble_after_col:n
}
-\cs_new_protected:cpn { __nicematrix _ \token_to_str:N ( } #1 #2
+\cs_new_protected:cpn { __nicematrix _ \token_to_str:N ( : } #1 #2
{
\bool_if:NT \l__nicematrix_small_bool { \__nicematrix_fatal:n { Delimiter~with~small } }
- \int_if_zero:nTF \c at jCol
+ \int_if_zero:nTF { \c at jCol }
{
\tl_if_eq:NNTF \g__nicematrix_left_delim_tl \c__nicematrix_dot_tl
{
@@ -2658,8 +2672,8 @@
}
{ \__nicematrix_make_preamble_iv:nn { #1 } { #2 } }
}
-\cs_set_eq:cc { __nicematrix _ \token_to_str:N [ } { __nicematrix _ \token_to_str:N ( }
-\cs_set_eq:cc { __nicematrix _ \token_to_str:N \{ } { __nicematrix _ \token_to_str:N ( }
+\cs_set_eq:cc { __nicematrix _ \token_to_str:N [ : } { __nicematrix _ \token_to_str:N ( : }
+\cs_set_eq:cc { __nicematrix _ \token_to_str:N \{ : } { __nicematrix _ \token_to_str:N ( : }
\cs_new_protected:Npn \__nicematrix_make_preamble_iv:nn #1 #2
{
\tl_gput_right:Ne \g__nicematrix_pre_code_after_tl
@@ -2671,15 +2685,15 @@
}
{ \__nicematrix_rec_preamble:n #2 }
}
-\cs_new_protected:cpn { __nicematrix _ \token_to_str:N \left } #1
- { \use:c { __nicematrix _ \token_to_str:N ( } }
-\cs_new_protected:cpn { __nicematrix _ \token_to_str:N ) } #1 #2
+\cs_new_protected:cpn { __nicematrix _ \token_to_str:N \left : } #1
+ { \use:c { __nicematrix _ \token_to_str:N ( : } }
+\cs_new_protected:cpn { __nicematrix _ \token_to_str:N ) : } #1 #2
{
\bool_if:NT \l__nicematrix_small_bool { \__nicematrix_fatal:n { Delimiter~with~small } }
\tl_if_in:nnTF { ) ] \} } { #2 }
{ \__nicematrix_make_preamble_v:nnn #1 #2 }
{
- \str_if_eq:nnTF { \__nicematrix_stop: } { #2 }
+ \str_if_eq:nnTF { \s_stop } { #2 }
{
\tl_if_eq:NNTF \g__nicematrix_right_delim_tl \c__nicematrix_dot_tl
{ \tl_gset:Nn \g__nicematrix_right_delim_tl { #1 } }
@@ -2699,11 +2713,11 @@
}
}
}
-\cs_set_eq:cc { __nicematrix _ \token_to_str:N ] } { __nicematrix _ \token_to_str:N ) }
-\cs_set_eq:cc { __nicematrix _ \token_to_str:N \} } { __nicematrix _ \token_to_str:N ) }
+\cs_set_eq:cc { __nicematrix _ \token_to_str:N ] : } { __nicematrix _ \token_to_str:N ) : }
+\cs_set_eq:cc { __nicematrix _ \token_to_str:N \} : } { __nicematrix _ \token_to_str:N ) : }
\cs_new_protected:Npn \__nicematrix_make_preamble_v:nnn #1 #2 #3
{
- \str_if_eq:nnTF { \__nicematrix_stop: } { #3 }
+ \str_if_eq:nnTF { \s_stop } { #3 }
{
\tl_if_eq:NNTF \g__nicematrix_right_delim_tl \c__nicematrix_dot_tl
{
@@ -2726,15 +2740,15 @@
\__nicematrix_rec_preamble:n #3
}
}
-\cs_new_protected:cpn { __nicematrix _ \token_to_str:N \right } #1
- { \use:c { __nicematrix _ \token_to_str:N ) } }
+\cs_new_protected:cpn { __nicematrix _ \token_to_str:N \right : } #1
+ { \use:c { __nicematrix _ \token_to_str:N ) : } }
\cs_new_protected:Npn \__nicematrix_rec_preamble_after_col:n #1
{
\str_if_eq:nnTF { #1 } { < }
- \__nicematrix_rec_preamble_after_col_i:n
+ { \__nicematrix_rec_preamble_after_col_i:n }
{
\str_if_eq:nnTF { #1 } { @ }
- \__nicematrix_rec_preamble_after_col_ii:n
+ { \__nicematrix_rec_preamble_after_col_ii:n }
{
\str_if_eq:eeTF \l__nicematrix_vlines_clist { all }
{
@@ -2775,14 +2789,15 @@
}
\__nicematrix_rec_preamble:n
}
-\cs_new_protected:cpn { __nicematrix _ * } #1 #2 #3
+\cs_new_protected:cpn { __nicematrix _ * : } #1 #2 #3
{
\tl_clear:N \l_tmpa_tl
\int_step_inline:nn { #2 } { \tl_put_right:Nn \l_tmpa_tl { #3 } }
\exp_last_unbraced:No \__nicematrix_rec_preamble:n \l_tmpa_tl
}
-\cs_new_protected:cpn { __nicematrix _ \token_to_str:N \NC at find } #1 { \__nicematrix_rec_preamble:n }
-\cs_new_protected:Npn \__nicematrix_X #1 #2
+\cs_new_protected:cpn { __nicematrix _ \token_to_str:N \NC at find : } #1
+ { \__nicematrix_rec_preamble:n }
+\cs_new_protected:Npn \__nicematrix_X: #1 #2
{
\str_if_eq:nnTF { #2 } { [ }
{ \__nicematrix_make_preamble_X:w [ }
@@ -2791,25 +2806,24 @@
\cs_new_protected:Npn \__nicematrix_make_preamble_X:w [ #1 ]
{ \__nicematrix_make_preamble_X_i:n { #1 } }
\keys_define:nn { nicematrix / X-column }
- { unknown .code:n = \int_set:Nn \l__nicematrix_weight_int { \l_keys_key_str } }
+ {
+ unknown .code:n =
+ \regex_match:nVTF { \A[0-9]*\.?[0-9]*\Z } \l_keys_key_str
+ { \fp_set:Nn \l_tmpa_fp { \l_keys_key_str } }
+ { \__nicematrix_error_or_warning:n { invalid~weight } }
+ }
\cs_new_protected:Npn \__nicematrix_make_preamble_X_i:n #1
{
\str_set:Nn \l__nicematrix_hpos_col_str { j }
\str_set:Nn \l__nicematrix_vpos_col_str { p }
- \int_zero_new:N \l__nicematrix_weight_int
- \int_set_eq:NN \l__nicematrix_weight_int \c_one_int
+ \fp_set:Nn \l_tmpa_fp { 1.0 }
\__nicematrix_keys_p_column:n { #1 }
\keys_set:no { nicematrix / X-column } \l_tmpa_tl
- \int_compare:nNnT \l__nicematrix_weight_int < \c_zero_int
- {
- \__nicematrix_error_or_warning:n { negative~weight }
- \int_set:Nn \l__nicematrix_weight_int { - \l__nicematrix_weight_int }
- }
- \int_gadd:Nn \g__nicematrix_total_X_weight_int \l__nicematrix_weight_int
+ \fp_gadd:Nn \g__nicematrix_total_X_weight_fp \l_tmpa_fp
\bool_if:NTF \l__nicematrix_X_columns_aux_bool
{
\__nicematrix_make_preamble_ii_iv:nnn
- { \l__nicematrix_weight_int \l__nicematrix_X_columns_dim }
+ { \fp_use:N \l_tmpa_fp \l__nicematrix_X_columns_dim }
{ minipage }
{ \__nicematrix_no_update_width: }
}
@@ -2847,15 +2861,19 @@
{ \exp_not:N ! { \skip_horizontal:N \arrayrulewidth } }
\__nicematrix_rec_preamble:n
}
-\cs_set_eq:cN { __nicematrix _ \token_to_str:N \__nicematrix_stop: } \use_none:n
-\cs_new_protected:cpn { __nicematrix _ \token_to_str:N \hline }
+\cs_set_eq:cN { __nicematrix _ \token_to_str:N \s_stop : } \use_none:n
+\cs_new_protected:cpn { __nicematrix _ \token_to_str:N \hline : }
{ \__nicematrix_fatal:n { Preamble~forgotten } }
-\cs_set_eq:cc { __nicematrix _ \token_to_str:N \Hline } { __nicematrix _ \token_to_str:N \hline }
-\cs_set_eq:cc { __nicematrix _ \token_to_str:N \toprule } { __nicematrix _ \token_to_str:N \hline }
-\cs_set_eq:cc { __nicematrix _ \token_to_str:N \Block } { __nicematrix _ \token_to_str:N \hline }
-\cs_set_eq:cc { __nicematrix _ \token_to_str:N \CodeBefore } { __nicematrix _ \token_to_str:N \hline }
-\cs_set_eq:cc { __nicematrix _ \token_to_str:N \RowStyle } { __nicematrix _ \token_to_str:N \hline }
-\cs_set_eq:cc { __nicematrix _ \token_to_str:N \diagbox } { __nicematrix _ \token_to_str:N \hline }
+\cs_set_eq:cc { __nicematrix _ \token_to_str:N \Hline : } { __nicematrix _ \token_to_str:N \hline : }
+\cs_set_eq:cc { __nicematrix _ \token_to_str:N \toprule : }
+ { __nicematrix _ \token_to_str:N \hline : }
+\cs_set_eq:cc { __nicematrix _ \token_to_str:N \Block : } { __nicematrix _ \token_to_str:N \hline : }
+\cs_set_eq:cc { __nicematrix _ \token_to_str:N \CodeBefore : }
+ { __nicematrix _ \token_to_str:N \hline : }
+\cs_set_eq:cc { __nicematrix _ \token_to_str:N \RowStyle : }
+ { __nicematrix _ \token_to_str:N \hline : }
+\cs_set_eq:cc { __nicematrix _ \token_to_str:N \diagbox : }
+ { __nicematrix _ \token_to_str:N \hline : }
\cs_new:Npn \__nicematrix_multicolumn:nnn #1 #2 #3
{
\multispan { #1 }
@@ -2863,7 +2881,7 @@
\begingroup
\bool_if:NT \c__nicematrix_testphase_table_bool
{ \tbl_update_multicolumn_cell_data:n { #1 } }
- \cs_set_nopar:Npn \@addamp
+ \def \@addamp
{ \legacy_if:nTF { @firstamp } { \@firstampfalse } { \@preamerr 5 } }
\tl_gclear:N \g__nicematrix_preamble_tl
\__nicematrix_make_m_preamble:n #2 \q_stop
@@ -2872,7 +2890,7 @@
\endgroup
\bool_if:NT \c__nicematrix_recent_array_bool
{ \UseTaggingSocket { tbl / colspan } { #1 } }
- \int_compare:nNnT { #1 } > \c_one_int
+ \int_compare:nNnT { #1 } > { \c_one_int }
{
\seq_gput_left:Ne \g__nicematrix_multicolumn_cells_seq
{ \int_use:N \c at iRow - \int_eval:n { \c at jCol + 1 } }
@@ -2880,13 +2898,13 @@
\seq_gput_right:Ne \g__nicematrix_pos_of_blocks_seq
{
{
- \int_if_zero:nTF \c at jCol
+ \int_if_zero:nTF { \c at jCol }
{ \int_eval:n { \c at iRow + 1 } }
{ \int_use:N \c at iRow }
}
{ \int_eval:n { \c at jCol + 1 } }
{
- \int_if_zero:nTF \c at jCol
+ \int_if_zero:nTF { \c at jCol }
{ \int_eval:n { \c at iRow + 1 } }
{ \int_use:N \c at iRow }
}
@@ -2903,14 +2921,14 @@
{ \int_use:N \c at iRow - \int_use:N \c at jCol }
{ \int_use:N \c at iRow - \int_eval:n { \c at jCol + #1 } }
}
- \ignorespaces
+ \ignorespaces
}
- \cs_set_nopar:Npn \@sharp { #3 }
+ \def \@sharp { #3 }
\@arstrut
\@preamble
\null
\int_gadd:Nn \c at jCol { #1 - 1 }
- \int_compare:nNnT \c at jCol > \g__nicematrix_col_total_int
+ \int_compare:nNnT { \c at jCol } > { \g__nicematrix_col_total_int }
{ \int_gset_eq:NN \g__nicematrix_col_total_int \c at jCol }
\ignorespaces
}
@@ -2949,7 +2967,7 @@
{
\tl_gput_right:Nn \g__nicematrix_preamble_tl
{
- > { \__nicematrix_cell_begin: \cs_set_nopar:Npn \l__nicematrix_hpos_cell_tl { #1 } }
+ > { \__nicematrix_cell_begin: \tl_set:Nn \l__nicematrix_hpos_cell_tl { #1 } }
#1
< \__nicematrix_cell_end:
}
@@ -2993,13 +3011,13 @@
\dim_set:Nn \l__nicematrix_col_width_dim { #4 }
\hbox_set:Nw \l__nicematrix_cell_box
\__nicematrix_cell_begin:
- \cs_set_nopar:Npn \l__nicematrix_hpos_cell_tl { #3 }
+ \tl_set:Nn \l__nicematrix_hpos_cell_tl { #3 }
}
c
< {
\__nicematrix_cell_end:
\hbox_set_end:
- \bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
+ \bool_if:NT \g__nicematrix_rotate_bool { \__nicematrix_rotate_cell_box: }
#1
\__nicematrix_adjust_size_box:
\makebox [ #4 ] [ #3 ] { \box_use_drop:N \l__nicematrix_cell_box }
@@ -3010,7 +3028,7 @@
\cs_new_protected:Npn \__nicematrix_make_m_preamble_x:n #1
{
\str_if_eq:nnTF { #1 } { < }
- \__nicematrix_make_m_preamble_ix:n
+ { \__nicematrix_make_m_preamble_ix:n }
{ \__nicematrix_make_m_preamble:n { #1 } }
}
\cs_new_protected:Npn \__nicematrix_make_m_preamble_ix:n #1
@@ -3024,7 +3042,7 @@
\box_set_dp:Nn \l_tmpa_box { \box_dp:N \l_tmpa_box + \l_tmpb_dim }
\str_if_eq:eeTF \l__nicematrix_baseline_tl { c }
{ \box_use_drop:N \l_tmpa_box }
- \__nicematrix_put_box_in_flow_i:
+ { \__nicematrix_put_box_in_flow_i: }
}
\cs_new_protected:Npn \__nicematrix_put_box_in_flow_i:
{
@@ -3049,13 +3067,13 @@
\str_if_eq:eeTF \l__nicematrix_baseline_tl { t }
{ \int_set_eq:NN \l_tmpa_int \c_one_int }
{
- \str_if_eq:onTF \l__nicematrix_baseline_tl { b }
+ \str_if_eq:onTF \l__nicematrix_baseline_tl { b }
{ \int_set_eq:NN \l_tmpa_int \c at iRow }
{ \int_set:Nn \l_tmpa_int \l__nicematrix_baseline_tl }
}
\bool_lazy_or:nnT
- { \int_compare_p:nNn \l_tmpa_int < \l__nicematrix_first_row_int }
- { \int_compare_p:nNn \l_tmpa_int > \g__nicematrix_row_total_int }
+ { \int_compare_p:nNn { \l_tmpa_int } < { \l__nicematrix_first_row_int } }
+ { \int_compare_p:nNn { \l_tmpa_int } > { \g__nicematrix_row_total_int } }
{
\__nicematrix_error:n { bad~value~for~baseline }
\int_set_eq:NN \l_tmpa_int \c_one_int
@@ -3072,7 +3090,7 @@
{
\bool_if:NT \l__nicematrix_NiceMatrix_without_vlines_bool
{
- \int_compare:nNnT \c at jCol > \c_one_int
+ \int_compare:nNnT { \c at jCol } > { \c_one_int }
{
\box_set_wd:Nn \l__nicematrix_the_array_box
{ \box_wd:N \l__nicematrix_the_array_box - \arraycolsep }
@@ -3086,7 +3104,7 @@
\bool_set_false:N \g__nicematrix_caption_finished_bool
\int_gzero:N \c at tabularnote
\__nicematrix_insert_caption:
- \int_compare:nNnT \g__nicematrix_notes_caption_int > \c_zero_int
+ \int_compare:nNnT { \g__nicematrix_notes_caption_int } > { \c_zero_int }
{
\tl_gput_right:Ne \g__nicematrix_aux_tl
{
@@ -3101,7 +3119,7 @@
{
\box_use_drop:N \l__nicematrix_the_array_box
\__nicematrix_create_extra_nodes:
- \seq_if_empty:NF \g__nicematrix_blocks_seq \__nicematrix_draw_blocks:
+ \seq_if_empty:NF \g__nicematrix_blocks_seq { \__nicematrix_draw_blocks: }
}
\bool_lazy_any:nT
{
@@ -3111,7 +3129,7 @@
}
\__nicematrix_insert_tabularnotes:
\cs_set_eq:NN \tabularnote \__nicematrix_tabularnote_error:n
- \bool_if:NF \l__nicematrix_caption_above_bool \__nicematrix_insert_caption:
+ \bool_if:NF \l__nicematrix_caption_above_bool { \__nicematrix_insert_caption: }
\end { minipage }
}
\cs_new_protected:Npn \__nicematrix_insert_caption:
@@ -3159,7 +3177,7 @@
\g__nicematrix_tabularnote_tl \par
\tl_gclear:N \g__nicematrix_tabularnote_tl
}
- \int_compare:nNnT \c at tabularnote > \c_zero_int
+ \int_compare:nNnT { \c at tabularnote } > { \c_zero_int }
{
\bool_if:NTF \l__nicematrix_notes_para_bool
{
@@ -3209,7 +3227,7 @@
\dim_gsub:Nn \g_tmpa_dim \pgf at y
\endpgfpicture
\dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
- \int_if_zero:nT \l__nicematrix_first_row_int
+ \int_if_zero:nT { \l__nicematrix_first_row_int }
{
\dim_gadd:Nn \g_tmpa_dim \g__nicematrix_ht_row_zero_dim
\dim_gadd:Nn \g_tmpa_dim \g__nicematrix_dp_row_zero_dim
@@ -3219,7 +3237,7 @@
\cs_new_protected:Npn \__nicematrix_use_arraybox_with_notes:
{
\str_if_eq:eeT \l__nicematrix_baseline_tl { t }
- { \cs_set_nopar:Npn \l__nicematrix_baseline_tl { 1 } }
+ { \tl_set:Nn \l__nicematrix_baseline_tl { 1 } }
\pgfpicture
\__nicematrix_qpoint:n { row - 1 }
\dim_gset_eq:NN \g_tmpa_dim \pgf at y
@@ -3229,7 +3247,7 @@
{
\str_range:Nnn
\l__nicematrix_baseline_tl
- 6
+ { 6 }
{ \tl_count:o \l__nicematrix_baseline_tl }
}
\__nicematrix_qpoint:n { row - \int_use:N \l_tmpa_int }
@@ -3237,8 +3255,8 @@
{
\int_set:Nn \l_tmpa_int \l__nicematrix_baseline_tl
\bool_lazy_or:nnT
- { \int_compare_p:nNn \l_tmpa_int < \l__nicematrix_first_row_int }
- { \int_compare_p:nNn \l_tmpa_int > \g__nicematrix_row_total_int }
+ { \int_compare_p:nNn { \l_tmpa_int } < { \l__nicematrix_first_row_int } }
+ { \int_compare_p:nNn { \l_tmpa_int } > { \g__nicematrix_row_total_int } }
{
\__nicematrix_error:n { bad~value~for~baseline }
\int_set:Nn \l_tmpa_int 1
@@ -3248,7 +3266,7 @@
\dim_gsub:Nn \g_tmpa_dim \pgf at y
\endpgfpicture
\dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
- \int_if_zero:nT \l__nicematrix_first_row_int
+ \int_if_zero:nT { \l__nicematrix_first_row_int }
{
\dim_gadd:Nn \g_tmpa_dim \g__nicematrix_ht_row_zero_dim
\dim_gadd:Nn \g_tmpa_dim \g__nicematrix_dp_row_zero_dim
@@ -3288,11 +3306,9 @@
}
\dim_set:Nn \l__nicematrix_real_right_delim_dim
{ \box_wd:N \l_tmpb_box - \nulldelimiterspace }
- \skip_horizontal:N \l__nicematrix_left_delim_dim
- \skip_horizontal:N -\l__nicematrix_real_left_delim_dim
+ \skip_horizontal:n { \l__nicematrix_left_delim_dim - \l__nicematrix_real_left_delim_dim }
\__nicematrix_put_box_in_flow:
- \skip_horizontal:N \l__nicematrix_right_delim_dim
- \skip_horizontal:N -\l__nicematrix_real_right_delim_dim
+ \skip_horizontal:n { \l__nicematrix_right_delim_dim - \l__nicematrix_real_right_delim_dim }
}
\NewDocumentEnvironment { __nicematrix-normal-syntax } { }
{
@@ -3299,7 +3315,7 @@
\peek_remove_spaces:n
{
\peek_meaning:NTF \end
- \__nicematrix_analyze_end:Nn
+ { \__nicematrix_analyze_end:Nn }
{
\__nicematrix_transform_preamble:
\__nicematrix_array:o \g__nicematrix_array_preamble_tl
@@ -3324,19 +3340,19 @@
\__nicematrix_create_col_nodes:
\endarray
}
-\cs_new_protected:Npn \__nicematrix_light_syntax_i:w #1\CodeAfter #2\q_stop
+\cs_new_protected:Npn \__nicematrix_light_syntax_i:w #1\CodeAfter #2 \q_stop
{
\tl_gput_right:Nn \g_nicematrix_code_after_tl { #2 }
\seq_clear_new:N \l__nicematrix_rows_seq
\tl_set_rescan:Nno \l__nicematrix_end_of_row_tl { } \l__nicematrix_end_of_row_tl
\bool_if:NTF \l__nicematrix_light_syntax_expanded_bool
- \seq_set_split:Nee
- \seq_set_split:Non
+ { \seq_set_split:Nee }
+ { \seq_set_split:Non }
\l__nicematrix_rows_seq \l__nicematrix_end_of_row_tl { #1 }
\seq_pop_right:NN \l__nicematrix_rows_seq \l_tmpa_tl
\tl_if_empty:NF \l_tmpa_tl
{ \seq_put_right:No \l__nicematrix_rows_seq \l_tmpa_tl }
- \int_compare:nNnT \l__nicematrix_last_row_int = { -1 }
+ \int_compare:nNnT { \l__nicematrix_last_row_int } = { -1 }
{ \int_set:Nn \l__nicematrix_last_row_int { \seq_count:N \l__nicematrix_rows_seq } }
\tl_build_begin:N \l__nicematrix_new_body_tl
\int_zero_new:N \l__nicematrix_nb_cols_int
@@ -3348,7 +3364,7 @@
\__nicematrix_line_with_light_syntax:n { ##1 }
}
\tl_build_end:N \l__nicematrix_new_body_tl
- \int_compare:nNnT \l__nicematrix_last_col_int = { -1 }
+ \int_compare:nNnT { \l__nicematrix_last_col_int } = { -1 }
{
\int_set:Nn \l__nicematrix_last_col_int
{ \l__nicematrix_nb_cols_int - 1 + \l__nicematrix_first_col_int }
@@ -3356,7 +3372,6 @@
\__nicematrix_transform_preamble:
\__nicematrix_array:o \g__nicematrix_array_preamble_tl \l__nicematrix_new_body_tl
}
-\cs_generate_variant:Nn \__nicematrix_line_with_light_syntax:n { o }
\cs_new_protected:Npn \__nicematrix_line_with_light_syntax:n #1
{
\seq_clear_new:N \l__nicematrix_cells_seq
@@ -3364,7 +3379,7 @@
\int_set:Nn \l__nicematrix_nb_cols_int
{
\int_max:nn
- \l__nicematrix_nb_cols_int
+ { \l__nicematrix_nb_cols_int }
{ \seq_count:N \l__nicematrix_cells_seq }
}
\seq_pop_left:NN \l__nicematrix_cells_seq \l_tmpa_tl
@@ -3372,6 +3387,7 @@
\seq_map_inline:Nn \l__nicematrix_cells_seq
{ \tl_build_put_right:Nn \l__nicematrix_new_body_tl { & ##1 } }
}
+\cs_generate_variant:Nn \__nicematrix_line_with_light_syntax:n { o }
\cs_new_protected:Npn \__nicematrix_analyze_end:Nn #1 #2
{
\str_if_eq:eeT \g__nicematrix_name_env_str { #2 }
@@ -3381,7 +3397,7 @@
\cs_new:Npn \__nicematrix_create_col_nodes:
{
\crcr
- \int_if_zero:nT \l__nicematrix_first_col_int
+ \int_if_zero:nT { \l__nicematrix_first_col_int }
{
\omit
\hbox_overlap_left:n
@@ -3394,22 +3410,21 @@
\str_if_empty:NF \l__nicematrix_name_str
{ \pgfnodealias { \l__nicematrix_name_str - col - 0 } { \__nicematrix_env: - col - 0 } }
\endpgfpicture
- \skip_horizontal:N 2\col at sep
- \skip_horizontal:N \g__nicematrix_width_first_col_dim
+ \skip_horizontal:n { 2 \col at sep + \g__nicematrix_width_first_col_dim }
}
&
}
\omit
\bool_gset_true:N \g__nicematrix_row_of_col_done_bool
- \int_if_zero:nTF \l__nicematrix_first_col_int
+ \int_if_zero:nTF { \l__nicematrix_first_col_int }
{
\bool_if:NT \l__nicematrix_code_before_bool
{
\hbox
{
- \skip_horizontal:N -0.5\arrayrulewidth
+ \skip_horizontal:n { -0.5 \arrayrulewidth }
\pgfsys at markposition { \__nicematrix_env: - col - 1 }
- \skip_horizontal:N 0.5\arrayrulewidth
+ \skip_horizontal:n { 0.5 \arrayrulewidth }
}
}
\pgfpicture
@@ -3425,9 +3440,9 @@
{
\hbox
{
- \skip_horizontal:N 0.5\arrayrulewidth
+ \skip_horizontal:n { 0.5 \arrayrulewidth }
\pgfsys at markposition { \__nicematrix_env: - col - 1 }
- \skip_horizontal:N -0.5\arrayrulewidth
+ \skip_horizontal:n { -0.5 \arrayrulewidth }
}
}
\pgfpicture
@@ -3440,10 +3455,10 @@
}
\skip_gset:Nn \g_tmpa_skip { 0 pt~plus 1 fill }
\bool_if:NF \l__nicematrix_auto_columns_width_bool
- { \dim_compare:nNnT \l__nicematrix_columns_width_dim > \c_zero_dim }
+ { \dim_compare:nNnT { \l__nicematrix_columns_width_dim } > { \c_zero_dim } }
{
\bool_lazy_and:nnTF
- \l__nicematrix_auto_columns_width_bool
+ { \l__nicematrix_auto_columns_width_bool }
{ \bool_not_p:n \l__nicematrix_block_auto_columns_width_bool }
{ \skip_gadd:Nn \g_tmpa_skip \g__nicematrix_max_cell_width_dim }
{ \skip_gadd:Nn \g_tmpa_skip \l__nicematrix_columns_width_dim }
@@ -3456,9 +3471,9 @@
{
\hbox
{
- \skip_horizontal:N -0.5\arrayrulewidth
+ \skip_horizontal:n { -0.5 \arrayrulewidth }
\pgfsys at markposition { \__nicematrix_env: - col - 2 }
- \skip_horizontal:N 0.5\arrayrulewidth
+ \skip_horizontal:n { 0.5 \arrayrulewidth }
}
}
\pgfpicture
@@ -3471,8 +3486,8 @@
}
\int_gset_eq:NN \g_tmpa_int \c_one_int
\bool_if:NTF \g__nicematrix_last_col_found_bool
- { \prg_replicate:nn { \int_max:nn { \g__nicematrix_col_total_int - 3 } \c_zero_int } }
- { \prg_replicate:nn { \int_max:nn { \g__nicematrix_col_total_int - 2 } \c_zero_int } }
+ { \prg_replicate:nn { \int_max:nn { \g__nicematrix_col_total_int - 3 } { 0 } } }
+ { \prg_replicate:nn { \int_max:nn { \g__nicematrix_col_total_int - 2 } { 0 } } }
{
&
\omit
@@ -3482,10 +3497,10 @@
{
\hbox
{
- \skip_horizontal:N -0.5\arrayrulewidth
+ \skip_horizontal:n { -0.5 \arrayrulewidth }
\pgfsys at markposition
{ \__nicematrix_env: - col - \int_eval:n { \g_tmpa_int + 1 } }
- \skip_horizontal:N 0.5\arrayrulewidth
+ \skip_horizontal:n { 0.5 \arrayrulewidth }
}
}
\pgfpicture
@@ -3502,7 +3517,7 @@
}
&
\omit
- \int_if_zero:nT \g__nicematrix_col_total_int
+ \int_if_zero:nT { \g__nicematrix_col_total_int }
{ \skip_gset:Nn \g_tmpa_skip { 0 pt~plus 1 fill } }
\skip_horizontal:N \g_tmpa_skip
\int_gincr:N \g_tmpa_int
@@ -3514,17 +3529,17 @@
\l__nicematrix_exterior_arraycolsep_bool
\l__nicematrix_bar_at_end_of_pream_bool
}
- { \skip_horizontal:N -\col at sep }
+ { \skip_horizontal:n { - \col at sep } }
\bool_if:NT \l__nicematrix_code_before_bool
{
\hbox
{
- \skip_horizontal:N -0.5\arrayrulewidth
+ \skip_horizontal:n { -0.5 \arrayrulewidth }
\bool_if:NT \l__nicematrix_NiceMatrix_without_vlines_bool
- { \skip_horizontal:N -\arraycolsep }
+ { \skip_horizontal:n { - \arraycolsep } }
\pgfsys at markposition
{ \__nicematrix_env: - col - \int_eval:n { \g_tmpa_int + 1 } }
- \skip_horizontal:N 0.5\arrayrulewidth
+ \skip_horizontal:n { 0.5 \arrayrulewidth }
\bool_if:NT \l__nicematrix_NiceMatrix_without_vlines_bool
{ \skip_horizontal:N \arraycolsep }
}
@@ -3588,11 +3603,11 @@
\hbox_set:Nw \l__nicematrix_cell_box
\__nicematrix_math_toggle:
\__nicematrix_tuning_key_small:
- \int_compare:nNnT \c at iRow > \c_zero_int
+ \int_compare:nNnT { \c at iRow } > { \c_zero_int }
{
\bool_lazy_or:nnT
- { \int_compare_p:nNn \l__nicematrix_last_row_int < \c_zero_int }
- { \int_compare_p:nNn \c at iRow < \l__nicematrix_last_row_int }
+ { \int_compare_p:nNn { \l__nicematrix_last_row_int } < { \c_zero_int } }
+ { \int_compare_p:nNn { \c at iRow } < { \l__nicematrix_last_row_int } }
{
\l__nicematrix_code_for_first_col_tl
\xglobal \colorlet { nicematrix-first-col } { . }
@@ -3604,15 +3619,15 @@
{
\__nicematrix_math_toggle:
\hbox_set_end:
- \bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
+ \bool_if:NT \g__nicematrix_rotate_bool { \__nicematrix_rotate_cell_box: }
\__nicematrix_adjust_size_box:
\__nicematrix_update_for_first_and_last_row:
\dim_gset:Nn \g__nicematrix_width_first_col_dim
- { \dim_max:nn \g__nicematrix_width_first_col_dim { \box_wd:N \l__nicematrix_cell_box } }
+ { \dim_max:nn { \g__nicematrix_width_first_col_dim } { \box_wd:N \l__nicematrix_cell_box } }
\hbox_overlap_left:n
{
- \dim_compare:nNnTF { \box_wd:N \l__nicematrix_cell_box } > \c_zero_dim
- \__nicematrix_node_for_cell:
+ \dim_compare:nNnTF { \box_wd:N \l__nicematrix_cell_box } > { \c_zero_dim }
+ { \__nicematrix_node_cell: }
{ \box_use_drop:N \l__nicematrix_cell_box }
\skip_horizontal:N \l__nicematrix_left_delim_dim
\skip_horizontal:N \l__nicematrix_left_margin_dim
@@ -3619,7 +3634,7 @@
\skip_horizontal:N \l__nicematrix_extra_left_margin_dim
}
\bool_gset_false:N \g__nicematrix_empty_cell_bool
- \skip_horizontal:N -2\col at sep
+ \skip_horizontal:n { -2 \col at sep }
}
}
\tl_const:Nn \c__nicematrix_preamble_last_col_tl
@@ -3634,11 +3649,11 @@
\hbox_set:Nw \l__nicematrix_cell_box
\__nicematrix_math_toggle:
\__nicematrix_tuning_key_small:
- \int_compare:nNnT \c at iRow > \c_zero_int
+ \int_compare:nNnT { \c at iRow } > { \c_zero_int }
{
\bool_lazy_or:nnT
- { \int_compare_p:nNn \l__nicematrix_last_row_int < \c_zero_int }
- { \int_compare_p:nNn \c at iRow < \l__nicematrix_last_row_int }
+ { \int_compare_p:nNn { \l__nicematrix_last_row_int } < { \c_zero_int } }
+ { \int_compare_p:nNn { \c at iRow } < { \l__nicematrix_last_row_int } }
{
\l__nicematrix_code_for_last_col_tl
\xglobal \colorlet { nicematrix-last-col } { . }
@@ -3650,20 +3665,20 @@
{
\__nicematrix_math_toggle:
\hbox_set_end:
- \bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
+ \bool_if:NT \g__nicematrix_rotate_bool { \__nicematrix_rotate_cell_box: }
\__nicematrix_adjust_size_box:
\__nicematrix_update_for_first_and_last_row:
\dim_gset:Nn \g__nicematrix_width_last_col_dim
- { \dim_max:nn \g__nicematrix_width_last_col_dim { \box_wd:N \l__nicematrix_cell_box } }
- \skip_horizontal:N -2\col at sep
+ { \dim_max:nn { \g__nicematrix_width_last_col_dim } { \box_wd:N \l__nicematrix_cell_box } }
+ \skip_horizontal:n { -2 \col at sep }
\hbox_overlap_right:n
{
- \dim_compare:nNnT { \box_wd:N \l__nicematrix_cell_box } > \c_zero_dim
+ \dim_compare:nNnT { \box_wd:N \l__nicematrix_cell_box } > { \c_zero_dim }
{
\skip_horizontal:N \l__nicematrix_right_delim_dim
\skip_horizontal:N \l__nicematrix_right_margin_dim
\skip_horizontal:N \l__nicematrix_extra_right_margin_dim
- \__nicematrix_node_for_cell:
+ \__nicematrix_node_cell:
}
}
\bool_gset_false:N \g__nicematrix_empty_cell_bool
@@ -3677,7 +3692,7 @@
\NiceArrayWithDelims . .
}
{ \endNiceArrayWithDelims }
-\cs_new_protected:Npn \__nicematrix_def_env:nnn #1 #2 #3
+\cs_new_protected:Npn \__nicematrix_def_env:NNN #1 #2 #3
{
\NewDocumentEnvironment { #1 NiceArray } { }
{
@@ -3689,12 +3704,11 @@
}
{ \endNiceArrayWithDelims }
}
-\__nicematrix_def_env:nnn p ( )
-\__nicematrix_def_env:nnn b [ ]
-\__nicematrix_def_env:nnn B \{ \}
-\__nicematrix_def_env:nnn v | |
-\__nicematrix_def_env:nnn V \| \|
-\cs_generate_variant:Nn \__nicematrix_begin_of_NiceMatrix:nn { n o }
+\__nicematrix_def_env:NNN p ( )
+\__nicematrix_def_env:NNN b [ ]
+\__nicematrix_def_env:NNN B \{ \}
+\__nicematrix_def_env:NNN v | |
+\__nicematrix_def_env:NNN V \| \|
\cs_new_protected:Npn \__nicematrix_begin_of_NiceMatrix:nn #1 #2
{
\bool_set_false:N \l__nicematrix_preamble_bool
@@ -3717,6 +3731,7 @@
\tl_set:Nn \l_tmpb_tl { \use:c { #1 NiceArray } }
\exp_args:No \l_tmpb_tl \l_tmpa_tl
}
+\cs_generate_variant:Nn \__nicematrix_begin_of_NiceMatrix:nn { n o }
\clist_map_inline:nn { p , b , B , v , V }
{
\NewDocumentEnvironment { #1 NiceMatrix } { ! O { } }
@@ -3723,13 +3738,13 @@
{
\bool_gset_true:N \g__nicematrix_delims_bool
\str_gset:Nn \g__nicematrix_name_env_str { #1 NiceMatrix }
- \int_if_zero:nT \l__nicematrix_last_col_int
+ \int_if_zero:nT { \l__nicematrix_last_col_int }
{
\bool_set_true:N \l__nicematrix_last_col_without_value_bool
\int_set:Nn \l__nicematrix_last_col_int { -1 }
}
\keys_set:nn { nicematrix / NiceMatrix } { ##1 }
- \__nicematrix_begin_of_NiceMatrix:no { #1 } \l__nicematrix_columns_type_tl
+ \__nicematrix_begin_of_NiceMatrix:no { #1 } { \l__nicematrix_columns_type_tl }
}
{ \use:c { end #1 NiceArray } }
}
@@ -3736,7 +3751,7 @@
\NewDocumentEnvironment { NiceMatrix } { ! O { } }
{
\str_gset:Nn \g__nicematrix_name_env_str { NiceMatrix }
- \int_if_zero:nT \l__nicematrix_last_col_int
+ \int_if_zero:nT { \l__nicematrix_last_col_int }
{
\bool_set_true:N \l__nicematrix_last_col_without_value_bool
\int_set:Nn \l__nicematrix_last_col_int { -1 }
@@ -3746,7 +3761,7 @@
{ \clist_if_empty_p:N \l__nicematrix_vlines_clist }
{ \l__nicematrix_except_borders_bool }
{ \bool_set_true:N \l__nicematrix_NiceMatrix_without_vlines_bool }
- \__nicematrix_begin_of_NiceMatrix:no { } \l__nicematrix_columns_type_tl
+ \__nicematrix_begin_of_NiceMatrix:no { } { \l__nicematrix_columns_type_tl }
}
{ \endNiceArray }
\cs_new_protected:Npn \__nicematrix_NotEmpty:
@@ -3753,7 +3768,7 @@
{ \bool_gset_true:N \g__nicematrix_not_empty_cell_bool }
\NewDocumentEnvironment { NiceTabular } { O { } m ! O { } }
{
- \dim_compare:nNnT \l__nicematrix_width_dim = \c_zero_dim
+ \dim_compare:nNnT { \l__nicematrix_width_dim } = { \c_zero_dim }
{ \dim_set_eq:NN \l__nicematrix_width_dim \linewidth }
\str_gset:Nn \g__nicematrix_name_env_str { NiceTabular }
\keys_set:nn { nicematrix / NiceTabular } { #1 , #3 }
@@ -3795,7 +3810,6 @@
\NewDocumentEnvironment { NiceTabularX } { m O { } m ! O { } }
{
\str_gset:Nn \g__nicematrix_name_env_str { NiceTabularX }
- \dim_zero_new:N \l__nicematrix_width_dim
\dim_set:Nn \l__nicematrix_width_dim { #1 }
\keys_set:nn { nicematrix / NiceTabular } { #2 , #4 }
\__nicematrix_settings_for_tabular:
@@ -3803,7 +3817,7 @@
}
{
\endNiceArray
- \int_if_zero:nT \g__nicematrix_total_X_weight_int
+ \fp_compare:nNnT { \g__nicematrix_total_X_weight_fp } = { \c_zero_fp }
{ \__nicematrix_error:n { NiceTabularX~without~X } }
}
\NewDocumentEnvironment { NiceTabular* } { m O { } m ! O { } }
@@ -3819,8 +3833,8 @@
{
\bool_lazy_all:nT
{
- { \int_compare_p:nNn \l__nicematrix_tab_rounded_corners_dim > \c_zero_dim }
- \l__nicematrix_hvlines_bool
+ { \dim_compare_p:nNn { \l__nicematrix_tab_rounded_corners_dim } > { \c_zero_dim } }
+ { \l__nicematrix_hvlines_bool }
{ ! \g__nicematrix_delims_bool }
{ ! \l__nicematrix_except_borders_bool }
}
@@ -3882,58 +3896,21 @@
}
\__nicematrix_create_diag_nodes:
\pgfpicture
- \int_step_inline:nn \c at iRow
- {
- \pgfnodealias
- { \__nicematrix_env: - ##1 - last }
- { \__nicematrix_env: - ##1 - \int_use:N \c at jCol }
- }
- \int_step_inline:nn \c at jCol
- {
- \pgfnodealias
- { \__nicematrix_env: - last - ##1 }
- { \__nicematrix_env: - \int_use:N \c at iRow - ##1 }
- }
- \str_if_empty:NF \l__nicematrix_name_str
- {
- \int_step_inline:nn \c at iRow
- {
- \pgfnodealias
- { \l__nicematrix_name_str - ##1 - last }
- { \__nicematrix_env: - ##1 - \int_use:N \c at jCol }
- }
- \int_step_inline:nn \c at jCol
- {
- \pgfnodealias
- { \l__nicematrix_name_str - last - ##1 }
- { \__nicematrix_env: - \int_use:N \c at iRow - ##1 }
- }
- }
+ \__nicematrix_create_aliases_last:
+ \str_if_empty:NF \l__nicematrix_name_str { \__nicematrix_create_alias_nodes: }
\endpgfpicture
\bool_if:NT \l__nicematrix_parallelize_diags_bool
{
- \int_gzero_new:N \g__nicematrix_ddots_int
- \int_gzero_new:N \g__nicematrix_iddots_int
- \dim_gzero_new:N \g__nicematrix_delta_x_one_dim
- \dim_gzero_new:N \g__nicematrix_delta_y_one_dim
- \dim_gzero_new:N \g__nicematrix_delta_x_two_dim
- \dim_gzero_new:N \g__nicematrix_delta_y_two_dim
+ \int_gzero:N \g__nicematrix_ddots_int
+ \int_gzero:N \g__nicematrix_iddots_int
+ \dim_gzero:N \g__nicematrix_delta_x_one_dim
+ \dim_gzero:N \g__nicematrix_delta_y_one_dim
+ \dim_gzero:N \g__nicematrix_delta_x_two_dim
+ \dim_gzero:N \g__nicematrix_delta_y_two_dim
}
- \int_zero_new:N \l__nicematrix_initial_i_int
- \int_zero_new:N \l__nicematrix_initial_j_int
- \int_zero_new:N \l__nicematrix_final_i_int
- \int_zero_new:N \l__nicematrix_final_j_int
\bool_set_false:N \l__nicematrix_initial_open_bool
\bool_set_false:N \l__nicematrix_final_open_bool
- \bool_if:NT \l__nicematrix_small_bool
- {
- \dim_set:Nn \l__nicematrix_xdots_radius_dim { 0.7 \l__nicematrix_xdots_radius_dim }
- \dim_set:Nn \l__nicematrix_xdots_inter_dim { 0.55 \l__nicematrix_xdots_inter_dim }
- \dim_set:Nn \l__nicematrix_xdots_shorten_start_dim
- { 0.6 \l__nicematrix_xdots_shorten_start_dim }
- \dim_set:Nn \l__nicematrix_xdots_shorten_end_dim
- { 0.6 \l__nicematrix_xdots_shorten_end_dim }
- }
+ \bool_if:NT \l__nicematrix_small_bool { \__nicematrix_tuning_key_small_for_dots: }
\__nicematrix_draw_dotted_lines:
\clist_if_empty:NF \l__nicematrix_corners_clist
{
@@ -3943,8 +3920,8 @@
}
\__nicematrix_adjust_pos_of_blocks_seq:
\__nicematrix_deal_with_rounded_corners:
- \clist_if_empty:NF \l__nicematrix_hlines_clist \__nicematrix_draw_hlines:
- \clist_if_empty:NF \l__nicematrix_vlines_clist \__nicematrix_draw_vlines:
+ \clist_if_empty:NF \l__nicematrix_hlines_clist { \__nicematrix_draw_hlines: }
+ \clist_if_empty:NF \l__nicematrix_vlines_clist { \__nicematrix_draw_vlines: }
\IfPackageLoadedT { tikz }
{
\tikzset
@@ -3999,8 +3976,35 @@
\__nicematrix_restore_iRow_jCol:
\cs_gset_eq:NN \CT at arc@ \__nicematrix_old_CT at arc@
}
+\cs_new_protected:Npn \__nicematrix_tuning_key_small_for_dots:
+ {
+ \dim_set:Nn \l__nicematrix_xdots_radius_dim { 0.7 \l__nicematrix_xdots_radius_dim }
+ \dim_set:Nn \l__nicematrix_xdots_inter_dim { 0.55 \l__nicematrix_xdots_inter_dim }
+ \dim_set:Nn \l__nicematrix_xdots_shorten_start_dim
+ { 0.6 \l__nicematrix_xdots_shorten_start_dim }
+ \dim_set:Nn \l__nicematrix_xdots_shorten_end_dim
+ { 0.6 \l__nicematrix_xdots_shorten_end_dim }
+ }
\NewDocumentCommand \__nicematrix_CodeAfter_keys: { O { } }
{ \keys_set:nn { nicematrix / CodeAfter } { #1 } }
+\cs_new_protected:Npn \__nicematrix_create_alias_nodes:
+ {
+ \int_step_inline:nn { \c at iRow }
+ {
+ \pgfnodealias
+ { \l__nicematrix_name_str - ##1 - last }
+ { \__nicematrix_env: - ##1 - \int_use:N \c at jCol }
+ }
+ \int_step_inline:nn { \c at jCol }
+ {
+ \pgfnodealias
+ { \l__nicematrix_name_str - last - ##1 }
+ { \__nicematrix_env: - \int_use:N \c at iRow - ##1 }
+ }
+ \pgfnodealias % added 2025-04-05
+ { \l__nicematrix_name_str - last - last }
+ { \__nicematrix_env: - \int_use:N \c at iRow - \int_use:N \c at jCol }
+ }
\cs_new_protected:Npn \__nicematrix_adjust_pos_of_blocks_seq:
{
\seq_gset_map_e:NNn \g__nicematrix_pos_of_blocks_seq \g__nicematrix_pos_of_blocks_seq
@@ -4071,7 +4075,7 @@
{
\pgfpicture
\pgfrememberpicturepositiononpagetrue
- \int_step_inline:nn { \int_max:nn \c at iRow \c at jCol }
+ \int_step_inline:nn { \int_max:nn { \c at iRow } { \c at jCol } }
{
\__nicematrix_qpoint:n { col - \int_min:nn { ##1 } { \c at jCol + 1 } }
\dim_set_eq:NN \l_tmpa_dim \pgf at x
@@ -4088,7 +4092,7 @@
\str_if_empty:NF \l__nicematrix_name_str
{ \pgfnodealias { \l__nicematrix_name_str - ##1 } { \__nicematrix_env: - ##1 } }
}
- \int_set:Nn \l_tmpa_int { \int_max:nn \c at iRow \c at jCol + 1 }
+ \int_set:Nn \l_tmpa_int { \int_max:nn { \c at iRow } { \c at jCol } + 1 }
\__nicematrix_qpoint:n { row - \int_min:nn { \l_tmpa_int } { \c at iRow + 1 } }
\dim_set_eq:NN \l_tmpa_dim \pgf at y
\__nicematrix_qpoint:n { col - \int_min:nn { \l_tmpa_int } { \c at jCol + 1 } }
@@ -4096,7 +4100,7 @@
{ \__nicematrix_env: - \int_use:N \l_tmpa_int } { \pgfpoint \pgf at x \l_tmpa_dim }
\pgfnodealias
{ \__nicematrix_env: - last }
- { \__nicematrix_env: - \int_eval:n { \int_max:nn \c at iRow \c at jCol + 1 } }
+ { \__nicematrix_env: - \int_eval:n { \int_max:nn { \c at iRow } { \c at jCol } + 1 } }
\str_if_empty:NF \l__nicematrix_name_str
{
\pgfnodealias
@@ -4251,9 +4255,9 @@
\seq_gput_right:Ne \g__nicematrix_pos_of_xdots_seq
{
{ \int_use:N \l__nicematrix_initial_i_int }
- { \int_min:nn \l__nicematrix_initial_j_int \l__nicematrix_final_j_int }
+ { \int_min:nn { \l__nicematrix_initial_j_int } { \l__nicematrix_final_j_int } }
{ \int_use:N \l__nicematrix_final_i_int }
- { \int_max:nn \l__nicematrix_initial_j_int \l__nicematrix_final_j_int }
+ { \int_max:nn { \l__nicematrix_initial_j_int } { \l__nicematrix_final_j_int } }
{ } % for the name of the block
}
}
@@ -4330,7 +4334,7 @@
\cs_new_protected:Npn \__nicematrix_open_x_initial_dim:
{
\dim_set_eq:NN \l__nicematrix_x_initial_dim \c_max_dim
- \int_step_inline:nnn \l__nicematrix_first_row_int \g__nicematrix_row_total_int
+ \int_step_inline:nnn { \l__nicematrix_first_row_int } { \g__nicematrix_row_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \__nicematrix_env: - ##1 - \int_use:N \l__nicematrix_initial_j_int }
@@ -4339,10 +4343,10 @@
{ \__nicematrix_env: - ##1 - \int_use:N \l__nicematrix_initial_j_int }
{ west }
\dim_set:Nn \l__nicematrix_x_initial_dim
- { \dim_min:nn \l__nicematrix_x_initial_dim \pgf at x }
+ { \dim_min:nn { \l__nicematrix_x_initial_dim } { \pgf at x } }
}
}
- \dim_compare:nNnT \l__nicematrix_x_initial_dim = \c_max_dim
+ \dim_compare:nNnT { \l__nicematrix_x_initial_dim } = { \c_max_dim }
{
\__nicematrix_qpoint:n { col - \int_use:N \l__nicematrix_initial_j_int }
\dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf at x
@@ -4352,7 +4356,7 @@
\cs_new_protected:Npn \__nicematrix_open_x_final_dim:
{
\dim_set:Nn \l__nicematrix_x_final_dim { - \c_max_dim }
- \int_step_inline:nnn \l__nicematrix_first_row_int \g__nicematrix_row_total_int
+ \int_step_inline:nnn { \l__nicematrix_first_row_int } { \g__nicematrix_row_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \__nicematrix_env: - ##1 - \int_use:N \l__nicematrix_final_j_int }
@@ -4360,11 +4364,11 @@
\pgfpointanchor
{ \__nicematrix_env: - ##1 - \int_use:N \l__nicematrix_final_j_int }
{ east }
- \dim_compare:nNnT \pgf at x > \l__nicematrix_x_final_dim
- { \dim_set_eq:NN \l__nicematrix_x_final_dim \pgf at x }
+ \dim_compare:nNnT { \pgf at x } > { \l__nicematrix_x_final_dim }
+ { \dim_set_eq:NN \l__nicematrix_x_final_dim \pgf at x }
}
}
- \dim_compare:nNnT \l__nicematrix_x_final_dim = { - \c_max_dim }
+ \dim_compare:nNnT { \l__nicematrix_x_final_dim } = { - \c_max_dim }
{
\__nicematrix_qpoint:n { col - \int_eval:n { \l__nicematrix_final_j_int + 1 } }
\dim_set_eq:NN \l__nicematrix_x_final_dim \pgf at x
@@ -4382,7 +4386,7 @@
\int_if_zero:nTF { #1 }
{ \color { nicematrix-first-row } }
{
- \int_compare:nNnT { #1 } = \l__nicematrix_last_row_int
+ \int_compare:nNnT { #1 } = { \l__nicematrix_last_row_int }
{ \color { nicematrix-last-row } }
}
\keys_set:nn { nicematrix / xdots } { #3 }
@@ -4411,7 +4415,7 @@
{
\l__nicematrix_initial_open_bool
\l__nicematrix_final_open_bool
- { \int_compare_p:nNn \l__nicematrix_initial_i_int = \l__nicematrix_last_row_int }
+ { \int_compare_p:nNn { \l__nicematrix_initial_i_int } = { \l__nicematrix_last_row_int } }
}
{
\dim_add:Nn \l__nicematrix_y_initial_dim \c__nicematrix_shift_Ldots_last_row_dim
@@ -4428,13 +4432,13 @@
\__nicematrix_adjust_to_submatrix:nn { #1 } { #2 }
\cs_if_free:cT { __nicematrix _ dotted _ #1 - #2 }
{
- \__nicematrix_find_extremities_of_line:nnnn { #1 } { #2 } 0 1
+ \__nicematrix_find_extremities_of_line:nnnn { #1 } { #2 } { 0 } { 1 }
\group_begin:
\__nicematrix_open_shorten:
\int_if_zero:nTF { #1 }
{ \color { nicematrix-first-row } }
{
- \int_compare:nNnT { #1 } = \l__nicematrix_last_row_int
+ \int_compare:nNnT { #1 } = { \l__nicematrix_last_row_int }
{ \color { nicematrix-last-row } }
}
\keys_set:nn { nicematrix / xdots } { #3 }
@@ -4452,8 +4456,8 @@
{ \__nicematrix_open_x_final_dim: }
{ \__nicematrix_set_final_coords_from_anchor:n { mid~west } }
\bool_lazy_and:nnTF
- \l__nicematrix_initial_open_bool
- \l__nicematrix_final_open_bool
+ { \l__nicematrix_initial_open_bool }
+ { \l__nicematrix_final_open_bool }
{
\__nicematrix_qpoint:n { row - \int_use:N \l__nicematrix_initial_i_int }
\dim_set_eq:NN \l_tmpa_dim \pgf at y
@@ -4472,7 +4476,7 @@
\cs_new_protected:Npn \__nicematrix_open_y_initial_dim:
{
\dim_set:Nn \l__nicematrix_y_initial_dim { - \c_max_dim }
- \int_step_inline:nnn \l__nicematrix_first_col_int \g__nicematrix_col_total_int
+ \int_step_inline:nnn { \l__nicematrix_first_col_int } { \g__nicematrix_col_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \__nicematrix_env: - \int_use:N \l__nicematrix_initial_i_int - ##1 }
@@ -4480,11 +4484,11 @@
\pgfpointanchor
{ \__nicematrix_env: - \int_use:N \l__nicematrix_initial_i_int - ##1 }
{ north }
- \dim_compare:nNnT \pgf at y > \l__nicematrix_y_initial_dim
+ \dim_compare:nNnT { \pgf at y } > { \l__nicematrix_y_initial_dim }
{ \dim_set_eq:NN \l__nicematrix_y_initial_dim \pgf at y }
}
}
- \dim_compare:nNnT \l__nicematrix_y_initial_dim = { - \c_max_dim }
+ \dim_compare:nNnT { \l__nicematrix_y_initial_dim } = { - \c_max_dim }
{
\__nicematrix_qpoint:n { row - \int_use:N \l__nicematrix_initial_i_int - base }
\dim_set:Nn \l__nicematrix_y_initial_dim
@@ -4500,7 +4504,7 @@
\cs_new_protected:Npn \__nicematrix_open_y_final_dim:
{
\dim_set_eq:NN \l__nicematrix_y_final_dim \c_max_dim
- \int_step_inline:nnn \l__nicematrix_first_col_int \g__nicematrix_col_total_int
+ \int_step_inline:nnn { \l__nicematrix_first_col_int } { \g__nicematrix_col_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \__nicematrix_env: - \int_use:N \l__nicematrix_final_i_int - ##1 }
@@ -4508,11 +4512,11 @@
\pgfpointanchor
{ \__nicematrix_env: - \int_use:N \l__nicematrix_final_i_int - ##1 }
{ south }
- \dim_compare:nNnT \pgf at y < \l__nicematrix_y_final_dim
+ \dim_compare:nNnT { \pgf at y } < { \l__nicematrix_y_final_dim }
{ \dim_set_eq:NN \l__nicematrix_y_final_dim \pgf at y }
}
}
- \dim_compare:nNnT \l__nicematrix_y_final_dim = \c_max_dim
+ \dim_compare:nNnT { \l__nicematrix_y_final_dim } = { \c_max_dim }
{
\__nicematrix_qpoint:n { row - \int_use:N \l__nicematrix_final_i_int - base }
\dim_set:Nn \l__nicematrix_y_final_dim
@@ -4524,13 +4528,13 @@
\__nicematrix_adjust_to_submatrix:nn { #1 } { #2 }
\cs_if_free:cT { __nicematrix _ dotted _ #1 - #2 }
{
- \__nicematrix_find_extremities_of_line:nnnn { #1 } { #2 } 1 0
+ \__nicematrix_find_extremities_of_line:nnnn { #1 } { #2 } { 1 } { 0 }
\group_begin:
\__nicematrix_open_shorten:
\int_if_zero:nTF { #2 }
{ \color { nicematrix-first-col } }
{
- \int_compare:nNnT { #2 } = \l__nicematrix_last_col_int
+ \int_compare:nNnT { #2 } = { \l__nicematrix_last_col_int }
{ \color { nicematrix-last-col } }
}
\keys_set:nn { nicematrix / xdots } { #3 }
@@ -4541,11 +4545,11 @@
}
\cs_new_protected:Npn \__nicematrix_actually_draw_Vdots:
{
- \bool_lazy_and:nnTF \l__nicematrix_initial_open_bool \l__nicematrix_final_open_bool
+ \bool_lazy_and:nnTF { \l__nicematrix_initial_open_bool } { \l__nicematrix_final_open_bool }
{
\__nicematrix_open_y_initial_dim:
\__nicematrix_open_y_final_dim:
- \int_if_zero:nTF \l__nicematrix_initial_j_int
+ \int_if_zero:nTF { \l__nicematrix_initial_j_int }
{
\__nicematrix_qpoint:n { col - 1 }
\dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf at x
@@ -4555,9 +4559,12 @@
}
{
\bool_lazy_and:nnTF
- { \int_compare_p:nNn \l__nicematrix_last_col_int > { -2 } }
- { \int_compare_p:nNn \l__nicematrix_initial_j_int = \g__nicematrix_col_total_int }
+ { \int_compare_p:nNn { \l__nicematrix_last_col_int } > { -2 } }
{
+ \int_compare_p:nNn
+ { \l__nicematrix_initial_j_int } = { \g__nicematrix_col_total_int }
+ }
+ {
\__nicematrix_qpoint:n { col - \int_use:N \l__nicematrix_initial_j_int }
\dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf at x
\dim_add:Nn \l__nicematrix_x_initial_dim \l__nicematrix_right_margin_dim
@@ -4581,7 +4588,10 @@
\__nicematrix_set_initial_coords_from_anchor:n { south~west }
\__nicematrix_set_final_coords_from_anchor:n { north~west }
\bool_set:Nn \l_tmpa_bool
- { \dim_compare_p:nNn \l__nicematrix_x_initial_dim = \l__nicematrix_x_final_dim }
+ {
+ \dim_compare_p:nNn
+ { \l__nicematrix_x_initial_dim } = { \l__nicematrix_x_final_dim }
+ }
}
}
\bool_if:NTF \l__nicematrix_initial_open_bool
@@ -4593,14 +4603,14 @@
{
\__nicematrix_set_initial_coords_from_anchor:n { south }
\bool_if:NTF \l__nicematrix_final_open_bool
- \__nicematrix_open_y_final_dim:
+ { \__nicematrix_open_y_final_dim: }
{
\__nicematrix_set_final_coords_from_anchor:n { north }
- \dim_compare:nNnF \l__nicematrix_x_initial_dim = \l__nicematrix_x_final_dim
+ \dim_compare:nNnF { \l__nicematrix_x_initial_dim } = { \l__nicematrix_x_final_dim }
{
\dim_set:Nn \l__nicematrix_x_initial_dim
{
- \bool_if:NTF \l_tmpa_bool \dim_min:nn \dim_max:nn
+ \bool_if:NTF \l_tmpa_bool { \dim_min:nn } { \dim_max:nn }
\l__nicematrix_x_initial_dim \l__nicematrix_x_final_dim
}
}
@@ -4615,7 +4625,7 @@
\__nicematrix_adjust_to_submatrix:nn { #1 } { #2 }
\cs_if_free:cT { __nicematrix _ dotted _ #1 - #2 }
{
- \__nicematrix_find_extremities_of_line:nnnn { #1 } { #2 } 1 1
+ \__nicematrix_find_extremities_of_line:nnnn { #1 } { #2 } { 1 } { 1 }
\group_begin:
\__nicematrix_open_shorten:
\keys_set:nn { nicematrix / xdots } { #3 }
@@ -4641,7 +4651,7 @@
\bool_if:NT \l__nicematrix_parallelize_diags_bool
{
\int_gincr:N \g__nicematrix_ddots_int
- \int_compare:nNnTF \g__nicematrix_ddots_int = \c_one_int
+ \int_compare:nNnTF { \g__nicematrix_ddots_int } = { \c_one_int }
{
\dim_gset:Nn \g__nicematrix_delta_x_one_dim
{ \l__nicematrix_x_final_dim - \l__nicematrix_x_initial_dim }
@@ -4649,7 +4659,7 @@
{ \l__nicematrix_y_final_dim - \l__nicematrix_y_initial_dim }
}
{
- \dim_compare:nNnF \g__nicematrix_delta_x_one_dim = \c_zero_dim
+ \dim_compare:nNnF { \g__nicematrix_delta_x_one_dim } = { \c_zero_dim }
{
\dim_set:Nn \l__nicematrix_y_final_dim
{
@@ -4667,7 +4677,7 @@
\__nicematrix_adjust_to_submatrix:nn { #1 } { #2 }
\cs_if_free:cT { __nicematrix _ dotted _ #1 - #2 }
{
- \__nicematrix_find_extremities_of_line:nnnn { #1 } { #2 } 1 { -1 }
+ \__nicematrix_find_extremities_of_line:nnnn { #1 } { #2 } { 1 } { -1 }
\group_begin:
\__nicematrix_open_shorten:
\keys_set:nn { nicematrix / xdots } { #3 }
@@ -4693,7 +4703,7 @@
\bool_if:NT \l__nicematrix_parallelize_diags_bool
{
\int_gincr:N \g__nicematrix_iddots_int
- \int_compare:nNnTF \g__nicematrix_iddots_int = \c_one_int
+ \int_compare:nNnTF { \g__nicematrix_iddots_int } = { \c_one_int }
{
\dim_gset:Nn \g__nicematrix_delta_x_two_dim
{ \l__nicematrix_x_final_dim - \l__nicematrix_x_initial_dim }
@@ -4701,7 +4711,7 @@
{ \l__nicematrix_y_final_dim - \l__nicematrix_y_initial_dim }
}
{
- \dim_compare:nNnF \g__nicematrix_delta_x_two_dim = \c_zero_dim
+ \dim_compare:nNnF { \g__nicematrix_delta_x_two_dim } = { \c_zero_dim }
{
\dim_set:Nn \l__nicematrix_y_final_dim
{
@@ -4720,9 +4730,9 @@
\pgf at relevantforpicturesizefalse
\bool_lazy_or:nnTF
{ \tl_if_eq_p:NN \l__nicematrix_xdots_line_style_tl \c__nicematrix_standard_tl }
- \l__nicematrix_dotted_bool
- \__nicematrix_draw_standard_dotted_line:
- \__nicematrix_draw_unstandard_dotted_line:
+ { \l__nicematrix_dotted_bool }
+ { \__nicematrix_draw_standard_dotted_line: }
+ { \__nicematrix_draw_unstandard_dotted_line: }
}
\cs_new_protected:Npn \__nicematrix_draw_unstandard_dotted_line:
{
@@ -4730,7 +4740,6 @@
\__nicematrix_draw_unstandard_dotted_line:o
{ \l__nicematrix_xdots_line_style_tl , \l__nicematrix_xdots_color_tl }
}
-\cs_generate_variant:Nn \__nicematrix_draw_unstandard_dotted_line:n { o }
\cs_new_protected:Npn \__nicematrix_draw_unstandard_dotted_line:n #1
{
\__nicematrix_draw_unstandard_dotted_line:nooo
@@ -4739,6 +4748,7 @@
\l__nicematrix_xdots_down_tl
\l__nicematrix_xdots_middle_tl
}
+\cs_generate_variant:Nn \__nicematrix_draw_unstandard_dotted_line:n { o }
\hook_gput_code:nnn { begindocument } { . }
{
\IfPackageLoadedT { tikz }
@@ -4755,7 +4765,6 @@
}
}
}
-\cs_generate_variant:Nn \__nicematrix_draw_unstandard_dotted_line:nnnn { n o o o }
\cs_new_protected:Npn \__nicematrix_draw_unstandard_dotted_line:nnnn #1 #2 #3 #4
{
\dim_zero_new:N \l__nicematrix_l_dim
@@ -4771,9 +4780,9 @@
)
}
}
- \dim_compare:nNnT \l__nicematrix_l_dim < \c__nicematrix_max_l_dim
+ \dim_compare:nNnT { \l__nicematrix_l_dim } < { \c__nicematrix_max_l_dim }
{
- \dim_compare:nNnT \l__nicematrix_l_dim > { 1 pt }
+ \dim_compare:nNnT { \l__nicematrix_l_dim } > { 1 pt }
\__nicematrix_draw_unstandard_dotted_line_i:
}
\bool_if:NT \l__nicematrix_xdots_h_labels_bool
@@ -4796,6 +4805,7 @@
( \l__nicematrix_x_final_dim , \l__nicematrix_y_final_dim ) ;
\end { scope }
}
+\cs_generate_variant:Nn \__nicematrix_draw_unstandard_dotted_line:nnnn { n o o o }
\cs_new_protected:Npn \__nicematrix_draw_unstandard_dotted_line_i:
{
\dim_set:Nn \l_tmpa_dim
@@ -4843,10 +4853,10 @@
)
}
}
- \dim_compare:nNnT \l__nicematrix_l_dim < \c__nicematrix_max_l_dim
+ \dim_compare:nNnT { \l__nicematrix_l_dim } < { \c__nicematrix_max_l_dim }
{
- \dim_compare:nNnT \l__nicematrix_l_dim > { 1 pt }
- \__nicematrix_draw_standard_dotted_line_i:
+ \dim_compare:nNnT { \l__nicematrix_l_dim } > { 1 pt }
+ { \__nicematrix_draw_standard_dotted_line_i: }
}
\group_end:
\bool_lazy_all:nF
@@ -4855,7 +4865,7 @@
{ \tl_if_empty_p:N \l__nicematrix_xdots_down_tl }
{ \tl_if_empty_p:N \l__nicematrix_xdots_middle_tl }
}
- \l__nicematrix_labels_standard_dotted_line:
+ { \__nicematrix_labels_standard_dotted_line: }
}
\dim_const:Nn \c__nicematrix_max_l_dim { 50 cm }
\cs_new_protected:Npn \__nicematrix_draw_standard_dotted_line_i:
@@ -4868,7 +4878,7 @@
- \l__nicematrix_xdots_shorten_start_dim
- \l__nicematrix_xdots_shorten_end_dim
}
- \l__nicematrix_xdots_inter_dim
+ { \l__nicematrix_xdots_inter_dim }
}
\dim_set:Nn \l_tmpa_dim
{
@@ -4901,7 +4911,7 @@
{ 2 \l__nicematrix_l_dim }
}
\pgf at relevantforpicturesizefalse
- \int_step_inline:nnn \c_zero_int \l_tmpa_int
+ \int_step_inline:nnn { \c_zero_int } { \l_tmpa_int }
{
\pgfpathcircle
{ \pgfpoint \l__nicematrix_x_initial_dim \l__nicematrix_y_initial_dim }
@@ -4911,7 +4921,7 @@
}
\pgfusepathqfill
}
-\cs_new_protected:Npn \l__nicematrix_labels_standard_dotted_line:
+\cs_new_protected:Npn \__nicematrix_labels_standard_dotted_line:
{
\pgfscope
\pgftransformshift
@@ -4926,7 +4936,7 @@
(
\l__nicematrix_y_final_dim - \l__nicematrix_y_initial_dim ,
\l__nicematrix_x_final_dim - \l__nicematrix_x_initial_dim
- )
+ )
}
\pgftransformrotate { \fp_use:N \l_tmpa_fp }
\bool_if:NF \l__nicematrix_xdots_h_labels_bool { \fp_zero:N \l_tmpa_fp }
@@ -4988,76 +4998,75 @@
}
\hook_gput_code:nnn { begindocument } { . }
{
- \cs_set_nopar:Npn \l__nicematrix_argspec_tl { m E { _ ^ : } { { } { } { } } }
- \tl_set_rescan:Nno \l__nicematrix_argspec_tl { } \l__nicematrix_argspec_tl
- \cs_new_protected:Npn \__nicematrix_Ldots
+ \tl_set_rescan:Nnn \l__nicematrix_argspec_tl { } { m E { _ ^ : } { { } { } { } } }
+ \cs_new_protected:Npn \__nicematrix_Ldots:
{ \__nicematrix_collect_options:n { \__nicematrix_Ldots_i } }
\exp_args:NNo \NewDocumentCommand \__nicematrix_Ldots_i \l__nicematrix_argspec_tl
{
- \int_if_zero:nTF \c at jCol
- { \__nicematrix_error:nn { in~first~col } \Ldots }
+ \int_if_zero:nTF { \c at jCol }
+ { \__nicematrix_error:nn { in~first~col } { \Ldots } }
{
- \int_compare:nNnTF \c at jCol = \l__nicematrix_last_col_int
- { \__nicematrix_error:nn { in~last~col } \Ldots }
+ \int_compare:nNnTF { \c at jCol } = { \l__nicematrix_last_col_int }
+ { \__nicematrix_error:nn { in~last~col } { \Ldots } }
{
- \__nicematrix_instruction_of_type:nnn \c_false_bool { Ldots }
+ \__nicematrix_instruction_of_type:nnn { \c_false_bool } { Ldots }
{ #1 , down = #2 , up = #3 , middle = #4 }
}
}
\bool_if:NF \l__nicematrix_nullify_dots_bool
- { \phantom { \ensuremath { \__nicematrix_old_ldots } } }
+ { \phantom { \ensuremath { \__nicematrix_old_ldots: } } }
\bool_gset_true:N \g__nicematrix_empty_cell_bool
}
- \cs_new_protected:Npn \__nicematrix_Cdots
+ \cs_new_protected:Npn \__nicematrix_Cdots:
{ \__nicematrix_collect_options:n { \__nicematrix_Cdots_i } }
\exp_args:NNo \NewDocumentCommand \__nicematrix_Cdots_i \l__nicematrix_argspec_tl
{
- \int_if_zero:nTF \c at jCol
- { \__nicematrix_error:nn { in~first~col } \Cdots }
+ \int_if_zero:nTF { \c at jCol }
+ { \__nicematrix_error:nn { in~first~col } { \Cdots } }
{
- \int_compare:nNnTF \c at jCol = \l__nicematrix_last_col_int
- { \__nicematrix_error:nn { in~last~col } \Cdots }
+ \int_compare:nNnTF { \c at jCol } = { \l__nicematrix_last_col_int }
+ { \__nicematrix_error:nn { in~last~col } { \Cdots } }
{
- \__nicematrix_instruction_of_type:nnn \c_false_bool { Cdots }
+ \__nicematrix_instruction_of_type:nnn { \c_false_bool } { Cdots }
{ #1 , down = #2 , up = #3 , middle = #4 }
}
}
\bool_if:NF \l__nicematrix_nullify_dots_bool
- { \phantom { \ensuremath { \__nicematrix_old_cdots } } }
+ { \phantom { \ensuremath { \__nicematrix_old_cdots: } } }
\bool_gset_true:N \g__nicematrix_empty_cell_bool
}
- \cs_new_protected:Npn \__nicematrix_Vdots
+ \cs_new_protected:Npn \__nicematrix_Vdots:
{ \__nicematrix_collect_options:n { \__nicematrix_Vdots_i } }
\exp_args:NNo \NewDocumentCommand \__nicematrix_Vdots_i \l__nicematrix_argspec_tl
{
- \int_if_zero:nTF \c at iRow
- { \__nicematrix_error:nn { in~first~row } \Vdots }
+ \int_if_zero:nTF { \c at iRow }
+ { \__nicematrix_error:nn { in~first~row } { \Vdots } }
{
- \int_compare:nNnTF \c at iRow = \l__nicematrix_last_row_int
- { \__nicematrix_error:nn { in~last~row } \Vdots }
+ \int_compare:nNnTF { \c at iRow } = { \l__nicematrix_last_row_int }
+ { \__nicematrix_error:nn { in~last~row } { \Vdots } }
{
- \__nicematrix_instruction_of_type:nnn \c_false_bool { Vdots }
+ \__nicematrix_instruction_of_type:nnn { \c_false_bool } { Vdots }
{ #1 , down = #2 , up = #3 , middle = #4 }
}
}
\bool_if:NF \l__nicematrix_nullify_dots_bool
- { \phantom { \ensuremath { \__nicematrix_old_vdots } } }
+ { \phantom { \ensuremath { \__nicematrix_old_vdots: } } }
\bool_gset_true:N \g__nicematrix_empty_cell_bool
}
- \cs_new_protected:Npn \__nicematrix_Ddots
+ \cs_new_protected:Npn \__nicematrix_Ddots:
{ \__nicematrix_collect_options:n { \__nicematrix_Ddots_i } }
\exp_args:NNo \NewDocumentCommand \__nicematrix_Ddots_i \l__nicematrix_argspec_tl
{
\int_case:nnF \c at iRow
{
- 0 { \__nicematrix_error:nn { in~first~row } \Ddots }
- \l__nicematrix_last_row_int { \__nicematrix_error:nn { in~last~row } \Ddots }
+ 0 { \__nicematrix_error:nn { in~first~row } { \Ddots } }
+ \l__nicematrix_last_row_int { \__nicematrix_error:nn { in~last~row } { \Ddots } }
}
{
\int_case:nnF \c at jCol
{
- 0 { \__nicematrix_error:nn { in~first~col } \Ddots }
- \l__nicematrix_last_col_int { \__nicematrix_error:nn { in~last~col } \Ddots }
+ 0 { \__nicematrix_error:nn { in~first~col } { \Ddots } }
+ \l__nicematrix_last_col_int { \__nicematrix_error:nn { in~last~col } { \Ddots } }
}
{
\keys_set_known:nn { nicematrix / Ddots } { #1 }
@@ -5067,32 +5076,32 @@
}
\bool_if:NF \l__nicematrix_nullify_dots_bool
- { \phantom { \ensuremath { \__nicematrix_old_ddots } } }
+ { \phantom { \ensuremath { \__nicematrix_old_ddots: } } }
\bool_gset_true:N \g__nicematrix_empty_cell_bool
}
- \cs_new_protected:Npn \__nicematrix_Iddots
+ \cs_new_protected:Npn \__nicematrix_Iddots:
{ \__nicematrix_collect_options:n { \__nicematrix_Iddots_i } }
\exp_args:NNo \NewDocumentCommand \__nicematrix_Iddots_i \l__nicematrix_argspec_tl
{
\int_case:nnF \c at iRow
{
- 0 { \__nicematrix_error:nn { in~first~row } \Iddots }
- \l__nicematrix_last_row_int { \__nicematrix_error:nn { in~last~row } \Iddots }
+ 0 { \__nicematrix_error:nn { in~first~row } { \Iddots } }
+ \l__nicematrix_last_row_int { \__nicematrix_error:nn { in~last~row } { \Iddots } }
}
{
\int_case:nnF \c at jCol
{
- 0 { \__nicematrix_error:nn { in~first~col } \Iddots }
- \l__nicematrix_last_col_int { \__nicematrix_error:nn { in~last~col } \Iddots }
+ 0 { \__nicematrix_error:nn { in~first~col } { \Iddots } }
+ \l__nicematrix_last_col_int { \__nicematrix_error:nn { in~last~col } { \Iddots } }
}
{
\keys_set_known:nn { nicematrix / Ddots } { #1 }
- \__nicematrix_instruction_of_type:nnn \l__nicematrix_draw_first_bool { Iddots }
+ \__nicematrix_instruction_of_type:nnn { \l__nicematrix_draw_first_bool } { Iddots }
{ #1 , down = #2 , up = #3 , middle = #4 }
}
}
\bool_if:NF \l__nicematrix_nullify_dots_bool
- { \phantom { \ensuremath { \__nicematrix_old_iddots } } }
+ { \phantom { \ensuremath { \__nicematrix_old_iddots: } } }
\bool_gset_true:N \g__nicematrix_empty_cell_bool
}
}
@@ -5107,32 +5116,31 @@
\bool_gset_true:N \g__nicematrix_empty_cell_bool
\hspace
}
-\cs_set_eq:NN \__nicematrix_old_multicolumn \multicolumn
+\cs_set_eq:NN \__nicematrix_old_multicolumn: \multicolumn
\cs_new:Npn \__nicematrix_Hdotsfor:
{
\bool_lazy_and:nnTF
- { \int_if_zero_p:n \c at jCol }
- { \int_if_zero_p:n \l__nicematrix_first_col_int }
+ { \int_if_zero_p:n { \c at jCol } }
+ { \int_if_zero_p:n { \l__nicematrix_first_col_int } }
{
\bool_if:NTF \g__nicematrix_after_col_zero_bool
{
\multicolumn { 1 } { c } { }
- \__nicematrix_Hdotsfor_i
+ \__nicematrix_Hdotsfor_i:
}
{ \__nicematrix_fatal:n { Hdotsfor~in~col~0 } }
}
{
\multicolumn { 1 } { c } { }
- \__nicematrix_Hdotsfor_i
+ \__nicematrix_Hdotsfor_i:
}
}
\hook_gput_code:nnn { begindocument } { . }
{
- \cs_set_nopar:Npn \l__nicematrix_argspec_tl { m m O { } E { _ ^ : } { { } { } { } } }
- \tl_set_rescan:Nno \l__nicematrix_argspec_tl { } \l__nicematrix_argspec_tl
- \cs_new_protected:Npn \__nicematrix_Hdotsfor_i
+ \cs_new_protected:Npn \__nicematrix_Hdotsfor_i:
{ \__nicematrix_collect_options:n { \__nicematrix_Hdotsfor_ii } }
- \exp_args:NNo \NewDocumentCommand \__nicematrix_Hdotsfor_ii \l__nicematrix_argspec_tl
+ \tl_set_rescan:Nnn \l_tmpa_tl { } { m m O { } E { _ ^ : } { { } { } { } } }
+ \exp_args:NNo \NewDocumentCommand \__nicematrix_Hdotsfor_ii \l_tmpa_tl
{
\tl_gput_right:Ne \g__nicematrix_HVdotsfor_lines_tl
{
@@ -5161,7 +5169,7 @@
\bool_set_false:N \l__nicematrix_final_open_bool
\int_set:Nn \l__nicematrix_initial_i_int { #1 }
\int_set_eq:NN \l__nicematrix_final_i_int \l__nicematrix_initial_i_int
- \int_compare:nNnTF { #2 } = \c_one_int
+ \int_compare:nNnTF { #2 } = { \c_one_int }
{
\int_set_eq:NN \l__nicematrix_initial_j_int \c_one_int
\bool_set_true:N \l__nicematrix_initial_open_bool
@@ -5179,7 +5187,7 @@
\bool_set_true:N \l__nicematrix_initial_open_bool
}
}
- \int_compare:nNnTF { #2 + #3 -1 } = \c at jCol
+ \int_compare:nNnTF { #2 + #3 -1 } = { \c at jCol }
{
\int_set:Nn \l__nicematrix_final_j_int { #2 + #3 - 1 }
\bool_set_true:N \l__nicematrix_final_open_bool
@@ -5202,10 +5210,9 @@
\int_if_zero:nTF { #1 }
{ \color { nicematrix-first-row } }
{
- \int_compare:nNnT { #1 } = \g__nicematrix_row_total_int
+ \int_compare:nNnT { #1 } = { \g__nicematrix_row_total_int }
{ \color { nicematrix-last-row } }
}
-
\keys_set:nn { nicematrix / xdots } { #4 }
\__nicematrix_color:o \l__nicematrix_xdots_color_tl
\__nicematrix_actually_draw_Ldots:
@@ -5215,11 +5222,10 @@
}
\hook_gput_code:nnn { begindocument } { . }
{
- \cs_set_nopar:Npn \l__nicematrix_argspec_tl { m m O { } E { _ ^ : } { { } { } { } } }
- \tl_set_rescan:Nno \l__nicematrix_argspec_tl { } \l__nicematrix_argspec_tl
\cs_new_protected:Npn \__nicematrix_Vdotsfor:
{ \__nicematrix_collect_options:n { \__nicematrix_Vdotsfor_i } }
- \exp_args:NNo \NewDocumentCommand \__nicematrix_Vdotsfor_i \l__nicematrix_argspec_tl
+ \tl_set_rescan:Nnn \l_tmpa_tl { } { m m O { } E { _ ^ : } { { } { } { } } }
+ \exp_args:NNo \NewDocumentCommand \__nicematrix_Vdotsfor_i \l_tmpa_tl
{
\bool_gset_true:N \g__nicematrix_empty_cell_bool
\tl_gput_right:Ne \g__nicematrix_HVdotsfor_lines_tl
@@ -5243,7 +5249,7 @@
\bool_set_false:N \l__nicematrix_final_open_bool
\int_set:Nn \l__nicematrix_initial_j_int { #2 }
\int_set_eq:NN \l__nicematrix_final_j_int \l__nicematrix_initial_j_int
- \int_compare:nNnTF { #1 } = \c_one_int
+ \int_compare:nNnTF { #1 } = { \c_one_int }
{
\int_set_eq:NN \l__nicematrix_initial_i_int \c_one_int
\bool_set_true:N \l__nicematrix_initial_open_bool
@@ -5261,7 +5267,7 @@
\bool_set_true:N \l__nicematrix_initial_open_bool
}
}
- \int_compare:nNnTF { #1 + #3 -1 } = \c at iRow
+ \int_compare:nNnTF { #1 + #3 -1 } = { \c at iRow }
{
\int_set:Nn \l__nicematrix_final_i_int { #1 + #3 - 1 }
\bool_set_true:N \l__nicematrix_final_open_bool
@@ -5284,7 +5290,7 @@
\int_if_zero:nTF { #2 }
{ \color { nicematrix-first-col } }
{
- \int_compare:nNnT { #2 } = \g__nicematrix_col_total_int
+ \int_compare:nNnT { #2 } = { \g__nicematrix_col_total_int }
{ \color { nicematrix-last-col } }
}
\keys_set:nn { nicematrix / xdots } { #4 }
@@ -5296,11 +5302,9 @@
}
\NewDocumentCommand \__nicematrix_rotate: { O { } }
{
- \peek_remove_spaces:n
- {
- \bool_gset_true:N \g__nicematrix_rotate_bool
- \keys_set:nn { nicematrix / rotate } { #1 }
- }
+ \bool_gset_true:N \g__nicematrix_rotate_bool
+ \keys_set:nn { nicematrix / rotate } { #1 }
+ \ignorespaces
}
\keys_define:nn { nicematrix / rotate }
{
@@ -5318,10 +5322,9 @@
{ \int_eval:n { #1 } - \int_eval:n { #2 } }
\hook_gput_code:nnn { begindocument } { . }
{
- \cs_set_nopar:Npn \l__nicematrix_argspec_tl
+ \tl_set_rescan:Nnn \l_tmpa_tl { }
{ O { } m m ! O { } E { _ ^ : } { { } { } { } } }
- \tl_set_rescan:Nno \l__nicematrix_argspec_tl { } \l__nicematrix_argspec_tl
- \exp_args:NNo \NewDocumentCommand \__nicematrix_line \l__nicematrix_argspec_tl
+ \exp_args:NNo \NewDocumentCommand \__nicematrix_line \l_tmpa_tl
{
\group_begin:
\keys_set:nn { nicematrix / xdots } { #1 , #4 , down = #5 , up = #6 }
@@ -5365,11 +5368,8 @@
\dim_set_eq:NN \l__nicematrix_y_final_dim \pgf at y
\__nicematrix_draw_line:
}
-\cs_new:Npn \__nicematrix_if_row_less_than:nn #1 #2
- { \int_compare:nNnT { \c at iRow } < { #1 } { #2 } }
-\cs_new:Npn \__nicematrix_if_col_greater_than:nn #1 #2
- { \int_compare:nNnF { \c at jCol } < { #1 } { #2 } }
-\cs_generate_variant:Nn \__nicematrix_put_in_row_style:n { e }
+\cs_new:Npn \__nicematrix_if_row_less_than:nn { \int_compare:nNnT { \c at iRow } < }
+\cs_new:Npn \__nicematrix_if_col_greater_than:nn { \int_compare:nNnF { \c at jCol } < }
\cs_set_protected:Npn \__nicematrix_put_in_row_style:n #1
{
\tl_gput_right:Ne \g__nicematrix_row_style_tl
@@ -5385,6 +5385,7 @@
}
}
}
+\cs_generate_variant:Nn \__nicematrix_put_in_row_style:n { e }
\keys_define:nn { nicematrix / RowStyle }
{
cell-space-top-limit .dim_set:N = \l_tmpa_dim ,
@@ -5431,20 +5432,17 @@
\__nicematrix_add_opacity_to_fill:
\tl_gput_right:Ne \g__nicematrix_pre_code_before_tl
{
- \int_compare:nNnTF \c at jCol > \c_one_int
+ \__nicematrix_exp_color_arg:No \__nicematrix_roundedrectanglecolor \l__nicematrix_fill_tl
+ { \int_use:N \c at iRow - \int_use:N \c at jCol }
{
- \__nicematrix_exp_color_arg:No \__nicematrix_roundedrectanglecolor \l__nicematrix_fill_tl
- { \int_use:N \c at iRow - \int_use:N \c at jCol }
- { \int_use:N \c at iRow - * }
- { \dim_use:N \l__nicematrix_rounded_corners_dim }
- \int_compare:nNnT \l__nicematrix_key_nb_rows_int > \c_one_int
- { \__nicematrix_rounded_from_row:n { \c at iRow + 1 } }
+ \int_eval:n { \c at iRow + \l__nicematrix_key_nb_rows_int - 1 }
+ - *
}
- { \__nicematrix_rounded_from_row:n { \c at iRow } }
+ { \dim_use:N \l__nicematrix_rounded_corners_dim }
}
}
\__nicematrix_put_in_row_style:n { \exp_not:n { #2 } }
- \dim_compare:nNnT \l_tmpa_dim > \c_zero_dim
+ \dim_compare:nNnT { \l_tmpa_dim } > { \c_zero_dim }
{
\__nicematrix_put_in_row_style:e
{
@@ -5455,7 +5453,7 @@
}
}
}
- \dim_compare:nNnT \l_tmpb_dim > \c_zero_dim
+ \dim_compare:nNnT { \l_tmpb_dim } > { \c_zero_dim }
{
\__nicematrix_put_in_row_style:e
{
@@ -5504,8 +5502,6 @@
}
{ \dim_use:N \l__nicematrix_rounded_corners_dim }
}
-\cs_generate_variant:Nn \__nicematrix_add_to_colors_seq:nn { e }
-\cs_generate_variant:Nn \__nicematrix_add_to_colors_seq:nn { e e }
\cs_new_protected:Npn \__nicematrix_add_to_colors_seq:nn #1 #2
{
\int_zero:N \l_tmpa_int
@@ -5514,7 +5510,7 @@
\seq_map_indexed_inline:Nn \g__nicematrix_colors_seq
{ \str_if_eq:eeT { #1 } { ##2 } { \int_set:Nn \l_tmpa_int { ##1 } } }
}
- \int_if_zero:nTF \l_tmpa_int
+ \int_if_zero:nTF { \l_tmpa_int }
{
\seq_gput_right:Nn \g__nicematrix_colors_seq { #1 }
\tl_gset:ce { g__nicematrix_color _ \seq_count:N \g__nicematrix_colors_seq _ tl } { #2 }
@@ -5521,9 +5517,11 @@
}
{ \tl_gput_right:ce { g__nicematrix_color _ \int_use:N \l_tmpa_int _tl } { #2 } }
}
+\cs_generate_variant:Nn \__nicematrix_add_to_colors_seq:nn { e }
+\cs_generate_variant:Nn \__nicematrix_add_to_colors_seq:nn { e e }
\cs_new_protected:Npn \__nicematrix_clip_with_rounded_corners:
{
- \dim_compare:nNnT \l__nicematrix_tab_rounded_corners_dim > \c_zero_dim
+ \dim_compare:nNnT { \l__nicematrix_tab_rounded_corners_dim } > { \c_zero_dim }
{
\group_begin:
\pgfsetcornersarced
@@ -5544,7 +5542,7 @@
\pgfpointadd
{
\__nicematrix_qpoint:n
- { \int_eval:n { \int_max:nn \c at iRow \c at jCol + 1 } }
+ { \int_eval:n { \int_max:nn { \c at iRow } { \c at jCol } + 1 } }
}
{ \pgfpoint \c_zero_dim { 0.5 \arrayrulewidth } }
}
@@ -5556,7 +5554,7 @@
\pgfpointadd
{
\__nicematrix_qpoint:n
- { \int_eval:n { \int_max:nn \c at iRow \c at jCol + 1 } }
+ { \int_eval:n { \int_max:nn { \c at iRow } { \c at jCol } + 1 } }
}
{ \pgfpoint \c_zero_dim \arrayrulewidth }
}
@@ -5572,7 +5570,7 @@
\__nicematrix_clip_with_rounded_corners:
\seq_map_indexed_inline:Nn \g__nicematrix_colors_seq
{
- \int_compare:nNnTF { ##1 } = \c_one_int
+ \int_compare:nNnTF { ##1 } = { \c_one_int }
{
\cs_set_eq:NN \__nicematrix_cartesian_path:n \__nicematrix_cartesian_path_nocolor:n
\use:c { g__nicematrix_color _ 1 _tl }
@@ -5580,7 +5578,7 @@
}
{
\begin { pgfscope }
- \__nicematrix_color_opacity ##2
+ \__nicematrix_color_opacity: ##2
\use:c { g__nicematrix_color _ ##1 _tl }
\tl_gclear:c { g__nicematrix_color _ ##1 _tl }
\pgfusepath { fill }
@@ -5589,7 +5587,7 @@
}
\endpgfpicture
}
-\cs_new_protected:Npn \__nicematrix_color_opacity
+\cs_new_protected:Npn \__nicematrix_color_opacity:
{
\peek_meaning:NTF [
{ \__nicematrix_color_opacity:w }
@@ -5611,8 +5609,8 @@
}
\cs_new_protected:Npn \__nicematrix_cartesian_color:nn #1 #2
{
- \cs_set_nopar:Npn \l__nicematrix_rows_tl { #1 }
- \cs_set_nopar:Npn \l__nicematrix_cols_tl { #2 }
+ \def \l__nicematrix_rows_tl { #1 }
+ \def \l__nicematrix_cols_tl { #2 }
\__nicematrix_cartesian_path:
}
\NewDocumentCommand \__nicematrix_rowcolor { O { } m m }
@@ -5654,8 +5652,6 @@
\cs_new_protected:Npn \__nicematrix_rectanglecolor:nnn #1 #2 #3
{
\__nicematrix_cut_on_hyphen:w #1 \q_stop
- \tl_clear_new:N \l__nicematrix_tmpc_tl
- \tl_clear_new:N \l__nicematrix_tmpd_tl
\tl_set_eq:NN \l__nicematrix_tmpc_tl \l_tmpa_tl
\tl_set_eq:NN \l__nicematrix_tmpd_tl \l_tmpb_tl
\__nicematrix_cut_on_hyphen:w #2 \q_stop
@@ -5670,9 +5666,9 @@
}
\NewDocumentCommand \__nicematrix_chessboardcolors { O { } m m }
{
- \int_step_inline:nn \c at iRow
+ \int_step_inline:nn { \c at iRow }
{
- \int_step_inline:nn \c at jCol
+ \int_step_inline:nn { \c at jCol }
{
\int_if_even:nTF { ####1 + ##1 }
{ \__nicematrix_cellcolor [ #1 ] { #2 } }
@@ -5702,7 +5698,7 @@
\seq_clear_new:N \l__nicematrix_colors_seq
\seq_set_split:Nnn \l__nicematrix_colors_seq { , } { #3 }
\tl_clear_new:N \l__nicematrix_cols_tl
- \cs_set_nopar:Npn \l__nicematrix_cols_tl { - }
+ \tl_set:Nn \l__nicematrix_cols_tl { - }
\keys_set:nn { nicematrix / rowcolors } { #4 }
\int_zero_new:N \l__nicematrix_color_int
\int_set_eq:NN \l__nicematrix_color_int \c_one_int
@@ -5716,14 +5712,13 @@
\pgf at relevantforpicturesizefalse
\clist_map_inline:nn { #2 }
{
- \cs_set_nopar:Npn \l_tmpa_tl { ##1 }
+ \tl_set:Nn \l_tmpa_tl { ##1 }
\tl_if_in:NnTF \l_tmpa_tl { - }
{ \__nicematrix_cut_on_hyphen:w ##1 \q_stop }
{ \tl_set:No \l_tmpb_tl { \int_use:N \c at iRow } }
\int_set:Nn \l_tmpa_int \l_tmpa_tl
\int_set:Nn \l__nicematrix_color_int
- { \bool_if:NTF \l__nicematrix_rowcolors_restart_bool 1 \l_tmpa_tl }
- \int_zero_new:N \l__nicematrix_tmpc_int
+ { \bool_if:NTF \l__nicematrix_rowcolors_restart_bool { 1 } { \l_tmpa_tl } }
\int_set:Nn \l__nicematrix_tmpc_int \l_tmpb_tl
\int_do_until:nNnn \l_tmpa_int > \l__nicematrix_tmpc_int
{
@@ -5734,9 +5729,8 @@
{ \__nicematrix_intersect_our_row_p:nnnnn ####1 }
\seq_map_inline:Nn \l_tmpb_seq { \__nicematrix_rowcolors_i:nnnnn ####1 }
}
- \tl_set:No \l__nicematrix_rows_tl
+ \tl_set:Ne \l__nicematrix_rows_tl
{ \int_use:N \l_tmpa_int - \int_use:N \l_tmpb_int }
- \tl_clear_new:N \l__nicematrix_color_tl
\tl_set:Ne \l__nicematrix_color_tl
{
\__nicematrix_color_index:n
@@ -5770,40 +5764,39 @@
{ \__nicematrix_rowlistcolors [ #1 ] { #2 } { { #3 } , { #4 } } }
\cs_new_protected:Npn \__nicematrix_rowcolors_i:nnnnn #1 #2 #3 #4 #5
{
- \int_compare:nNnT { #3 } > \l_tmpb_int
+ \int_compare:nNnT { #3 } > { \l_tmpb_int }
{ \int_set:Nn \l_tmpb_int { #3 } }
}
-\prg_new_conditional:Nnn \__nicematrix_not_in_exterior:nnnnn p
+\prg_new_conditional:Nnn \__nicematrix_not_in_exterior:nnnnn { p }
{
\int_if_zero:nTF { #4 }
- \prg_return_false:
+ { \prg_return_false: }
{
- \int_compare:nNnTF { #2 } > \c at jCol
- \prg_return_false:
- \prg_return_true:
+ \int_compare:nNnTF { #2 } > { \c at jCol }
+ { \prg_return_false: }
+ { \prg_return_true: }
}
}
-\prg_new_conditional:Nnn \__nicematrix_intersect_our_row:nnnnn p
+\prg_new_conditional:Nnn \__nicematrix_intersect_our_row:nnnnn { p }
{
- \int_compare:nNnTF { #1 } > \l_tmpa_int
- \prg_return_false:
+ \int_compare:nNnTF { #1 } > { \l_tmpa_int }
+ { \prg_return_false: }
{
- \int_compare:nNnTF \l_tmpa_int > { #3 }
- \prg_return_false:
- \prg_return_true:
+ \int_compare:nNnTF { \l_tmpa_int } > { #3 }
+ { \prg_return_false: }
+ { \prg_return_true: }
}
}
\cs_new_protected:Npn \__nicematrix_cartesian_path_normal:n #1
{
- \dim_compare:nNnTF { #1 } = \c_zero_dim
+ \dim_compare:nNnTF { #1 } = { \c_zero_dim }
{
- \bool_if:NTF
- \l__nicematrix_nocolor_used_bool
- \__nicematrix_cartesian_path_normal_ii:
+ \bool_if:NTF \l__nicematrix_nocolor_used_bool
+ { \__nicematrix_cartesian_path_normal_ii: }
{
\clist_if_empty:NTF \l__nicematrix_corners_cells_clist
{ \__nicematrix_cartesian_path_normal_i:n { #1 } }
- \__nicematrix_cartesian_path_normal_ii:
+ { \__nicematrix_cartesian_path_normal_ii: }
}
}
{ \__nicematrix_cartesian_path_normal_i:n { #1 } }
@@ -5813,17 +5806,17 @@
\pgfsetcornersarced { \pgfpoint { #1 } { #1 } }
\clist_map_inline:Nn \l__nicematrix_cols_tl
{
- \cs_set_nopar:Npn \l_tmpa_tl { ##1 }
+ \def \l_tmpa_tl { ##1 }
\tl_if_in:NnTF \l_tmpa_tl { - }
{ \__nicematrix_cut_on_hyphen:w ##1 \q_stop }
- { \__nicematrix_cut_on_hyphen:w ##1 - ##1 \q_stop }
+ { \def \l_tmpb_tl { ##1 } } % 2025-04-16
\tl_if_empty:NTF \l_tmpa_tl
- { \cs_set_nopar:Npn \l_tmpa_tl { 1 } }
+ { \def \l_tmpa_tl { 1 } }
{
\str_if_eq:eeT \l_tmpa_tl { * }
- { \cs_set_nopar:Npn \l_tmpa_tl { 1 } }
+ { \def \l_tmpa_tl { 1 } }
}
- \int_compare:nNnT \l_tmpa_tl > \g__nicematrix_col_total_int
+ \int_compare:nNnT { \l_tmpa_tl } > { \g__nicematrix_col_total_int }
{ \__nicematrix_error:n { Invalid~col~number } }
\tl_if_empty:NTF \l_tmpb_tl
{ \tl_set:No \l_tmpb_tl { \int_use:N \c at jCol } }
@@ -5831,11 +5824,11 @@
\str_if_eq:eeT \l_tmpb_tl { * }
{ \tl_set:No \l_tmpb_tl { \int_use:N \c at jCol } }
}
- \int_compare:nNnT \l_tmpb_tl > \g__nicematrix_col_total_int
+ \int_compare:nNnT { \l_tmpb_tl } > { \g__nicematrix_col_total_int }
{ \tl_set:No \l_tmpb_tl { \int_use:N \g__nicematrix_col_total_int } }
\tl_set_eq:NN \l__nicematrix_tmpc_tl \l_tmpa_tl
\__nicematrix_qpoint:n { col - \l_tmpa_tl }
- \int_compare:nNnTF \l__nicematrix_first_col_int = \l_tmpa_tl
+ \int_compare:nNnTF { \l__nicematrix_first_col_int } = { \l_tmpa_tl }
{ \dim_set:Nn \l__nicematrix_tmpc_dim { \pgf at x - 0.5 \arrayrulewidth } }
{ \dim_set:Nn \l__nicematrix_tmpc_dim { \pgf at x + 0.5 \arrayrulewidth } }
\__nicematrix_qpoint:n { col - \int_eval:n { \l_tmpb_tl + 1 } }
@@ -5842,15 +5835,15 @@
\dim_set:Nn \l_tmpa_dim { \pgf at x + 0.5 \arrayrulewidth }
\clist_map_inline:Nn \l__nicematrix_rows_tl
{
- \cs_set_nopar:Npn \l_tmpa_tl { ####1 }
+ \def \l_tmpa_tl { ####1 }
\tl_if_in:NnTF \l_tmpa_tl { - }
{ \__nicematrix_cut_on_hyphen:w ####1 \q_stop }
{ \__nicematrix_cut_on_hyphen:w ####1 - ####1 \q_stop }
\tl_if_empty:NTF \l_tmpa_tl
- { \cs_set_nopar:Npn \l_tmpa_tl { 1 } }
+ { \def \l_tmpa_tl { 1 } }
{
\str_if_eq:eeT \l_tmpa_tl { * }
- { \cs_set_nopar:Npn \l_tmpa_tl { 1 } }
+ { \def \l_tmpa_tl { 1 } }
}
\tl_if_empty:NTF \l_tmpb_tl
{ \tl_set:No \l_tmpb_tl { \int_use:N \c at iRow } }
@@ -5858,9 +5851,9 @@
\str_if_eq:eeT \l_tmpb_tl { * }
{ \tl_set:No \l_tmpb_tl { \int_use:N \c at iRow } }
}
- \int_compare:nNnT \l_tmpa_tl > \g__nicematrix_row_total_int
+ \int_compare:nNnT { \l_tmpa_tl } > { \g__nicematrix_row_total_int }
{ \__nicematrix_error:n { Invalid~row~number } }
- \int_compare:nNnT \l_tmpb_tl > \g__nicematrix_row_total_int
+ \int_compare:nNnT { \l_tmpb_tl } > { \g__nicematrix_row_total_int }
{ \tl_set:No \l_tmpb_tl { \int_use:N \g__nicematrix_row_total_int } }
\cs_if_exist:cF
{ __nicematrix _ nocolor _ \l_tmpa_tl - \l__nicematrix_tmpc_tl }
@@ -5883,7 +5876,7 @@
\clist_map_inline:Nn \l__nicematrix_cols_tl
{
\__nicematrix_qpoint:n { col - ##1 }
- \int_compare:nNnTF \l__nicematrix_first_col_int = { ##1 }
+ \int_compare:nNnTF { \l__nicematrix_first_col_int } = { ##1 }
{ \dim_set:Nn \l__nicematrix_tmpc_dim { \pgf at x - 0.5 \arrayrulewidth } }
{ \dim_set:Nn \l__nicematrix_tmpc_dim { \pgf at x + 0.5 \arrayrulewidth } }
\__nicematrix_qpoint:n { col - \int_eval:n { ##1 + 1 } }
@@ -5924,7 +5917,7 @@
\clist_clear:N #1
\clist_map_inline:Nn \l_tmpa_clist
{
- \cs_set_nopar:Npn \l_tmpa_tl { ##1 }
+ \def \l_tmpa_tl { ##1 }
\tl_if_in:NnTF \l_tmpa_tl { - }
{ \__nicematrix_cut_on_hyphen:w ##1 \q_stop }
{ \__nicematrix_cut_on_hyphen:w ##1 - ##1 \q_stop }
@@ -5931,14 +5924,14 @@
\bool_lazy_or:nnT
{ \str_if_eq_p:ee \l_tmpa_tl { * } }
{ \tl_if_blank_p:o \l_tmpa_tl }
- { \cs_set_nopar:Npn \l_tmpa_tl { 1 } }
+ { \def \l_tmpa_tl { 1 } }
\bool_lazy_or:nnT
{ \str_if_eq_p:ee \l_tmpb_tl { * } }
{ \tl_if_blank_p:o \l_tmpb_tl }
{ \tl_set:No \l_tmpb_tl { \int_use:N #2 } }
- \int_compare:nNnT \l_tmpb_tl > #2
+ \int_compare:nNnT { \l_tmpb_tl } > { #2 }
{ \tl_set:No \l_tmpb_tl { \int_use:N #2 } }
- \int_step_inline:nnn \l_tmpa_tl \l_tmpb_tl
+ \int_step_inline:nnn { \l_tmpa_tl } { \l_tmpb_tl }
{ \clist_put_right:Nn #1 { ####1 } }
}
}
@@ -5965,14 +5958,9 @@
{ \__nicematrix_rowlistcolors_tabular [ #1 ] { { #2 } , { #3 } } }
\NewDocumentCommand { \__nicematrix_rowlistcolors_tabular } { O { } m O { } }
{
- \peek_remove_spaces:n
- { \__nicematrix_rowlistcolors_tabular:nnn { #1 } { #2 } { #3 } }
- }
-\cs_new_protected:Npn \__nicematrix_rowlistcolors_tabular:nnn #1 #2 #3
- {
\seq_gclear:N \g_tmpa_seq
\seq_map_inline:Nn \g__nicematrix_rowlistcolors_seq
- { \__nicematrix_rowlistcolors_tabular_i:nnnn ##1 }
+ { \__nicematrix_rowlistcolors_tabular:nnnn ##1 }
\seq_gset_eq:NN \g__nicematrix_rowlistcolors_seq \g_tmpa_seq
\seq_gput_right:Ne \g__nicematrix_rowlistcolors_seq
{
@@ -5981,10 +5969,11 @@
{ \exp_not:n { #2 } }
{ restart , cols = \int_use:N \c at jCol - , \exp_not:n { #3 } }
}
+ \ignorespaces
}
-\cs_new_protected:Npn \__nicematrix_rowlistcolors_tabular_i:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \__nicematrix_rowlistcolors_tabular:nnnn #1 #2 #3 #4
{
- \int_compare:nNnTF { #1 } = \c at iRow
+ \int_compare:nNnTF { #1 } = { \c at iRow }
{ \seq_gput_right:Nn \g_tmpa_seq { { #1 } { #2 } { #3 } { #4 } } }
{
\tl_gput_right:Ne \g__nicematrix_pre_code_before_tl
@@ -6010,7 +5999,7 @@
}
\NewDocumentCommand \__nicematrix_columncolor_preamble { O { } m }
{
- \int_compare:nNnT \c at jCol > \g__nicematrix_col_total_int
+ \int_compare:nNnT { \c at jCol } > { \g__nicematrix_col_total_int }
{
\tl_gput_left:Ne \g__nicematrix_pre_code_before_tl
{
@@ -6019,23 +6008,6 @@
}
}
}
-\hook_gput_code:nnn { begindocument } { . }
- {
- \IfPackageLoadedTF { colortbl }
- {
- \cs_set_eq:NN \__nicematrix_old_cellcolor \cellcolor
- \cs_set_eq:NN \__nicematrix_old_rowcolor \rowcolor
- \cs_new_protected:Npn \__nicematrix_revert_colortbl:
- {
- \hook_gput_code:nnn { env / tabular / begin } { nicematrix }
- {
- \cs_set_eq:NN \cellcolor \__nicematrix_old_cellcolor
- \cs_set_eq:NN \rowcolor \__nicematrix_old_rowcolor
- }
- }
- }
- { \cs_new_protected:Npn \__nicematrix_revert_colortbl: { } }
- }
\cs_new_protected:Npn \__nicematrix_EmptyColumn:n #1
{
\clist_map_inline:nn { #1 }
@@ -6057,13 +6029,16 @@
\cs_set_eq:NN \OnlyMainNiceMatrix \use:n
\cs_new_protected:Npn \__nicematrix_OnlyMainNiceMatrix:n #1
{
- \int_if_zero:nTF \l__nicematrix_first_col_int
+ \int_if_zero:nTF { \l__nicematrix_first_col_int }
{ \__nicematrix_OnlyMainNiceMatrix_i:n { #1 } }
{
- \int_if_zero:nTF \c at jCol
+ \int_if_zero:nTF { \c at jCol }
{
- \int_compare:nNnF \c at iRow = { -1 }
- { \int_compare:nNnF \c at iRow = { \l__nicematrix_last_row_int - 1 } { #1 } }
+ \int_compare:nNnF { \c at iRow } = { -1 }
+ {
+ \int_compare:nNnF { \c at iRow } = { \l__nicematrix_last_row_int - 1 }
+ { #1 }
+ }
}
{ \__nicematrix_OnlyMainNiceMatrix_i:n { #1 } }
}
@@ -6070,11 +6045,11 @@
}
\cs_new_protected:Npn \__nicematrix_OnlyMainNiceMatrix_i:n #1
{
- \int_if_zero:nF \c at iRow
+ \int_if_zero:nF { \c at iRow }
{
- \int_compare:nNnF \c at iRow = \l__nicematrix_last_row_int
+ \int_compare:nNnF { \c at iRow } = { \l__nicematrix_last_row_int }
{
- \int_compare:nNnT \c at jCol > \c_zero_int
+ \int_compare:nNnT { \c at jCol } > { \c_zero_int }
{ \bool_if:NF \l__nicematrix_in_last_col_bool { #1 } }
}
}
@@ -6090,7 +6065,7 @@
{ \__nicematrix_error:nn { TopRule~without~tikz } { #1 } }
}
\NewExpandableDocumentCommand { \__nicematrix_TopRule } { }
- { \__nicematrix_tikz_booktabs_loaded:nn \TopRule \__nicematrix_TopRule_i: }
+ { \__nicematrix_tikz_booktabs_loaded:nn { \TopRule } { \__nicematrix_TopRule_i: } }
\cs_new:Npn \__nicematrix_TopRule_i:
{
\noalign \bgroup
@@ -6118,7 +6093,7 @@
\egroup
}
\NewExpandableDocumentCommand { \__nicematrix_BottomRule } { }
- { \__nicematrix_tikz_booktabs_loaded:nn \BottomRule \__nicematrix_BottomRule_i: }
+ { \__nicematrix_tikz_booktabs_loaded:nn { \BottomRule } { \__nicematrix_BottomRule_i: } }
\cs_new:Npn \__nicematrix_BottomRule_i:
{
\noalign \bgroup
@@ -6148,7 +6123,7 @@
\egroup
}
\NewExpandableDocumentCommand { \__nicematrix_MidRule } { }
- { \__nicematrix_tikz_booktabs_loaded:nn \MidRule \__nicematrix_MidRule_i: }
+ { \__nicematrix_tikz_booktabs_loaded:nn { \MidRule } { \__nicematrix_MidRule_i: } }
\cs_new:Npn \__nicematrix_MidRule_i:
{
\noalign \bgroup
@@ -6197,10 +6172,10 @@
dotted .initial:n = false ,
dotted .default:n = true ,
color .code:n =
- \__nicematrix_set_CT at arc@:n { #1 }
+ \__nicematrix_set_CTarc:n { #1 }
\tl_set:Nn \l__nicematrix_rule_color_tl { #1 } ,
color .value_required:n = true ,
- sep-color .code:n = \__nicematrix_set_CT at drsc@:n { #1 } ,
+ sep-color .code:n = \__nicematrix_set_CTdrsc:n { #1 } ,
sep-color .value_required:n = true ,
tikz .code:n =
\IfPackageLoadedTF { tikz }
@@ -6217,7 +6192,7 @@
\group_begin:
\int_set_eq:NN \l__nicematrix_end_int \c at iRow
\keys_set_known:nnN { nicematrix / Rules } { #1 } \l__nicematrix_other_keys_tl
- \int_compare:nNnT \l__nicematrix_position_int < { \c at jCol + 2 }
+ \int_compare:nNnT { \l__nicematrix_position_int } < { \c at jCol + 2 }
\__nicematrix_vline_i:
\group_end:
}
@@ -6234,14 +6209,14 @@
{ \__nicematrix_test_vline_in_block:nnnnn ##1 }
\seq_map_inline:Nn \g__nicematrix_pos_of_stroken_blocks_seq
{ \__nicematrix_test_vline_in_stroken_block:nnnn ##1 }
- \clist_if_empty:NF \l__nicematrix_corners_clist \__nicematrix_test_in_corner_v:
+ \clist_if_empty:NF \l__nicematrix_corners_clist { \__nicematrix_test_in_corner_v: }
\bool_if:NTF \g_tmpa_bool
{
- \int_if_zero:nT \l__nicematrix_local_start_int
+ \int_if_zero:nT { \l__nicematrix_local_start_int }
{ \int_set:Nn \l__nicematrix_local_start_int \l_tmpa_tl }
}
{
- \int_compare:nNnT \l__nicematrix_local_start_int > \c_zero_int
+ \int_compare:nNnT { \l__nicematrix_local_start_int } > { \c_zero_int }
{
\int_set:Nn \l__nicematrix_local_end_int { \l_tmpa_tl - 1 }
\__nicematrix_vline_ii:
@@ -6249,7 +6224,7 @@
}
}
}
- \int_compare:nNnT \l__nicematrix_local_start_int > \c_zero_int
+ \int_compare:nNnT { \l__nicematrix_local_start_int } > { \c_zero_int }
{
\int_set_eq:NN \l__nicematrix_local_end_int \l__nicematrix_end_int
\__nicematrix_vline_ii:
@@ -6257,7 +6232,7 @@
}
\cs_new_protected:Npn \__nicematrix_test_in_corner_v:
{
- \int_compare:nNnTF \l_tmpb_tl = { \c at jCol + 1 }
+ \int_compare:nNnTF { \l_tmpb_tl } = { \c at jCol + 1 }
{
\__nicematrix_if_in_corner:nT { \l_tmpa_tl - \int_eval:n { \l_tmpb_tl - 1 } }
{ \bool_set_false:N \g_tmpa_bool }
@@ -6265,7 +6240,7 @@
{
\__nicematrix_if_in_corner:nT { \l_tmpa_tl - \l_tmpb_tl }
{
- \int_compare:nNnTF \l_tmpb_tl = \c_one_int
+ \int_compare:nNnTF { \l_tmpb_tl } = { \c_one_int }
{ \bool_set_false:N \g_tmpa_bool }
{
\__nicematrix_if_in_corner:nT
@@ -6280,11 +6255,11 @@
\tl_clear:N \l__nicematrix_tikz_rule_tl
\keys_set:no { nicematrix / RulesBis } \l__nicematrix_other_keys_tl
\bool_if:NTF \l__nicematrix_dotted_bool
- \__nicematrix_vline_iv:
+ { \__nicematrix_vline_iv: }
{
\tl_if_empty:NTF \l__nicematrix_tikz_rule_tl
- \__nicematrix_vline_iii:
- \__nicematrix_vline_v:
+ { \__nicematrix_vline_iii: }
+ { \__nicematrix_vline_v: }
}
}
\cs_new_protected:Npn \__nicematrix_vline_iii:
@@ -6307,7 +6282,7 @@
\dim_set_eq:NN \l__nicematrix_tmpc_dim \pgf at y
\bool_lazy_all:nT
{
- { \int_compare_p:nNn \l__nicematrix_multiplicity_int > \c_one_int }
+ { \int_compare_p:nNn { \l__nicematrix_multiplicity_int } > { \c_one_int } }
{ \cs_if_exist_p:N \CT at drsc@ }
{ ! \tl_if_blank_p:o \CT at drsc@ }
}
@@ -6360,7 +6335,7 @@
}
\cs_new_protected:Npn \__nicematrix_vline_v:
{
- \begin {tikzpicture }
+ \begin { tikzpicture }
\CT at arc@
\tl_if_empty:NF \l__nicematrix_rule_color_tl
{ \tl_put_right:Ne \l__nicematrix_tikz_rule_tl { , color = \l__nicematrix_rule_color_tl } }
@@ -6381,10 +6356,14 @@
\cs_new_protected:Npn \__nicematrix_draw_vlines:
{
\int_step_inline:nnn
- { \bool_lazy_or:nnTF \g__nicematrix_delims_bool \l__nicematrix_except_borders_bool 2 1 }
{
- \bool_lazy_or:nnTF \g__nicematrix_delims_bool \l__nicematrix_except_borders_bool
- \c at jCol
+ \bool_lazy_or:nnTF { \g__nicematrix_delims_bool } { \l__nicematrix_except_borders_bool }
+ { 2 }
+ { 1 }
+ }
+ {
+ \bool_lazy_or:nnTF { \g__nicematrix_delims_bool } { \l__nicematrix_except_borders_bool }
+ { \c at jCol }
{ \int_eval:n { \c at jCol + 1 } }
}
{
@@ -6396,7 +6375,6 @@
\cs_new_protected:Npn \__nicematrix_hline:n #1
{
\group_begin:
- \int_zero_new:N \l__nicematrix_end_int
\int_set_eq:NN \l__nicematrix_end_int \c at jCol
\keys_set_known:nnN { nicematrix / Rules } { #1 } \l__nicematrix_other_keys_tl
\__nicematrix_hline_i:
@@ -6404,8 +6382,8 @@
}
\cs_new_protected:Npn \__nicematrix_hline_i:
{
- \int_zero_new:N \l__nicematrix_local_start_int
- \int_zero_new:N \l__nicematrix_local_end_int
+ % \int_zero:N \l__nicematrix_local_start_int
+ % \int_zero:N \l__nicematrix_local_end_int
\tl_set:No \l_tmpa_tl { \int_use:N \l__nicematrix_position_int }
\int_step_variable:nnNn \l__nicematrix_start_int \l__nicematrix_end_int
\l_tmpb_tl
@@ -6417,14 +6395,14 @@
{ \__nicematrix_test_hline_in_block:nnnnn ##1 }
\seq_map_inline:Nn \g__nicematrix_pos_of_stroken_blocks_seq
{ \__nicematrix_test_hline_in_stroken_block:nnnn ##1 }
- \clist_if_empty:NF \l__nicematrix_corners_clist \__nicematrix_test_in_corner_h:
+ \clist_if_empty:NF \l__nicematrix_corners_clist { \__nicematrix_test_in_corner_h: }
\bool_if:NTF \g_tmpa_bool
{
- \int_if_zero:nT \l__nicematrix_local_start_int
+ \int_if_zero:nT { \l__nicematrix_local_start_int }
{ \int_set:Nn \l__nicematrix_local_start_int \l_tmpb_tl }
}
{
- \int_compare:nNnT \l__nicematrix_local_start_int > \c_zero_int
+ \int_compare:nNnT { \l__nicematrix_local_start_int } > { \c_zero_int }
{
\int_set:Nn \l__nicematrix_local_end_int { \l_tmpb_tl - 1 }
\__nicematrix_hline_ii:
@@ -6432,7 +6410,7 @@
}
}
}
- \int_compare:nNnT \l__nicematrix_local_start_int > \c_zero_int
+ \int_compare:nNnT { \l__nicematrix_local_start_int } > { \c_zero_int }
{
\int_set_eq:NN \l__nicematrix_local_end_int \l__nicematrix_end_int
\__nicematrix_hline_ii:
@@ -6440,7 +6418,7 @@
}
\cs_new_protected:Npn \__nicematrix_test_in_corner_h:
{
- \int_compare:nNnTF \l_tmpa_tl = { \c at iRow + 1 }
+ \int_compare:nNnTF { \l_tmpa_tl } = { \c at iRow + 1 }
{
\__nicematrix_if_in_corner:nT { \int_eval:n { \l_tmpa_tl - 1 } - \l_tmpb_tl }
{ \bool_set_false:N \g_tmpa_bool }
@@ -6448,7 +6426,7 @@
{
\__nicematrix_if_in_corner:nT { \l_tmpa_tl - \l_tmpb_tl }
{
- \int_compare:nNnTF \l_tmpa_tl = \c_one_int
+ \int_compare:nNnTF { \l_tmpa_tl } = { \c_one_int }
{ \bool_set_false:N \g_tmpa_bool }
{
\__nicematrix_if_in_corner:nT
@@ -6463,11 +6441,11 @@
\tl_clear:N \l__nicematrix_tikz_rule_tl
\keys_set:no { nicematrix / RulesBis } \l__nicematrix_other_keys_tl
\bool_if:NTF \l__nicematrix_dotted_bool
- \__nicematrix_hline_iv:
+ { \__nicematrix_hline_iv: }
{
\tl_if_empty:NTF \l__nicematrix_tikz_rule_tl
- \__nicematrix_hline_iii:
- \__nicematrix_hline_v:
+ { \__nicematrix_hline_iii: }
+ { \__nicematrix_hline_v: }
}
}
\cs_new_protected:Npn \__nicematrix_hline_iii:
@@ -6490,7 +6468,7 @@
\dim_set_eq:NN \l__nicematrix_tmpc_dim \pgf at x
\bool_lazy_all:nT
{
- { \int_compare_p:nNn \l__nicematrix_multiplicity_int > \c_one_int }
+ { \int_compare_p:nNn { \l__nicematrix_multiplicity_int } > { \c_one_int } }
{ \cs_if_exist_p:N \CT at drsc@ }
{ ! \tl_if_blank_p:o \CT at drsc@ }
}
@@ -6533,7 +6511,7 @@
\dim_set_eq:NN \l__nicematrix_y_final_dim \l__nicematrix_y_initial_dim
\__nicematrix_qpoint:n { col - \int_use:N \l__nicematrix_local_start_int }
\dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf at x
- \int_compare:nNnT \l__nicematrix_local_start_int = \c_one_int
+ \int_compare:nNnT { \l__nicematrix_local_start_int } = { \c_one_int }
{
\dim_sub:Nn \l__nicematrix_x_initial_dim \l__nicematrix_left_margin_dim
\bool_if:NF \g__nicematrix_delims_bool
@@ -6543,7 +6521,7 @@
}
\__nicematrix_qpoint:n { col - \int_eval:n { \l__nicematrix_local_end_int + 1 } }
\dim_set_eq:NN \l__nicematrix_x_final_dim \pgf at x
- \int_compare:nNnT \l__nicematrix_local_end_int = \c at jCol
+ \int_compare:nNnT { \l__nicematrix_local_end_int } = { \c at jCol }
{
\dim_add:Nn \l__nicematrix_x_final_dim \l__nicematrix_right_margin_dim
\bool_if:NF \g__nicematrix_delims_bool
@@ -6580,8 +6558,8 @@
\int_step_inline:nnn
{ \bool_lazy_or:nnTF \g__nicematrix_delims_bool \l__nicematrix_except_borders_bool 2 1 }
{
- \bool_lazy_or:nnTF \g__nicematrix_delims_bool \l__nicematrix_except_borders_bool
- \c at iRow
+ \bool_lazy_or:nnTF { \g__nicematrix_delims_bool } { \l__nicematrix_except_borders_bool }
+ { \c at iRow }
{ \int_eval:n { \c at iRow + 1 } }
}
{
@@ -6644,7 +6622,6 @@
ccommand .str_set:N = \l__nicematrix_ccommand_str ,
ccommand .value_required:n = true ,
}
-\cs_generate_variant:Nn \__nicematrix_custom_line_i:n { o }
\cs_new_protected:Npn \__nicematrix_custom_line_i:n #1
{
\bool_set_false:N \l__nicematrix_tikz_rule_bool
@@ -6660,7 +6637,7 @@
}
\bool_if:NT \l__nicematrix_dotted_rule_bool
{
- \int_compare:nNnT \l__nicematrix_multiplicity_int > \c_one_int
+ \int_compare:nNnT { \l__nicematrix_multiplicity_int } > { \c_one_int }
{ \__nicematrix_error:n { key~multiplicity~with~dotted } }
}
\str_if_empty:NF \l__nicematrix_letter_str
@@ -6673,7 +6650,7 @@
\l__nicematrix_letter_str
{ \__nicematrix_error:ne { Forbidden~letter } \l__nicematrix_letter_str }
{
- \cs_set_nopar:cpn { __nicematrix _ \l__nicematrix_letter_str } ##1
+ \cs_set_nopar:cpn { __nicematrix _ \l__nicematrix_letter_str : } ##1
{ \__nicematrix_v_custom_line:n { #1 } }
}
}
@@ -6681,6 +6658,7 @@
\str_if_empty:NF \l__nicematrix_command_str { \__nicematrix_h_custom_line:n { #1 } }
\str_if_empty:NF \l__nicematrix_ccommand_str { \__nicematrix_c_custom_line:n { #1 } }
}
+\cs_generate_variant:Nn \__nicematrix_custom_line_i:n { o }
\tl_const:Nn \c__nicematrix_forbidden_letters_tl { lcrpmbVX|()[]!@<> }
\str_const:Nn \c__nicematrix_forbidden_letters_str { lcrpmbVX|()[]!@<> }
\keys_define:nn { nicematrix / custom-line-bis }
@@ -6798,13 +6776,13 @@
{ letter = : , command = hdottedline , ccommand = cdottedline, dotted }
\cs_new_protected:Npn \__nicematrix_test_hline_in_block:nnnnn #1 #2 #3 #4 #5
{
- \int_compare:nNnT \l_tmpa_tl > { #1 }
+ \int_compare:nNnT { \l_tmpa_tl } > { #1 }
{
- \int_compare:nNnT \l_tmpa_tl < { #3 + 1 }
+ \int_compare:nNnT { \l_tmpa_tl } < { #3 + 1 }
{
- \int_compare:nNnT \l_tmpb_tl > { #2 - 1 }
+ \int_compare:nNnT { \l_tmpb_tl } > { #2 - 1 }
{
- \int_compare:nNnT \l_tmpb_tl < { #4 + 1 }
+ \int_compare:nNnT { \l_tmpb_tl } < { #4 + 1 }
{ \bool_gset_false:N \g_tmpa_bool }
}
}
@@ -6812,13 +6790,13 @@
}
\cs_new_protected:Npn \__nicematrix_test_vline_in_block:nnnnn #1 #2 #3 #4 #5
{
- \int_compare:nNnT \l_tmpa_tl > { #1 - 1 }
+ \int_compare:nNnT { \l_tmpa_tl } > { #1 - 1 }
{
- \int_compare:nNnT \l_tmpa_tl < { #3 + 1 }
+ \int_compare:nNnT { \l_tmpa_tl } < { #3 + 1 }
{
- \int_compare:nNnT \l_tmpb_tl > { #2 }
+ \int_compare:nNnT { \l_tmpb_tl } > { #2 }
{
- \int_compare:nNnT \l_tmpb_tl < { #4 + 1 }
+ \int_compare:nNnT { \l_tmpb_tl } < { #4 + 1 }
{ \bool_gset_false:N \g_tmpa_bool }
}
}
@@ -6826,14 +6804,14 @@
}
\cs_new_protected:Npn \__nicematrix_test_hline_in_stroken_block:nnnn #1 #2 #3 #4
{
- \int_compare:nNnT \l_tmpb_tl > { #2 - 1 }
+ \int_compare:nNnT { \l_tmpb_tl } > { #2 - 1 }
{
- \int_compare:nNnT \l_tmpb_tl < { #4 + 1 }
+ \int_compare:nNnT { \l_tmpb_tl } < { #4 + 1 }
{
- \int_compare:nNnTF \l_tmpa_tl = { #1 }
+ \int_compare:nNnTF { \l_tmpa_tl } = { #1 }
{ \bool_gset_false:N \g_tmpa_bool }
{
- \int_compare:nNnT \l_tmpa_tl = { #3 + 1 }
+ \int_compare:nNnT { \l_tmpa_tl } = { #3 + 1 }
{ \bool_gset_false:N \g_tmpa_bool }
}
}
@@ -6841,14 +6819,14 @@
}
\cs_new_protected:Npn \__nicematrix_test_vline_in_stroken_block:nnnn #1 #2 #3 #4
{
- \int_compare:nNnT \l_tmpa_tl > { #1 - 1 }
+ \int_compare:nNnT { \l_tmpa_tl } > { #1 - 1 }
{
- \int_compare:nNnT \l_tmpa_tl < { #3 + 1 }
+ \int_compare:nNnT { \l_tmpa_tl } < { #3 + 1 }
{
- \int_compare:nNnTF \l_tmpb_tl = { #2 }
+ \int_compare:nNnTF { \l_tmpb_tl } = { #2 }
{ \bool_gset_false:N \g_tmpa_bool }
{
- \int_compare:nNnT \l_tmpb_tl = { #4 + 1 }
+ \int_compare:nNnT { \l_tmpb_tl } = { #4 + 1 }
{ \bool_gset_false:N \g_tmpa_bool }
}
}
@@ -6878,7 +6856,7 @@
{
\tl_gput_right:Ne \g__nicematrix_aux_tl
{
- \cs_set_nopar:Npn \exp_not:N \l__nicematrix_corners_cells_clist
+ \clist_set:Nn \exp_not:N \l__nicematrix_corners_cells_clist
{ \l__nicematrix_corners_cells_clist }
}
}
@@ -6895,8 +6873,8 @@
{
\cs_if_exist:cTF
{ __nicematrix _ block _ \int_eval:n { #1 } - \int_eval:n { #2 } }
- \prg_return_true:
- \prg_return_false:
+ { \prg_return_true: }
+ { \prg_return_false: }
}
\cs_new_protected:Npn \__nicematrix_compute_a_corner:nnnnnn #1 #2 #3 #4 #5 #6
{
@@ -6934,10 +6912,10 @@
{ \int_set:Nn \l__nicematrix_last_empty_column_int { ##1 } }
}
}
- \int_step_inline:nnnn { #1 } { #3 } \l__nicematrix_last_empty_row_int
+ \int_step_inline:nnnn { #1 } { #3 } { \l__nicematrix_last_empty_row_int }
{
\bool_set_false:N \l_tmpa_bool
- \int_step_inline:nnnn { #2 } { #4 } \l__nicematrix_last_empty_column_int
+ \int_step_inline:nnnn { #2 } { #4 } { \l__nicematrix_last_empty_column_int }
{
\bool_lazy_or:nnTF
{ \cs_if_exist_p:c { pgf @ sh @ ns @ \__nicematrix_env: - ##1 - ####1 } }
@@ -7029,17 +7007,17 @@
{
\int_step_variable:nnNn \l__nicematrix_first_row_int \g__nicematrix_row_total_int \__nicematrix_i:
{
- \dim_zero_new:c { l__nicematrix_row_\__nicematrix_i: _min_dim }
- \dim_set_eq:cN { l__nicematrix_row_\__nicematrix_i: _min_dim } \c_max_dim
- \dim_zero_new:c { l__nicematrix_row_\__nicematrix_i: _max_dim }
- \dim_set:cn { l__nicematrix_row_\__nicematrix_i: _max_dim } { - \c_max_dim }
+ \dim_zero_new:c { l__nicematrix_row_ \__nicematrix_i: _min_dim }
+ \dim_set_eq:cN { l__nicematrix_row_ \__nicematrix_i: _min_dim } \c_max_dim
+ \dim_zero_new:c { l__nicematrix_row_ \__nicematrix_i: _max_dim }
+ \dim_set:cn { l__nicematrix_row_ \__nicematrix_i: _max_dim } { - \c_max_dim }
}
\int_step_variable:nnNn \l__nicematrix_first_col_int \g__nicematrix_col_total_int \__nicematrix_j:
{
- \dim_zero_new:c { l__nicematrix_column_\__nicematrix_j: _min_dim }
- \dim_set_eq:cN { l__nicematrix_column_\__nicematrix_j: _min_dim } \c_max_dim
- \dim_zero_new:c { l__nicematrix_column_\__nicematrix_j: _max_dim }
- \dim_set:cn { l__nicematrix_column_\__nicematrix_j: _max_dim } { - \c_max_dim }
+ \dim_zero_new:c { l__nicematrix_column_ \__nicematrix_j: _min_dim }
+ \dim_set_eq:cN { l__nicematrix_column_ \__nicematrix_j: _min_dim } \c_max_dim
+ \dim_zero_new:c { l__nicematrix_column_ \__nicematrix_j: _max_dim }
+ \dim_set:cn { l__nicematrix_column_ \__nicematrix_j: _max_dim } { - \c_max_dim }
}
\int_step_variable:nnNn \l__nicematrix_first_row_int \g__nicematrix_row_total_int \__nicematrix_i:
{
@@ -7050,20 +7028,20 @@
{ pgf @ sh @ ns @ \__nicematrix_env: - \__nicematrix_i: - \__nicematrix_j: }
{
\pgfpointanchor { \__nicematrix_env: - \__nicematrix_i: - \__nicematrix_j: } { south~west }
- \dim_set:cn { l__nicematrix_row_\__nicematrix_i: _min_dim}
+ \dim_set:cn { l__nicematrix_row_ \__nicematrix_i: _min_dim }
{ \dim_min:vn { l__nicematrix_row _ \__nicematrix_i: _min_dim } \pgf at y }
\seq_if_in:NeF \g__nicematrix_multicolumn_cells_seq { \__nicematrix_i: - \__nicematrix_j: }
{
- \dim_set:cn { l__nicematrix_column _ \__nicematrix_j: _min_dim}
+ \dim_set:cn { l__nicematrix_column _ \__nicematrix_j: _min_dim }
{ \dim_min:vn { l__nicematrix_column _ \__nicematrix_j: _min_dim } \pgf at x }
}
\pgfpointanchor { \__nicematrix_env: - \__nicematrix_i: - \__nicematrix_j: } { north~east }
\dim_set:cn { l__nicematrix_row _ \__nicematrix_i: _ max_dim }
- { \dim_max:vn { l__nicematrix_row _ \__nicematrix_i: _ max_dim } \pgf at y }
+ { \dim_max:vn { l__nicematrix_row _ \__nicematrix_i: _ max_dim } { \pgf at y } }
\seq_if_in:NeF \g__nicematrix_multicolumn_cells_seq { \__nicematrix_i: - \__nicematrix_j: }
{
\dim_set:cn { l__nicematrix_column _ \__nicematrix_j: _ max_dim }
- { \dim_max:vn { l__nicematrix_column _ \__nicematrix_j: _max_dim } \pgf at x }
+ { \dim_max:vn { l__nicematrix_column _ \__nicematrix_j: _max_dim } { \pgf at x } }
}
}
}
@@ -7095,7 +7073,7 @@
\pgfrememberpicturepositiononpagetrue
\pgf at relevantforpicturesizefalse
\__nicematrix_computations_for_medium_nodes:
- \cs_set_nopar:Npn \l__nicematrix_suffix_tl { -medium }
+ \tl_set:Nn \l__nicematrix_suffix_tl { -medium }
\__nicematrix_create_nodes:
\endpgfpicture
}
@@ -7106,7 +7084,7 @@
\pgf at relevantforpicturesizefalse
\__nicematrix_computations_for_medium_nodes:
\__nicematrix_computations_for_large_nodes:
- \cs_set_nopar:Npn \l__nicematrix_suffix_tl { - large }
+ \tl_set:Nn \l__nicematrix_suffix_tl { - large }
\__nicematrix_create_nodes:
\endpgfpicture
}
@@ -7116,10 +7094,10 @@
\pgfrememberpicturepositiononpagetrue
\pgf at relevantforpicturesizefalse
\__nicematrix_computations_for_medium_nodes:
- \cs_set_nopar:Npn \l__nicematrix_suffix_tl { - medium }
+ \tl_set:Nn \l__nicematrix_suffix_tl { - medium }
\__nicematrix_create_nodes:
\__nicematrix_computations_for_large_nodes:
- \cs_set_nopar:Npn \l__nicematrix_suffix_tl { - large }
+ \tl_set:Nn \l__nicematrix_suffix_tl { - large }
\__nicematrix_create_nodes:
\endpgfpicture
}
@@ -7138,7 +7116,7 @@
/ 2
}
\dim_set_eq:cc { l__nicematrix_row _ \int_eval:n { \__nicematrix_i: + 1 } _ max _ dim }
- { l__nicematrix_row_\__nicematrix_i: _min_dim }
+ { l__nicematrix_row_ \__nicematrix_i: _min_dim }
}
\int_step_variable:nNn { \c at jCol - 1 } \__nicematrix_j:
{
@@ -7181,6 +7159,21 @@
}
}
}
+ \int_step_inline:nn { \c at iRow }
+ {
+ \pgfnodealias
+ { \__nicematrix_env: - ##1 - last \l__nicematrix_suffix_tl }
+ { \__nicematrix_env: - ##1 - \int_use:N \c at jCol \l__nicematrix_suffix_tl }
+ }
+ \int_step_inline:nn { \c at jCol }
+ {
+ \pgfnodealias
+ { \__nicematrix_env: - last - ##1 \l__nicematrix_suffix_tl }
+ { \__nicematrix_env: - \int_use:N \c at iRow - ##1 \l__nicematrix_suffix_tl }
+ }
+ \pgfnodealias % added 2025-04-05
+ { \__nicematrix_env: - last - last \l__nicematrix_suffix_tl }
+ { \__nicematrix_env: - \int_use:N \c at iRow - \int_use:N \c at jCol \l__nicematrix_suffix_tl }
\seq_map_pairwise_function:NNN
\g__nicematrix_multicolumn_cells_seq
\g__nicematrix_multicolumn_sizes_seq
@@ -7204,7 +7197,7 @@
{
\pgfnodealias
{ \l__nicematrix_name_str - \__nicematrix_i: - \__nicematrix_j: \l__nicematrix_suffix_tl }
- { \int_use:N \g__nicematrix_env_int - \__nicematrix_i: - \__nicematrix_j: \l__nicematrix_suffix_tl}
+ { \int_use:N \g__nicematrix_env_int - \__nicematrix_i: - \__nicematrix_j: \l__nicematrix_suffix_tl }
}
}
\keys_define:nn { nicematrix / Block / FirstPass }
@@ -7251,22 +7244,20 @@
\cs_new_protected:Npn \__nicematrix_Block: { \__nicematrix_collect_options:n { \__nicematrix_Block_i: } }
\NewExpandableDocumentCommand \__nicematrix_Block_i: { m m D < > { } +m }
{
- \peek_remove_spaces:n
+ \tl_if_blank:nTF { #2 }
+ { \__nicematrix_Block_ii:nnnnn \c_one_int \c_one_int }
{
- \tl_if_blank:nTF { #2 }
- { \__nicematrix_Block_ii:nnnnn \c_one_int \c_one_int }
- {
- \int_compare:nNnTF { \char_value_catcode:n { 45 } } = { 13 }
- \__nicematrix_Block_i_czech \__nicematrix_Block_i
- #2 \q_stop
- }
- { #1 } { #3 } { #4 }
+ \int_compare:nNnTF { \char_value_catcode:n { 45 } } = { 13 }
+ \__nicematrix_Block_i_czech:w \__nicematrix_Block_i:w
+ #2 \q_stop
}
+ { #1 } { #3 } { #4 }
+ \ignorespaces
}
-\cs_new:Npn \__nicematrix_Block_i #1-#2 \q_stop { \__nicematrix_Block_ii:nnnnn { #1 } { #2 } }
+\cs_new:Npn \__nicematrix_Block_i:w #1-#2 \q_stop { \__nicematrix_Block_ii:nnnnn { #1 } { #2 } }
{
\char_set_catcode_active:N -
- \cs_new:Npn \__nicematrix_Block_i_czech #1-#2 \q_stop { \__nicematrix_Block_ii:nnnnn { #1 } { #2 } }
+ \cs_new:Npn \__nicematrix_Block_i_czech:w #1-#2 \q_stop { \__nicematrix_Block_ii:nnnnn { #1 } { #2 } }
}
\cs_new_protected:Npn \__nicematrix_Block_ii:nnnnn #1 #2 #3 #4 #5
{
@@ -7280,7 +7271,7 @@
{ \str_if_eq_p:ee { * } { #2 } }
{ \int_set:Nn \l_tmpb_int { 100 } }
{ \int_set:Nn \l_tmpb_int { #2 } }
- \int_compare:nNnTF \l_tmpb_int = \c_one_int
+ \int_compare:nNnTF { \l_tmpb_int } = { \c_one_int }
{
\tl_if_empty:NTF \l__nicematrix_hpos_cell_tl
{ \str_set_eq:NN \l__nicematrix_hpos_block_str \c__nicematrix_c_str }
@@ -7310,7 +7301,6 @@
{ \__nicematrix_Block_v:eennn }
{ \l_tmpa_int } { \l_tmpb_int } { #3 } { #4 } { #5 }
}
-\cs_generate_variant:Nn \__nicematrix_Block_iv:nnnnn { e e }
\cs_new_protected:Npn \__nicematrix_Block_iv:nnnnn #1 #2 #3 #4 #5
{
\int_gincr:N \g__nicematrix_block_box_int
@@ -7333,17 +7323,17 @@
{ g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
{
\tl_if_empty:NTF \l__nicematrix_color_tl
- { \int_compare:nNnT { #2 } = \c_one_int \set at color }
+ { \int_compare:nNnT { #2 } = { \c_one_int } { \set at color } }
{ \__nicematrix_color:o \l__nicematrix_color_tl }
- \int_compare:nNnT { #1 } = \c_one_int
+ \int_compare:nNnT { #1 } = { \c_one_int }
{
- \int_if_zero:nTF \c at iRow
+ \int_if_zero:nTF { \c at iRow }
{
\cs_set_eq:NN \Block \__nicematrix_NullBlock:
\l__nicematrix_code_for_first_row_tl
}
{
- \int_compare:nNnT \c at iRow = \l__nicematrix_last_row_int
+ \int_compare:nNnT { \c at iRow } = { \l__nicematrix_last_row_int }
{
\cs_set_eq:NN \Block \__nicematrix_NullBlock:
\l__nicematrix_code_for_last_row_tl
@@ -7359,15 +7349,18 @@
{
\bool_lazy_all:nTF
{
- { \int_compare_p:nNn { #2 } = \c_one_int }
- { ! \dim_compare_p:nNn \l__nicematrix_col_width_dim < \c_zero_dim }
+ { \int_compare_p:nNn { #2 } = { \c_one_int } }
+ {
+ ! \dim_compare_p:nNn
+ { \l__nicematrix_col_width_dim } < { \c_zero_dim }
+ }
{ ! \g__nicematrix_rotate_bool }
}
{
\use:e
{
- \exp_not:N \begin { minipage }%
- [ \str_lowercase:o \l__nicematrix_vpos_block_str ]
+ \exp_not:N \begin { minipage }
+ [ \str_lowercase:f \l__nicematrix_vpos_block_str ]
{ \l__nicematrix_col_width_dim }
\str_case:on \l__nicematrix_hpos_block_str
{ c \centering r \raggedleft l \raggedright }
@@ -7380,8 +7373,8 @@
{ \tagpdfsetup { table / tagging = presentation } }
\use:e
{
- \exp_not:N \begin { tabular }%
- [ \str_lowercase:o \l__nicematrix_vpos_block_str ]
+ \exp_not:N \begin { tabular }
+ [ \str_lowercase:f \l__nicematrix_vpos_block_str ]
{ @ { } \l__nicematrix_hpos_block_str @ { } }
}
#5
@@ -7392,8 +7385,8 @@
\c_math_toggle_token
\use:e
{
- \exp_not:N \begin { array }%
- [ \str_lowercase:o \l__nicematrix_vpos_block_str ]
+ \exp_not:N \begin { array }
+ [ \str_lowercase:f \l__nicematrix_vpos_block_str ]
{ @ { } \l__nicematrix_hpos_block_str @ { } }
}
#5
@@ -7401,13 +7394,13 @@
\c_math_toggle_token
}
}
- \bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_box_of_block:
- \int_compare:nNnT { #2 } = \c_one_int
+ \bool_if:NT \g__nicematrix_rotate_bool { \__nicematrix_rotate_box_of_block: }
+ \int_compare:nNnT { #2 } = { \c_one_int }
{
\dim_gset:Nn \g__nicematrix_blocks_wd_dim
{
\dim_max:nn
- \g__nicematrix_blocks_wd_dim
+ { \g__nicematrix_blocks_wd_dim }
{
\box_wd:c
{ g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
@@ -7415,13 +7408,13 @@
}
}
\bool_lazy_and:nnT
- { \int_compare_p:nNn { #1 } = \c_one_int }
+ { \int_compare_p:nNn { #1 } = { \c_one_int } }
{ \str_if_empty_p:N \l__nicematrix_vpos_block_str }
{
\dim_gset:Nn \g__nicematrix_blocks_ht_dim
{
\dim_max:nn
- \g__nicematrix_blocks_ht_dim
+ { \g__nicematrix_blocks_ht_dim }
{
\box_ht:c
{ g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
@@ -7430,7 +7423,7 @@
\dim_gset:Nn \g__nicematrix_blocks_dp_dim
{
\dim_max:nn
- \g__nicematrix_blocks_dp_dim
+ { \g__nicematrix_blocks_dp_dim }
{
\box_dp:c
{ g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
@@ -7447,7 +7440,10 @@
{
\bool_if:NTF \g__nicematrix_rotate_c_bool
{ m }
- { \int_compare:nNnT \c at iRow = \l__nicematrix_last_row_int T }
+ {
+ \int_compare:nNnT { \c at iRow } = { \l__nicematrix_last_row_int }
+ { T }
+ }
}
}
{
@@ -7468,17 +7464,22 @@
{
\str_case:onF \l__nicematrix_vpos_block_str
{ b l B l t r T r }
- { \int_compare:nNnTF \c at iRow = \l__nicematrix_last_row_int r l }
+ {
+ \int_compare:nNnTF { \c at iRow } = { \l__nicematrix_last_row_int }
+ { r }
+ { l }
+ }
}
}
}
}
+\cs_generate_variant:Nn \__nicematrix_Block_iv:nnnnn { e e }
\cs_new_protected:Npn \__nicematrix_rotate_box_of_block:
{
\box_grotate:cn
{ g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
{ 90 }
- \int_compare:nNnT \c at iRow = \l__nicematrix_last_row_int
+ \int_compare:nNnT { \c at iRow } = { \l__nicematrix_last_row_int }
{
\vbox_gset_top:cn
{ g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
@@ -7503,7 +7504,6 @@
}
}
}
-\cs_generate_variant:Nn \__nicematrix_Block_v:nnnnn { e e }
\cs_new_protected:Npn \__nicematrix_Block_v:nnnnn #1 #2 #3 #4 #5
{
\seq_gput_right:Ne \g__nicematrix_blocks_seq
@@ -7553,7 +7553,7 @@
}
}
}
-\cs_generate_variant:Nn \__nicematrix_Block_vi:nnnnn { e e }
+\cs_generate_variant:Nn \__nicematrix_Block_v:nnnnn { e e }
\cs_new_protected:Npn \__nicematrix_Block_vi:nnnnn #1 #2 #3 #4 #5
{
\seq_gput_right:Ne \g__nicematrix_blocks_seq
@@ -7563,7 +7563,7 @@
{ { \exp_not:n { #4 #5 } } }
}
}
-\cs_generate_variant:Nn \__nicematrix_Block_vii:nnnnn { e e }
+\cs_generate_variant:Nn \__nicematrix_Block_vi:nnnnn { e e }
\cs_new_protected:Npn \__nicematrix_Block_vii:nnnnn #1 #2 #3 #4 #5
{
\seq_gput_right:Ne \g__nicematrix_blocks_seq
@@ -7573,6 +7573,7 @@
{ \exp_not:n { #4 #5 } }
}
}
+\cs_generate_variant:Nn \__nicematrix_Block_vii:nnnnn { e e }
\keys_define:nn { nicematrix / Block / SecondPass }
{
ampersand-in-blocks .bool_set:N = \l__nicematrix_amp_in_blocks_bool ,
@@ -7654,8 +7655,8 @@
}
\cs_new_protected:Npn \__nicematrix_Block_iv:nnnnnn #1 #2 #3 #4 #5 #6
{
- \int_zero_new:N \l__nicematrix_last_row_int
- \int_zero_new:N \l__nicematrix_last_col_int
+ \int_zero:N \l__nicematrix_last_row_int
+ \int_zero:N \l__nicematrix_last_col_int
\int_compare:nNnTF { #3 } > { 98 }
{ \int_set_eq:NN \l__nicematrix_last_row_int \c at iRow }
{ \int_set:Nn \l__nicematrix_last_row_int { #3 } }
@@ -7662,10 +7663,10 @@
\int_compare:nNnTF { #4 } > { 98 }
{ \int_set_eq:NN \l__nicematrix_last_col_int \c at jCol }
{ \int_set:Nn \l__nicematrix_last_col_int { #4 } }
- \int_compare:nNnTF \l__nicematrix_last_col_int > \g__nicematrix_col_total_int
+ \int_compare:nNnTF { \l__nicematrix_last_col_int } > { \g__nicematrix_col_total_int }
{
\bool_lazy_and:nnTF
- \l__nicematrix_preamble_bool
+ { \l__nicematrix_preamble_bool }
{
\int_compare_p:n
{ \l__nicematrix_last_col_int <= \g__nicematrix_static_num_of_col_int }
@@ -7678,7 +7679,7 @@
{ \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } }
}
{
- \int_compare:nNnTF \l__nicematrix_last_row_int > \g__nicematrix_row_total_int
+ \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:nneenn
@@ -7691,7 +7692,6 @@
}
}
}
-\cs_generate_variant:Nn \__nicematrix_Block_v:nnnnnn { n n e e }
\cs_new_protected:Npn \__nicematrix_Block_v:nnnnnn #1 #2 #3 #4 #5 #6
{
\group_begin:
@@ -7700,7 +7700,7 @@
\keys_set:nn { nicematrix / Block / SecondPass } { #5 }
\tl_if_in:nnT { #6 } { & } { \bool_set_true:N \l__nicematrix_ampersand_bool }
\bool_lazy_and:nnT
- \l__nicematrix_vlines_block_bool
+ { \l__nicematrix_vlines_block_bool }
{ ! \l__nicematrix_ampersand_bool }
{
\tl_gput_right:Ne \g_nicematrix_code_after_tl
@@ -7723,7 +7723,7 @@
}
\bool_if:NF \l__nicematrix_transparent_bool
{
- \bool_lazy_and:nnF \l__nicematrix_vlines_block_bool \l__nicematrix_hlines_block_bool
+ \bool_lazy_and:nnF { \l__nicematrix_vlines_block_bool } { \l__nicematrix_hlines_block_bool }
{
\seq_gput_left:Ne \g__nicematrix_pos_of_blocks_seq
{ { #1 } { #2 } { #3 } { #4 } { \l__nicematrix_block_name_str } }
@@ -7818,7 +7818,7 @@
\bool_if:NF \l__nicematrix_hpos_of_block_cap_bool
{
\dim_set_eq:NN \l_tmpb_dim \c_max_dim
- \int_step_inline:nnn \l__nicematrix_first_row_int \g__nicematrix_row_total_int
+ \int_step_inline:nnn { \l__nicematrix_first_row_int } { \g__nicematrix_row_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \__nicematrix_env: - ##1 - #2 }
@@ -7830,13 +7830,13 @@
}
}
}
- \dim_compare:nNnT \l_tmpb_dim = \c_max_dim
+ \dim_compare:nNnT { \l_tmpb_dim } = { \c_max_dim }
{
\__nicematrix_qpoint:n { col - #2 }
\dim_set_eq:NN \l_tmpb_dim \pgf at x
}
\dim_set:Nn \l__nicematrix_tmpd_dim { - \c_max_dim }
- \int_step_inline:nnn \l__nicematrix_first_row_int \g__nicematrix_row_total_int
+ \int_step_inline:nnn { \l__nicematrix_first_row_int } { \g__nicematrix_row_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \__nicematrix_env: - ##1 - \int_use:N \l__nicematrix_last_col_int }
@@ -7846,11 +7846,12 @@
\pgfpointanchor
{ \__nicematrix_env: - ##1 - \int_use:N \l__nicematrix_last_col_int }
{ east }
- \dim_set:Nn \l__nicematrix_tmpd_dim { \dim_max:nn \l__nicematrix_tmpd_dim \pgf at x }
+ \dim_set:Nn \l__nicematrix_tmpd_dim
+ { \dim_max:nn { \l__nicematrix_tmpd_dim } { \pgf at x } }
}
}
}
- \dim_compare:nNnT \l__nicematrix_tmpd_dim = { - \c_max_dim }
+ \dim_compare:nNnT { \l__nicematrix_tmpd_dim } = { - \c_max_dim }
{
\__nicematrix_qpoint:n { col - \int_eval:n { \l__nicematrix_last_col_int + 1 } }
\dim_set_eq:NN \l__nicematrix_tmpd_dim \pgf at x
@@ -7893,7 +7894,7 @@
\dim_set:Nn \l_tmpb_dim
{ ( \pgf at x - \l_tmpa_dim ) / \int_use:N \l__nicematrix_split_int }
\bool_lazy_or:nnT
- \l__nicematrix_vlines_block_bool
+ { \l__nicematrix_vlines_block_bool }
{ \str_if_eq_p:ee \l__nicematrix_vlines_clist { all } }
{
\int_step_inline:nn { \l__nicematrix_split_int - 1 }
@@ -7918,11 +7919,11 @@
}
\__nicematrix_qpoint:n { row - #1 - base }
\dim_set_eq:NN \l__nicematrix_tmpc_dim \pgf at y
- \int_step_inline:nn \l__nicematrix_split_int
+ \int_step_inline:nn { \l__nicematrix_split_int }
{
\group_begin:
\dim_set:Nn \col at sep
- { \bool_if:NTF \l__nicematrix_tabular_bool \tabcolsep \arraycolsep }
+ { \bool_if:NTF \l__nicematrix_tabular_bool { \tabcolsep } { \arraycolsep } }
\pgftransformshift
{
\pgfpoint
@@ -7974,7 +7975,7 @@
\endpgfpicture
\hbox_set:Nn \l__nicematrix_cell_box
{
- \begin { minipage } [ \str_lowercase:o \l__nicematrix_vpos_block_str ]
+ \begin { minipage } [ \str_lowercase:f \l__nicematrix_vpos_block_str ]
{ \g_tmpb_dim }
\str_case:on \l__nicematrix_hpos_block_str
{ c \centering r \raggedleft l \raggedright j { } }
@@ -7983,13 +7984,13 @@
}
}
{ \hbox_set:Nn \l__nicematrix_cell_box { \set at color #6 } }
- \bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
+ \bool_if:NT \g__nicematrix_rotate_bool { \__nicematrix_rotate_cell_box: }
\pgfpicture
\pgfrememberpicturepositiononpagetrue
\pgf at relevantforpicturesizefalse
\bool_lazy_any:nTF
{
- { \str_if_empty_p:N \l__nicematrix_vpos_block_str } % added 2024/06/29
+ { \str_if_empty_p:N \l__nicematrix_vpos_block_str }
{ \str_if_eq_p:ee \l__nicematrix_vpos_block_str { c } }
{ \str_if_eq_p:ee \l__nicematrix_vpos_block_str { T } }
{ \str_if_eq_p:ee \l__nicematrix_vpos_block_str { B } }
@@ -7998,7 +7999,7 @@
\int_if_zero:nT { #2 } { \str_set_eq:NN \l__nicematrix_hpos_block_str \c__nicematrix_r_str }
\bool_if:nT \g__nicematrix_last_col_found_bool
{
- \int_compare:nNnT { #2 } = \g__nicematrix_col_total_int
+ \int_compare:nNnT { #2 } = { \g__nicematrix_col_total_int }
{ \str_set_eq:NN \l__nicematrix_hpos_block_str \c__nicematrix_l_str }
}
\tl_set:Ne \l_tmpa_tl
@@ -8005,7 +8006,7 @@
{
\str_case:on \l__nicematrix_vpos_block_str
{
- { } { % added 2024-06-29
+ { } {
\str_case:on \l__nicematrix_hpos_block_str
{
c { center }
@@ -8104,6 +8105,7 @@
}
\group_end:
}
+\cs_generate_variant:Nn \__nicematrix_Block_v:nnnnnn { n n e e }
\cs_set_protected:Npn \__nicematrix_fill:nnnnn #1 #2 #3 #4 #5
{
\pgfpicture
@@ -8156,9 +8158,9 @@
{ \l__nicematrix_rounded_corners_dim }
}
\__nicematrix_cut_on_hyphen:w #2 \q_stop
- \int_compare:nNnF \l_tmpa_tl > \c at iRow
+ \int_compare:nNnF { \l_tmpa_tl } > { \c at iRow }
{
- \int_compare:nNnF \l_tmpb_tl > \c at jCol
+ \int_compare:nNnF { \l_tmpb_tl } > { \c at jCol }
{
\__nicematrix_qpoint:n { row - \l_tmpa_tl }
\dim_set_eq:NN \l_tmpb_dim \pgf at y
@@ -8165,9 +8167,9 @@
\__nicematrix_qpoint:n { col - \l_tmpb_tl }
\dim_set_eq:NN \l__nicematrix_tmpc_dim \pgf at x
\__nicematrix_cut_on_hyphen:w #3 \q_stop
- \int_compare:nNnT \l_tmpa_tl > \c at iRow
+ \int_compare:nNnT { \l_tmpa_tl } > { \c at iRow }
{ \tl_set:No \l_tmpa_tl { \int_use:N \c at iRow } }
- \int_compare:nNnT \l_tmpb_tl > \c at jCol
+ \int_compare:nNnT { \l_tmpb_tl } > { \c at jCol }
{ \tl_set:No \l_tmpb_tl { \int_use:N \c at jCol } }
\__nicematrix_qpoint:n { row - \int_eval:n { \l_tmpa_tl + 1 } }
\dim_set_eq:NN \l_tmpa_dim \pgf at y
@@ -8177,7 +8179,7 @@
\pgfpathrectanglecorners
{ \pgfpoint \l__nicematrix_tmpc_dim \l_tmpb_dim }
{ \pgfpoint \l__nicematrix_tmpd_dim \l_tmpa_dim }
- \dim_compare:nNnTF \l__nicematrix_rounded_corners_dim = \c_zero_dim
+ \dim_compare:nNnTF { \l__nicematrix_rounded_corners_dim } = { \c_zero_dim }
{ \pgfusepathqstroke }
{ \pgfusepath { stroke } }
}
@@ -8198,6 +8200,7 @@
\cs_new_protected:Npn \__nicematrix_vlines_block:nnn #1 #2 #3
{
\group_begin:
+ \dim_set_eq:NN \l__nicematrix_line_width_dim \arrayrulewidth
\keys_set_known:nn { nicematrix / BlockBorders } { #1 }
\dim_set_eq:NN \arrayrulewidth \l__nicematrix_line_width_dim
\__nicematrix_cut_on_hyphen:w #2 \q_stop
@@ -8206,7 +8209,7 @@
\__nicematrix_cut_on_hyphen:w #3 \q_stop
\tl_set:Ne \l_tmpa_tl { \int_eval:n { \l_tmpa_tl + 1 } }
\tl_set:Ne \l_tmpb_tl { \int_eval:n { \l_tmpb_tl + 1 } }
- \int_step_inline:nnn \l__nicematrix_tmpd_tl \l_tmpb_tl
+ \int_step_inline:nnn { \l__nicematrix_tmpd_tl } { \l_tmpb_tl }
{
\use:e
{
@@ -8224,6 +8227,7 @@
\cs_new_protected:Npn \__nicematrix_hlines_block:nnn #1 #2 #3
{
\group_begin:
+ \dim_set_eq:NN \l__nicematrix_line_width_dim \arrayrulewidth
\keys_set_known:nn { nicematrix / BlockBorders } { #1 }
\dim_set_eq:NN \arrayrulewidth \l__nicematrix_line_width_dim
\__nicematrix_cut_on_hyphen:w #2 \q_stop
@@ -8232,7 +8236,7 @@
\__nicematrix_cut_on_hyphen:w #3 \q_stop
\tl_set:Ne \l_tmpa_tl { \int_eval:n { \l_tmpa_tl + 1 } }
\tl_set:Ne \l_tmpb_tl { \int_eval:n { \l_tmpb_tl + 1 } }
- \int_step_inline:nnn \l__nicematrix_tmpc_tl \l_tmpa_tl
+ \int_step_inline:nnn { \l__nicematrix_tmpc_tl } { \l_tmpa_tl }
{
\use:e
{
@@ -8251,7 +8255,7 @@
{
\dim_set_eq:NN \l__nicematrix_line_width_dim \arrayrulewidth
\keys_set_known:nn { nicematrix / BlockBorders } { #1 }
- \dim_compare:nNnTF \l__nicematrix_rounded_corners_dim > \c_zero_dim
+ \dim_compare:nNnTF { \l__nicematrix_rounded_corners_dim } > { \c_zero_dim }
{ \__nicematrix_error:n { borders~forbidden } }
{
\tl_clear_new:N \l__nicematrix_borders_tikz_tl
@@ -8350,7 +8354,6 @@
line-width .dim_set:N = \l__nicematrix_line_width_dim
}
-\cs_generate_variant:Nn \__nicematrix_block_tikz:nnnnn { o }
\cs_new_protected:Npn \__nicematrix_block_tikz:nnnnn #1 #2 #3 #4 #5
{
\begin { tikzpicture }
@@ -8377,6 +8380,7 @@
}
\end { tikzpicture }
}
+\cs_generate_variant:Nn \__nicematrix_block_tikz:nnnnn { o }
\keys_define:nn { nicematrix / SpecialOffset }
{ offset .dim_set:N = \l__nicematrix_offset_dim }
\cs_new_protected:Npn \__nicematrix_NullBlock:
@@ -8430,28 +8434,28 @@
{ * { #4 } { \exp_not:o \l__nicematrix_columns_type_tl } }
[ \exp_not:o \l_tmpa_tl ]
}
- \int_if_zero:nT \l__nicematrix_first_row_int
+ \int_if_zero:nT { \l__nicematrix_first_row_int }
{
- \int_if_zero:nT \l__nicematrix_first_col_int { & }
+ \int_if_zero:nT { \l__nicematrix_first_col_int } { & }
\prg_replicate:nn { #4 - 1 } { & }
- \int_compare:nNnT \l__nicematrix_last_col_int > { -1 } { & } \\
+ \int_compare:nNnT { \l__nicematrix_last_col_int } > { -1 } { & } \\
}
\prg_replicate:nn { #3 }
{
- \int_if_zero:nT \l__nicematrix_first_col_int { & }
+ \int_if_zero:nT { \l__nicematrix_first_col_int } { & }
\prg_replicate:nn { #4 - 1 } { { } #5 & } #5
- \int_compare:nNnT \l__nicematrix_last_col_int > { -1 } { & } \\
+ \int_compare:nNnT { \l__nicematrix_last_col_int } > { -1 } { & } \\
}
- \int_compare:nNnT \l__nicematrix_last_row_int > { -2 }
+ \int_compare:nNnT { \l__nicematrix_last_row_int } > { -2 }
{
- \int_if_zero:nT \l__nicematrix_first_col_int { & }
+ \int_if_zero:nT { \l__nicematrix_first_col_int } { & }
\prg_replicate:nn { #4 - 1 } { & }
- \int_compare:nNnT \l__nicematrix_last_col_int > { -1 } { & } \\
+ \int_compare:nNnT { \l__nicematrix_last_col_int } > { -1 } { & } \\
}
\end { NiceArrayWithDelims }
\group_end:
}
-\cs_set_protected:Npn \__nicematrix_define_com:nnn #1 #2 #3
+\cs_set_protected:Npn \__nicematrix_define_com:NNN #1 #2 #3
{
\cs_set_protected:cpn { #1 AutoNiceMatrix }
{
@@ -8460,11 +8464,6 @@
\AutoNiceMatrixWithDelims { #2 } { #3 }
}
}
-\__nicematrix_define_com:nnn p ( )
-\__nicematrix_define_com:nnn b [ ]
-\__nicematrix_define_com:nnn v | |
-\__nicematrix_define_com:nnn V \| \|
-\__nicematrix_define_com:nnn B \{ \}
\NewDocumentCommand \AutoNiceMatrix { O { } m O { } m ! O { } }
{
\group_begin:
@@ -8472,14 +8471,17 @@
\AutoNiceMatrixWithDelims . . { #2 } { #4 } [ #1 , #3 , #5 ]
\group_end:
}
-\cs_set_eq:NN \__nicematrix_old_dotfill \dotfill
+\cs_set_eq:NN \__nicematrix_old_dotfill: \dotfill
\cs_new_protected:Npn \__nicematrix_dotfill:
{
- \__nicematrix_old_dotfill
+ \__nicematrix_old_dotfill:
\tl_gput_right:Nn \g__nicematrix_cell_after_hook_tl \__nicematrix_dotfill_i:
}
\cs_new_protected:Npn \__nicematrix_dotfill_i:
- { \dim_compare:nNnT { \box_wd:N \l__nicematrix_cell_box } = \c_zero_dim \__nicematrix_old_dotfill }
+ {
+ \dim_compare:nNnT { \box_wd:N \l__nicematrix_cell_box } = { \c_zero_dim }
+ { \__nicematrix_old_dotfill: }
+ }
\cs_new_protected:Npn \__nicematrix_diagbox:nn #1 #2
{
\tl_gput_right:Ne \g__nicematrix_pre_code_after_tl
@@ -8573,7 +8575,7 @@
\bool_if:nTF { #3 }
{ \dim_set_eq:NN \l_tmpa_dim \c_max_dim }
{ \dim_set:Nn \l_tmpa_dim { - \c_max_dim } }
- \int_step_inline:nnn \l__nicematrix_first_row_int \g__nicematrix_row_total_int
+ \int_step_inline:nnn { \l__nicematrix_first_row_int } { \g__nicematrix_row_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \__nicematrix_env: - ##1 - #2 }
@@ -8582,7 +8584,13 @@
{ \__nicematrix_env: - ##1 - #2 }
{ \bool_if:nTF { #3 } { west } { east } }
\dim_set:Nn \l_tmpa_dim
- { \bool_if:nTF { #3 } \dim_min:nn \dim_max:nn \l_tmpa_dim \pgf at x }
+ {
+ \bool_if:nTF { #3 }
+ { \dim_min:nn }
+ { \dim_max:nn }
+ \l_tmpa_dim
+ { \pgf at x }
+ }
}
}
\pgfset { inner~sep = \c_zero_dim }
@@ -8678,24 +8686,22 @@
}
\NewDocumentCommand \__nicematrix_SubMatrix_in_code_before { m m m m ! O { } }
{
- \peek_remove_spaces:n
+ \tl_gput_right:Ne \g__nicematrix_pre_code_after_tl
{
- \tl_gput_right:Ne \g__nicematrix_pre_code_after_tl
- {
- \SubMatrix { #1 } { #2 } { #3 } { #4 }
- [
- delimiters / color = \l__nicematrix_delimiters_color_tl ,
- hlines = \l__nicematrix_submatrix_hlines_clist ,
- vlines = \l__nicematrix_submatrix_vlines_clist ,
- extra-height = \dim_use:N \l__nicematrix_submatrix_extra_height_dim ,
- left-xshift = \dim_use:N \l__nicematrix_submatrix_left_xshift_dim ,
- right-xshift = \dim_use:N \l__nicematrix_submatrix_right_xshift_dim ,
- slim = \bool_to_str:N \l__nicematrix_submatrix_slim_bool ,
- #5
- ]
- }
- \__nicematrix_SubMatrix_in_code_before_i { #2 } { #3 }
+ \SubMatrix { #1 } { #2 } { #3 } { #4 }
+ [
+ delimiters / color = \l__nicematrix_delimiters_color_tl ,
+ hlines = \l__nicematrix_submatrix_hlines_clist ,
+ vlines = \l__nicematrix_submatrix_vlines_clist ,
+ extra-height = \dim_use:N \l__nicematrix_submatrix_extra_height_dim ,
+ left-xshift = \dim_use:N \l__nicematrix_submatrix_left_xshift_dim ,
+ right-xshift = \dim_use:N \l__nicematrix_submatrix_right_xshift_dim ,
+ slim = \bool_to_str:N \l__nicematrix_submatrix_slim_bool ,
+ #5
+ ]
}
+ \__nicematrix_SubMatrix_in_code_before_i { #2 } { #3 }
+ \ignorespaces
}
\NewDocumentCommand \__nicematrix_SubMatrix_in_code_before_i
{ > { \SplitArgument { 1 } { - } } m > { \SplitArgument { 1 } { - } } m }
@@ -8710,28 +8716,15 @@
{ \str_if_eq:eeTF { #4 } { last } { \int_use:N \c at jCol } { #4 } }
}
}
-\hook_gput_code:nnn { begindocument } { . }
- {
- \cs_set_nopar:Npn \l__nicematrix_argspec_tl { m m m m O { } E { _ ^ } { { } { } } }
- \tl_set_rescan:Nno \l__nicematrix_argspec_tl { } \l__nicematrix_argspec_tl
- \exp_args:NNo \NewDocumentCommand \__nicematrix_SubMatrix \l__nicematrix_argspec_tl
- {
- \peek_remove_spaces:n
- {
- \__nicematrix_sub_matrix:nnnnnnn
- { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } { #7 }
- }
- }
- }
\NewDocumentCommand \__nicematrix_compute_i_j:nn
{ > { \SplitArgument { 1 } { - } } m > { \SplitArgument { 1 } { - } } m }
{ \__nicematrix_compute_i_j:nnnn #1 #2 }
\cs_new_protected:Npn \__nicematrix_compute_i_j:nnnn #1 #2 #3 #4
{
- \cs_set_nopar:Npn \l__nicematrix_first_i_tl { #1 }
- \cs_set_nopar:Npn \l__nicematrix_first_j_tl { #2 }
- \cs_set_nopar:Npn \l__nicematrix_last_i_tl { #3 }
- \cs_set_nopar:Npn \l__nicematrix_last_j_tl { #4 }
+ \def \l__nicematrix_first_i_tl { #1 }
+ \def \l__nicematrix_first_j_tl { #2 }
+ \def \l__nicematrix_last_i_tl { #3 }
+ \def \l__nicematrix_last_j_tl { #4 }
\tl_if_eq:NnT \l__nicematrix_first_i_tl { last }
{ \tl_set:NV \l__nicematrix_first_i_tl \c at iRow }
\tl_if_eq:NnT \l__nicematrix_first_j_tl { last }
@@ -8741,15 +8734,22 @@
\tl_if_eq:NnT \l__nicematrix_last_j_tl { last }
{ \tl_set:NV \l__nicematrix_last_j_tl \c at jCol }
}
+\hook_gput_code:nnn { begindocument } { . }
+ {
+ \tl_set_rescan:Nnn \l_tmpa_tl { } { m m m m O { } E { _ ^ } { { } { } } }
+ \exp_args:NNo \NewDocumentCommand \__nicematrix_SubMatrix \l_tmpa_tl
+ { \__nicematrix_sub_matrix:nnnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } { #7 } }
+ }
+
\cs_new_protected:Npn \__nicematrix_sub_matrix:nnnnnnn #1 #2 #3 #4 #5 #6 #7
{
\group_begin:
\__nicematrix_compute_i_j:nn { #2 } { #3 }
- \int_compare:nNnT \l__nicematrix_first_i_tl = \l__nicematrix_last_i_tl
- { \cs_set_nopar:Npn \arraystretch { 1 } }
+ \int_compare:nNnT { \l__nicematrix_first_i_tl } = { \l__nicematrix_last_i_tl }
+ { \def \arraystretch { 1 } }
\bool_lazy_or:nnTF
- { \int_compare_p:nNn \l__nicematrix_last_i_tl > \g__nicematrix_row_total_int }
- { \int_compare_p:nNn \l__nicematrix_last_j_tl > \g__nicematrix_col_total_int }
+ { \int_compare_p:nNn { \l__nicematrix_last_i_tl } > { \g__nicematrix_row_total_int } }
+ { \int_compare_p:nNn { \l__nicematrix_last_j_tl } > { \g__nicematrix_col_total_int } }
{ \__nicematrix_error:nn { Construct~too~large } { \SubMatrix } }
{
\str_clear_new:N \l__nicematrix_submatrix_name_str
@@ -8761,14 +8761,14 @@
\dim_set_eq:NN \l__nicematrix_x_initial_dim \c_max_dim
\dim_set:Nn \l__nicematrix_x_final_dim { - \c_max_dim }
\bool_if:NTF \l__nicematrix_submatrix_slim_bool
- { \int_step_inline:nnn \l__nicematrix_first_i_tl \l__nicematrix_last_i_tl }
- { \int_step_inline:nnn \l__nicematrix_first_row_int \g__nicematrix_row_total_int }
+ { \int_step_inline:nnn { \l__nicematrix_first_i_tl } { \l__nicematrix_last_i_tl } }
+ { \int_step_inline:nnn { \l__nicematrix_first_row_int } { \g__nicematrix_row_total_int } }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \__nicematrix_env: - ##1 - \l__nicematrix_first_j_tl }
{
\pgfpointanchor { \__nicematrix_env: - ##1 - \l__nicematrix_first_j_tl } { west }
- \dim_compare:nNnT \pgf at x < \l__nicematrix_x_initial_dim
+ \dim_compare:nNnT { \pgf at x } < { \l__nicematrix_x_initial_dim }
{ \dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf at x }
}
\cs_if_exist:cT
@@ -8775,14 +8775,14 @@
{ pgf @ sh @ ns @ \__nicematrix_env: - ##1 - \l__nicematrix_last_j_tl }
{
\pgfpointanchor { \__nicematrix_env: - ##1 - \l__nicematrix_last_j_tl } { east }
- \dim_compare:nNnT \pgf at x > \l__nicematrix_x_final_dim
+ \dim_compare:nNnT { \pgf at x } > { \l__nicematrix_x_final_dim }
{ \dim_set_eq:NN \l__nicematrix_x_final_dim \pgf at x }
}
}
- \dim_compare:nNnTF \l__nicematrix_x_initial_dim = \c_max_dim
+ \dim_compare:nNnTF { \l__nicematrix_x_initial_dim } = { \c_max_dim }
{ \__nicematrix_error:nn { Impossible~delimiter } { left } }
{
- \dim_compare:nNnTF \l__nicematrix_x_final_dim = { - \c_max_dim }
+ \dim_compare:nNnTF { \l__nicematrix_x_final_dim } = { - \c_max_dim }
{ \__nicematrix_error:nn { Impossible~delimiter } { right } }
{ \__nicematrix_sub_matrix_i:nnnn { #1 } { #4 } { #6 } { #7 } }
}
@@ -8789,6 +8789,7 @@
\endpgfpicture
}
\group_end:
+ \ignorespaces
}
\cs_new_protected:Npn \__nicematrix_sub_matrix_i:nnnn #1 #2 #3 #4
{
@@ -8804,7 +8805,7 @@
\__nicematrix_qpoint:n { row - \l__nicematrix_last_i_tl - base }
\dim_set:Nn \l__nicematrix_y_final_dim
{ \fp_to_dim:n { \pgf at y - ( \box_dp:N \strutbox ) * \arraystretch } }
- \int_step_inline:nnn \l__nicematrix_first_col_int \g__nicematrix_col_total_int
+ \int_step_inline:nnn { \l__nicematrix_first_col_int } { \g__nicematrix_col_total_int }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \__nicematrix_env: - \l__nicematrix_first_i_tl - ##1 }
@@ -8811,13 +8812,13 @@
{
\pgfpointanchor { \__nicematrix_env: - \l__nicematrix_first_i_tl - ##1 } { north }
\dim_set:Nn \l__nicematrix_y_initial_dim
- { \dim_max:nn \l__nicematrix_y_initial_dim \pgf at y }
+ { \dim_max:nn { \l__nicematrix_y_initial_dim } { \pgf at y } }
}
\cs_if_exist:cT
{ pgf @ sh @ ns @ \__nicematrix_env: - \l__nicematrix_last_i_tl - ##1 }
{
\pgfpointanchor { \__nicematrix_env: - \l__nicematrix_last_i_tl - ##1 } { south }
- \dim_compare:nNnT \pgf at y < \l__nicematrix_y_final_dim
+ \dim_compare:nNnT { \pgf at y } < { \l__nicematrix_y_final_dim }
{ \dim_set_eq:NN \l__nicematrix_y_final_dim \pgf at y }
}
}
@@ -8829,11 +8830,11 @@
\dim_zero:N \nulldelimiterspace
\group_begin:
\pgfsetlinewidth { 1.1 \arrayrulewidth }
- \__nicematrix_set_CT at arc@:o \l__nicematrix_rules_color_tl
+ \__nicematrix_set_CTarc:o \l__nicematrix_rules_color_tl
\CT at arc@
\seq_map_inline:Nn \g__nicematrix_cols_vlism_seq
{
- \int_compare:nNnT \l__nicematrix_first_j_tl < { ##1 }
+ \int_compare:nNnT { \l__nicematrix_first_j_tl } < { ##1 }
{
\int_compare:nNnT
{ ##1 } < { \int_eval:n { \l__nicematrix_last_j_tl + 1 } }
@@ -8850,7 +8851,7 @@
{ \clist_map_inline:Nn \l__nicematrix_submatrix_vlines_clist }
{
\bool_lazy_and:nnTF
- { \int_compare_p:nNn { ##1 } > \c_zero_int }
+ { \int_compare_p:nNn { ##1 } > { \c_zero_int } }
{
\int_compare_p:nNn
{ ##1 } < { \l__nicematrix_last_j_tl - \l__nicematrix_first_j_tl + 1 } }
@@ -8867,7 +8868,7 @@
{ \clist_map_inline:Nn \l__nicematrix_submatrix_hlines_clist }
{
\bool_lazy_and:nnTF
- { \int_compare_p:nNn { ##1 } > \c_zero_int }
+ { \int_compare_p:nNn { ##1 } > { \c_zero_int } }
{
\int_compare_p:nNn
{ ##1 } < { \l__nicematrix_last_i_tl - \l__nicematrix_first_i_tl + 1 } }
@@ -8931,9 +8932,9 @@
\flag_clear_new:N \l__nicematrix_code_flag
\l__nicematrix_code_tl
}
-\cs_set_eq:NN \__nicematrix_old_pgfpointanchor \pgfpointanchor
+\cs_set_eq:NN \__nicematrix_old_pgfpointanchor: \pgfpointanchor
\cs_new:Npn \__nicematrix_pgfpointanchor:n #1
- { \exp_args:Ne \__nicematrix_old_pgfpointanchor { \__nicematrix_pgfpointanchor_i:n { #1 } } }
+ { \exp_args:Ne \__nicematrix_old_pgfpointanchor: { \__nicematrix_pgfpointanchor_i:n { #1 } } }
\cs_new:Npn \__nicematrix_pgfpointanchor_i:n #1
{ \__nicematrix_pgfpointanchor_ii:w #1 \tikz at pp@name \q_stop }
\cs_new:Npn \__nicematrix_pgfpointanchor_ii:w #1 \tikz at pp@name #2 \q_stop
@@ -8944,8 +8945,8 @@
}
\cs_new:Npn \__nicematrix_pgfpointanchor_iv:w #1 \tikz at pp@name
{ \__nicematrix_pgfpointanchor_ii:n { #1 } }
-\cs_new:Npn \__nicematrix_pgfpointanchor_ii:n #1 { \__nicematrix_pgfpointanchor_i:w #1-\q_stop }
-\cs_new:Npn \__nicematrix_pgfpointanchor_i:w #1-#2\q_stop
+\cs_new:Npn \__nicematrix_pgfpointanchor_ii:n #1 { \__nicematrix_pgfpointanchor_i:w #1- \q_stop }
+\cs_new:Npn \__nicematrix_pgfpointanchor_i:w #1-#2 \q_stop
{
\str_if_empty:nTF { #2 }
{ \__nicematrix_pgfpointanchor_iii:n { #1 } }
@@ -9037,13 +9038,13 @@
}
\NewDocumentCommand \__nicematrix_UnderBrace { O { } m m m O { } }
{
- \peek_remove_spaces:n
- { \__nicematrix_brace:nnnnn { #2 } { #3 } { #4 } { #1 , #5 } { under } }
+ \__nicematrix_brace:nnnnn { #2 } { #3 } { #4 } { #1 , #5 } { under }
+ \ignorespaces
}
\NewDocumentCommand \__nicematrix_OverBrace { O { } m m m O { } }
{
- \peek_remove_spaces:n
- { \__nicematrix_brace:nnnnn { #2 } { #3 } { #4 } { #1 , #5 } { over } }
+ \__nicematrix_brace:nnnnn { #2 } { #3 } { #4 } { #1 , #5 } { over }
+ \ignorespaces
}
\keys_define:nn { nicematrix / Brace }
{
@@ -9067,8 +9068,8 @@
\group_begin:
\__nicematrix_compute_i_j:nn { #1 } { #2 }
\bool_lazy_or:nnTF
- { \int_compare_p:nNn \l__nicematrix_last_i_tl > \g__nicematrix_row_total_int }
- { \int_compare_p:nNn \l__nicematrix_last_j_tl > \g__nicematrix_col_total_int }
+ { \int_compare_p:nNn { \l__nicematrix_last_i_tl } > { \g__nicematrix_row_total_int } }
+ { \int_compare_p:nNn { \l__nicematrix_last_j_tl } > { \g__nicematrix_col_total_int } }
{
\str_if_eq:eeTF { #5 } { under }
{ \__nicematrix_error:nn { Construct~too~large } { \UnderBrace } }
@@ -9084,7 +9085,7 @@
\bool_if:NT \l__nicematrix_brace_left_shorten_bool
{
\dim_set_eq:NN \l__nicematrix_x_initial_dim \c_max_dim
- \int_step_inline:nnn \l__nicematrix_first_i_tl \l__nicematrix_last_i_tl
+ \int_step_inline:nnn { \l__nicematrix_first_i_tl } { \l__nicematrix_last_i_tl }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \__nicematrix_env: - ##1 - \l__nicematrix_first_j_tl }
@@ -9091,7 +9092,7 @@
{
\pgfpointanchor { \__nicematrix_env: - ##1 - \l__nicematrix_first_j_tl } { west }
- \dim_compare:nNnT \pgf at x < \l__nicematrix_x_initial_dim
+ \dim_compare:nNnT { \pgf at x } < { \l__nicematrix_x_initial_dim }
{ \dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf at x }
}
}
@@ -9098,7 +9099,7 @@
}
\bool_lazy_or:nnT
{ \bool_not_p:n \l__nicematrix_brace_left_shorten_bool }
- { \dim_compare_p:nNn \l__nicematrix_x_initial_dim = \c_max_dim }
+ { \dim_compare_p:nNn { \l__nicematrix_x_initial_dim } = { \c_max_dim } }
{
\__nicematrix_qpoint:n { col - \l__nicematrix_first_j_tl }
\dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf at x
@@ -9106,13 +9107,13 @@
\bool_if:NT \l__nicematrix_brace_right_shorten_bool
{
\dim_set:Nn \l__nicematrix_x_final_dim { - \c_max_dim }
- \int_step_inline:nnn \l__nicematrix_first_i_tl \l__nicematrix_last_i_tl
+ \int_step_inline:nnn { \l__nicematrix_first_i_tl } { \l__nicematrix_last_i_tl }
{
\cs_if_exist:cT
{ pgf @ sh @ ns @ \__nicematrix_env: - ##1 - \l__nicematrix_last_j_tl }
{
\pgfpointanchor { \__nicematrix_env: - ##1 - \l__nicematrix_last_j_tl } { east }
- \dim_compare:nNnT \pgf at x > \l__nicematrix_x_final_dim
+ \dim_compare:nNnT { \pgf at x } > { \l__nicematrix_x_final_dim }
{ \dim_set_eq:NN \l__nicematrix_x_final_dim \pgf at x }
}
}
@@ -9119,7 +9120,7 @@
}
\bool_lazy_or:nnT
{ \bool_not_p:n \l__nicematrix_brace_right_shorten_bool }
- { \dim_compare_p:nNn \l__nicematrix_x_final_dim = { - \c_max_dim } }
+ { \dim_compare_p:nNn { \l__nicematrix_x_final_dim } = { - \c_max_dim } }
{
\__nicematrix_qpoint:n { col - \int_eval:n { \l__nicematrix_last_j_tl + 1 } }
\dim_set_eq:NN \l__nicematrix_x_final_dim \pgf at x
@@ -9138,8 +9139,8 @@
\pgftransformshift
{
\pgfpoint
- { ( \l__nicematrix_x_initial_dim + \l__nicematrix_x_final_dim) / 2 }
- { \pgf at y + \l__nicematrix_brace_yshift_dim - 3 pt}
+ { ( \l__nicematrix_x_initial_dim + \l__nicematrix_x_final_dim ) / 2 }
+ { \pgf at y + \l__nicematrix_brace_yshift_dim - 3 pt }
}
\pgfnode
{ rectangle }
@@ -9178,7 +9179,7 @@
\pgftransformshift
{
\pgfpoint
- { ( \l__nicematrix_x_initial_dim + \l__nicematrix_x_final_dim) / 2 }
+ { ( \l__nicematrix_x_initial_dim + \l__nicematrix_x_final_dim ) / 2 }
{ \pgf at y - \l__nicematrix_brace_yshift_dim + 3 pt }
}
\pgfnode
@@ -9234,6 +9235,7 @@
\keys_define:nn { nicematrix / Hbrace }
{
color .code:n = ,
+ horizontal-label .code:n = ,
horizontal-labels .code:n = ,
shorten .code:n = ,
shorten-start .code:n = ,
@@ -9244,15 +9246,15 @@
{
\cs_if_exist:cTF { tikz at library@decorations.pathreplacing at loaded }
{ \__nicematrix_hbrace:nnn { #1 } { #2 } { #3 } }
- { \__nicematrix_error:n { Hbrace~not~allowed } }
+ { \__nicematrix_error:nn { Hbrace~not~allowed } { \Hbrace } }
}
\cs_new:Npn \__nicematrix_hbrace:nnn #1 #2 #3
{
- \int_compare:nNnTF \c at iRow < 1
+ \int_compare:nNnTF { \c at iRow } < { \c_one_int }
{
\str_if_eq:nnTF { #2 } { * }
{
- \NiceMatrixOptions{nullify-dots}
+ \NiceMatrixOptions { nullify-dots }
\Ldots
[
line-style = nicematrix / brace ,
@@ -9275,7 +9277,7 @@
{
\str_if_eq:nnTF { #2 } { * }
{
- \NiceMatrixOptions{nullify-dots}
+ \NiceMatrixOptions { nullify-dots }
\Ldots
[
line-style = nicematrix / mirrored-brace ,
@@ -9301,15 +9303,15 @@
{
\cs_if_exist:cTF { tikz at library@decorations.pathreplacing at loaded }
{ \__nicematrix_vbrace:nnn { #1 } { #2 } { #3 } }
- { \__nicematrix_error:n { Vbrace~not~allowed } }
+ { \__nicematrix_error:nn { Hbrace~not~allowed } { \Vbrace } }
}
\cs_new:Npn \__nicematrix_vbrace:nnn #1 #2 #3
{
- \int_compare:nNnTF \c at jCol = 0
+ \int_if_zero:nTF { \c at jCol }
{
\str_if_eq:nnTF { #2 } { * }
{
- \NiceMatrixOptions{nullify-dots}
+ \NiceMatrixOptions { nullify-dots }
\Vdots
[
line-style = nicematrix / mirrored-brace ,
@@ -9332,7 +9334,7 @@
{
\str_if_eq:nnTF { #2 } { * }
{
- \NiceMatrixOptions{nullify-dots}
+ \NiceMatrixOptions { nullify-dots }
\Vdots
[
line-style = nicematrix / brace ,
@@ -9361,15 +9363,15 @@
{
not-empty .code:n =
\bool_lazy_or:nnTF
- \l__nicematrix_in_code_after_bool
- \g__nicematrix_recreate_cell_nodes_bool
+ { \l__nicematrix_in_code_after_bool }
+ { \g__nicematrix_create_cell_nodes_bool }
{ \bool_set_true:N \l__nicematrix_not_empty_bool }
{ \__nicematrix_error:n { detection~of~empty~cells } } ,
not-empty .value_forbidden:n = true ,
empty .code:n =
\bool_lazy_or:nnTF
- \l__nicematrix_in_code_after_bool
- \g__nicematrix_recreate_cell_nodes_bool
+ { \l__nicematrix_in_code_after_bool }
+ { \g__nicematrix_create_cell_nodes_bool }
{ \bool_set_true:N \l__nicematrix_empty_bool }
{ \__nicematrix_error:n { detection~of~empty~cells } } ,
empty .value_forbidden:n = true ,
@@ -9391,23 +9393,23 @@
{ \__nicematrix_error:n { TikzEveryCell~without~tikz } }
}
-\tl_new:N \__nicematrix_i_tl
-\tl_new:N \__nicematrix_j_tl
+\tl_new:N \l__nicematrix_i_tl
+\tl_new:N \l__nicematrix_j_tl
\cs_new_protected:Nn \__nicematrix_all_the_cells:
{
- \int_step_variable:nNn \c at iRow \__nicematrix_i_tl
+ \int_step_inline:nn \c at iRow
{
- \int_step_variable:nNn \c at jCol \__nicematrix_j_tl
+ \int_step_inline:nn \c at jCol
{
- \cs_if_exist:cF { cell - \__nicematrix_i_tl - \__nicematrix_j_tl }
+ \cs_if_exist:cF { cell - ##1 - ####1 }
{
\clist_if_in:NeF \l__nicematrix_corners_cells_clist
- { \__nicematrix_i_tl - \__nicematrix_j_tl }
+ { ##1 - ####1 }
{
\bool_set_false:N \l_tmpa_bool
\cs_if_exist:cTF
- { pgf @ sh @ ns @ \__nicematrix_env: - \__nicematrix_i_tl - \__nicematrix_j_tl }
+ { pgf @ sh @ ns @ \__nicematrix_env: - ##1 - ####1 }
{
\bool_if:NF \l__nicematrix_empty_bool
{ \bool_set_true:N \l_tmpa_bool }
@@ -9419,7 +9421,7 @@
\bool_if:NT \l_tmpa_bool
{
\__nicematrix_block_tikz:onnnn
- \l_tmpa_tl \__nicematrix_i_tl \__nicematrix_j_tl \__nicematrix_i_tl \__nicematrix_j_tl
+ \l_tmpa_tl { ##1 } { ####1 } { ##1 } { ####1 }
}
}
}
@@ -9456,7 +9458,7 @@
{ \__nicematrix_qpoint:n { 1 } }
{
\__nicematrix_qpoint:n
- { \int_eval:n { \int_max:nn \c at iRow \c at jCol + 1 } }
+ { \int_eval:n { \int_max:nn { \c at iRow } { \c at jCol } + 1 } }
}
\pgfsetfillopacity { 0.75 }
\pgfsetfillcolor { white }
@@ -9466,7 +9468,7 @@
\dim_gzero_new:N \g__nicematrix_tmpc_dim
\dim_gzero_new:N \g__nicematrix_tmpd_dim
\dim_gzero_new:N \g__nicematrix_tmpe_dim
- \int_step_inline:nn \c at iRow
+ \int_step_inline:nn { \c at iRow }
{
\bool_if:NTF \l__nicematrix_in_code_after_bool
{
@@ -9483,7 +9485,7 @@
\bool_if:NTF \l__nicematrix_in_code_after_bool
{ \endpgfpicture }
{ \end { pgfpicture } }
- \int_step_inline:nn \c at jCol
+ \int_step_inline:nn { \c at jCol }
{
\hbox_set:Nn \l_tmpa_box
{
@@ -9542,7 +9544,7 @@
\bool_new:N \g__nicematrix_footnote_bool
\msg_new:nnnn { nicematrix } { Unknown~key~for~package }
{
- You~have~used~the~key~'\l_keys_key_str'~when~loading~nicematrix~
+ You~have~used~the~key~' \l_keys_key_str '~when~loading~nicematrix~
but~that~key~is~unknown. \\
It~will~be~ignored. \\
For~a~list~of~the~available~keys,~type~H~<return>.
@@ -9617,11 +9619,11 @@
{ \__nicematrix_error:n { underscore~after~nicematrix } }
}
}
-\bool_if:NTF \g__nicematrix_messages_for_Overleaf_bool
- { \str_const:Nn \c__nicematrix_available_keys_str { } }
+\str_const:Ne \c__nicematrix_available_keys_str
{
- \str_const:Nn \c__nicematrix_available_keys_str
+ \bool_if:nTF { ! \g__nicematrix_messages_for_Overleaf_bool }
{ For~a~list~of~the~available~keys,~type~H~<return>. }
+ { }
}
\seq_new:N \g__nicematrix_types_of_matrix_seq
\seq_gset_from_clist:Nn \g__nicematrix_types_of_matrix_seq
@@ -9635,9 +9637,9 @@
{
\seq_if_in:NoF \g__nicematrix_types_of_matrix_seq \g__nicematrix_name_env_str
{ \__nicematrix_fatal:nn { too~much~cols~for~array } }
- \int_compare:nNnT \l__nicematrix_last_col_int = { -2 }
+ \int_compare:nNnT { \l__nicematrix_last_col_int } = { -2 }
{ \__nicematrix_fatal:n { too~much~cols~for~matrix } }
- \int_compare:nNnT \l__nicematrix_last_col_int = { -1 }
+ \int_compare:nNnT { \l__nicematrix_last_col_int } = { -1 }
{ \__nicematrix_fatal:n { too~much~cols~for~matrix } }
\bool_if:NF \l__nicematrix_last_col_without_value_bool
{ \__nicematrix_fatal:n { too~much~cols~for~matrix~with~last~col } }
@@ -9645,12 +9647,12 @@
\cs_new:Npn \__nicematrix_message_hdotsfor:
{
\tl_if_empty:oF \g__nicematrix_HVdotsfor_lines_tl
- { ~Maybe~your~use~of~\token_to_str:N \Hdotsfor\ is~incorrect.}
+ { ~Maybe~your~use~of~ \token_to_str:N \Hdotsfor \ is~incorrect. }
}
\__nicematrix_msg_new:nn { hvlines,~rounded-corners~and~corners }
{
Incompatible~options.\\
- You~should~not~use~'hvlines',~'rounded-corners'~and~'corners'~at~this~time.\\
+ You~should~not~use~'hvlines',~'rounded-corners'~and~'corners'~at~the~same~time.\\
The~output~will~not~be~reliable.
}
\__nicematrix_msg_new:nn { key~color-inside }
@@ -9660,59 +9662,60 @@
and~have~been~deprecated.\\
You~won't~have~similar~message~till~the~end~of~the~document.
}
-\__nicematrix_msg_new:nn { negative~weight }
+\__nicematrix_msg_new:nn { invalid~weight }
{
- Negative~weight.\\
- The~weight~of~the~'X'~columns~must~be~positive~and~you~have~used~
- the~value~'\int_use:N \l__nicematrix_weight_int'.\\
- The~absolute~value~will~be~used.
+ Unknown~key.\\
+ The~key~' \l_keys_key_str '~of~your~column~X~is~unknown~and~will~be~ignored.
}
\__nicematrix_msg_new:nn { last~col~not~used }
{
Column~not~used.\\
The~key~'last-col'~is~in~force~but~you~have~not~used~that~last~column~
- in~your~\__nicematrix_full_name_env:.~However,~you~can~go~on.
+ in~your~\__nicematrix_full_name_env: .~
+ However,~you~can~go~on.
}
\__nicematrix_msg_new:nn { too~much~cols~for~matrix~with~last~col }
{
Too~much~columns.\\
- In~the~row~\int_eval:n { \c at iRow },~
+ In~the~row~ \int_eval:n { \c at iRow },~
you~try~to~use~more~columns~
- than~allowed~by~your~\__nicematrix_full_name_env:.\__nicematrix_message_hdotsfor:\
- The~maximal~number~of~columns~is~\int_eval:n { \l__nicematrix_last_col_int - 1 }~
+ than~allowed~by~your~ \__nicematrix_full_name_env: .
+ \__nicematrix_message_hdotsfor: \
+ The~maximal~number~of~columns~is~ \int_eval:n { \l__nicematrix_last_col_int - 1 }~
(plus~the~exterior~columns).~This~error~is~fatal.
}
\__nicematrix_msg_new:nn { too~much~cols~for~matrix }
{
Too~much~columns.\\
- In~the~row~\int_eval:n { \c at iRow },~
- you~try~to~use~more~columns~than~allowed~by~your~
- \__nicematrix_full_name_env:.\__nicematrix_message_hdotsfor:\ Recall~that~the~maximal~
- number~of~columns~for~a~matrix~(excepted~the~potential~exterior~
- columns)~is~fixed~by~the~LaTeX~counter~'MaxMatrixCols'.~
- Its~current~value~is~\int_use:N \c at MaxMatrixCols\ (use~
- \token_to_str:N \setcounter\ to~change~that~value).~
+ In~the~row~ \int_eval:n { \c at iRow } ,~
+ you~try~to~use~more~columns~than~allowed~by~your~ \__nicematrix_full_name_env: .
+ \__nicematrix_message_hdotsfor: \
+ Recall~that~the~maximal~number~of~columns~for~a~matrix~
+ (excepted~the~potential~exterior~columns)~is~fixed~by~the~
+ LaTeX~counter~'MaxMatrixCols'.~
+ Its~current~value~is~ \int_use:N \c at MaxMatrixCols \
+ (use~ \token_to_str:N \setcounter \ to~change~that~value).~
This~error~is~fatal.
}
\__nicematrix_msg_new:nn { too~much~cols~for~array }
{
Too~much~columns.\\
- In~the~row~\int_eval:n { \c at iRow },~
+ In~the~row~ \int_eval:n { \c at iRow } ,~
~you~try~to~use~more~columns~than~allowed~by~your~
- \__nicematrix_full_name_env:.\__nicematrix_message_hdotsfor:\ The~maximal~number~of~columns~is~
- \int_use:N \g__nicematrix_static_num_of_col_int\
+ \__nicematrix_full_name_env: . \__nicematrix_message_hdotsfor: \ The~maximal~number~of~columns~is~
+ \int_use:N \g__nicematrix_static_num_of_col_int \
\bool_if:nT
- { \int_compare_p:nNn \l__nicematrix_first_col_int = 0 || \g__nicematrix_last_col_found_bool }
+ { \int_compare_p:n { \l__nicematrix_first_col_int = 0 } || \g__nicematrix_last_col_found_bool }
{ ~(plus~the~exterior~ones) }
- since~the~preamble~is~'\g__nicematrix_user_preamble_tl'.\\
+ since~the~preamble~is~' \g__nicematrix_user_preamble_tl '.\\
This~error~is~fatal.
}
\__nicematrix_msg_new:nn { columns~not~used }
{
Columns~not~used.\\
- The~preamble~of~your~\__nicematrix_full_name_env:\ is~'\g__nicematrix_user_preamble_tl'.~
- It~announces~\int_use:N
- \g__nicematrix_static_num_of_col_int\ columns~but~you~only~used~\int_use:N \c at jCol.\\
+ The~preamble~of~your~ \__nicematrix_full_name_env: \ is~' \g__nicematrix_user_preamble_tl '.~
+ It~announces~ \int_use:N \g__nicematrix_static_num_of_col_int \
+ columns~but~you~only~used~ \int_use:N \c at jCol .\\
The~columns~you~did~not~used~won't~be~created.\\
You~won't~have~similar~warning~till~the~end~of~the~document.
}
@@ -9719,7 +9722,7 @@
\__nicematrix_msg_new:nn { empty~preamble }
{
Empty~preamble.\\
- The~preamble~of~your~\__nicematrix_full_name_env:\ is~empty.\\
+ The~preamble~of~your~ \__nicematrix_full_name_env: \ is~empty.\\
This~error~is~fatal.
}
\__nicematrix_msg_new:nn { in~first~col }
@@ -9762,7 +9765,7 @@
{
Key~caption~forbidden.\\
You~can't~use~the~key~'caption'~because~you~are~not~in~a~floating~
- environment.~This~key~will~be~ignored.
+ environment~(such~as~\{table\}).~This~key~will~be~ignored.
}
\__nicematrix_msg_new:nn { short-caption~without~caption }
{
@@ -9805,17 +9808,17 @@
{
Identical~tabular~notes.\\
You~can't~put~several~notes~with~the~same~content~in~
- \token_to_str:N \caption\ (but~you~can~in~the~main~tabular).\\
+ \token_to_str:N \caption \ (but~you~can~in~the~main~tabular).\\
If~you~go~on,~the~output~will~probably~be~erroneous.
}
\__nicematrix_msg_new:nn { tabularnote~below~the~tabular }
{
- \token_to_str:N \tabularnote\ forbidden\\
- You~can't~use~\token_to_str:N \tabularnote\ in~the~caption~
+ \token_to_str:N \tabularnote \ forbidden\\
+ You~can't~use~ \token_to_str:N \tabularnote \ in~the~caption~
of~your~tabular~because~the~caption~will~be~composed~below~
the~tabular.~If~you~want~the~caption~above~the~tabular~use~the~
- key~'caption-above'~in~\token_to_str:N \NiceMatrixOptions.\\
- Your~\token_to_str:N \tabularnote\ will~be~discarded~and~
+ key~'caption-above'~in~ \token_to_str:N \NiceMatrixOptions .\\
+ Your~ \token_to_str:N \tabularnote \ will~be~discarded~and~
no~similar~error~will~raised~in~this~document.
}
\__nicematrix_msg_new:nn { Unknown~key~for~rules }
@@ -9822,15 +9825,15 @@
{
Unknown~key.\\
There~is~only~two~keys~available~here:~width~and~color.\\
- Your~key~'\l_keys_key_str'~will~be~ignored.
+ Your~key~' \l_keys_key_str '~will~be~ignored.
}
\__nicematrix_msg_new:nn { Unknown~key~for~Hbrace }
{
Unknown~key.\\
- You~have~used~the~key~'\l_keys_key_str'~but~the~only~
- keys~allowed~for~the~commands~\token_to_str:N \Hbrace\
- and~\token_to_str:N \Vbrace\ are:~'color',~
- 'horizontal-labels',~'shorten'~'shorten-end'~
+ You~have~used~the~key~' \l_keys_key_str '~but~the~only~
+ keys~allowed~for~the~commands~ \token_to_str:N \Hbrace \
+ and~ \token_to_str:N \Vbrace \ are:~'color',~
+ 'horizontal-label(s)',~'shorten'~'shorten-end'~
and~'shorten-start'.
}
\__nicematrix_msg_new:nn { Unknown~key~for~TikzEveryCell }
@@ -9838,18 +9841,18 @@
Unknown~key.\\
There~is~only~two~keys~available~here:~
'empty'~and~'not-empty'.\\
- Your~key~'\l_keys_key_str'~will~be~ignored.
+ Your~key~' \l_keys_key_str '~will~be~ignored.
}
\__nicematrix_msg_new:nn { Unknown~key~for~rotate }
{
Unknown~key.\\
The~only~key~available~here~is~'c'.\\
- Your~key~'\l_keys_key_str'~will~be~ignored.
+ Your~key~' \l_keys_key_str '~will~be~ignored.
}
\__nicematrix_msg_new:nnn { Unknown~key~for~custom-line }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~in~a~'custom-line'.~
+ The~key~' \l_keys_key_str '~is~unknown~in~a~'custom-line'.~
It~you~go~on,~you~will~probably~have~other~errors. \\
\c__nicematrix_available_keys_str
}
@@ -9867,13 +9870,13 @@
\__nicematrix_msg_new:nnn { Unknown~key~for~xdots }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~a~command~for~drawing~dotted~rules.\\
+ The~key~' \l_keys_key_str '~is~unknown~for~a~command~for~drawing~dotted~rules.\\
\c__nicematrix_available_keys_str
}
{
The~available~keys~are~(in~alphabetic~order):~
'color',~
- 'horizontal-labels',~
+ 'horizontal(s)-labels',~
'inter',~
'line-style',~
'radius',~
@@ -9884,23 +9887,23 @@
{
Unknown~key.\\
As~for~now,~there~is~only~two~keys~available~here:~'cols'~and~'respect-blocks'~
- (and~you~try~to~use~'\l_keys_key_str')\\
+ (and~you~try~to~use~' \l_keys_key_str ')\\
That~key~will~be~ignored.
}
\__nicematrix_msg_new:nn { label~without~caption }
{
- You~can't~use~the~key~'label'~in~your~'{NiceTabular}'~because~
+ You~can't~use~the~key~'label'~in~your~\{NiceTabular\}~because~
you~have~not~used~the~key~'caption'.~The~key~'label'~will~be~ignored.
}
\__nicematrix_msg_new:nn { W~warning }
{
- Line~\msg_line_number:.~The~cell~is~too~wide~for~your~column~'W'~
- (row~\int_use:N \c at iRow).
+ Line~ \msg_line_number: .~The~cell~is~too~wide~for~your~column~'W'~
+ (row~ \int_use:N \c at iRow ).
}
\__nicematrix_msg_new:nn { Construct~too~large }
{
Construct~too~large.\\
- Your~command~\token_to_str:N #1
+ Your~command~ \token_to_str:N #1
can't~be~drawn~because~your~matrix~is~too~small.\\
That~command~will~be~ignored.
}
@@ -9909,20 +9912,21 @@
Problem~with~'underscore'.\\
The~package~'underscore'~should~be~loaded~before~'nicematrix'.~
You~can~go~on~but~you~won't~be~able~to~write~something~such~as:\\
- '\token_to_str:N \Cdots\token_to_str:N _{n~\token_to_str:N \text{~times}}'.
+ ' \token_to_str:N \Cdots \token_to_str:N _
+ \{ n \token_to_str:N \text \{ ~times \} \}'.
}
\__nicematrix_msg_new:nn { ampersand~in~light-syntax }
{
Ampersand~forbidden.\\
- You~can't~use~an~ampersand~(\token_to_str:N &)~to~separate~columns~because~
+ You~can't~use~an~ampersand~( \token_to_str:N &)~to~separate~columns~because~
~the~key~'light-syntax'~is~in~force.~This~error~is~fatal.
}
\__nicematrix_msg_new:nn { double-backslash~in~light-syntax }
{
Double~backslash~forbidden.\\
- You~can't~use~\token_to_str:N
- \\~to~separate~rows~because~the~key~'light-syntax'~
- is~in~force.~You~must~use~the~character~'\l__nicematrix_end_of_row_tl'~
+ You~can't~use~ \token_to_str:N \\
+ ~to~separate~rows~because~the~key~'light-syntax'~
+ is~in~force.~You~must~use~the~character~' \l__nicematrix_end_of_row_tl '~
(set~by~the~key~'end-of-row').~This~error~is~fatal.
}
\__nicematrix_msg_new:nn { hlines~with~color }
@@ -9929,16 +9933,16 @@
{
Incompatible~keys.\\
You~can't~use~the~keys~'hlines',~'vlines'~or~'hvlines'~for~a~
- '\token_to_str:N \Block'~when~the~key~'color'~or~'draw'~is~used.\\
- However,~you~can~put~several~commands~\token_to_str:N \Block.\\
+ \token_to_str:N \Block \ when~the~key~'color'~or~'draw'~is~used.\\
+ However,~you~can~put~several~commands~ \token_to_str:N \Block.\\
Your~key~will~be~discarded.
}
\__nicematrix_msg_new:nn { bad~value~for~baseline }
{
Bad~value~for~baseline.\\
- The~value~given~to~'baseline'~(\int_use:N \l_tmpa_int)~is~not~
+ The~value~given~to~'baseline'~( \int_use:N \l_tmpa_int )~is~not~
valid.~The~value~must~be~between~\int_use:N \l__nicematrix_first_row_int\ and~
- \int_use:N \g__nicematrix_row_total_int\ or~equal~to~'t',~'c'~or~'b'~or~of~
+ \int_use:N \g__nicematrix_row_total_int \ or~equal~to~'t',~'c'~or~'b'~or~of~
the~form~'line-i'.\\
A~value~of~1~will~be~used.
}
@@ -9946,8 +9950,8 @@
{
Problem~with~'not-empty'\\
For~technical~reasons,~you~must~activate~
- 'create-cell-nodes'~in~\token_to_str:N \CodeBefore\
- in~order~to~use~the~key~'\l_keys_key_str'.\\
+ 'create-cell-nodes'~in~ \token_to_str:N \CodeBefore \
+ in~order~to~use~the~key~' \l_keys_key_str '.\\
That~key~will~be~ignored.
}
\__nicematrix_msg_new:nn { siunitx~not~loaded }
@@ -9959,8 +9963,8 @@
\__nicematrix_msg_new:nn { Invalid~name }
{
Invalid~name.\\
- You~can't~give~the~name~'\l_keys_value_tl'~to~a~\token_to_str:N
- \SubMatrix\ of~your~\__nicematrix_full_name_env:.\\
+ You~can't~give~the~name~' \l_keys_value_tl '~to~a~ \token_to_str:N
+ \SubMatrix \ of~your~ \__nicematrix_full_name_env: .\\
A~name~must~be~accepted~by~the~regular~expression~[A-Za-z][A-Za-z0-9]*.\\
This~key~will~be~ignored.
}
@@ -9967,21 +9971,22 @@
\__nicematrix_msg_new:nn { Hbrace~not~allowed }
{
Command~not~allowed.\\
- You~can't~use~the~command~\token_to_str:N \Hbrace\
- because~you~have~not~loaded~TikZ~
- and~the~TikZ~library~'decorations.pathreplacing'.\\
- Use:~\token_to_str:N \usepackage\{tikz\}~
- \token_to_str:N \usetikzlibrary \{ decorations.pathreplacing \} \\
+ You~can't~use~the~command~ \token_to_str:N #1
+ because~you~have~not~loaded~
+ \IfPackageLoadedTF { tikz }
+ { the~TikZ~library~'decorations.pathreplacing'.~Use~ }
+ { TikZ.~ Use:~ \token_to_str:N \usepackage \{tikz\}~and~ }
+ \token_to_str:N \usetikzlibrary \{decorations.pathreplacing\}. \\
That~command~will~be~ignored.
}
\__nicematrix_msg_new:nn { Vbrace~not~allowed }
{
Command~not~allowed.\\
- You~can't~use~the~command~\token_to_str:N \Vbrace\
+ You~can't~use~the~command~ \token_to_str:N \Vbrace \
because~you~have~not~loaded~TikZ~
and~the~TikZ~library~'decorations.pathreplacing'.\\
- Use:~\token_to_str:N \usepackage\{tikz\}~
- \token_to_str:N \usetikzlibrary \{ decorations.pathreplacing \} \\
+ Use: ~\token_to_str:N \usepackage \{tikz\}~
+ \token_to_str:N \usetikzlibrary \{decorations.pathreplacing\} \\
That~command~will~be~ignored.
}
\__nicematrix_msg_new:nn { Wrong~line~in~SubMatrix }
@@ -9988,7 +9993,7 @@
{
Wrong~line.\\
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~
+ \token_to_str:N \SubMatrix \ of~your~ \__nicematrix_full_name_env: \ but~that~
number~is~not~valid.~It~will~be~ignored.
}
\__nicematrix_msg_new:nn { Impossible~delimiter }
@@ -9995,16 +10000,16 @@
{
Impossible~delimiter.\\
It's~impossible~to~draw~the~#1~delimiter~of~your~
- \token_to_str:N \SubMatrix\ because~all~the~cells~are~empty~
+ \token_to_str:N \SubMatrix \ because~all~the~cells~are~empty~
in~that~column.
\bool_if:NT \l__nicematrix_submatrix_slim_bool
{ ~Maybe~you~should~try~without~the~key~'slim'. } \\
- This~\token_to_str:N \SubMatrix\ will~be~ignored.
+ This~ \token_to_str:N \SubMatrix \ will~be~ignored.
}
\__nicematrix_msg_new:nnn { width~without~X~columns }
{
You~have~used~the~key~'width'~but~you~have~put~no~'X'~column~in~
- the~preamble~('\g__nicematrix_user_preamble_tl')~of~your~\__nicematrix_full_name_env:.\\
+ the~preamble~(' \g__nicematrix_user_preamble_tl ')~of~your~ \__nicematrix_full_name_env: .\\
That~key~will~be~ignored.
}
{
@@ -10011,7 +10016,7 @@
This~message~is~the~message~'width~without~X~columns'~
of~the~module~'nicematrix'.~
The~experimented~users~can~disable~that~message~with~
- \token_to_str:N \msg_redirect_name:nnn.\\
+ \token_to_str:N \msg_redirect_name:nnn .\\
}
\__nicematrix_msg_new:nn { key~multiplicity~with~dotted }
@@ -10024,7 +10029,7 @@
\__nicematrix_msg_new:nn { empty~environment }
{
Empty~environment.\\
- Your~\__nicematrix_full_name_env:\ is~empty.~This~error~is~fatal.
+ Your~ \__nicematrix_full_name_env: \ is~empty.~This~error~is~fatal.
}
\__nicematrix_msg_new:nn { No~letter~and~no~command }
{
@@ -10045,13 +10050,14 @@
{
Wrong~name.\\
You~must~use~only~one~letter~as~value~for~the~key~'letter'~(and~you~
- have~used~'\l__nicematrix_letter_str').\\
+ have~used~' \l__nicematrix_letter_str ').\\
It~will~be~ignored.
}
\__nicematrix_msg_new:nn { Delimiter~with~small }
{
Delimiter~forbidden.\\
- You~can't~put~a~delimiter~in~the~preamble~of~your~\__nicematrix_full_name_env:\
+ You~can't~put~a~delimiter~in~the~preamble~of~your~
+ \__nicematrix_full_name_env: \
because~the~key~'small'~is~in~force.\\
This~error~is~fatal.
}
@@ -10058,36 +10064,36 @@
\__nicematrix_msg_new:nn { unknown~cell~for~line~in~CodeAfter }
{
Unknown~cell.\\
- Your~command~\token_to_str:N\line\{#1\}\{#2\}~in~
- the~\token_to_str:N \CodeAfter\ of~your~\__nicematrix_full_name_env:\
+ Your~command~ \token_to_str:N \line \{ #1 \} \{ #2 \}~in~
+ the~ \token_to_str:N \CodeAfter \ of~your~ \__nicematrix_full_name_env: \
can't~be~executed~because~a~cell~doesn't~exist.\\
- This~command~\token_to_str:N \line\ will~be~ignored.
+ This~command~ \token_to_str:N \line \ will~be~ignored.
}
\__nicematrix_msg_new:nnn { Duplicate~name~for~SubMatrix }
{
Duplicate~name.\\
- The~name~'#1'~is~already~used~for~a~\token_to_str:N \SubMatrix\
- in~this~\__nicematrix_full_name_env:.\\
+ The~name~'#1'~is~already~used~for~a~ \token_to_str:N \SubMatrix \
+ in~this~ \__nicematrix_full_name_env: .\\
This~key~will~be~ignored.\\
\bool_if:NF \g__nicematrix_messages_for_Overleaf_bool
{ For~a~list~of~the~names~already~used,~type~H~<return>. }
}
{
- The~names~already~defined~in~this~\__nicematrix_full_name_env:\ are:~
- \seq_use:Nnnn \g__nicematrix_submatrix_names_seq { ~and~ } { ,~ } { ~and~ }.
+ The~names~already~defined~in~this~ \__nicematrix_full_name_env: \ are:~
+ \seq_use:Nnnn \g__nicematrix_submatrix_names_seq { ~and~ } { ,~ } { ~and~ } .
}
\__nicematrix_msg_new:nn { r~or~l~with~preamble }
{
Erroneous~use.\\
- You~can't~use~the~key~'\l_keys_key_str'~in~your~\__nicematrix_full_name_env:.~
+ You~can't~use~the~key~' \l_keys_key_str '~in~your~ \__nicematrix_full_name_env: .~
You~must~specify~the~alignment~of~your~columns~with~the~preamble~of~
- your~\__nicematrix_full_name_env:.\\
+ your~ \__nicematrix_full_name_env: .\\
This~key~will~be~ignored.
}
\__nicematrix_msg_new:nn { Hdotsfor~in~col~0 }
{
Erroneous~use.\\
- You~can't~use~\token_to_str:N \Hdotsfor\ in~an~exterior~column~of~
+ You~can't~use~ \token_to_str:N \Hdotsfor \ in~an~exterior~column~of~
the~array.~This~error~is~fatal.
}
\__nicematrix_msg_new:nn { bad~corner }
@@ -10100,18 +10106,18 @@
\__nicematrix_msg_new:nn { bad~border }
{
Bad~border.\\
- \l_keys_key_str\space~is~an~incorrect~specification~for~a~border~
- (in~the~key~'borders'~of~the~command~\token_to_str:N \Block).~
+ \l_keys_key_str \space ~is~an~incorrect~specification~for~a~border~
+ (in~the~key~'borders'~of~the~command~ \token_to_str:N \Block ).~
The~available~values~are:~left,~right,~top~and~bottom~(and~you~can~
also~use~the~key~'tikz'
\IfPackageLoadedF { tikz }
- {~if~you~load~the~LaTeX~package~'tikz'}).\\
+ { ~if~you~load~the~LaTeX~package~'tikz' } ).\\
This~specification~of~border~will~be~ignored.
}
\__nicematrix_msg_new:nn { TikzEveryCell~without~tikz }
{
TikZ~not~loaded.\\
- You~can't~use~\token_to_str:N \TikzEveryCell\
+ You~can't~use~ \token_to_str:N \TikzEveryCell \
because~you~have~not~loaded~tikz.~
This~command~will~be~ignored.
}
@@ -10118,29 +10124,29 @@
\__nicematrix_msg_new:nn { tikz~key~without~tikz }
{
TikZ~not~loaded.\\
- You~can't~use~the~key~'tikz'~for~the~command~'\token_to_str:N
- \Block'~because~you~have~not~loaded~tikz.~
+ You~can't~use~the~key~'tikz'~for~the~command~' \token_to_str:N
+ \Block '~because~you~have~not~loaded~tikz.~
This~key~will~be~ignored.
}
\__nicematrix_msg_new:nn { last-col~non~empty~for~NiceArray }
{
Erroneous~use.\\
- In~the~\__nicematrix_full_name_env:,~you~must~use~the~key~
+ In~the~ \__nicematrix_full_name_env: ,~you~must~use~the~key~
'last-col'~without~value.\\
However,~you~can~go~on~for~this~time~
- (the~value~'\l_keys_value_tl'~will~be~ignored).
+ (the~value~' \l_keys_value_tl '~will~be~ignored).
}
\__nicematrix_msg_new:nn { last-col~non~empty~for~NiceMatrixOptions }
{
- Erroneous~use.\\
- In~\token_to_str:N \NiceMatrixOptions,~you~must~use~the~key~
- 'last-col'~without~value.\\
+ Erroneous~use. \\
+ In~\token_to_str:N \NiceMatrixOptions ,~you~must~use~the~key~
+ 'last-col'~without~value. \\
However,~you~can~go~on~for~this~time~
- (the~value~'\l_keys_value_tl'~will~be~ignored).
+ (the~value~' \l_keys_value_tl '~will~be~ignored).
}
\__nicematrix_msg_new:nn { Block~too~large~1 }
{
- Block~too~large.\\
+ Block~too~large. \\
You~try~to~draw~a~block~in~the~cell~#1-#2~of~your~matrix~but~the~matrix~is~
too~small~for~that~block. \\
This~block~and~maybe~others~will~be~ignored.
@@ -10147,25 +10153,25 @@
}
\__nicematrix_msg_new:nn { Block~too~large~2 }
{
- Block~too~large.\\
- The~preamble~of~your~\__nicematrix_full_name_env:\ announces~\int_use:N
- \g__nicematrix_static_num_of_col_int\
- columns~but~you~use~only~\int_use:N \c at jCol\ and~that's~why~a~block~
+ Block~too~large. \\
+ The~preamble~of~your~ \__nicematrix_full_name_env: \ announces~ \int_use:N
+ \g__nicematrix_static_num_of_col_int \
+ columns~but~you~use~only~ \int_use:N \c at jCol \ and~that's~why~a~block~
specified~in~the~cell~#1-#2~can't~be~drawn.~You~should~add~some~ampersands~
- (&)~at~the~end~of~the~first~row~of~your~\__nicematrix_full_name_env:.\\
+ (&)~at~the~end~of~the~first~row~of~your~ \__nicematrix_full_name_env: . \\
This~block~and~maybe~others~will~be~ignored.
}
\__nicematrix_msg_new:nn { unknown~column~type }
{
- Bad~column~type.\\
- The~column~type~'#1'~in~your~\__nicematrix_full_name_env:\
+ Bad~column~type. \\
+ The~column~type~'#1'~in~your~ \__nicematrix_full_name_env: \
is~unknown. \\
This~error~is~fatal.
}
\__nicematrix_msg_new:nn { unknown~column~type~S }
{
- Bad~column~type.\\
- The~column~type~'S'~in~your~\__nicematrix_full_name_env:\ is~unknown. \\
+ Bad~column~type. \\
+ The~column~type~'S'~in~your~ \__nicematrix_full_name_env: \ is~unknown. \\
If~you~want~to~use~the~column~type~'S'~of~siunitx,~you~should~
load~that~package. \\
This~error~is~fatal.
@@ -10172,18 +10178,18 @@
}
\__nicematrix_msg_new:nn { tabularnote~forbidden }
{
- Forbidden~command.\\
- You~can't~use~the~command~\token_to_str:N\tabularnote\
+ Forbidden~command. \\
+ You~can't~use~the~command~ \token_to_str:N \tabularnote \
~here.~This~command~is~available~only~in~
\{NiceTabular\},~\{NiceTabular*\}~and~\{NiceTabularX\}~or~in~
- the~argument~of~a~command~\token_to_str:N \caption\ included~
- in~an~environment~{table}. \\
+ the~argument~of~a~command~\token_to_str:N \caption \ included~
+ in~an~environment~\{table\}. \\
This~command~will~be~ignored.
}
\__nicematrix_msg_new:nn { borders~forbidden }
{
Forbidden~key.\\
- You~can't~use~the~key~'borders'~of~the~command~\token_to_str:N \Block\
+ You~can't~use~the~key~'borders'~of~the~command~ \token_to_str:N \Block \
because~the~option~'rounded-corners'~
is~in~force~with~a~non-zero~value.\\
This~key~will~be~ignored.
@@ -10197,21 +10203,21 @@
}
\__nicematrix_msg_new:nn { enumitem~not~loaded }
{
- enumitem~not~loaded.\\
- You~can't~use~the~command~\token_to_str:N\tabularnote\
- ~because~you~haven't~loaded~'enumitem'.\\
- All~the~commands~\token_to_str:N\tabularnote\ will~be~
+ enumitem~not~loaded. \\
+ You~can't~use~the~command~ \token_to_str:N \tabularnote \
+ ~because~you~haven't~loaded~'enumitem'. \\
+ All~the~commands~ \token_to_str:N \tabularnote \ will~be~
ignored~in~the~document.
}
\__nicematrix_msg_new:nn { tikz~without~tikz }
{
- Tikz~not~loaded.\\
+ Tikz~not~loaded. \\
You~can't~use~the~key~'tikz'~here~because~Tikz~is~not~
loaded.~If~you~go~on,~that~key~will~be~ignored.
}
\__nicematrix_msg_new:nn { tikz~in~custom-line~without~tikz }
{
- Tikz~not~loaded.\\
+ Tikz~not~loaded. \\
You~have~used~the~key~'tikz'~in~the~definition~of~a~
customized~line~(with~'custom-line')~but~tikz~is~not~loaded.~
You~can~go~on~but~you~will~have~another~error~if~you~actually~
@@ -10219,9 +10225,9 @@
}
\__nicematrix_msg_new:nn { tikz~in~borders~without~tikz }
{
- Tikz~not~loaded.\\
+ Tikz~not~loaded. \\
You~have~used~the~key~'tikz'~in~a~key~'borders'~(of~a~
- command~'\token_to_str:N\Block')~but~tikz~is~not~loaded.~
+ command~' \token_to_str:N \Block ')~but~tikz~is~not~loaded.~
That~key~will~be~ignored.
}
\__nicematrix_msg_new:nn { color~in~custom-line~with~tikz }
@@ -10234,9 +10240,9 @@
\__nicematrix_msg_new:nn { Wrong~last~row }
{
Wrong~number.\\
- You~have~used~'last-row=\int_use:N \l__nicematrix_last_row_int'~but~your~
- \__nicematrix_full_name_env:\ seems~to~have~\int_use:N \c at iRow \ rows.~
- If~you~go~on,~the~value~of~\int_use:N \c at iRow \ will~be~used~for~
+ You~have~used~'last-row= \int_use:N \l__nicematrix_last_row_int '~but~your~
+ \__nicematrix_full_name_env: \ seems~to~have~ \int_use:N \c at iRow \ rows.~
+ If~you~go~on,~the~value~of~ \int_use:N \c at iRow \ will~be~used~for~
last~row.~You~can~avoid~this~problem~by~using~'last-row'~
without~value~(more~compilations~might~be~necessary).
}
@@ -10249,23 +10255,23 @@
\__nicematrix_msg_new:nn { Outside~math~mode }
{
Outside~math~mode.\\
- The~\__nicematrix_full_name_env:\ can~be~used~only~in~math~mode~
- (and~not~in~\token_to_str:N \vcenter).\\
+ The~\__nicematrix_full_name_env: \ can~be~used~only~in~math~mode~
+ (and~not~in~ \token_to_str:N \vcenter ).\\
This~error~is~fatal.
}
\__nicematrix_msg_new:nn { One~letter~allowed }
{
Bad~name.\\
- The~value~of~key~'\l_keys_key_str'~must~be~of~length~1~and~
- you~have~used~'\l_keys_value_tl'.\\
+ The~value~of~key~' \l_keys_key_str '~must~be~of~length~1~and~
+ you~have~used~' \l_keys_value_tl '.\\
It~will~be~ignored.
}
\__nicematrix_msg_new:nn { TabularNote~in~CodeAfter }
{
- Environment~{TabularNote}~forbidden.\\
- You~must~use~{TabularNote}~at~the~end~of~your~{NiceTabular}~
- but~*before*~the~\token_to_str:N \CodeAfter.\\
- This~environment~{TabularNote}~will~be~ignored.
+ Environment~\{TabularNote\}~forbidden.\\
+ You~must~use~\{TabularNote\}~at~the~end~of~your~\{NiceTabular\}~
+ but~*before*~the~ \token_to_str:N \CodeAfter . \\
+ This~environment~\{TabularNote\}~will~be~ignored.
}
\__nicematrix_msg_new:nn { varwidth~not~loaded }
{
@@ -10277,7 +10283,7 @@
\__nicematrix_msg_new:nnn { Unknow~key~for~RulesBis }
{
Unknown~key.\\
- Your~key~'\l_keys_key_str'~is~unknown~for~a~rule.\\
+ Your~key~' \l_keys_key_str '~is~unknown~for~a~rule.\\
\c__nicematrix_available_keys_str
}
{
@@ -10291,9 +10297,10 @@
\__nicematrix_msg_new:nnn { Unknown~key~for~Block }
{
- Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~command~\token_to_str:N
- \Block.\\ It~will~be~ignored. \\
+ Unknown~key. \\
+ The~key~' \l_keys_key_str '~is~unknown~for~the~command~
+ \token_to_str:N \Block . \\
+ It~will~be~ignored. \\
\c__nicematrix_available_keys_str
}
{
@@ -10305,8 +10312,8 @@
\__nicematrix_msg_new:nnn { Unknown~key~for~Brace }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~commands~\token_to_str:N
- \UnderBrace\ and~\token_to_str:N \OverBrace.\\
+ The~key~' \l_keys_key_str '~is~unknown~for~the~commands~
+ \token_to_str:N \UnderBrace \ and~ \token_to_str:N \OverBrace . \\
It~will~be~ignored. \\
\c__nicematrix_available_keys_str
}
@@ -10318,7 +10325,7 @@
\__nicematrix_msg_new:nnn { Unknown~key~for~CodeAfter }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown.\\
+ The~key~' \l_keys_key_str '~is~unknown.\\
It~will~be~ignored. \\
\c__nicematrix_available_keys_str
}
@@ -10328,12 +10335,12 @@
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.
+ The~latter~is~for~the~command~ \token_to_str:N \line .
}
\__nicematrix_msg_new:nnn { Unknown~key~for~CodeBefore }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown.\\
+ The~key~' \l_keys_key_str '~is~unknown.\\
It~will~be~ignored. \\
\c__nicematrix_available_keys_str
}
@@ -10346,7 +10353,7 @@
\__nicematrix_msg_new:nnn { Unknown~key~for~SubMatrix }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown.\\
+ The~key~' \l_keys_key_str '~is~unknown.\\
That~key~will~be~ignored. \\
\c__nicematrix_available_keys_str
}
@@ -10367,7 +10374,7 @@
\__nicematrix_msg_new:nnn { Unknown~key~for~notes }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown.\\
+ The~key~' \l_keys_key_str '~is~unknown.\\
That~key~will~be~ignored. \\
\c__nicematrix_available_keys_str
}
@@ -10387,8 +10394,8 @@
\__nicematrix_msg_new:nnn { Unknown~key~for~RowStyle }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~command~
- \token_to_str:N \RowStyle. \\
+ The~key~' \l_keys_key_str '~is~unknown~for~the~command~
+ \token_to_str:N \RowStyle . \\
That~key~will~be~ignored. \\
\c__nicematrix_available_keys_str
}
@@ -10400,7 +10407,7 @@
cell-space-limits,~
color,~
fill~(alias:~rowcolor),~
- nb-rows,
+ nb-rows,~
opacity~and~
rounded-corners.
}
@@ -10407,8 +10414,8 @@
\__nicematrix_msg_new:nnn { Unknown~key~for~NiceMatrixOptions }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~command~
- \token_to_str:N \NiceMatrixOptions. \\
+ The~key~' \l_keys_key_str '~is~unknown~for~the~command~
+ \token_to_str:N \NiceMatrixOptions . \\
That~key~will~be~ignored. \\
\c__nicematrix_available_keys_str
}
@@ -10462,7 +10469,7 @@
\__nicematrix_msg_new:nnn { Unknown~key~for~NiceArray }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~environment~
+ The~key~' \l_keys_key_str '~is~unknown~for~the~environment~
\{NiceArray\}. \\
That~key~will~be~ignored. \\
\c__nicematrix_available_keys_str
@@ -10520,8 +10527,8 @@
\__nicematrix_msg_new:nnn { Unknown~key~for~NiceMatrix }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~
- \__nicematrix_full_name_env:. \\
+ The~key~' \l_keys_key_str '~is~unknown~for~the~
+ \__nicematrix_full_name_env: . \\
That~key~will~be~ignored. \\
\c__nicematrix_available_keys_str
}
@@ -10581,7 +10588,7 @@
\__nicematrix_msg_new:nnn { Unknown~key~for~NiceTabular }
{
Unknown~key.\\
- The~key~'\l_keys_key_str'~is~unknown~for~the~environment~
+ The~key~' \l_keys_key_str '~is~unknown~for~the~environment~
\{NiceTabular\}. \\
That~key~will~be~ignored. \\
\c__nicematrix_available_keys_str
@@ -10644,18 +10651,18 @@
\__nicematrix_msg_new:nnn { Duplicate~name }
{
Duplicate~name.\\
- The~name~'\l_keys_value_tl'~is~already~used~and~you~shouldn't~use~
+ The~name~' \l_keys_value_tl '~is~already~used~and~you~shouldn't~use~
the~same~environment~name~twice.~You~can~go~on,~but,~
maybe,~you~will~have~incorrect~results~especially~
if~you~use~'columns-width=auto'.~If~you~don't~want~to~see~this~
message~again,~use~the~key~'allow-duplicate-names'~in~
- '\token_to_str:N \NiceMatrixOptions'.\\
+ ' \token_to_str:N \NiceMatrixOptions '.\\
\bool_if:NF \g__nicematrix_messages_for_Overleaf_bool
{ For~a~list~of~the~names~already~used,~type~H~<return>. }
}
{
The~names~already~defined~in~this~document~are:~
- \seq_use:Nnnn \g__nicematrix_names_seq { ~and~ } { ,~ } { ~and~ }.
+ \clist_use:Nnnn \g__nicematrix_names_clist { ~and~ } { ,~ } { ~and~ } .
}
\__nicematrix_msg_new:nn { Option~auto~for~columns-width }
{
@@ -10666,7 +10673,7 @@
\__nicematrix_msg_new:nn { NiceTabularX~without~X }
{
NiceTabularX~without~X.\\
- You~should~not~use~{NiceTabularX}~without~X~columns.\\
+ You~should~not~use~\{NiceTabularX\}~without~X~columns.\\
However,~you~can~go~on.
}
\__nicematrix_msg_new:nn { Preamble~forgotten }
@@ -10673,21 +10680,26 @@
{
Preamble~forgotten.\\
You~have~probably~forgotten~the~preamble~of~your~
- \__nicematrix_full_name_env:. \\
+ \__nicematrix_full_name_env: . \\
This~error~is~fatal.
}
\__nicematrix_msg_new:nn { Invalid~col~number }
{
Invalid~column~number.\\
- A~color~instruction~in~the~\token_to_str:N \CodeBefore\
+ A~color~instruction~in~the~ \token_to_str:N \CodeBefore \
specifies~a~column~which~is~outside~the~array.~It~will~be~ignored.
}
\__nicematrix_msg_new:nn { Invalid~row~number }
{
Invalid~row~number.\\
- A~color~instruction~in~the~\token_to_str:N \CodeBefore\
+ A~color~instruction~in~the~ \token_to_str:N \CodeBefore \
specifies~a~row~which~is~outside~the~array.~It~will~be~ignored.
}
+\__nicematrix_define_com:NNN p ( )
+\__nicematrix_define_com:NNN b [ ]
+\__nicematrix_define_com:NNN v | |
+\__nicematrix_define_com:NNN V \| \|
+\__nicematrix_define_com:NNN B \{ \}
\endinput
%%
More information about the tex-live-commits
mailing list.