texlive[73531] Master/texmf-dist: nicematrix (20jan25)
commits+karl at tug.org
commits+karl at tug.org
Mon Jan 20 22:26:05 CET 2025
Revision: 73531
https://tug.org/svn/texlive?view=revision&revision=73531
Author: karl
Date: 2025-01-20 22:26:05 +0100 (Mon, 20 Jan 2025)
Log Message:
-----------
nicematrix (20jan25)
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/source/latex/nicematrix/nicematrix.ins
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-01-20 21:25:50 UTC (rev 73530)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex 2025-01-20 21:26:05 UTC (rev 73531)
@@ -148,19 +148,22 @@
L_n & a_{n1} & a_{n2} & \Cdots & a_{nn}
\end{bNiceArray}$
\hspace{2cm}
-\begin{NiceTabular}[c]{lSSSS}%
-[code-before = \rowcolor{red!15}{1-2} \rowcolors{3}{blue!15}{}]
-\toprule
-\Block{2-1}{Produit} & \multicolumn{3}{c}{dimensions (cm)} & \Block{2-1}{\rotate Prix} \\
-\cmidrule(rl){2-4}
- & L & l & h \\
-\midrule
-petit & 3 & 5.5 & 1 & 30 \\
-standard & 5.5 & 8 & 1.5 & 50.5 \\
-premium & 8.5 & 10.5 & 2 & 80 \\
-extra & 8.5 & 10 & 1.5 & 85.5 \\
-spécial & 12 & 12 & 0.5 & 70 \\
-\bottomrule
+\begin{NiceTabular}[c]{lSSSS}[no-cell-nodes]
+\CodeBefore
+ \rowcolor{red!15}{1-2}
+ \rowcolors{3}{blue!15}{}
+\Body
+ \toprule
+ \Block{2-1}{Produit} & \multicolumn{3}{c}{dimensions (cm)} & \Block{2-1}{\rotate Prix} \\
+ \cmidrule(rl){2-4}
+ & L & l & h \\
+ \midrule
+ petit & 3 & 5.5 & 1 & 30 \\
+ standard & 5.5 & 8 & 1.5 & 50.5 \\
+ premium & 8.5 & 10.5 & 2 & 80 \\
+ extra & 8.5 & 10 & 1.5 & 85.5 \\
+ spécial & 12 & 12 & 0.5 & 70 \\
+ \bottomrule
\end{NiceTabular}
@@ -301,9 +304,10 @@
\index{cell-space-bottom-limit}
\index{cell-space-limits}
-Il est bien connu que certaines rangées des tableaux créés par défaut avec
-LaTeX sont trop proches l'une de l'autre. On en donne ci-dessous un exemple
-classique.
+Il est bien connu que certaines rangées\footnote{Dans ce document, on parlera de
+ \emph{rangée} pour désigner uniquement les rangées horizontales. Les colonnes,
+ par opposition, sont verticales.} des tableaux créés par défaut avec LaTeX
+sont trop proches l'une de l'autre. On en donne ci-dessous un exemple classique.
\medskip
\begin{Code}[width=9cm]
@@ -349,7 +353,7 @@
\end{Code}
\begin{scope}
\NiceMatrixOptions{ cell-space-limits = 1pt }
-$\begin{pNiceMatrix}
+$\begin{pNiceMatrix}[no-cell-nodes]
\frac{1}{2} & -\frac{1}{2} \\
\frac{1}{3} & \frac{1}{4} \\
\end{pNiceMatrix}$
@@ -378,7 +382,7 @@
1 & p & 1+p
\end{pNiceMatrix}$
\end{Code}
-$A = \begin{pNiceMatrix}[baseline=2]
+$A = \begin{pNiceMatrix}[baseline=2,no-cell-nodes]
\frac{1}{\sqrt{1+p^2}} & p & 1-p \\
1 & 1 & 1 \\
1 & p & 1+p
@@ -418,7 +422,7 @@
\item un item
\smallskip
\item \renewcommand{\arraystretch}{1.2}
-$\begin{NiceArray}[t]{lcccccc}
+$\begin{NiceArray}[t]{lcccccc}[no-cell-nodes]
\hline
n & 0 & 1 & 2 & 3 & 4 & 5 \\
u_n & 1 & 2 & 4 & 8 & 16 & 32 \\
@@ -453,7 +457,7 @@
\item an item
\smallskip
\item
-$\begin{NiceArray}[t]{lcccccc}
+$\begin{NiceArray}[t]{lcccccc}[no-cell-nodes]
\toprule
n & 0 & 1 & 2 & 3 & 4 & 5 \\
\midrule
@@ -487,7 +491,7 @@
\end{Code}
\begin{scope}
\NiceMatrixOptions{cell-space-limits=1pt}
-\raisebox{-5mm}{$A=\begin{pNiceArray}{cc|cc}[baseline=line-3]
+\raisebox{-5mm}{$A=\begin{pNiceArray}{cc|cc}[baseline=line-3,no-cell-nodes]
\dfrac{1}{A} & \dfrac{1}{B} & 0 & 0 \\
\dfrac{1}{C} & \dfrac{1}{D} & 0 & 0 \\
\hline
@@ -731,8 +735,9 @@
largeur de la colonne courante.
Dans les colonnes à largeur fixée (|p{...}|, |b{...}|, |m{...}|, |w{...}{...}|,
-|W{...}{...}|, |V{...}| et~|X|), le contenu du bloc est mis en forme comme un
-paragraphe de cette largeur.
+|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
@@ -829,7 +834,7 @@
\end{NiceTabular}
\end{Code}
%
-\begin{NiceTabular}{cc}
+\begin{NiceTabular}{cc}[no-cell-nodes]
\toprule
Écrivain
& \Block[l]{}{année de\\ naissance} \\
@@ -937,7 +942,7 @@
\medskip
\begin{center}
-\begin{NiceTabular}{@{}c!{\qquad}ccc!{\qquad}ccc@{}}
+\begin{NiceTabular}{@{}c!{\qquad}ccc!{\qquad}ccc@{}}[no-cell-nodes]
\toprule
Rang & \Block[C]{1-3}{Premier groupe} & & & \Block{1-3}{Deuxième groupe} \\
& 1A & 1B & 1C & 2A & 2B & 2C \\
@@ -951,17 +956,17 @@
\end{center}
\bigskip
-\colorbox{yellow!50}{\bfseries Nouveau 6.28}\par\nobreak
-\smallskip
La commande |\Block| accepte aussi les clés |p| et |j|. Avec la clé
\Definition{p}, le contenu du bloc est composé comme un paragraphe (de manière
similaire à une colonne standard de type |p|). Cette clé peut s'utiliser en
conjonction avec les clés |l|, |c| ou |r| et, alors, le paragraphe est composé
-avec |\raggedright|, |\centering| ou |\raggedleft| (et les commandes
-|\RaggedRight|, |\Centering| et |\RaggedLeft| dans le cas où l'extension
-\pkg{ragged2e} est chargée). Avec la clé \Definition{j},
-le paragraphe est composé de manière justifiée.
+avec |\raggedright|, |\centering| ou |\raggedleft| (en fait, quand
+\pkg{ragged2e} est chargée, ce sont les commandes
+|\RaggedRight|, |\Centering| et |\RaggedLeft| fournies par cette extension qui
+seront utilisées au lieu de |\raggedright|, |\centering| et |\raggedleft|).
+Avec la clé \Definition{j} (qui force la clé |p|), le paragraphe est composé de
+manière justifiée.
\subsection{Positionnement vertical du contenu des blocs}
@@ -981,10 +986,10 @@
\item Avec la clé \Definition{t}, la ligne de base du contenu du bloc est alignée avec la
ligne de base de la première rangée concernée par le bloc.
-\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.
+\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.
\item Avec la clé \Definition{T}, le contenu du bloc est calé vers le haut.
@@ -1098,8 +1103,6 @@
\index{ampersand-in-blocks}
\index{\&-in-blocks}
-\colorbox{yellow!50}{\bfseries Nouveau 6.28}\par\nobreak
-
\medskip
L'extension \pkg{nicematrix} offre la possibilité d'utiliser directement |\\| et
|&| dans le contenu d'un bloc (dans le but de formater son contenu) mais il y a
@@ -1125,7 +1128,8 @@
\end{itemize}
\bigskip
-L'esperluette |&| permet de diviser horizontalement un bloc en sous-blocs \emph{de même taille}.
+L'esperluette |&| permet de diviser horizontalement un bloc en sous-blocs
+\emph{de même taille}.
\medskip
\begin{Code}[width=85mm]
@@ -1133,13 +1137,13 @@
[hvlines,\emph{ampersand-in-blocks}]
& les cinq premiers entiers naturels \\
3 & \Block{}{un&deux&trois} \\
-4 & \Block{}{un&deux&trois& quatre} \\
+4 & \Block{}{un&deux&trois&quatre} \\
5 & \Block{}{un&deux&trois&quatre&cinq} \\
\end{NiceTabular}
\end{Code}
%
\begin{NiceTabular}{ll}%
- [hvlines,ampersand-in-blocks]
+ [hvlines,ampersand-in-blocks,no-cell-nodes]
& les cinq premiers entiers naturels \\
3 & \Block{}{un & deux & trois} \\
4 & \Block{}{un& deux & trois & quatre} \\
@@ -1147,9 +1151,9 @@
\end{NiceTabular}
\medskip
-Comme on le voit, le bloc (qui était ici mono-case) a été divisé en sous-cases
-de même taille. Dans le cas présent, on aurait peut-être préféré le codage
-suivant :
+Comme on le voit, chaque bloc (ici, à chaque fois mono-case) a été divisé en
+sous-cases de \emph{même taille}. Dans le cas présent, on aurait peut-être
+préféré le codage suivant :
\medskip
\begin{Code}[width=85mm]
@@ -1164,7 +1168,7 @@
\end{Code}
%
\begin{NiceTabular}{lccccc}%
- [hvlines,ampersand-in-blocks]
+ [hvlines,ampersand-in-blocks,no-cell-nodes]
& \Block{1-5}{les cinq premiers entiers naturels} \\
3 & \Block{1-5}{un & deux & trois} \\
4 & \Block{1-5}{un& deux & trois & quatre} \\
@@ -1207,7 +1211,7 @@
\end{NiceTabular}
\end{Code}
%
-\begin{NiceTabular}{|c|c|}[c] \hline
+\begin{NiceTabular}{|c|c|}[c,no-cell-nodes] \hline
Premier & Deuxième \\ \hline\hline
Paul \\ \hline
Marie & Pauline \\ \hline
@@ -1239,7 +1243,7 @@
\end{NiceArray}$
\end{Code}
%
-$\begin{NiceArray}{c|ccc}
+$\begin{NiceArray}{c|ccc}[no-cell-nodes]
\toprule
a & b & c & d \\
\midrule
@@ -1311,7 +1315,7 @@
%
\begin{scope}
\setlength{\arrayrulewidth}{2pt}
-\begin{NiceTabular}[c]{cccc}
+\begin{NiceTabular}[c]{cccc}[no-cell-nodes]
\hline
A&B&C&D \\
\cline{2}
@@ -1362,7 +1366,7 @@
\end{NiceTabular}
\end{Code}
\hspace{-5cm}
-\begin{NiceTabular}{|ccc|}[rules/color=[gray]{0.9},rules/width=1pt]
+\begin{NiceTabular}{|ccc|}[rules/color=[gray]{0.9},rules/width=1pt,no-cell-nodes]
\hline
rose & tulipe & lys \\
arum & iris & violette \\
@@ -1438,7 +1442,7 @@
\end{NiceTabular}
\end{Code}
%
-\begin{NiceTabular}{|c|[color=blue]c|}
+\begin{NiceTabular}{|c|[color=blue]c|}[no-cell-nodes]
\Hline
a & b \\
\Hline[color=red]
@@ -1474,7 +1478,7 @@
1 & 2 & 3 & 4 & 5 & 6
\end{pNiceMatrix}$
\end{Code}
-$\begin{pNiceMatrix}[vlines,rules/width=0.2pt]
+$\begin{pNiceMatrix}[vlines,rules/width=0.2pt,no-cell-nodes]
1 & 2 & 3 & 4 & 5 & 6 \\
1 & 2 & 3 & 4 & 5 & 6 \\
1 & 2 & 3 & 4 & 5 & 6
@@ -1575,7 +1579,8 @@
Dans l'exemple ci-contre (où B est au centre d'un |\Block| de taille $2\times2$),
on a colorié en bleu clair les quatre coins (vides) du tableau.
\end{minipage}\hspace{2cm}%
-\begin{NiceTabular}{*{6}{c}}[cell-space-top-limit=3pt,hvlines,rules={color=white,width=0.1pt}]
+\begin{NiceTabular}{*{6}{c}}%
+[cell-space-top-limit=3pt,hvlines,rules={color=white,width=0.1pt},no-cell-nodes]
\CodeBefore
\rectanglecolor{blue!10}{1-1}{4-2}
\rectanglecolor{blue!10}{1-1}{1-4}
@@ -1590,7 +1595,7 @@
A & A & A & A & A & A \\
A & A & A & A & A & A \\
& A & A & A \\
- & \Block{2-2}{B} & & A \\
+ & \Block[C]{2-2}{B} & & A \\
& & & A \\
\end{NiceTabular}
@@ -1625,7 +1630,7 @@
A & A & A & A & A & A \\
A & A & A & A & A & A \\
& A & A & A \\
- & \Block{2-2}{B} & & A \\
+ & \Block[C]{2-2}{B} & & A \\
& & & A \\
\end{NiceTabular}
@@ -1683,7 +1688,7 @@
c & c & b & a & e
\end{NiceArray}$
\end{Code}
-$\begin{NiceArray}{*{5}{c}}[hvlines]
+$\begin{NiceArray}{*{5}{c}}[hvlines,no-cell-nodes]
\diagbox{x}{y} & e & a & b & c \\
e & e & a & b & c \\
a & a & e & c & b \\
@@ -1705,7 +1710,7 @@
c & c & b & a & e
\end{NiceArray}$
\end{Code}
-$\begin{NiceArray}{*{5}{c}}[hvlines]
+$\begin{NiceArray}{*{5}{c}}[hvlines,no-cell-nodes]
\Block{2-2}{\diagbox{x}{y}} & & a & b & c \\
& & a & b & c \\
a & a & e & c & b \\
@@ -1728,7 +1733,7 @@
c & c & b & a & e
\end{NiceArray}$
\end{Code}
-$\begin{NiceArray}{*{5}{c}}[hvlines]
+$\begin{NiceArray}{*{5}{c}}[hvlines,no-cell-nodes]
\Block{2-2}{\diagbox{}{}} & y & a & b & c \\
x & & a & b & c \\
a & a & e & c & b \\
@@ -1877,7 +1882,7 @@
quatre & \cellcolor{yellow} cinq & six \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccc}
+\begin{NiceTabular}{ccc}[no-cell-nodes]
un & deux & trois \\
\DoubleRule
quatre & \cellcolor{yellow} cinq & six \\
@@ -1936,7 +1941,7 @@
total-width = \pgflinewidth
}
}
-\begin{NiceTabular}{cIcIc}
+\begin{NiceTabular}{cIcIc}[no-cell-nodes]
un & deux & trois \\
quatre & cinq & six \\
sept & huit & neuf
@@ -1961,10 +1966,12 @@
p.~\pageref{Cdots}).
\medskip
-L'extension \pkg{nicematrix} prédéfinit en fait les commandes \DefinitionCommande{hdottedline} et
-\DefinitionCommande{cdottedline} et la lettre «|:|» pour ces filets en pointillés.\footnote{Néanmoins, l'utilisateur peut écraser ces définitions de
- |\hdottedline|, |\cdottedline| et de «|:|» avec |custom-line| s'il le souhaite
- (par exemple pour les remplacer par des lignes en tiretés).}
+L'extension \pkg{nicematrix} prédéfinit en fait les commandes
+\DefinitionCommande{hdottedline} et \DefinitionCommande{cdottedline} et la
+lettre «|:|» pour ces filets en pointillés.\footnote{Néanmoins, l'utilisateur
+ peut écraser ces définitions de |\hdottedline|, |\cdottedline| et de «|:|»
+ avec |custom-line| s'il le souhaite (par exemple pour les remplacer par des
+ lignes en tiretés).}
\smallskip
\begin{Code}
@@ -1995,7 +2002,7 @@
11 & 12 & 13 & 14 & 15
\end{pNiceMatrix}
\end{Code}
-$\begin{pNiceMatrix}
+$\begin{pNiceMatrix}[no-cell-nodes]
1 & 2 & 3 & 4 & 5 \\
\hdottedline
6 & 7 & 8 & 9 & 10 \\
@@ -2017,7 +2024,7 @@
11 & 12 & 13 & 14 & 15
\end{pNiceArray}
\end{Code}
-$\begin{pNiceArray}{cccc:c}
+$\begin{pNiceArray}{cccc:c}[no-cell-nodes]
1 & 2 & 3 & 4 & 5 \\
6 & 7 & 8 & 9 & 10 \\
11 & 12 & 13 & 14 & 15
@@ -2117,7 +2124,8 @@
position des filets éventuels sont également accessibles : cf.
p.~\pageref{nodes-i}.}
-Les noms de certaines de ces commandes sont inspirés des noms des commandes de \pkg{colortbl}.
+Les noms de certaines de ces commandes sont inspirés des noms des commandes de
+\pkg{colortbl}.
\label{code-before}
\index{cellcolor@\texttt{\textbackslash cellcolor}!commande du
@@ -2189,7 +2197,7 @@
h & i & j \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccc}[hvlines]
+\begin{NiceTabular}{ccc}[hvlines,no-cell-nodes]
\CodeBefore
\cellcolor[HTML]{FFFF88}{3-1,2-2,-3}
\Body
@@ -2218,7 +2226,7 @@
h & i & j \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccc}[hvlines]
+\begin{NiceTabular}{ccc}[hvlines,no-cell-nodes]
\CodeBefore
\rectanglecolor{blue!15}{2-2}{3-3}
\Body
@@ -2254,7 +2262,7 @@
1 & -1 & 1
\end{pNiceMatrix}$
\end{Code}
-$\begin{pNiceMatrix}[baseline=1, r, margin]
+$\begin{pNiceMatrix}[baseline=1, r, margin,no-cell-nodes]
\CodeBefore
\chessboardcolors{red!15}{blue!15}
\Body
@@ -2298,7 +2306,7 @@
\end{NiceArray}$
\end{Code}
%
-$\begin{NiceArray}{lll}[baseline=4,hvlines]
+$\begin{NiceArray}{lll}[baseline=4,hvlines,no-cell-nodes]
\CodeBefore
\rowcolor{red!15}{1,3-5,8-}
\Body
@@ -2379,7 +2387,7 @@
& Estelle & 15
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{clr}[hvlines,baseline=2]
+\begin{NiceTabular}{clr}[hvlines,baseline=2,no-cell-nodes]
\CodeBefore
\rowcolors[gray]{2}{0.8}{}[cols=2-3,restart]
\Body
@@ -2433,11 +2441,12 @@
\end{scope}
\medskip
-\item L'extension \pkg{nicematrix} propose aussi une commande \Definition{\textbackslash
- rowlistcolors}. Cette commande généralise la commande |\rowcolors|: au lieu de
-prendre deux arguments successifs pour les couleurs, elle prend un seul argument
-qui est une liste de couleurs séparées par des virgules. Dans cette liste, le
-symbole |=| représente une couleur identique à la précédente.
+\item L'extension \pkg{nicematrix} propose aussi une commande
+\Definition{\textbackslash rowlistcolors}. Cette commande généralise la commande
+|\rowcolors|: au lieu de prendre deux arguments successifs pour les couleurs,
+elle prend un seul argument qui est une \emph{liste} de couleurs séparées par
+des virgules. Dans cette liste, le symbole |=| représente une couleur identique
+à la précédente.
\smallskip
\begin{Code}[width=10cm]
@@ -2497,7 +2506,7 @@
Stéphanie \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{c}
+\begin{NiceTabular}{c}[no-cell-nodes]
\CodeBefore
\definecolorseries{BlueWhite}{rgb}{last}{blue}{white}
\resetcolorseries[\value{iRow}]{BlueWhite}
@@ -2523,7 +2532,8 @@
\medskip
\index{corners (clé d'un environnement)|textit}
\begin{Code}[width=15cm]
-\begin{NiceTabular}{cccccc}[\emph{corners=NE},margin,hvlines,first-row,first-col]
+\begin{NiceTabular}{cccccc}
+ [\emph{corners=NE},margin,hvlines,first-row,first-col]
\CodeBefore
\emph{\rowlistcolors{1}{blue!15, }}
\Body
@@ -2538,7 +2548,8 @@
\end{NiceTabular}
\end{Code}
\hspace{-6cm}
-\begin{NiceTabular}{ccccccc}[corners=NE,margin,hvlines,first-row,first-col]
+\begin{NiceTabular}{ccccccc}%
+ [corners=NE,margin,hvlines,first-row,first-col]
\CodeBefore
\rowlistcolors{1}{blue!15, }
\Body
@@ -2585,7 +2596,8 @@
\end{NiceTabular}
\end{Code}
\hspace{-6cm}
-\begin{NiceTabular}{ccccccc}[corners=NE,margin,hvlines,first-row,first-col]
+\begin{NiceTabular}{ccccccc}%
+ [corners=NE,margin,hvlines,first-row,first-col]
\CodeBefore
\rowlistcolors{1}{blue!15, }
\columncolor{red!15}{0}
@@ -2632,7 +2644,7 @@
\emph{\bottomrule}
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}[c]{lSSSS}
+\begin{NiceTabular}[c]{lSSSS}[no-cell-nodes]
\CodeBefore
\rowcolor{red!15}{1-2}
\rowcolors{3}{blue!15}{}
@@ -2717,7 +2729,7 @@
\begin{center}
\NewDocumentCommand { \Blue } { } {\columncolor{blue!15}}
-\begin{NiceTabular}{>{\Blue}c>{\Blue}cc}
+\begin{NiceTabular}{>{\Blue}c>{\Blue}cc}[no-cell-nodes]
\toprule
\rowcolor{red!15}
Nom & Prénom & Année de naissance \\
@@ -2754,7 +2766,7 @@
sept \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{c}[hvlines]
+\begin{NiceTabular}{c}[hvlines,no-cell-nodes]
un \\
deux \\
\rowlistcolors{red!15}
@@ -2770,9 +2782,9 @@
\index{nocolor}
-L'extension \pkg{nicematrix} propose la couleur spéciale |nocolor| utilisable
-dans toutes les commandes de coloriage fournies par \pkg{nicematrix} (dans le
-|\CodeBefore| ou bien dans le tableau proprement dit).
+L'extension \pkg{nicematrix} propose la couleur spéciale \Definition{nocolor}
+utilisable dans toutes les commandes de coloriage fournies par \pkg{nicematrix}
+(dans le |\CodeBefore| ou bien dans le tableau proprement dit).
Les cases marquées par cette couleur ne seront pas coloriées, quelles que soient
les autres commandes de coloriage qui auraient pu s'appliquer à ces cases.
@@ -2810,11 +2822,13 @@
\index{rowcolor (clé de \texttt{\textbackslash RowStyle})}
\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
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
-couleur de fond.
+couleur de fond. Si la clé \Definition{rounded-corners} est utilisée, ce fond
+aura des coins arrondis.
\item
\index{color!clé de \texttt{\textbackslash RowStyle}}
@@ -2843,7 +2857,7 @@
\end{NiceTabular}
\end{Code}
\index{rotate@\texttt{\textbackslash rotate}|textit}
-\begin{NiceTabular}{cccc}
+\begin{NiceTabular}{cccc}[no-cell-nodes]
\hline
\RowStyle[cell-space-limits=3pt]{\rotate}
premier & deuxième & troisième & quatrième \\
@@ -2874,7 +2888,7 @@
Rio & Tokyo & Oslo
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{W{c}{2cm}cc}[hvlines]
+\begin{NiceTabular}{W{c}{2cm}cc}[hvlines,no-cell-nodes]
Paris & New York & Madrid \\
Berlin & London & Roma \\
Rio & Tokyo & Oslo
@@ -2896,7 +2910,7 @@
4 & 1 & 2
\end{pNiceMatrix}$
\end{Code}
-$\begin{pNiceMatrix}[columns-width = 1cm]
+$\begin{pNiceMatrix}[columns-width = 1cm,no-cell-nodes]
1 & 12 & -123 \\
12 & 0 & 0 \\
4 & 1 & 2
@@ -2909,11 +2923,12 @@
|\arraycolsep| à~$0$ avant).
\medskip
-Il est possible de donner la valeur spéciale |auto| à l'option |columns-width|:
-toutes les colonnes du tableau auront alors une largeur égale à la largeur de la
-case la plus large du tableau.\footnote{Le résultat est atteint dès la première
- compilation (mais PGF-TikZ écrivant des informations dans le fichier |aux|,
- un message demandant une deuxième compilation apparaîtra).}\par\nobreak
+Il est possible de donner la valeur spéciale \Definition{auto} à l'option
+|columns-width|: toutes les colonnes du tableau auront alors une largeur égale à
+la largeur de la case la plus large du tableau.\footnote{Le résultat est atteint
+ dès la première compilation (mais PGF-TikZ écrivant des informations dans le
+ fichier |aux|, un message demandant une deuxième compilation
+ apparaîtra).}\par\nobreak
\medskip
\begin{Code}[width=10cm]
@@ -2923,7 +2938,7 @@
4 & 1 & 2
\end{pNiceMatrix}$
\end{Code}
-$\begin{pNiceMatrix}[columns-width = auto]
+$\begin{pNiceMatrix}[columns-width = auto,no-cell-nodes]
1 & 12 & -123 \\
12 & 0 & 0 \\
4 & 1 & 2
@@ -2947,12 +2962,12 @@
\end{Code}
\begin{scope}
\NiceMatrixOptions{columns-width=10mm}
-$\begin{pNiceMatrix}
+$\begin{pNiceMatrix}[no-cell-nodes]
a & b \\
c & d
\end{pNiceMatrix}
=
-\begin{pNiceMatrix}
+\begin{pNiceMatrix}[no-cell-nodes]
1 & 1245 \\
345 & 2
\end{pNiceMatrix}$
@@ -3858,7 +3873,8 @@
«|shorten >|» et «|shorten <|»).
\medskip
-Voici par exemple une matrice tridiagonale avec le style |loosely dotted| :\par\nobreak
+Voici par exemple une matrice tridiagonale avec le style |loosely dotted|
+:\par\nobreak
\medskip
\begin{Code}
@@ -3946,7 +3962,7 @@
\end{NiceArray}$
\end{Code}
-\[\begin{NiceArray}{\left\lgroup ccc\right\rgroup l}
+\[\begin{NiceArray}{\left\lgroup ccc\right\rgroup l}[no-cell-nodes]
1 & 2 & 3 & \\
4 & 1 & 6 & \\
7 & 8 & 9 & \scriptstyle L_3 \gets L_3 + L_1 + L_2
@@ -3983,7 +3999,7 @@
\smallskip
\begin{center}
On définit $f$ par\quad
-\begin{NiceTabular}[t]{\{ll}
+\begin{NiceTabular}[t]{\{ll}[no-cell-nodes]
$f(x) = 0$ & si $x$ est négatif \\
$f(x) = 1-e^x$ & si $x$ est positif
\end{NiceTabular}
@@ -4003,7 +4019,7 @@
\end{pNiceArray}$
\end{Code}
-\[\begin{pNiceArray}{(c)(c)(c)}
+\[\begin{pNiceArray}{(c)(c)(c)}[no-cell-nodes]
a_{11} & a_{12} & a_{13} \\
a_{21} & \displaystyle \int_0^1\dfrac{1}{x^2+1}\,dx & a_{23} \\
a_{31} & a_{32} & a_{33}
@@ -4079,10 +4095,10 @@
\begin{Code}[width=11cm]
\NiceMatrixOptions{xdots/shorten = 0.6 em}
\begin{pNiceMatrix}
-I & 0 & \Cdots &0 \\
-0 & I & \Ddots &\Vdots\\
-\Vdots &\Ddots & I &0 \\
-0 &\Cdots & 0 &I
+I & 0 & \Cdots & 0 \\
+0 & I & \Ddots & \Vdots \\
+\Vdots & \Ddots & I & 0 \\
+0 & \Cdots & 0 & I
\emph{\CodeAfter \line{2-2}{3-3}}
\end{pNiceMatrix}
\end{Code}
@@ -4089,10 +4105,10 @@
\begin{scope}
\NiceMatrixOptions{xdots/shorten = 0.6 em}
$\begin{pNiceMatrix}
-I & 0 & \Cdots &0 \\
-0 & I & \Ddots &\Vdots\\
-\Vdots &\Ddots & I &0 \\
-0 &\Cdots & 0 &I
+I & 0 & \Cdots & 0 \\
+0 & I & \Ddots & \Vdots\\
+\Vdots &\Ddots & I & 0 \\
+0 &\Cdots & 0 & I
\CodeAfter \line{2-2}{3-3}
\end{pNiceMatrix}$
\end{scope}
@@ -4138,7 +4154,7 @@
|\lfloor|, etc. mais aussi le délimiteur nul |.| ;
\item le deuxième argument est le coin supérieur gauche de la sous-matrice avec
la syntaxe $i$|-|$j$ où $i$ est le numéro de rangée et $j$ le numéro de colonne
-;
+(le spécificateur |last| est utilisable) ;
\item le troisième argument est le coin inférieur droit avec la même syntaxe ;
\item la quatrième argument est le délimiteur droit ;
\item le cinquième argument, optionnel, entre crochets, est une liste de couples
@@ -4187,9 +4203,9 @@
\hfuzz=15cm
\begin{Code}[width=11cm]
$\begin{NiceArray}{\emph{(ccc)(c)}}[cell-space-limits=2pt]
- 1 & 1 & 1 & x \\
+ 1 & 1 & 1 & x \\
\dfrac{1}{4} & \dfrac{1}{2} & \dfrac{1}{4} & y \\
- 1 & 2 & 3 & z
+ 1 & 2 & 3 & z
\end{NiceArray}$
\end{Code}
\end{scope}
@@ -4204,7 +4220,7 @@
\bigskip
La commande |\SubMatrix| accepte en fait également deux arguments optionnels
spécifiés par les symboles traditionnels |^| et |_| pour des éléments en
-exposant et en indice.
+exposant et en indice (mais aucun espace n'est réservé pour ces éléments).
\medskip
\begin{scope}
@@ -4357,7 +4373,7 @@
& a second sub-part \\
\bottomrule
\CodeAfter
- \emph{\emph{\SubMatrix{\{}{2-2}{3-2}{.}}}
+ \emph{\SubMatrix{\{}{2-2}{3-2}{.}}
\end{NiceTabular}
\end{Code}
\hspace{2cm}
@@ -4737,7 +4753,7 @@
\end{Code}
\begin{center}
-\begin{NiceTabular}{@{}llr@{}}
+\begin{NiceTabular}{@{}llr@{}}[no-cell-nodes]
\toprule \RowStyle{\bfseries}
Nom & Prénom & Date de naissance \\
\midrule
@@ -4851,7 +4867,8 @@
\tabularnote[$\star$]{On peut mettre une note dans la légende.} ,
label = t:tabularnote,
tabularnote = Un peu de texte avant les notes. ,
- notes/bottomrule
+ notes/bottomrule ,
+ no-cell-nodes
]
\toprule
Nom & Prénom & Durée de vie \\
@@ -5006,11 +5023,11 @@
\item La clé \Definition{notes/enumitem-keys-para} est similaire à la précédente
-mais elle est utilisée pour le type de liste qui sera utilisé quand l'option |para| est
-choisie. Bien entendu, quand cette option |para| est active, c'est une liste de
-type |inline| (suivant le vocabulaire de \pkg{enumitem}) qui est utilisée et les
-paires \textsl{clé=valeur} doivent donc correspondre à une telle liste de type
-|inline|.
+mais elle est utilisée pour le type de liste qui sera utilisé quand l'option
+|para| est choisie. Bien entendu, quand cette option |para| est active, c'est
+une liste de type |inline| (suivant le vocabulaire de \pkg{enumitem}) qui est
+utilisée et les paires \textsl{clé=valeur} doivent donc correspondre à une telle
+liste de type |inline|.
Initialement, le style de liste utilisé est défini par :\quad
@@ -5109,7 +5126,7 @@
Jalon & Amandine & Dentiste \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccc}[hvlines,rounded-corners]
+\begin{NiceTabular}{ccc}[hvlines,rounded-corners,no-cell-nodes]
\CodeBefore
\rowcolor{red!15}{1}
\Body
@@ -5158,8 +5175,7 @@
Si l'extension \pkg{siunitx} est chargée (avant ou après \pkg{nicematrix}), il
est possible d'utiliser les colonnes de type |S| de \pkg{siunitx} dans les
-environnements de \pkg{nicematrix}. L'implémentation n'utilise explicitement
-aucune macro privée de \pkg{siunitx}.
+environnements de \pkg{nicematrix}.
\medskip
\begin{Code}[width = 10.6cm]
@@ -5205,7 +5221,7 @@
\sin x & \cos x
\end{bNiceMatrix}$
\end{Code}
-$\begin{bNiceMatrix}[r]
+$\begin{bNiceMatrix}[r,no-cell-nodes]
\cos x & - \sin x \\
\sin x & \cos x
\end{bNiceMatrix}$
@@ -5245,7 +5261,7 @@
\NiceMatrixOptions
{code-for-first-row = \scriptstyle\rotate \text{image de },
code-for-last-col = \scriptstyle }
-$ A = \begin{pNiceMatrix}[first-row,last-col=4]
+$ A = \begin{pNiceMatrix}[first-row,last-col=4,no-cell-nodes]
e_1 & e_2 & e_3 \\
1 & 2 & 3 & e_1 \\
4 & 5 & 6 & e_2 \\
@@ -5268,7 +5284,7 @@
\NiceMatrixOptions
{code-for-last-row = \scriptstyle \emph{\rotate} ,
code-for-last-col = \scriptstyle }
-$A = \begin{pNiceMatrix}[last-row,last-col=4]
+$A = \begin{pNiceMatrix}[last-row=4,last-col=4]
1 & 2 & 3 & e_1 \\
4 & 5 & 6 & e_2 \\
7 & 8 & 9 & e_3 \\
@@ -5279,7 +5295,7 @@
\NiceMatrixOptions
{code-for-last-row = \scriptstyle\rotate ,
code-for-last-col = \scriptstyle }%
-$A = \begin{pNiceMatrix}[last-row,last-col=4]
+$A = \begin{pNiceMatrix}[last-row=4,last-col=4,no-cell-nodes]
1 & 2 & 3 & e_1 \\
4 & 5 & 6 & e_2 \\
7 & 8 & 9 & e_3 \\
@@ -5290,8 +5306,8 @@
\bigskip
La commande |\rotate| accepte une option |c| entre crochets : |\rotate[c]| (les
espaces sont supprimés après |\rotate[c]|). Quand cette clé est utilisée, le
-contenu, après rotation, est composé dans une |\vcenter|, ce qui fait que, le
-plus souvent, on obtiendra un centrage vertical.
+contenu, après rotation, est composé dans une |\vcenter| (une primitive de TeX),
+ce qui fait que, le plus souvent, on obtiendra un centrage vertical.
\medskip
@@ -5326,7 +5342,8 @@
\end{Code}
%
\[\begin{bNiceArray}{cccc|c}%
- [small, last-col, code-for-last-col = \scriptscriptstyle, columns-width=3mm]
+ [small, last-col, code-for-last-col = \scriptscriptstyle, columns-width=3mm,
+ no-cell-nodes]
1 & -2 & 3 & 4 & 5 \\
0 & 3 & 2 & 1 & 2 & L_2 \gets 2 L_1 - L_2 \\
0 & 1 & 1 & 2 & 3 & L_3 \gets L_1 + L_3
@@ -5393,7 +5410,8 @@
$\begin{pNiceMatrix}[first-row,
first-col,
code-for-first-row = \mathbf{\alph{jCol}} ,
- code-for-first-col = \mathbf{\arabic{iRow}} ]
+ code-for-first-col = \mathbf{\arabic{iRow}} ,
+ no-cell-nodes]
& & & & \\
& 1 & 2 & 3 & 4 \\
& 5 & 6 & 7 & 8 \\
@@ -5461,7 +5479,7 @@
\end{Code}
\end{scope}
%
-$\begin{bNiceMatrix}[light-syntax,first-row,first-col]
+$\begin{bNiceMatrix}[light-syntax,first-row,first-col,no-cell-nodes]
{} a b ;
a 2\cos a {\cos a + \cos b} ;
b \cos a+\cos b { 2 \cos b }
@@ -5543,7 +5561,7 @@
\end{Code}
%
$\begin{NiceArrayWithDelims}
- {\downarrow}{\uparrow}{ccc}[margin]
+ {\downarrow}{\uparrow}{ccc}[margin,no-cell-nodes]
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
@@ -5594,7 +5612,11 @@
\medskip
Comme la création de ces nœuds requiert du temps et de la mémoire, il est
possible de la désactiver ponctuellement avec la clé \Definition{no-cell-nodes}
-pour accélerer les compilations.
+pour accélérer les compilations. Attention toutefois : ces nœuds sont utilisés
+en interne par certaines fonctionnalités de \pkg{nicematrix}. On ne peut donc
+utiliser |no-cell-nodes| que si on n'utilise pas ces fonctionnalités, parmi
+lesquelles figurent la clé |corners| et les commandes de lignes pointillées
+continues (|\Cdots|, etc.).
\medskip
Tous les nœuds du document doivent avoir des noms deux à deux distincts et le
@@ -5889,7 +5911,8 @@
marges ne sont pas incorporées dans les «nœuds larges». Dans l'exemple suivant,
nous avons utilisé |extra-left-margin| et |extra-right-margin| avec la valeur $3$~pt.
\[\begin{pNiceMatrix}%
- [create-large-nodes,left-margin,right-margin,extra-right-margin=3pt,extra-left-margin=3pt]
+ [create-large-nodes,left-margin,right-margin,extra-right-margin=3pt,
+ extra-left-margin=3pt]
\CodeBefore [create-cell-nodes]
\begin{tikzpicture}
[every node/.style = {inner sep = 0 pt},
@@ -6053,10 +6076,9 @@
simplement |last|.
\smallskip
-\colorbox{yellow!50}{\textbf{Modification 6.28}}\enskip Il existe aussi des nœuds nommés
-$i$|.1|, $i$|.2|, $i$|.25|, $i$|.3|, $i$|.4|, $i$|.5|, $i$|.6|, $i$|.7|,
-$i$|.75|, $i$|.8| et $i$|.9| intermédiaires entre le nœud~$i$ et le
-nœud~$i+1$.
+Il existe aussi des nœuds nommés $i$|.1|, $i$|.2|, $i$|.25|, $i$|.3|, $i$|.4|,
+$i$|.5|, $i$|.6|, $i$|.7|, $i$|.75|, $i$|.8| et $i$|.9| intermédiaires entre le
+nœud~$i$ et le nœud~$i+1$.
\smallskip
Ces nœuds sont accessibles dans le
@@ -6063,7 +6085,7 @@
|\CodeAfter| mais aussi dans le |\CodeBefore|.
\begin{center}
-\begin{NiceTabular}{ccc}[hvlines,rules={width=1pt,color=gray}]
+\begin{NiceTabular}{ccc}[hvlines,rules={width=1pt,color=gray},no-cell-nodes]
& tulipe & lys \\
arum & & violette mauve \\
muguet & dahlia
@@ -6091,7 +6113,7 @@
\begin{Code}
\begin{NiceMatrix}
\CodeBefore
-\emph{\tikz \draw [fill=red!15] (7-|4) |- (8-|5) |- (9-|6) |- cycle ;}
+ \emph{\tikz \draw [fill=red!15] (7-|4) |- (8-|5) |- (9-|6) |- cycle ;}
\Body
1 \\
1 & 1 \\
@@ -6105,9 +6127,9 @@
\end{NiceMatrix}
\end{Code}
%
-\[\begin{NiceMatrix}
+\[\begin{NiceMatrix}[no-cell-nodes]
\CodeBefore
-\tikz \draw [fill=red!15] (7-|4) |- (8-|5) |- (9-|6) |- cycle ;
+ \tikz \draw [fill=red!15] (7-|4) |- (8-|5) |- (9-|6) |- cycle ;
\Body
1 \\
1 & 1 \\
@@ -6134,7 +6156,7 @@
\tikz \draw [red] (\emph{3.4}-|1) -- (\emph{3.4}-|last) ;
\end{pNiceArray}$
\end{Code}
-$\begin{pNiceArray}{ccc|c}
+$\begin{pNiceArray}{ccc|c}[no-cell-nodes]
2 & 1 & 3 & 0 \\
3 & 3 & 1 & 0 \\
3 & 3 & 1 & 0
@@ -6294,7 +6316,7 @@
mante & raie & poule
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccc}[hvlines]
+\begin{NiceTabular}{ccc}[hvlines,no-cell-nodes]
\CodeBefore
\arraycolor{gray!10}
\Body
@@ -6476,7 +6498,18 @@
\index{Incompatibilités}
+Il peut y avoir des incompatibilités de \pkg{nicematrix} avec \pkg{babel} pour
+les langues qui activent (au sens de TeX) certains caractères, en particulier le
+caractère~|<|.
+Par exemple, pour l'espagnol, il vaut mieux désactiver au chargement les
+abréviations avec :
+
+\begin{Code}
+\usepackage[spanish,es-noshorthands]{babel}
+\end{Code}
+
+\medskip
L'extension \pkg{nicematrix} est incompatible avec certaines classes qui
redéfinissent les environnements |{tabular}| et |{array}|. C'est en particulier
le cas de la classe |socg-lipics-v2021|. Néanmoins, dans ce cas-là, il est
@@ -6612,7 +6645,7 @@
\begin{center}
\ttfamily \small
-\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt,rounded-corners]
+\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt,rounded-corners,no-cell-nodes]
\Block[tikz={pattern=grid,pattern color=lightgray}]{}
{pattern = grid,\\ pattern color = lightgray}
& \Block[tikz={pattern = north west lines,pattern color=blue}]{}
@@ -6845,7 +6878,7 @@
\end{Code}
\begin{center}
-\begin{NiceTabular}{@{}llr@{}}
+\begin{NiceTabular}{@{}llr@{}}[no-cell-nodes]
\toprule \RowStyle{\bfseries}
Nom & Prénom & Date de naissance \\
\midrule
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-01-20 21:25:50 UTC (rev 73530)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex 2025-01-20 21:26:05 UTC (rev 73531)
@@ -145,8 +145,11 @@
\Vdots & \Vdots & \Vdots & \Ddots & \Vdots\\
L_n & a_{n1} & a_{n2} & \Cdots & a_{nn}
\end{bNiceArray}$\hspace{2cm}
-\begin{NiceTabular}{lSSSS}%
- [code-before = \rowcolor{red!15}{1-2} \rowcolors{3}{blue!15}{}]
+\begin{NiceTabular}{lSSSS}[no-cell-nodes]
+\CodeBefore
+ \rowcolor{red!15}{1-2}
+ \rowcolors{3}{blue!15}{}
+\Body
\toprule
\Block{2-1}{Product} & \multicolumn{3}{c}{dimensions (cm)}
& \Block{2-1}{\rotate Price} \\
@@ -324,7 +327,7 @@
\end{Code}
\begin{scope}
\NiceMatrixOptions{cell-space-limits = 1pt}
-$\begin{pNiceMatrix}
+$\begin{pNiceMatrix}[no-cell-nodes]
\frac12 & -\frac12 \\
\frac13 & \frac14 \\
\end{pNiceMatrix}$
@@ -353,7 +356,7 @@
1 & p & 1+p
\end{pNiceMatrix}$
\end{Code}
-$A = \begin{pNiceMatrix}[baseline=2]
+$A = \begin{pNiceMatrix}[baseline=2,no-cell-nodes]
\frac{1}{\sqrt{1+p^2}} & p & 1-p \\
1 & 1 & 1 \\
1 & p & 1+p
@@ -393,7 +396,7 @@
\item an item
\smallskip
\item \renewcommand{\arraystretch}{1.2}
-$\begin{NiceArray}[t]{lcccccc}
+$\begin{NiceArray}[t]{lcccccc}[no-cell-nodes]
\hline
n & 0 & 1 & 2 & 3 & 4 & 5 \\
u_n & 1 & 2 & 4 & 8 & 16 & 32 \\
@@ -428,7 +431,7 @@
\item an item
\smallskip
\item
-$\begin{NiceArray}[t]{lcccccc}
+$\begin{NiceArray}[t]{lcccccc}[no-cell-nodes]
\toprule
n & 0 & 1 & 2 & 3 & 4 & 5 \\
\midrule
@@ -461,7 +464,7 @@
\end{Code}
\begin{scope}
\NiceMatrixOptions{cell-space-limits=1pt}
-\raisebox{-5mm}{$A=\begin{pNiceArray}{cc|cc}[baseline=line-3]
+\raisebox{-5mm}{$A=\begin{pNiceArray}{cc|cc}[baseline=line-3,no-cell-nodes]
\dfrac{1}{A} & \dfrac{1}{B} & 0 & 0 \\
\dfrac{1}{C} & \dfrac{1}{D} & 0 & 0 \\
\hline
@@ -906,7 +909,7 @@
\bigskip
\begin{center}
-\begin{NiceTabular}{@{}c!{\qquad}ccc!{\qquad}ccc@{}}
+\begin{NiceTabular}{@{}c!{\qquad}ccc!{\qquad}ccc@{}}[no-cell-nodes]
\toprule
Rank & \Block[C]{1-3}{First group} & & & \Block{1-3}{Second group} \\
& 1A & 1B & 1C & 2A & 2B & 2C \\
@@ -919,18 +922,14 @@
\end{NiceTabular}
\end{center}
-
\bigskip
-\colorbox{yellow!50}{\bfseries New 6.28}\par\nobreak
-
-\smallskip
The command |\Block| supports also the keys |p| and |j|. With the key
\Definition{p}, the content of the block is formatted like a paragraph (as in a
column of type |p|). That key may be used in conjunction with the key: |l|, |c|
or |r|, and, in that case, the paragraph is formatted with |\raggedright|,
|\centering| or |\raggedleft| (or |\RaggedRight|, |\Centering| and |\RaggedLeft|
-when \pkg{ragged2e}) est chargée. With the key \Definition{j}, the paragraph is
-justified.
+when \pkg{ragged2e}) est chargée. With the key \Definition{j} (which inforces
+the key |p|), the paragraph is justified.
\subsection{Vertical position of the content of the block}
@@ -941,8 +940,9 @@
\begin{itemize}
-\item \index{v-center (key of \texttt{\textbackslash Block})}
-With the key \Definition{m}\footnote{That key has an alias: |v-center|.}, the content of the block is vertically centered.
+\item \index{v-center (key of \texttt{\textbackslash Block})} With the key
+\Definition{m}\footnote{That key has an alias: |v-center|.}, the content of the
+block is vertically centered.
\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
@@ -1062,10 +1062,10 @@
\index{ampersand-in-blocks}
\index{\&-in-blocks}
-\colorbox{yellow!50}{\bfseries New 6.28}\par\nobreak
-
+\medskip
The extension \pkg{nicematrix} provides the ability to use |\\| and |&| directly
-in the content of a block (in order to format its contents) but there is some rectrictions.
+in the content of a block (in order to format its contents) but there is some
+rectrictions.
\begin{itemize}
\item One must not use both |\\| and |&| in the same block.
@@ -1103,7 +1103,7 @@
\end{Code}
%
\begin{NiceTabular}{ll}%
- [hvlines,ampersand-in-blocks]
+ [hvlines,ampersand-in-blocks,no-cell-nodes]
& the five first naturels numbers \\
3 & \Block{}{one & two & three} \\
4 & \Block{}{one& two & three & four} \\
@@ -1112,7 +1112,8 @@
As we can see, the blocks (which was are in fact mono-cell blocks) are divided
-into sub-blocks of the same size. However, maybe the following code would be prefered.
+into sub-blocks of the \emph{same size}. However, maybe the following code would
+be prefered.
\medskip
\begin{Code}[width=90mm]
@@ -1127,7 +1128,7 @@
\end{Code}
%
\begin{NiceTabular}{lccccc}%
- [hvlines,ampersand-in-blocks]
+ [hvlines,ampersand-in-blocks,no-cell-nodes]
& \Block{1-5}{the five first natural numbers} \\
3 & \Block{1-5}{one & two & three} \\
4 & \Block{1-5}{one& two & three & four} \\
@@ -1200,7 +1201,7 @@
1 & 2 & 3 & 4 \\ \bottomrule
\end{NiceArray}$
\end{Code}
-$\begin{NiceArray}{c|ccc}
+$\begin{NiceArray}{c|ccc}[no-cell-nodes]
\toprule
a & b & c & d \\
\midrule
@@ -1267,7 +1268,7 @@
\end{Code}
\begin{scope}
\setlength{\arrayrulewidth}{2pt}
-\begin{NiceTabular}[c]{cccc}
+\begin{NiceTabular}[c]{cccc}[no-cell-nodes]
\hline
A&B&C&D \\ \cline{2}
A&B&C&D \\ \hline
@@ -1315,7 +1316,8 @@
\end{NiceTabular}
\end{Code}
\hspace{-5cm}
-\begin{NiceTabular}{|ccc|}[rules/color=[gray]{0.9},rules/width=1pt]
+\begin{NiceTabular}{|ccc|}%
+ [rules/color=[gray]{0.9},rules/width=1pt,no-cell-nodes]
\hline
rose & tulipe & lys \\
arum & iris & violette \\
@@ -1387,7 +1389,7 @@
\end{NiceTabular}
\end{Code}
%
-\begin{NiceTabular}{|c|[color=blue]c|}
+\begin{NiceTabular}{|c|[color=blue]c|}[no-cell-nodes]
\Hline
a & b \\
\Hline[color=red]
@@ -1421,7 +1423,7 @@
1 & 2 & 3 & 4 & 5 & 6
\end{pNiceMatrix}$
\end{Code}
-$\begin{pNiceMatrix}[vlines,rules/width=0.2pt]
+$\begin{pNiceMatrix}[vlines,rules/width=0.2pt,no-cell-nodes]
1 & 2 & 3 & 4 & 5 & 6 \\
1 & 2 & 3 & 4 & 5 & 6 \\
1 & 2 & 3 & 4 & 5 & 6
@@ -1443,7 +1445,7 @@
z & 0 & 0 & 0 & 0 & 0 \\
\end{NiceArray}$
\end{Code}
-$\begin{NiceArray}{c||ccccc}[hlines,vlines]
+$\begin{NiceArray}{c||ccccc}[hlines,vlines,no-cell-nodes]
& a & b & c & d & e \\ \Hline\Hline
x & 0 & 0 & 0 & 0 & 0 \\
y & 0 & 0 & 0 & 0 & 0 \\
@@ -1522,7 +1524,11 @@
$2\times2$), we have colored in blue the four (empty) corners of the array.
\end{minipage}\hspace{2cm}%
\begin{NiceTabular}
- [cell-space-top-limit=3pt,hvlines,rules={color=white,width=0.1pt}]
+ [cell-space-top-limit=3pt,
+ hvlines,
+ rules={color=white,width=0.1pt} ,
+ no-cell-nodes
+ ]
{*{6}{c}}
\CodeBefore
\rectanglecolor{blue!10}{1-1}{4-2}
@@ -1561,11 +1567,16 @@
A & A & A & A & A & A \\
A & A & A & A & A & A \\
& A & A & A \\
- & \Block{2-2}{B} & & A \\
+ & \Block[C]{2-2}{B} & & A \\
& & & A \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{*{6}{c}}[corners,hvlines,cell-space-top-limit=3pt]
+\begin{NiceTabular}{*{6}{c}}%
+ [
+ corners,
+ hvlines,
+ cell-space-top-limit=3pt
+ ]
& & & & A \\
& & A & A & A \\
& & & A \\
@@ -1573,7 +1584,7 @@
A & A & A & A & A & A \\
A & A & A & A & A & A \\
& A & A & A \\
- & \Block{2-2}{B} & & A \\
+ & \Block[C]{2-2}{B} & & A \\
& & & A \\
\end{NiceTabular}
@@ -1594,7 +1605,8 @@
& & & & &1
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{*{6}{c}}[c,corners=NE,hvlines,cell-space-top-limit=3pt]
+\begin{NiceTabular}{*{6}{c}}%
+ [c,corners=NE,hvlines,cell-space-top-limit=3pt]
1\\
1&1\\
1&2&1\\
@@ -1628,7 +1640,7 @@
c & c & b & a & e
\end{NiceArray}$
\end{Code}
-$\begin{NiceArray}{*{5}{c}}[hvlines]
+$\begin{NiceArray}{*{5}{c}}[hvlines,no-cell-nodes]
\diagbox{x}{y} & e & a & b & c \\
e & e & a & b & c \\
a & a & e & c & b \\
@@ -1649,7 +1661,7 @@
c & c & b & a & e
\end{NiceArray}$
\end{Code}
-$\begin{NiceArray}{*{5}{c}}[hvlines]
+$\begin{NiceArray}{*{5}{c}}[hvlines,no-cell-nodes]
\Block{2-2}{\diagbox{x}{y}} & & a & b & c \\
& & a & b & c \\
a & a & e & c & b \\
@@ -1671,7 +1683,7 @@
c & c & b & a & e
\end{NiceArray}$
\end{Code}
-$\begin{NiceArray}{*{5}{c}}[hvlines]
+$\begin{NiceArray}{*{5}{c}}[hvlines,no-cell-nodes]
\Block{2-2}{\diagbox{}{}} & y & a & b & c \\
x & & a & b & c \\
a & a & e & c & b \\
@@ -1770,7 +1782,7 @@
\begin{center}
-\begin{NiceTabular}{lcIcIc}[custom-line = {letter=I, color=blue}]
+\begin{NiceTabular}{lcIcIc}[custom-line = {letter=I, color=blue},no-cell-nodes]
\hline
& \Block{1-3}{dimensions} \\
& L & l & H \\
@@ -1878,7 +1890,7 @@
total-width = \pgflinewidth
}
}
-\begin{NiceTabular}{cIcIc}
+\begin{NiceTabular}{cIcIc}[no-cell-nodes]
one & two & three \\
four & five & six \\
seven & eight & nine
@@ -1901,10 +1913,10 @@
between cells of the matrix with |\Cdots|, |\Vdots|, etc. (cf. p.~\pageref{Cdots}).
In fact, \pkg{nicematrix} defines by default the commands
-\DefinitionCommand{hdottedline} and \DefinitionCommand{cdottedline} and the letter ``|:|'' for
-those dotted rules.\footnote{However, it's possible to overwrite those
- definitions with a |custom-line| (in order, for example, to switch to dashed
- lines).}
+\DefinitionCommand{hdottedline} and \DefinitionCommand{cdottedline} and the
+letter ``|:|'' for those dotted rules.\footnote{However, it's possible to
+ overwrite those definitions with a |custom-line| (in order, for example, to
+ switch to dashed lines).}
\smallskip
\begin{Code}
@@ -1933,7 +1945,7 @@
11 & 12 & 13 & 14 & 15
\end{pNiceMatrix}
\end{Code}
-$\begin{pNiceMatrix}
+$\begin{pNiceMatrix}[no-cell-nodes]
1 & 2 & 3 & 4 & 5 \\
\hdottedline
6 & 7 & 8 & 9 & 10 \\
@@ -1955,7 +1967,7 @@
11 & 12 & 13 & 14 & 15
\end{NiceArray}\right)
\end{Code}
-$\left(\begin{NiceArray}{cccc:c}
+$\left(\begin{NiceArray}{cccc:c}[no-cell-nodes]
1 & 2 & 3 & 4 & 5 \\
6 & 7 & 8 & 9 & 10 \\
11 & 12 & 13 & 14 & 15
@@ -1994,7 +2006,7 @@
priority to graphical element drawn posteriorly (which is in the spirit of the
``painting model'' of PostScript and PDF). Concerning this problem, MuPDF
(which is used, for instance, by SumatraPDF) gives better results than Adobe
-Reader).
+Reader.
\item A thin white line may appear between two cells of the same color. This
phenomenon occurs when each cell is colored with its own instruction |fill|
(the PostScript operator |fill| noted |f| in PDF). This is the case with
@@ -2004,7 +2016,7 @@
As for this phenomenon, Adobe Reader gives better results than MuPDF.
\end{itemize}
-The package \pkg{nicematrix} provides tools to avoid those problems.
+The package \pkg{nicematrix} provides tools to avoid both problems.
\end{itemize}
\subsection{The tools of nicematrix in the \textbackslash CodeBefore}
@@ -2124,7 +2136,7 @@
h & i & j \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccc}[hvlines]
+\begin{NiceTabular}{ccc}[hvlines,no-cell-nodes]
\CodeBefore
\cellcolor[HTML]{FFFF88}{3-1,2-2,-3}
\Body
@@ -2152,9 +2164,9 @@
h & i & j \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccc}[hvlines]
+\begin{NiceTabular}{ccc}[hvlines,no-cell-nodes]
\CodeBefore
- \rectanglecolor{blue!15}{2-2}{3-3}
+ \rectanglecolor{blue!15}{2-2}{3-3}
\Body
a & b & c \\
e & f & g \\
@@ -2187,9 +2199,9 @@
1 & -1 & 1
\end{pNiceMatrix}$
\end{Code}
-$\begin{pNiceMatrix}[r,baseline=1, margin]
+$\begin{pNiceMatrix}[r,baseline=1, margin,no-cell-nodes]
\CodeBefore
-\chessboardcolors{red!15}{blue!15}
+ \chessboardcolors{red!15}{blue!15}
\Body
1 & -1 & 1 \\
-1 & 1 & -1 \\
@@ -2229,9 +2241,9 @@
a_{10} & b_{10} & c_{10} \\
\end{NiceArray}$
\end{Code}
-$\begin{NiceArray}{lll}[baseline=4,hvlines]
+$\begin{NiceArray}{lll}[baseline=4,hvlines,no-cell-nodes]
\CodeBefore
-\rowcolor{red!15}{1,3-5,8-}
+ \rowcolor{red!15}{1,3-5,8-}
\Body
a_1 & b_1 & c_1 \\
a_2 & b_2 & c_2 \\
@@ -2307,7 +2319,7 @@
Madison & 15
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{clr}[hvlines,baseline=2]
+\begin{NiceTabular}{clr}[hvlines,baseline=2,no-cell-nodes]
\CodeBefore
\rowcolors[gray]{2}{0.8}{}[cols=2-3,restart]
\Body
@@ -2383,7 +2395,7 @@
Alexandra \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{c}
+\begin{NiceTabular}{c}[no-cell-nodes]
\CodeBefore
\rowlistcolors{1}{red!15,blue!15,green!15}
\Body
@@ -2427,7 +2439,7 @@
\end{NiceTabular}
\end{Code}
\hspace{-1cm}
-\begin{NiceTabular}{c}
+\begin{NiceTabular}{c}[no-cell-nodes]
\CodeBefore
\definecolorseries{BlueWhite}{rgb}{last}{blue}{white}
\resetcolorseries[\value{iRow}]{BlueWhite}
@@ -2466,7 +2478,8 @@
\end{NiceTabular}
\end{Code}
\hspace{-6cm}
-\begin{NiceTabular}{ccccccc}[corners=NE,margin,hvlines,first-row,first-col]
+\begin{NiceTabular}{ccccccc}%
+ [corners=NE,margin,hvlines,first-row,first-col]
\CodeBefore
\rowlistcolors{1}{blue!15, }
\Body
@@ -2512,7 +2525,8 @@
\end{NiceTabular}
\end{Code}
\hspace{-6cm}
-\begin{NiceTabular}{ccccccc}[corners=NE,margin,hvlines,first-row,first-col]
+\begin{NiceTabular}{ccccccc}%
+ [corners=NE,margin,hvlines,first-row,first-col]
\CodeBefore
\rowlistcolors{1}{blue!15, }
\columncolor{red!15}{0}
@@ -2559,7 +2573,7 @@
\emph{\bottomrule}
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}[c]{lSSSS}
+\begin{NiceTabular}[c]{lSSSS}[no-cell-nodes]
\CodeBefore
\rowcolor{red!15}{1-2}
\rowcolors{3}{blue!15}{}
@@ -2644,7 +2658,7 @@
\begin{center}
\NewDocumentCommand { \Blue } { } { \columncolor{blue!15} }
-\begin{NiceTabular}{>{\Blue}c>{\Blue}cc}
+\begin{NiceTabular}{>{\Blue}c>{\Blue}cc}[no-cell-nodes]
\toprule
\rowcolor{red!15}
Last name & First name & Birth day \\
@@ -2697,9 +2711,9 @@
\index{nocolor}
-The extension \pkg{nicematrix} provides the special color |nocolor| which may be
-used in all the coloring commands provided by \pkg{nicematrix} (in the
-|\CodeBefore| or the array itself).
+The extension \pkg{nicematrix} provides the special color \Definition{nocolor}
+which may be used in all the coloring commands provided by \pkg{nicematrix} (in
+the |\CodeBefore| or the array itself).
The cells marked by this color won't be colored, whatever the other instructions
of coloring which may apply to these cells.
@@ -2732,10 +2746,12 @@
\item \index{rowcolor (key of \texttt{\textbackslash RowStyle})}
\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
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.
+ support such instructions.} sets its opacity. If the key
+\Definition{rounded-corners} is used, that background will have rounded-corners.
\item
\index{color!key of \texttt{\textbackslash RowStyle}}
@@ -2763,7 +2779,7 @@
\end{NiceTabular}
\end{Code}
\index{rotate@\texttt{\textbackslash rotate}|textit}
-\begin{NiceTabular}{cccc}
+\begin{NiceTabular}{cccc}[no-cell-nodes]
\hline
\RowStyle[cell-space-limits=3pt]{\rotate}
first & second & third & fourth \\
@@ -2794,7 +2810,7 @@
Rio & Tokyo & Oslo
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{W{c}{2cm}cc}[hvlines]
+\begin{NiceTabular}{W{c}{2cm}cc}[hvlines,no-cell-nodes]
Paris & New York & Madrid \\
Berlin & London & Roma \\
Rio & Tokyo & Oslo
@@ -2815,7 +2831,7 @@
4 & 1 & 2
\end{pNiceMatrix}$
\end{Code}
-$\begin{pNiceMatrix}[columns-width = 1cm]
+$\begin{pNiceMatrix}[columns-width = 1cm,no-cell-nodes]
1 & 12 & -123 \\
12 & 0 & 0 \\
4 & 1 & 2
@@ -2828,11 +2844,11 @@
|\tabcolsep| or |\arraycolsep| equal to $0$~pt before the environment).
\bigskip
-It's possible to give the special value |auto| to the option |columns-width|:
-all the columns of the array will have a width equal to the widest cell of the
-array.\footnote{The result is achieved with only one compilation (but PGF/TikZ
-will have written informations in the |aux| file and a message requiring a
-second compilation will appear).}\par\nobreak
+It's possible to give the special value \Definition{auto} to the option
+|columns-width|: all the columns of the array will have a width equal to the
+widest cell of the array.\footnote{The result is achieved with only one
+ compilation (but PGF/TikZ will have written informations in the |aux| file and
+ a message requiring a second compilation will appear).}\par\nobreak
\medskip
\begin{Code}[width=10cm]
@@ -2842,7 +2858,7 @@
4 & 1 & 2
\end{pNiceMatrix}$
\end{Code}
-$\begin{pNiceMatrix}[columns-width = auto]
+$\begin{pNiceMatrix}[columns-width = auto,no-cell-nodes]
1 & 12 & -123 \\
12 & 0 & 0 \\
4 & 1 & 2
@@ -4042,7 +4058,8 @@
provided by LaTeX : |(|, |[|, |\{|, |\langle|, |\lgroup|, |\lfloor|, etc. but also
the null delimiter |.|;
\item the second argument is the upper-left corner of the submatrix with the
-syntax $i$|-|$j$ where $i$ the number of row and $j$ the number of column;
+syntax $i$|-|$j$ where $i$ the number of row and $j$ the number of column (the
+special word~|last| is allowed);
\item the third argument is the lower-right corner with the same syntax;
\item the fourth argument is the right delimiter;
\item the last argument, which is optional, is a list of \textsl{key=value}
@@ -4106,7 +4123,7 @@
\bigskip
In fact, the command |\SubMatrix| also takes in two optional arguments
specified by the traditional symbols |^| and |_| for material in superscript
-and subscript.
+and subscript (but no space is reserved for that material).
\medskip
\begin{scope}
@@ -4631,7 +4648,7 @@
\begin{center}
-\begin{NiceTabular}{@{}llr@{}}
+\begin{NiceTabular}{@{}llr@{}}[no-cell-nodes]
\toprule \RowStyle{\bfseries}
Last name & First name & Birth day \\
\midrule
@@ -4743,7 +4760,8 @@
note in the caption} ,
label = t:tabularnote ,
tabularnote = Some text before the notes. ,
- notes/bottomrule
+ notes/bottomrule ,
+ no-cell-nodes
]
\toprule
Last name & First name & Length of life \\
@@ -4991,7 +5009,7 @@
Jalon & Amandine & Physicist
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccc}[hvlines,rounded-corners]
+\begin{NiceTabular}{ccc}[hvlines,rounded-corners,no-cell-nodes]
\CodeBefore
\rowcolor{red!15}{1}
\Body
@@ -5023,7 +5041,7 @@
\emph{\CodeAfter \ShowCellNames}
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccc}[hvlines,cell-space-limits=3pt]
+\begin{NiceTabular}{ccc}[hvlines,cell-space-limits=3pt,no-cell-nodes]
\Block{2-2}{} & & test \\
& & blabla \\
& some text & nothing
@@ -5038,10 +5056,10 @@
If the package \pkg{siunitx} is loaded (before or after \pkg{nicematrix}),
it's possible to use the |S| column type of \pkg{siunitx} in the environments
-of \pkg{nicematrix}. The implementation doesn't use explicitly any private
-macro of \pkg{siunitx}.
+of \pkg{nicematrix}.
+
\medskip
\begin{Code}[width = 11cm]
$\begin{pNiceArray}{\emph{S}cW{c}{1cm}c}[nullify-dots,first-row]
@@ -5052,7 +5070,7 @@
7.2 & 0 & \Cdots & 0
\end{pNiceArray}$
\end{Code}
-$\begin{pNiceArray}{ScW{c}{1cm}c}[nullify-dots,first-row]
+$\begin{pNiceArray}{ScW{c}{1cm}c}[nullify-dots,first-row,no-cell-nodes]
{C_1} & \Cdots & & C_n \\
2.3 & 0 & \Cdots & 0 \\
12.4 & \Vdots & & \Vdots \\
@@ -5086,7 +5104,7 @@
\sin x & \cos x
\end{bNiceMatrix}$
\end{Code}
-$\begin{bNiceMatrix}[r]
+$\begin{bNiceMatrix}[r,no-cell-nodes]
\cos x & - \sin x \\
\sin x & \cos x
\end{bNiceMatrix}$
@@ -5126,7 +5144,7 @@
\NiceMatrixOptions%
{code-for-first-row = \scriptstyle\rotate \text{image of },
code-for-last-col = \scriptstyle }
-$ A = \begin{pNiceMatrix}[first-row,last-col=4]
+$ A = \begin{pNiceMatrix}[first-row,last-col=4,no-cell-nodes]
e_1 & e_2 & e_3 \\
1 & 2 & 3 & e_1 \\
4 & 5 & 6 & e_2 \\
@@ -5161,7 +5179,7 @@
\NiceMatrixOptions%
{code-for-last-row = \scriptstyle\rotate ,
code-for-last-col = \scriptstyle }%
-$A = \begin{pNiceMatrix}[last-row=4,last-col=4]
+$A = \begin{pNiceMatrix}[last-row=4,last-col=4,no-cell-nodes]
1 & 2 & 3 & e_1 \\
4 & 5 & 6 & e_2 \\
7 & 8 & 9 & e_3 \\
@@ -5194,7 +5212,7 @@
\bigskip
\begin{Code}
$\begin{bNiceArray}{cccc|c}[\emph{small},
- last-col,
+ last-col ,
code-for-last-col = \scriptscriptstyle,
columns-width = 3mm ]
1 & -2 & 3 & 4 & 5 \\
@@ -5203,9 +5221,14 @@
\end{bNiceArray}$
\end{Code}
%
-\[\begin{bNiceArray}{cccc|c}[small, last-col,
- code-for-last-col = \scriptscriptstyle,
- columns-width=3mm]
+\[\begin{bNiceArray}{cccc|c}%
+ [
+ small,
+ last-col ,
+ code-for-last-col = \scriptscriptstyle,
+ columns-width=3mm,
+ no-cell-nodes
+ ]
1 & -2 & 3 & 4 & 5 \\
0 & 3 & 2 & 1 & 2 & L_2 \gets 2 L_1 - L_2 \\
0 & 1 & 1 & 2 & 3 & L_3 \gets L_1 + L_3
@@ -5271,7 +5294,8 @@
$\begin{pNiceMatrix}[first-row,
first-col,
code-for-first-row = \mathbf{\alph{jCol}} ,
- code-for-first-col = \mathbf{\arabic{iRow}} ]
+ code-for-first-col = \mathbf{\arabic{iRow}} ,
+ no-cell-nodes]
& & & & \\
& 1 & 2 & 3 & 4 \\
& 5 & 6 & 7 & 8 \\
@@ -5336,7 +5360,7 @@
b \cos a+\cos b { 2 \cos b }
\end{bNiceMatrix}$
\end{Code}
-$\begin{bNiceMatrix}[light-syntax,first-row,first-col]
+$\begin{bNiceMatrix}[light-syntax,first-row,first-col,no-cell-nodes]
{} a b ;
a 2\cos a {\cos a + \cos b} ;
b \cos a+\cos b { 2 \cos b }
@@ -5416,7 +5440,7 @@
\end{\emph{NiceArrayWithDelims}}$
\end{Code}
$\begin{NiceArrayWithDelims}
- {\downarrow}{\uparrow}{ccc}[margin]
+ {\downarrow}{\uparrow}{ccc}[margin,no-cell-nodes]
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
@@ -5466,7 +5490,10 @@
\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.
+in order to speed up the compilations. But e 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.).
\medskip
The nodes of a document must have distinct names. That's why the names of the
@@ -5920,9 +5947,9 @@
also an alias called |last|.
\smallskip
-\colorbox{yellow!50}{\bfseries Modification 6.28}\enskip There are also nodes
-called $i$|.1|, $i$|.2|, $i$|.25|, $i$|.3|, $i$|.4|, $i$|.5|, $i$|.6|, $i$|.7|,
-$i$|.75|, $i$|.8| and $i$|.9| between the node~$i$ and the node~$i+1$.
+There are also nodes called $i$|.1|, $i$|.2|, $i$|.25|, $i$|.3|, $i$|.4|,
+$i$|.5|, $i$|.6|, $i$|.7|, $i$|.75|, $i$|.8| and $i$|.9| between the node~$i$
+and the node~$i+1$.
\smallskip
These nodes are available in the |\CodeBefore| and the |\CodeAfter|.
@@ -6330,6 +6357,18 @@
\index{Incompatibilities}
+There might be incompatibilities between \pkg{nicematrix} and \pkg{babel} with
+the language which activate (in the TeX sens) some characters, in particular
+the character |<|.
+
+Par exemple, for Spanish, it's recommended to deactivate the abreviations at
+load-time with the instruction:
+
+\begin{Code}
+\usepackage[spanish,es-noshorthands]{babel}
+\end{Code}
+
+\medskip
The extension \pkg{nicematrix} is usually not compatible with the classes and
packages that redefine the environments |{tabular}| and |{array}|. In
particular, it's the case of the class |socg-lipics-v2021|. However, in that
@@ -6467,7 +6506,7 @@
\begin{center}
\ttfamily \small
-\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt,rounded-corners]
+\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt,rounded-corners,no-cell-nodes]
\Block[tikz={pattern=grid,pattern color=lightgray}]{}
{pattern = grid,\\ pattern color = lightgray}
& \Block[tikz={pattern = north west lines,pattern color=blue}]{}
@@ -6695,7 +6734,7 @@
\end{Code}
\begin{center}
-\begin{NiceTabular}{@{}llr@{}}
+\begin{NiceTabular}{@{}llr@{}}[no-cell-nodes]
\toprule \RowStyle{\bfseries}
Last name & First name & Birth day \\
\midrule
Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx 2025-01-20 21:25:50 UTC (rev 73530)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx 2025-01-20 21:26:05 UTC (rev 73531)
@@ -2,7 +2,7 @@
%
% This file should be compiled with $lualatex$.
%
-% Copyright (C) 2018-2024 by F. Pantigny
+% Copyright (C) 2018-2025 by F. Pantigny
% ------------------------------------------
%
% This file may be distributed and/or modified under the
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{7.0a}
-\def\myfiledate{2024/12/16}
+\def\myfileversion{7.0b}
+\def\myfiledate{2025/01/20}
%
%
%<*batchfile>
@@ -29,7 +29,7 @@
\preamble
-Copyright (C) 2018-2024 by F. Pantigny
+Copyright (C) 2018-2025 by F. Pantigny
-----------------------------------
This file may be distributed and/or modified under the
@@ -899,7 +899,6 @@
\bool_new:N \g_@@_rotate_bool
% \end{macrocode}
%
-%
% \bigskip
% The following boolean will be raise then the command |\rotate| is used with
% the key |c|.
@@ -909,14 +908,21 @@
%
% \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.
+% type |X| thanks to that flag (the |X| columns of \pkg{nicematrix} are inspired
+% by those of \pkg{tabularx}).
% \begin{macrocode}
\bool_new:N \l_@@_X_bool
% \end{macrocode}
-%
+%
% \begin{macrocode}
\bool_new:N \g_@@_caption_finished_bool
% \end{macrocode}
+%
+% \bigskip
+% The following boolean will be raised when the key |no-cell-nodes| is used.
+% \begin{macrocode}
+\bool_new:N \l_@@_no_cell_nodes_bool
+% \end{macrocode}
%
% \bigskip
% We will write in |\g_@@_aux_tl| all the instructions that we have to write on
@@ -1260,6 +1266,18 @@
% draw the rules (which respect the blocks).
%
% \bigskip
+% In the |\CodeBefore|, the value of |\g_@@_pos_of_blocks_seq| will be the value
+% read in the |aux| file from a previous run. However, in the |\CodeBefore|, the
+% commands |\EmptyColumn| and |\EmptyRow| will write virtual positions of blocks
+% in the following sequence.
+% \begin{macrocode}
+\seq_new:N \g_@@_future_pos_of_blocks_seq
+% \end{macrocode}
+% The, after the execution of the |\CodeBefore|, the sequence
+% |\g_@@_pos_of_blocs_seq| will erased and replaced by the value of
+% |\g_@@_future_pos_of_blocks_seq|.
+%
+% \bigskip
% We will also manage a sequence for the positions of the dotted lines. These
% dotted lines are created in the array by |\Cdots|, |\Vdots|, |\Ddots|, etc.
% However, their positions, that is to say, their extremities, will be
@@ -1598,7 +1616,7 @@
%
% \medskip
% \begin{macrocode}
-\cs_set_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.
@@ -2464,6 +2482,7 @@
ampersand-in-blocks .default:n = true ,
&-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:
{ \box_use_drop:N \l_@@_cell_box } ,
no-cell-nodes .value_forbidden:n = true ,
@@ -2579,7 +2598,7 @@
% \begin{macrocode}
\keys_define:nn { nicematrix / environments }
{
- corners .clist_set:N = \l_@@_corners_clist ,
+ corners .clist_set:N = \l_@@_corners_clist ,
corners .default:n = { NW , SW , NE , SE } ,
code-before .code:n =
{
@@ -3266,10 +3285,10 @@
{ \box_use_drop:N \l_@@_cell_box }
{
\bool_if:NTF \g_@@_not_empty_cell_bool
- \@@_node_for_cell:
+ \@@_print_node_cell:
{
\dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > \c_zero_dim
- \@@_node_for_cell:
+ \@@_print_node_cell:
{ \box_use_drop:N \l_@@_cell_box }
}
}
@@ -3324,8 +3343,32 @@
% \end{macrocode}
%
% \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
+% 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.
+% \begin{macrocode}
+\socket_new:nn { nicematrix / siunitx-wrap } { 1 }
+\socket_new_plug:nnn { nicematrix / siunitx-wrap } { active }
+ {
+ \use:c
+ {
+ __siunitx_table_align_
+ \bool_if:NTF \l__siunitx_table_text_bool
+ \l__siunitx_table_align_text_tl
+ \l__siunitx_table_align_number_tl
+ :n
+ }
+ { #1 }
+ }
+\cs_new_protected:Npn \@@_print_node_cell:
+ { \socket_use:nn { nicematrix / siunitx-wrap } { \@@_node_for_cell: } }
+% \end{macrocode}
+%
+% \bigskip
% The following command creates the \textsc{pgf} name of the node with, of
-% course, |\l_@@_cell_box| as the content.
+% course, |\l_@@_cell_box| as the content.
% \begin{macrocode}
\cs_new_protected:Npn \@@_node_for_cell:
{
@@ -3814,6 +3857,9 @@
\cs_set_eq:NN \CodeAfter \@@_CodeAfter:
\cs_set_eq:NN \diagbox \@@_diagbox:nn
\cs_set_eq:NN \NotEmpty \@@_NotEmpty:
+ \cs_set_eq:NN \TopRule \@@_TopRule
+ \cs_set_eq:NN \MidRule \@@_MidRule
+ \cs_set_eq:NN \BottomRule \@@_BottomRule
\cs_set_eq:NN \RowStyle \@@_RowStyle:n
\seq_map_inline:Nn \l_@@_custom_line_commands_seq
{ \cs_set_eq:cc { ##1 } { nicematrix - ##1 } }
@@ -3986,7 +4032,7 @@
% that variable because it will be reconstructed during the creation of the
% array.
% \begin{macrocode}
- \seq_gclear:N \g_@@_pos_of_blocks_seq
+ \seq_gset_eq:NN \g_@@_pos_of_blocks_seq \g_@@_future_pos_of_blocks_seq
% \end{macrocode}
% Idem for other sequences written on the |aux| file.
% \begin{macrocode}
@@ -4185,6 +4231,8 @@
\cs_set_eq:NN \SubMatrix \@@_SubMatrix_in_code_before
\cs_set_eq:NN \ShowCellNames \@@_ShowCellNames
\cs_set_eq:NN \TikzEveryCell \@@_TikzEveryCell
+ \cs_set_eq:NN \EmptyColumn \@@_EmptyColumn:n
+ \cs_set_eq:NN \EmptyRow \@@_EmptyRow:n
}
% \end{macrocode}
%
@@ -5056,7 +5104,7 @@
\tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl
\tl_gclear:N \g_@@_pre_cell_tl
\tl_gput_right:Nn \g_@@_array_preamble_tl
- { > \@@_cell_begin: c < \@@_cell_end: }
+ { > \@@_cell_begin: c < \@@_cell_end: }
% \end{macrocode}
%
% We increment the counter of columns and then we test for the presence of a |<|.
@@ -5370,10 +5418,7 @@
\tl_gput_right:Nn \g_@@_array_preamble_tl
{ > \@@_test_if_empty_for_S: }
}
- {
- \tl_gput_right:Nn \g_@@_array_preamble_tl
- { > \@@_test_if_empty: }
- }
+ { \tl_gput_right:Nn \g_@@_array_preamble_tl { > \@@_test_if_empty: } }
\tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl
\tl_gclear:N \g_@@_pre_cell_tl
\tl_gput_right:Nn \g_@@_array_preamble_tl
@@ -5449,23 +5494,35 @@
% \begin{macrocode}
\group_align_safe_begin:
\peek_meaning:NTF &
+ \@@_the_cell_is_empty:
{
- \group_align_safe_end:
- \tl_gput_right:Nn \g_@@_cell_after_hook_tl
+ \peek_meaning:NTF \\
+ \@@_the_cell_is_empty:
{
+ \peek_meaning:NTF \crcr
+ \@@_the_cell_is_empty:
+ \group_align_safe_end:
+ }
+ }
+ }
% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_the_cell_is_empty:
+ {
+ \group_align_safe_end:
+ \tl_gput_right:Nn \g_@@_cell_after_hook_tl
+ {
+% \end{macrocode}
% Be careful: here, we can't merely use
% |\bool_gset_true: \g_@@_empty_cell_bool|,
% in particular because of the columns of type~|X|.
% \begin{macrocode}
- \box_set_wd:Nn \l_@@_cell_box \c_zero_dim
- \skip_horizontal:N \l_@@_col_width_dim
- }
+ \box_set_wd:Nn \l_@@_cell_box \c_zero_dim
+ \skip_horizontal:N \l_@@_col_width_dim
}
- { \group_align_safe_end: }
}
% \end{macrocode}
-%
%
% \begin{macrocode}
\cs_new_protected:Npn \@@_test_if_empty_for_S:
@@ -5669,12 +5726,39 @@
\tl_gput_right:Nn \g_@@_array_preamble_tl
{
> {
+% \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
+% (\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).
+% \begin{macrocode}
+ \socket_assign_plug:nn { nicematrix / siunitx-wrap } { active }
+ \keys_set:nn { siunitx } { #1 }
\@@_cell_begin:
- \keys_set:nn { siunitx } { #1 }
\siunitx_cell_begin:w
}
c
- < { \siunitx_cell_end: \@@_cell_end: }
+ <
+ {
+ \siunitx_cell_end:
+% \end{macrocode}
+% We want the value of |\l__siunitx_table_text_bool| available \emph{after}
+% |\@@_cell_end:| because we need it to know how to align our box after the
+% construction of the PGF/TikZ node. That's why we use
+% |\g_@@_cell_after_hook_tl| to reset the correct value of
+% |\l__siunitx_table_text_bool| (of course, if will stay local within the cell
+% of the underlying |\halign|).
+% \begin{macrocode}
+ \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
+ \l__siunitx_table_text_bool
+ }
+ \@@_cell_end:
+ }
}
% \end{macrocode}
% We increment the counter of columns and then we test for the presence of a |<|.
@@ -6048,7 +6132,10 @@
{ \@@_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 }
% \end{macrocode}
%
% \bigskip
@@ -7814,7 +7901,12 @@
% in |\l_@@_corners_cells_clist| which will contain all the cells which are empty
% (and not in a block) considered in the corners of the array.
% \begin{macrocode}
- \clist_if_empty:NF \l_@@_corners_clist \@@_compute_corners:
+ \clist_if_empty:NF \l_@@_corners_clist
+ {
+ \bool_if:NTF \l_@@_no_cell_nodes_bool
+ { \@@_error:n { corners~with~no-cell-nodes } }
+ { \@@_compute_corners: }
+ }
% \end{macrocode}
%
% \bigskip
@@ -7859,7 +7951,7 @@
% When |light-syntax| is used, we insert systematically a |\CodeAfter| in the
% flow. Thus, it's possible to have two instructions |\CodeAfter| and the second
% may be in |\g_nicematrix_code_after_tl|. That's why we set
-% |\Code-after| to be \textsl{no-op} now.
+% |\CodeAfter| to be \textsl{no-op} now.
% \begin{macrocode}
\cs_set_eq:NN \CodeAfter \prg_do_nothing:
% \end{macrocode}
@@ -7972,12 +8064,12 @@
{ #1 }
{ #2 }
{
- \int_compare:nNnTF { #3 } > { 99 }
+ \int_compare:nNnTF { #3 } > { 98 }
{ \int_use:N \c at iRow }
{ #3 }
}
{
- \int_compare:nNnTF { #4 } > { 99 }
+ \int_compare:nNnTF { #4 } > { 98 }
{ \int_use:N \c at jCol }
{ #4 }
}
@@ -10902,6 +10994,8 @@
\str_if_eq:eeT \l_tmpa_tl { * }
{ \cs_set_nopar:Npn \l_tmpa_tl { 1 } }
}
+ \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 } }
{
@@ -10941,6 +11035,8 @@
\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
+ { \@@_error:n { Invalid~row~number } }
\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}
@@ -11272,6 +11368,31 @@
{ \cs_new_protected:Npn \@@_revert_colortbl: { } }
}
% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_EmptyColumn:n #1
+ {
+ \clist_map_inline:nn { #1 }
+ {
+ \seq_gput_right:Nn \g_@@_future_pos_of_blocks_seq
+ { { -2 } { #1 } { 98 } { ##1 } { } } % 98 and not 99 !
+ \columncolor { nocolor } { ##1 }
+ }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_EmptyRow:n #1
+ {
+ \clist_map_inline:nn { #1 }
+ {
+ \seq_gput_right:Nn \g_@@_future_pos_of_blocks_seq
+ { { ##1 } { -2 } { ##1 } { 98 } { } } % 98 and not 99 !
+ \rowcolor { nocolor } { ##1 }
+ }
+ }
+% \end{macrocode}
%
% \bigskip
% \section{The vertical and horizontal rules}
@@ -11339,7 +11460,140 @@
% |\l_@@_last_row_int| may be equal to $-2$ or $-1$ (we can't write
% |\int_compare:nNnT \c at iRow < \l_@@_last_row_int|).
%
+% \bigskip
+% The following command will be used for |\Toprule|, |\BottomRule| and |\MidRule|.
+% \begin{macrocode}
+\cs_new:Npn \@@_tikz_booktabs_loaded:nn #1 #2
+ {
+ \IfPackageLoadedTF { tikz }
+ {
+ \IfPackageLoadedTF { booktabs }
+ { #2 }
+ { \@@_error:nn { TopRule~without~booktabs } { #1 } }
+ }
+ { \@@_error:nn { TopRule~without~tikz } { #1 } }
+ }
+% \end{macrocode}
%
+% \begin{macrocode}
+\NewExpandableDocumentCommand { \@@_TopRule } { }
+ { \@@_tikz_booktabs_loaded:nn \TopRule \@@_TopRule_i: }
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+\cs_new:Npn \@@_TopRule_i:
+ {
+ \noalign \bgroup
+ \peek_meaning:NTF [
+ { \@@_TopRule_ii: }
+ { \@@_TopRule_ii: [ \dim_use:N \heavyrulewidth ] }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \@@_TopRule_ii: { o }
+ {
+ \tl_gput_right:Ne \g_@@_pre_code_after_tl
+ {
+ \@@_hline:n
+ {
+ position = \int_eval:n { \c at iRow + 1 } ,
+ tikz =
+ {
+ line~width = #1 ,
+ yshift = 0.25 \arrayrulewidth ,
+ shorten~< = - 0.5 \arrayrulewidth
+ } ,
+ total-width = #1
+ }
+ }
+ \skip_vertical:n { \belowrulesep + #1 }
+ \egroup
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewExpandableDocumentCommand { \@@_BottomRule } { }
+ { \@@_tikz_booktabs_loaded:nn \BottomRule \@@_BottomRule_i: }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new:Npn \@@_BottomRule_i:
+ {
+ \noalign \bgroup
+ \peek_meaning:NTF [
+ { \@@_BottomRule_ii: }
+ { \@@_BottomRule_ii: [ \dim_use:N \heavyrulewidth ] }
+ }
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+\NewDocumentCommand \@@_BottomRule_ii: { o }
+ {
+ \tl_gput_right:Ne \g_@@_pre_code_after_tl
+ {
+ \@@_hline:n
+ {
+ position = \int_eval:n { \c at iRow + 1 } ,
+ tikz =
+ {
+ line~width = #1 ,
+ yshift = 0.25 \arrayrulewidth ,
+ shorten~< = - 0.5 \arrayrulewidth
+ } ,
+ total-width = #1 ,
+ }
+ }
+ \skip_vertical:N \aboverulesep
+ \@@_create_row_node_i:
+ \skip_vertical:n { #1 }
+ \egroup
+ }
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+\NewExpandableDocumentCommand { \@@_MidRule } { }
+ { \@@_tikz_booktabs_loaded:nn \MidRule \@@_MidRule_i: }
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+\cs_new:Npn \@@_MidRule_i:
+ {
+ \noalign \bgroup
+ \peek_meaning:NTF [
+ { \@@_MidRule_ii: }
+ { \@@_MidRule_ii: [ \dim_use:N \lightrulewidth ] }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \@@_MidRule_ii: { o }
+ {
+ \skip_vertical:N \aboverulesep
+ \@@_create_row_node_i:
+ \tl_gput_right:Ne \g_@@_pre_code_after_tl
+ {
+ \@@_hline:n
+ {
+ position = \int_eval:n { \c at iRow + 1 } ,
+ tikz =
+ {
+ line~width = #1 ,
+ yshift = 0.25 \arrayrulewidth ,
+ shorten~< = - 0.5 \arrayrulewidth
+ } ,
+ total-width = #1 ,
+ }
+ }
+ \skip_vertical:n { \belowrulesep + #1 }
+ \egroup
+ }
+% \end{macrocode}
+%
% \bigskip
% \subsubsection*{General system for drawing rules}
%
@@ -12011,9 +12265,9 @@
{
\peek_remove_spaces:n
{
- \peek_meaning:NTF \Hline
- { \@@_Hline_ii:nn { #1 + 1 } }
- { \@@_Hline_iii:n { #1 } }
+ \peek_meaning:NTF \Hline
+ { \@@_Hline_ii:nn { #1 + 1 } }
+ { \@@_Hline_iii:n { #1 } }
}
}
% \end{macrocode}
@@ -12029,7 +12283,7 @@
%
%
% \begin{macrocode}
-\cs_set:Npn \@@_Hline_iv:nn #1 #2
+\cs_set_protected:Npn \@@_Hline_iv:nn #1 #2
{
\@@_compute_rule_width:n { multiplicity = #1 , #2 }
\skip_vertical:N \l_@@_rule_width_dim
@@ -12697,11 +12951,22 @@
{
\bool_if:nTF \l_@@_medium_nodes_bool
{
- \bool_if:NTF \l_@@_large_nodes_bool
- \@@_create_medium_and_large_nodes:
- \@@_create_medium_nodes:
+ \bool_if:NTF \l_@@_no_cell_nodes_bool
+ { \@@_error:n { extra-nodes~with~no-cell-nodes } }
+ {
+ \bool_if:NTF \l_@@_large_nodes_bool
+ \@@_create_medium_and_large_nodes:
+ \@@_create_medium_nodes:
+ }
}
- { \bool_if:NT \l_@@_large_nodes_bool \@@_create_large_nodes: }
+ {
+ \bool_if:NT \l_@@_large_nodes_bool
+ {
+ \bool_if:NTF \l_@@_no_cell_nodes_bool
+ { \@@_error:n { extra-nodes~with~no-cell-nodes } }
+ \@@_create_large_nodes:
+ }
+ }
}
% \end{macrocode}
%
@@ -13665,11 +13930,10 @@
{
\l_tmpa_tl
{ \exp_not:n { #3 } }
- {
- \group_begin:
- \exp_not:n { #4 #5 }
- \group_end:
- }
+% \end{macrocode}
+% Here, the curly braces for the group are mandatory.
+% \begin{macrocode}
+ { { \exp_not:n { #4 #5 } } }
}
}
% \end{macrocode}
@@ -13676,7 +13940,7 @@
%
%
% \bigskip
-% The following macro is for the case of a |\Block| which uses the key~|p|.
+% 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
@@ -13796,7 +14060,6 @@
% \end{macrocode}
%
% \begin{macrocode}
-\cs_generate_variant:Nn \@@_Block_v:nnnnnn { n n e e }
\cs_new_protected:Npn \@@_Block_iv:nnnnnn #1 #2 #3 #4 #5 #6
{
% \end{macrocode}
@@ -13809,18 +14072,22 @@
%
% We remind that the first mandatory argument of the command |\Block| is the
% size of the block with the special format $i$|-|$j$. However, the user is
-% allowed to omit $i$ or $j$ (or both). This will be interpreted as: the last
-% row (resp. column) of the block will be the last row (resp. column) of the
-% block (without the potential exterior row---resp. column---of the array). By
-% convention, this is stored in |\g_@@_blocks_seq| as a number of rows (resp.
-% columns) for the block equal to 100. That's what we detect now.
+% allowed to omit $i$ or $j$ (or both). This will be interpreted as follows: the
+% last row (resp. column) of the block will be the last row (resp. column) of
+% the block (without the potential exterior row---resp. column---of the array).
+% By convention, this is stored in |\g_@@_blocks_seq| as a number of rows (resp.
+% columns) for the block equal to 100. That's what we detect now (we write 98
+% for the case the the command |\Block| has been issued in the ``first row'').
% \begin{macrocode}
- \int_compare:nNnTF { #3 } > { 99 }
+ \int_compare:nNnTF { #3 } > { 98 }
{ \int_set_eq:NN \l_@@_last_row_int \c at iRow }
{ \int_set:Nn \l_@@_last_row_int { #3 } }
- \int_compare:nNnTF { #4 } > { 99 }
+ \int_compare:nNnTF { #4 } > { 98 }
{ \int_set_eq:NN \l_@@_last_col_int \c at jCol }
{ \int_set:Nn \l_@@_last_col_int { #4 } }
+% \end{macrocode}
+%
+% \begin{macrocode}
\int_compare:nNnTF \l_@@_last_col_int > \g_@@_col_total_int
{
\bool_lazy_and:nnTF
@@ -13862,6 +14129,7 @@
% |#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}
@@ -16360,6 +16628,14 @@
%
%
% \begin{macrocode}
+\@@_msg_new:nn { no-test-for-array }
+ {
+ The~key~'no-test-for-array'~has~been~deprecated~and~will~be~
+ deleted~in~a~future~version~of~nicematrix.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
\keys_define:nn { nicematrix / Package }
{
renew-dots .bool_set:N = \l_@@_renew_dots_bool ,
@@ -16370,10 +16646,10 @@
footnote .bool_set:N = \g_@@_footnote_bool ,
footnotehyper .bool_set:N = \g_@@_footnotehyper_bool ,
% \end{macrocode}
-% The test for a potential modification of \pkg{array} has been deleted. You
+% The test for a potential modification of \pkg{array} has been deleted. We
% keep the following key only for compatibility but maybe we will delete it.
% \begin{macrocode}
- no-test-for-array .code:n = \prg_do_nothing: ,
+ no-test-for-array .code:n = \@@_warning:n { no-test-for-array } ,
unknown .code:n = \@@_error:n { Unknown~key~for~package }
}
\ProcessKeysOptions { nicematrix / Package }
@@ -16595,8 +16871,10 @@
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\
- ~(plus~the~potential~exterior~ones).~
+ \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 }
+ { ~(plus~the~exterior~ones) }.~
This~error~is~fatal.
}
% \end{macrocode}
@@ -16653,11 +16931,29 @@
% \begin{macrocode}
\@@_msg_new:nn { in~last~row }
{
+ Erroneous~use.\\
You~can't~use~the~command~#1 in~the~last~row~(exterior)~of~the~array.\\
That~command~will~be~ignored.
}
% \end{macrocode}
%
+% \begin{macrocode}
+\@@_msg_new:nn { TopRule~without~booktabs }
+ {
+ Erroneous~use.\\
+ You~can't~use~the~command~ #1 because~'booktabs'~is~not~loaded.\\
+ That~command~will~be~ignored.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@@_msg_new:nn { TopRule~without~tikz }
+ {
+ Erroneous~use.\\
+ You~can't~use~the~command~ #1 because~'tikz'~is~not~loaded.\\
+ That~command~will~be~ignored.
+ }
+% \end{macrocode}
%
% \begin{macrocode}
\@@_msg_new:nn { caption~outside~float }
@@ -16704,6 +17000,26 @@
% \end{macrocode}
%
% \begin{macrocode}
+\@@_msg_new:nn { corners~with~no-cell-nodes }
+ {
+ Incompatible~keys.\\
+ You~can't~use~the~key~'corners'~here~because~the~key~'no-cell-nodes'~
+ is~in~force.\\
+ If~you~go~on,~that~key~will~be~ignored.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@@_msg_new:nn { extra-nodes~with~no-cell-nodes }
+ {
+ Incompatible~keys.\\
+ You~can't~create~'extra~nodes'~here~because~the~key~'no-cell-nodes'~
+ is~in~force.\\
+ If~you~go~on,~those~extra~nodes~won't~be~created.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
\@@_msg_new:nn { Identical~notes~in~caption }
{
Identical~tabular~notes.\\
@@ -17778,7 +18094,25 @@
This~error~is~fatal.
}
% \end{macrocode}
+%
+% \begin{macrocode}
+\@@_msg_new:nn { Invalid~col~number }
+ {
+ Invalid~column~number.\\
+ A~color~instruction~the~\token_to_str:N \CodeBefore\
+ specifies~a~column~which~is~outside~the~array.~It~will~be~ignored.
+ }
+% \end{macrocode}
%
+% \begin{macrocode}
+\@@_msg_new:nn { Invalid~row~number }
+ {
+ Invalid~row~number.\\
+ A~color~instruction~the~\token_to_str:N \CodeBefore\
+ specifies~a~row~which~is~outside~the~array.~It~will~be~ignored.
+ }
+% \end{macrocode}
+%
% \newpage
% \tableofcontents
%
Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins 2025-01-20 21:25:50 UTC (rev 73530)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins 2025-01-20 21:26:05 UTC (rev 73531)
@@ -1,5 +1,5 @@
%%
-%% Copyright (C) 2018-2024 by F. Pantigny
+%% Copyright (C) 2018-2025 by F. Pantigny
%%
%%
%% This file may be distributed and/or modified under the
@@ -17,7 +17,7 @@
\usedir{tex/latex/nicematrix}
\preamble
-Copyright (C) 2018-2024 by F. Pantigny
+Copyright (C) 2018-2025 by F. Pantigny
This file may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty 2025-01-20 21:25:50 UTC (rev 73530)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty 2025-01-20 21:26:05 UTC (rev 73531)
@@ -6,7 +6,7 @@
%%
%% nicematrix-code.dtx (with options: `package')
%%
-%% Copyright (C) 2018-2024 by F. Pantigny
+%% Copyright (C) 2018-2025 by F. Pantigny
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -18,8 +18,8 @@
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%%
-\def\myfileversion{7.0a}
-\def\myfiledate{2024/12/16}
+\def\myfileversion{7.0b}
+\def\myfiledate{2025/01/20}
\RequirePackage{pgfcore}
\usepgfmodule{shapes}
\RequirePackage{l3keys2e}
@@ -335,6 +335,7 @@
\bool_new:N \g__nicematrix_rotate_c_bool
\bool_new:N \l__nicematrix_X_bool
\bool_new:N \g__nicematrix_caption_finished_bool
+\bool_new:N \l__nicematrix_no_cell_nodes_bool
\tl_new:N \g__nicematrix_aux_tl
\bool_new:N \g__nicematrix_aux_found_bool
\seq_new:N \g__nicematrix_size_seq
@@ -408,6 +409,7 @@
\dim_new:N \g__nicematrix_width_first_col_dim
\seq_new:N \g__nicematrix_blocks_seq
\seq_new:N \g__nicematrix_pos_of_blocks_seq
+\seq_new:N \g__nicematrix_future_pos_of_blocks_seq
\seq_new:N \g__nicematrix_pos_of_xdots_seq
\seq_new:N \g__nicematrix_pos_of_stroken_blocks_seq
\clist_new:N \l__nicematrix_corners_cells_clist
@@ -468,7 +470,7 @@
\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_set_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 }
@@ -828,6 +830,7 @@
ampersand-in-blocks .default:n = true ,
&-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:
{ \box_use_drop:N \l__nicematrix_cell_box } ,
no-cell-nodes .value_forbidden:n = true ,
@@ -1311,10 +1314,10 @@
{ \box_use_drop:N \l__nicematrix_cell_box }
{
\bool_if:NTF \g__nicematrix_not_empty_cell_bool
- \__nicematrix_node_for_cell:
+ \__nicematrix_print_node_cell:
{
\dim_compare:nNnTF { \box_wd:N \l__nicematrix_cell_box } > \c_zero_dim
- \__nicematrix_node_for_cell:
+ \__nicematrix_print_node_cell:
{ \box_use_drop:N \l__nicematrix_cell_box }
}
}
@@ -1350,6 +1353,21 @@
minimum~width = \c_zero_dim
}
}
+\socket_new:nn { nicematrix / siunitx-wrap } { 1 }
+\socket_new_plug:nnn { nicematrix / siunitx-wrap } { active }
+ {
+ \use:c
+ {
+ __siunitx_table_align_
+ \bool_if:NTF \l__siunitx_table_text_bool
+ \l__siunitx_table_align_text_tl
+ \l__siunitx_table_align_number_tl
+ :n
+ }
+ { #1 }
+ }
+\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:
{
\pgfpicture
@@ -1608,6 +1626,9 @@
\cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter:
\cs_set_eq:NN \diagbox \__nicematrix_diagbox:nn
\cs_set_eq:NN \NotEmpty \__nicematrix_NotEmpty:
+ \cs_set_eq:NN \TopRule \__nicematrix_TopRule
+ \cs_set_eq:NN \MidRule \__nicematrix_MidRule
+ \cs_set_eq:NN \BottomRule \__nicematrix_BottomRule
\cs_set_eq:NN \RowStyle \__nicematrix_RowStyle:n
\seq_map_inline:Nn \l__nicematrix_custom_line_commands_seq
{ \cs_set_eq:cc { ##1 } { nicematrix - ##1 } }
@@ -1678,7 +1699,7 @@
\seq_gclear:N \g__nicematrix_cols_vlism_seq
\seq_gclear:N \g__nicematrix_submatrix_seq
\bool_if:NT \l__nicematrix_code_before_bool \__nicematrix_exec_code_before:
- \seq_gclear:N \g__nicematrix_pos_of_blocks_seq
+ \seq_gset_eq:NN \g__nicematrix_pos_of_blocks_seq \g__nicematrix_future_pos_of_blocks_seq
\seq_gclear_new:N \g__nicematrix_multicolumn_cells_seq
\seq_gclear_new:N \g__nicematrix_multicolumn_sizes_seq
\int_gset:Nn \g__nicematrix_last_row_node_int { -2 }
@@ -1764,6 +1785,8 @@
\cs_set_eq:NN \SubMatrix \__nicematrix_SubMatrix_in_code_before
\cs_set_eq:NN \ShowCellNames \__nicematrix_ShowCellNames
\cs_set_eq:NN \TikzEveryCell \__nicematrix_TikzEveryCell
+ \cs_set_eq:NN \EmptyColumn \__nicematrix_EmptyColumn:n
+ \cs_set_eq:NN \EmptyRow \__nicematrix_EmptyRow:n
}
\cs_new_protected:Npn \__nicematrix_exec_code_before:
{
@@ -2400,10 +2423,7 @@
\tl_gput_right:Nn \g__nicematrix_array_preamble_tl
{ > \__nicematrix_test_if_empty_for_S: }
}
- {
- \tl_gput_right:Nn \g__nicematrix_array_preamble_tl
- { > \__nicematrix_test_if_empty: }
- }
+ { \tl_gput_right:Nn \g__nicematrix_array_preamble_tl { > \__nicematrix_test_if_empty: } }
\tl_gput_right:No \g__nicematrix_array_preamble_tl \g__nicematrix_pre_cell_tl
\tl_gclear:N \g__nicematrix_pre_cell_tl
\tl_gput_right:Nn \g__nicematrix_array_preamble_tl
@@ -2440,16 +2460,26 @@
{
\group_align_safe_begin:
\peek_meaning:NTF &
+ \__nicematrix_the_cell_is_empty:
{
- \group_align_safe_end:
- \tl_gput_right:Nn \g__nicematrix_cell_after_hook_tl
+ \peek_meaning:NTF \\
+ \__nicematrix_the_cell_is_empty:
{
- \box_set_wd:Nn \l__nicematrix_cell_box \c_zero_dim
- \skip_horizontal:N \l__nicematrix_col_width_dim
+ \peek_meaning:NTF \crcr
+ \__nicematrix_the_cell_is_empty:
+ \group_align_safe_end:
}
}
- { \group_align_safe_end: }
}
+\cs_new_protected:Npn \__nicematrix_the_cell_is_empty:
+ {
+ \group_align_safe_end:
+ \tl_gput_right:Nn \g__nicematrix_cell_after_hook_tl
+ {
+ \box_set_wd:Nn \l__nicematrix_cell_box \c_zero_dim
+ \skip_horizontal:N \l__nicematrix_col_width_dim
+ }
+ }
\cs_new_protected:Npn \__nicematrix_test_if_empty_for_S:
{
\peek_meaning:NT \__siunitx_table_skip:n
@@ -2571,12 +2601,24 @@
\tl_gput_right:Nn \g__nicematrix_array_preamble_tl
{
> {
+ \socket_assign_plug:nn { nicematrix / siunitx-wrap } { active }
+ \keys_set:nn { siunitx } { #1 }
\__nicematrix_cell_begin:
- \keys_set:nn { siunitx } { #1 }
\siunitx_cell_begin:w
}
c
- < { \siunitx_cell_end: \__nicematrix_cell_end: }
+ <
+ {
+ \siunitx_cell_end:
+ \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
+ \l__siunitx_table_text_bool
+ }
+ \__nicematrix_cell_end:
+ }
}
\int_gincr:N \c at jCol
\__nicematrix_rec_preamble_after_col:n
@@ -2793,7 +2835,10 @@
{ \__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_new:Npn \__nicematrix_multicolumn:nnn #1 #2 #3
{
\multispan { #1 }
@@ -3873,7 +3918,12 @@
{ 0.6 \l__nicematrix_xdots_shorten_end_dim }
}
\__nicematrix_draw_dotted_lines:
- \clist_if_empty:NF \l__nicematrix_corners_clist \__nicematrix_compute_corners:
+ \clist_if_empty:NF \l__nicematrix_corners_clist
+ {
+ \bool_if:NTF \l__nicematrix_no_cell_nodes_bool
+ { \__nicematrix_error:n { corners~with~no-cell-nodes } }
+ { \__nicematrix_compute_corners: }
+ }
\__nicematrix_adjust_pos_of_blocks_seq:
\__nicematrix_deal_with_rounded_corners:
\clist_if_empty:NF \l__nicematrix_hlines_clist \__nicematrix_draw_hlines:
@@ -3944,12 +3994,12 @@
{ #1 }
{ #2 }
{
- \int_compare:nNnTF { #3 } > { 99 }
+ \int_compare:nNnTF { #3 } > { 98 }
{ \int_use:N \c at iRow }
{ #3 }
}
{
- \int_compare:nNnTF { #4 } > { 99 }
+ \int_compare:nNnTF { #4 } > { 98 }
{ \int_use:N \c at jCol }
{ #4 }
}
@@ -5749,6 +5799,8 @@
\str_if_eq:eeT \l_tmpa_tl { * }
{ \cs_set_nopar:Npn \l_tmpa_tl { 1 } }
}
+ \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 } }
{
@@ -5782,6 +5834,8 @@
\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
+ { \__nicematrix_error:n { Invalid~row~number } }
\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
@@ -5958,6 +6012,24 @@
}
{ \cs_new_protected:Npn \__nicematrix_revert_colortbl: { } }
}
+\cs_new_protected:Npn \__nicematrix_EmptyColumn:n #1
+ {
+ \clist_map_inline:nn { #1 }
+ {
+ \seq_gput_right:Nn \g__nicematrix_future_pos_of_blocks_seq
+ { { -2 } { #1 } { 98 } { ##1 } { } } % 98 and not 99 !
+ \columncolor { nocolor } { ##1 }
+ }
+ }
+\cs_new_protected:Npn \__nicematrix_EmptyRow:n #1
+ {
+ \clist_map_inline:nn { #1 }
+ {
+ \seq_gput_right:Nn \g__nicematrix_future_pos_of_blocks_seq
+ { { ##1 } { -2 } { ##1 } { 98 } { } } % 98 and not 99 !
+ \rowcolor { nocolor } { ##1 }
+ }
+ }
\cs_set_eq:NN \OnlyMainNiceMatrix \use:n
\cs_new_protected:Npn \__nicematrix_OnlyMainNiceMatrix:n #1
{
@@ -5983,6 +6055,104 @@
}
}
}
+\cs_new:Npn \__nicematrix_tikz_booktabs_loaded:nn #1 #2
+ {
+ \IfPackageLoadedTF { tikz }
+ {
+ \IfPackageLoadedTF { booktabs }
+ { #2 }
+ { \__nicematrix_error:nn { TopRule~without~booktabs } { #1 } }
+ }
+ { \__nicematrix_error:nn { TopRule~without~tikz } { #1 } }
+ }
+\NewExpandableDocumentCommand { \__nicematrix_TopRule } { }
+ { \__nicematrix_tikz_booktabs_loaded:nn \TopRule \__nicematrix_TopRule_i: }
+\cs_new:Npn \__nicematrix_TopRule_i:
+ {
+ \noalign \bgroup
+ \peek_meaning:NTF [
+ { \__nicematrix_TopRule_ii: }
+ { \__nicematrix_TopRule_ii: [ \dim_use:N \heavyrulewidth ] }
+ }
+\NewDocumentCommand \__nicematrix_TopRule_ii: { o }
+ {
+ \tl_gput_right:Ne \g__nicematrix_pre_code_after_tl
+ {
+ \__nicematrix_hline:n
+ {
+ position = \int_eval:n { \c at iRow + 1 } ,
+ tikz =
+ {
+ line~width = #1 ,
+ yshift = 0.25 \arrayrulewidth ,
+ shorten~< = - 0.5 \arrayrulewidth
+ } ,
+ total-width = #1
+ }
+ }
+ \skip_vertical:n { \belowrulesep + #1 }
+ \egroup
+ }
+\NewExpandableDocumentCommand { \__nicematrix_BottomRule } { }
+ { \__nicematrix_tikz_booktabs_loaded:nn \BottomRule \__nicematrix_BottomRule_i: }
+\cs_new:Npn \__nicematrix_BottomRule_i:
+ {
+ \noalign \bgroup
+ \peek_meaning:NTF [
+ { \__nicematrix_BottomRule_ii: }
+ { \__nicematrix_BottomRule_ii: [ \dim_use:N \heavyrulewidth ] }
+ }
+\NewDocumentCommand \__nicematrix_BottomRule_ii: { o }
+ {
+ \tl_gput_right:Ne \g__nicematrix_pre_code_after_tl
+ {
+ \__nicematrix_hline:n
+ {
+ position = \int_eval:n { \c at iRow + 1 } ,
+ tikz =
+ {
+ line~width = #1 ,
+ yshift = 0.25 \arrayrulewidth ,
+ shorten~< = - 0.5 \arrayrulewidth
+ } ,
+ total-width = #1 ,
+ }
+ }
+ \skip_vertical:N \aboverulesep
+ \__nicematrix_create_row_node_i:
+ \skip_vertical:n { #1 }
+ \egroup
+ }
+\NewExpandableDocumentCommand { \__nicematrix_MidRule } { }
+ { \__nicematrix_tikz_booktabs_loaded:nn \MidRule \__nicematrix_MidRule_i: }
+\cs_new:Npn \__nicematrix_MidRule_i:
+ {
+ \noalign \bgroup
+ \peek_meaning:NTF [
+ { \__nicematrix_MidRule_ii: }
+ { \__nicematrix_MidRule_ii: [ \dim_use:N \lightrulewidth ] }
+ }
+\NewDocumentCommand \__nicematrix_MidRule_ii: { o }
+ {
+ \skip_vertical:N \aboverulesep
+ \__nicematrix_create_row_node_i:
+ \tl_gput_right:Ne \g__nicematrix_pre_code_after_tl
+ {
+ \__nicematrix_hline:n
+ {
+ position = \int_eval:n { \c at iRow + 1 } ,
+ tikz =
+ {
+ line~width = #1 ,
+ yshift = 0.25 \arrayrulewidth ,
+ shorten~< = - 0.5 \arrayrulewidth
+ } ,
+ total-width = #1 ,
+ }
+ }
+ \skip_vertical:n { \belowrulesep + #1 }
+ \egroup
+ }
\keys_define:nn { nicematrix / Rules }
{
position .int_set:N = \l__nicematrix_position_int ,
@@ -6401,15 +6571,15 @@
{
\peek_remove_spaces:n
{
- \peek_meaning:NTF \Hline
- { \__nicematrix_Hline_ii:nn { #1 + 1 } }
- { \__nicematrix_Hline_iii:n { #1 } }
+ \peek_meaning:NTF \Hline
+ { \__nicematrix_Hline_ii:nn { #1 + 1 } }
+ { \__nicematrix_Hline_iii:n { #1 } }
}
}
\cs_set:Npn \__nicematrix_Hline_ii:nn #1 #2 { \__nicematrix_Hline_i:n { #1 } }
\cs_set:Npn \__nicematrix_Hline_iii:n #1
{ \__nicematrix_collect_options:n { \__nicematrix_Hline_iv:nn { #1 } } }
-\cs_set:Npn \__nicematrix_Hline_iv:nn #1 #2
+\cs_set_protected:Npn \__nicematrix_Hline_iv:nn #1 #2
{
\__nicematrix_compute_rule_width:n { multiplicity = #1 , #2 }
\skip_vertical:N \l__nicematrix_rule_width_dim
@@ -6814,11 +6984,22 @@
{
\bool_if:nTF \l__nicematrix_medium_nodes_bool
{
- \bool_if:NTF \l__nicematrix_large_nodes_bool
- \__nicematrix_create_medium_and_large_nodes:
- \__nicematrix_create_medium_nodes:
+ \bool_if:NTF \l__nicematrix_no_cell_nodes_bool
+ { \__nicematrix_error:n { extra-nodes~with~no-cell-nodes } }
+ {
+ \bool_if:NTF \l__nicematrix_large_nodes_bool
+ \__nicematrix_create_medium_and_large_nodes:
+ \__nicematrix_create_medium_nodes:
+ }
}
- { \bool_if:NT \l__nicematrix_large_nodes_bool \__nicematrix_create_large_nodes: }
+ {
+ \bool_if:NT \l__nicematrix_large_nodes_bool
+ {
+ \bool_if:NTF \l__nicematrix_no_cell_nodes_bool
+ { \__nicematrix_error:n { extra-nodes~with~no-cell-nodes } }
+ \__nicematrix_create_large_nodes:
+ }
+ }
}
\cs_new_protected:Npn \__nicematrix_computations_for_medium_nodes:
{
@@ -7355,11 +7536,7 @@
{
\l_tmpa_tl
{ \exp_not:n { #3 } }
- {
- \group_begin:
- \exp_not:n { #4 #5 }
- \group_end:
- }
+ { { \exp_not:n { #4 #5 } } }
}
}
\cs_generate_variant:Nn \__nicematrix_Block_vii:nnnnn { e e }
@@ -7451,15 +7628,14 @@
{ \cs_set_eq:NN \ialign \__nicematrix_old_ialign: }
\seq_map_inline:Nn \g__nicematrix_blocks_seq { \__nicematrix_Block_iv:nnnnnn ##1 }
}
-\cs_generate_variant:Nn \__nicematrix_Block_v:nnnnnn { n n e e }
\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_compare:nNnTF { #3 } > { 99 }
+ \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 } }
- \int_compare:nNnTF { #4 } > { 99 }
+ \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
@@ -7491,6 +7667,7 @@
}
}
}
+\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:
@@ -9194,6 +9371,11 @@
renew-dots,~and~
renew-matrix.
}
+\__nicematrix_msg_new:nn { no-test-for-array }
+ {
+ The~key~'no-test-for-array'~has~been~deprecated~and~will~be~
+ deleted~in~a~future~version~of~nicematrix.
+ }
\keys_define:nn { nicematrix / Package }
{
renew-dots .bool_set:N = \l__nicematrix_renew_dots_bool ,
@@ -9203,7 +9385,7 @@
messages-for-Overleaf .bool_set:N = \g__nicematrix_messages_for_Overleaf_bool ,
footnote .bool_set:N = \g__nicematrix_footnote_bool ,
footnotehyper .bool_set:N = \g__nicematrix_footnotehyper_bool ,
- no-test-for-array .code:n = \prg_do_nothing: ,
+ no-test-for-array .code:n = \__nicematrix_warning:n { no-test-for-array } ,
unknown .code:n = \__nicematrix_error:n { Unknown~key~for~package }
}
\ProcessKeysOptions { nicematrix / Package }
@@ -9340,8 +9522,10 @@
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\
- ~(plus~the~potential~exterior~ones).~
+ \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 }
+ { ~(plus~the~exterior~ones) }.~
This~error~is~fatal.
}
\__nicematrix_msg_new:nn { columns~not~used }
@@ -9378,9 +9562,22 @@
}
\__nicematrix_msg_new:nn { in~last~row }
{
+ Erroneous~use.\\
You~can't~use~the~command~#1 in~the~last~row~(exterior)~of~the~array.\\
That~command~will~be~ignored.
}
+\__nicematrix_msg_new:nn { TopRule~without~booktabs }
+ {
+ Erroneous~use.\\
+ You~can't~use~the~command~ #1 because~'booktabs'~is~not~loaded.\\
+ That~command~will~be~ignored.
+ }
+\__nicematrix_msg_new:nn { TopRule~without~tikz }
+ {
+ Erroneous~use.\\
+ You~can't~use~the~command~ #1 because~'tikz'~is~not~loaded.\\
+ That~command~will~be~ignored.
+ }
\__nicematrix_msg_new:nn { caption~outside~float }
{
Key~caption~forbidden.\\
@@ -9410,6 +9607,20 @@
Since~you~haven't~loaded~Tikz,~the~only~value~you~can~give~to~'line-style'~
is~'standard'.~That~key~will~be~ignored.
}
+\__nicematrix_msg_new:nn { corners~with~no-cell-nodes }
+ {
+ Incompatible~keys.\\
+ You~can't~use~the~key~'corners'~here~because~the~key~'no-cell-nodes'~
+ is~in~force.\\
+ If~you~go~on,~that~key~will~be~ignored.
+ }
+\__nicematrix_msg_new:nn { extra-nodes~with~no-cell-nodes }
+ {
+ Incompatible~keys.\\
+ You~can't~create~'extra~nodes'~here~because~the~key~'no-cell-nodes'~
+ is~in~force.\\
+ If~you~go~on,~those~extra~nodes~won't~be~created.
+ }
\__nicematrix_msg_new:nn { Identical~notes~in~caption }
{
Identical~tabular~notes.\\
@@ -10253,6 +10464,18 @@
\__nicematrix_full_name_env:. \\
This~error~is~fatal.
}
+\__nicematrix_msg_new:nn { Invalid~col~number }
+ {
+ Invalid~column~number.\\
+ A~color~instruction~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~the~\token_to_str:N \CodeBefore\
+ specifies~a~row~which~is~outside~the~array.~It~will~be~ignored.
+ }
\endinput
%%
More information about the tex-live-commits
mailing list.