texlive[71045] Master/texmf-dist: nicematrix (23apr24)
commits+karl at tug.org
commits+karl at tug.org
Tue Apr 23 21:29:55 CEST 2024
Revision: 71045
https://tug.org/svn/texlive?view=revision&revision=71045
Author: karl
Date: 2024-04-23 21:29:54 +0200 (Tue, 23 Apr 2024)
Log Message:
-----------
nicematrix (23apr24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex
trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-code.pdf
Deleted: 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 2024-04-23 19:29:41 UTC (rev 71044)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex 2024-04-23 19:29:54 UTC (rev 71045)
@@ -10,7 +10,7 @@
\usepackage{nicematrix}
\usepackage{tikz}
-\usetikzlibrary{fit,patterns,arrows.meta,decorations.pathmorphing}
+\usetikzlibrary{fit,patterns,arrows.meta,decorations.pathmorphing,babel}
\usepackage{enumitem}
\usepackage{siunitx}
@@ -642,8 +642,8 @@
|tikz|, voir p.~\pageref{tikz-key-examples}.
\colorbox{yellow!50}{\textbf{Nouveau 6.24}}\enskip En fait, dans la liste des
-clés fournies à |tikz|, on peut mettre une clé |offset|. Cette clé n'est pas
-fournie par TikZ mais par \pkg{nicematrix}. Elle réduit le rectangle
+clés fournies à |tikz|, on peut mettre une clé \Definition{offset}. Cette clé
+n'est pas fournie par TikZ mais par \pkg{nicematrix}. Elle réduit le rectangle
correspondant au bloc par une marge (horizontalement et verticalement) égale à
la valeur (passée à |offset|). C'est ce rectangle réduit qui sera le chemin
exécuté par TikZ avec comme options les autres clés passées à la clé |tikz|.
@@ -774,7 +774,7 @@
(\emph{depth}) naturelles sont prises en compte pour la hauteur et la largeur de
la rangée en cours (comme le fait la commande standard |\multicolumn| de LaTeX),
sauf lorsqu'une option de placement vertical a été utilisée pour le bloc (une
-des clés |t|, |b|, |v-center|, |T| et |B| décrites à la partie
+des clés |t|, |b|, |m|, |T| et |B| décrites à la partie
\ref{vertical-pos-block}, p.~\pageref{vertical-pos-block}).
@@ -943,14 +943,12 @@
\label{vertical-pos-block}
Concernant le positionnement vertical, la commande |\Block| admet les clés
-|v-center|\footnote{Cette clé ne peut être nommée \texttt{c} car la clé
- \texttt{c} est déjà prise pour le positionnement horizontal.}, |t|, |b|, |T| et~|B|.
+|m|, |t|, |b|, |T| et~|B|.
-
\begin{itemize}
\item \index{v-center (clé de \texttt{\textbackslash Block)})}
-Avec la clé \Definition{v-center}, le contenu du bloc est centré verticalement.
+Avec la clé \Definition{m}\footnote{Cette clé a un alias : |v-center|.}, le contenu du bloc est centré verticalement.
\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.
@@ -964,12 +962,12 @@
Il n'y a pas de marge verticale. Néanmoins, le contenu du bloc est (toujours)
composé en interne dans une |{minipage}|, un |{tabular}| ou un |{array}|, ce qui
-fait qu'il y souvent déjà une marge.
+fait qu'il y a souvent déjà une marge.
\item Avec la clé \Definition{B}, le contenu du bloc est calé vers le bas.
\end{itemize}
-Quand aucune clé n'est donnée, c'est la clé |v-center| qui s'applique (sauf pour
+Quand aucune clé n'est donnée, c'est la clé |m| qui s'applique (sauf pour
les blocs mono-rangée).
\medskip
@@ -1368,7 +1366,29 @@
\end{pNiceMatrix}$
+\medskip
+Même quand la clé |hlines| est utilisée, il reste possible d'utiliser
+|\Hline\Hline| pour placer un filet double horizontal. De même,
+on peut mettre \verb+||+ dans le préambule (d'un environnement à préambule) pour
+placer un double filet vertical, même quand la clé |vlines| est utilisée.
+\medskip
+\begin{Code}[width=10.6cm]
+$\begin{NiceArray}{c\emph{||}ccccc}[hlines,vlines]
+ & a & b & c & d & e \\ \emph{\Hline\Hline}
+x & 0 & 0 & 0 & 0 & 0 \\
+y & 0 & 0 & 0 & 0 & 0 \\
+z & 0 & 0 & 0 & 0 & 0 \\
+\end{NiceArray}$
+\end{Code}
+$\begin{NiceArray}{c||ccccc}[hlines,vlines]
+ & a & b & c & d & e \\ \Hline\Hline
+x & 0 & 0 & 0 & 0 & 0 \\
+y & 0 & 0 & 0 & 0 & 0 \\
+z & 0 & 0 & 0 & 0 & 0 \\
+\end{NiceArray}$
+
+
\subsubsection{Les clés hvlines et hvlines-except-borders}
\label{hvlines}
\index{hvlines|see{Filets}}
@@ -1376,7 +1396,7 @@
\index{hvlines-except-borders}
La clé |hvlines|, qui ne prend pas de valeur, est la conjonction des clés
-|hlines| et |vlines|.
+|hlines| et |vlines|.
\smallskip
\begin{Code}
@@ -1410,6 +1430,7 @@
exemple d'utilisation de cette clé, voir la partie «Exemple d'utilisation avec
\pkg{tcolorbox}» p.~\pageref{tcolorbox}.
+
\medskip
\subsubsection{Les coins (vides)}
\label{corners}
@@ -2118,18 +2139,20 @@
\index{restart (clé de \texttt{\textbackslash rowcolors} du \texttt{\textbackslash CodeBefore})}
\index{respect-blocks (clé de \texttt{\textbackslash rowcolors} du\newline \texttt{\textbackslash CodeBefore})}
\begin{itemize}
-\item La clé |cols| décrit un ensemble de colonnes sur lesquelles portera
-l'effet de |\rowcolors|. Cet ensemble de colonnes est une liste d'intervalles de
-la forme $i$|-|$j$ (où $i$ et $j$ peuvent être remplacés par |*|).
+\item La clé \Definition{cols} décrit un ensemble de colonnes sur lesquelles
+portera l'effet de |\rowcolors|. Cet ensemble de colonnes est une liste
+d'intervalles de la forme $i$|-|$j$ (où $i$ et $j$ peuvent être remplacés par
+|*|).
-\item Avec la clé |restart|, chacun des intervalles de rangées spécifié par le
-premier argument de |\rowcolors| recommence avec la même
+\item Avec la clé \Definition{restart}, chacun des intervalles de rangées
+spécifié par le premier argument de |\rowcolors| recommence avec la même
couleur.\footnote{Autrement, la couleur d'une rangée ne dépend que de la parité
de son numéro absolu.}
-\item Avec la clé |respect-blocks|, qui est de type booléen, les «rangées»
-colorées alternativement peuvent s'étendre sur plusieurs rangées réelles du
-tableau pour englober les blocs (créés par la commande |\Block| : cf.~p.~\pageref{Block}).
+\item Avec la clé \Definition{respect-blocks}, qui est de type booléen, les
+«rangées» colorées alternativement peuvent s'étendre sur plusieurs rangées
+réelles du tableau pour englober les blocs (créés par la commande |\Block| :
+cf.~p.~\pageref{Block}).
\end{itemize}
\medskip
@@ -2241,7 +2264,8 @@
On peut aussi utiliser dans la commande |\rowlistcolors| une série de couleurs
définie par la commande |\definecolorseries| de \pkg{xcolor} (et initialisée
avec |\resetcolorseries|\footnote{Pour l'initialisation, on a
- utilisé dans l'exemple qui suit le compteur LaTeX |iRow| qui, quand il est utilisé
+ utilisé dans l'exemple qui suit le compteur LaTeX |iRow| (qui correspond en
+ interne au compteur TeX |\c at iRow|) qui, quand il est utilisé
dans le |\CodeBefore| (ou le |\CodeAfter|) désigne le nombre de rangées du
tableau : cf~p.~\pageref{iRow}. Cela permet un ajustement de la gradation des
couleurs à la taille du tableau.}).
@@ -4268,14 +4292,15 @@
\index{non empty (clé de \texttt{\textbackslash TikzEveryCell})}
\colorbox{yellow!50}{\textbf{Nouveau 6.24}}\enskip La commande |\TikzEveryCell|
-exécute avec TikZ le chemin rectangulaire qui correspond à chaque case du tableau,
-avec comme paramètres TikZ l'argument de |\TikzEveryCell|. Cet argument doit
-être une liste de couples \textsl{clé=valeur} applicables à un chemin
-TikZ. En fait, cette commande s'applique à chaque case du tableau, exceptées
-celles situées dans les rangées et colonnes extérieures (cf.~p.~\pageref{exterior}) et celles situées dans
-les coins vides (quand la clé |corners| est utilisée: cf.~p.~\pageref{corners}). Elle s'applique en fait à
-chaque bloc (sauf ceux qui ont la clé |transparent|) et ne s'applique pas aux
-cases situées dans ces blocs.
+exécute avec TikZ le chemin rectangulaire qui correspond à chaque case du
+tableau, avec comme paramètres TikZ l'argument de |\TikzEveryCell|. Cet argument
+doit être une liste de couples \textsl{clé=valeur} applicables à un chemin TikZ.
+En fait, cette commande s'applique à chaque case du tableau, exceptées celles
+situées dans les rangées et colonnes extérieures (cf.~p.~\pageref{exterior}) et
+celles situées dans les coins vides (quand la clé |corners| est utilisée:
+cf.~p.~\pageref{corners}). Elle s'applique en fait aussi à chaque bloc (sauf
+ceux qui ont la clé |transparent|) et ne s'applique pas aux cases individuelles
+situées dans ces blocs.
\medskip
En fait, dans la liste des clés passée en argument on peut mettre une clé
@@ -5068,16 +5093,18 @@
\index{jCol (compteur LaTeX)}
Dans les cases du tableau, il est possible d'utiliser les compteurs LaTeX |iRow|
-et |jCol| qui représentent le numéro de la rangée courante et le numéro de la
-colonne courante\footnote{On rappelle que le numéro de la «première rangée» (si
- elle existe) est $0$ et que le numéro de la «première colonne» (si elle
- existe) est $0$ également.}. Bien entendu, l'utilisateur ne doit pas modifier
-les valeurs de ces compteurs qui sont utilisés en interne par \pkg{nicematrix}.
+et |jCol|\footnote{Il s'agit bien de compteurs LaTeX, ce qui fait que les
+ compteurs TeX sous-jacents sont |\c at iRow| et |\c at jCol|.} qui représentent le
+numéro de la rangée courante et le numéro de la colonne courante. On rappelle
+que le numéro de la «première rangée» (si elle existe) est $0$ et que le numéro
+de la «première colonne» (si elle existe) est $0$ également. Bien entendu,
+l'utilisateur ne doit pas modifier les valeurs de ces compteurs |iRow| et~|jCol|
+qui sont utilisés en interne par \pkg{nicematrix}.
Dans le |\CodeBefore| (cf. p. \pageref{code-before}) et dans le |\CodeAfter|
(cf. p. \pageref{code-after}), |iRow| représente le nombre total de rangées
-(hors éventuelles rangées extérieures) et |jCol| le nombre total de colonnes
-(hors potentielles colonnes extérieures).
+(hors éventuelles rangées extérieures : cf. p.~\pageref{exterior}) et |jCol| le
+nombre total de colonnes (hors potentielles colonnes extérieures).
\medskip
\begin{Code}[width=10.6cm]
@@ -5181,6 +5208,7 @@
\medskip
+\index{light-syntax-expanded}
\colorbox{yellow!50}{\textbf{Nouveau 6.27}}\enskip La clé
|light-syntax-expanded| a le même comportement que la clé |light-syntax| mais
avec cette différence que le corps de l'environnement est complètement développé
@@ -5968,6 +5996,9 @@
\ExplSyntaxOff
\medskip
+On a utilisé les compteurs LaTeX |iRow| et |jCol| fournis par \pkg{nicematrix} (cf.~p.~\pageref{iRow}).
+
+\medskip
Voici un exemple d'utilisation :
\medskip
@@ -6408,7 +6439,7 @@
\begin{Code}
\ExplSyntaxOn
\NewDocumentCommand { \emph{\stars} } { m }
- { \prg_replicate:nn { \value { #1 } } { $ \star $ } }
+ { \prg_replicate:nn { \value { #1 } } { \( \star \) } }
\ExplSyntaxOff
\end{Code}
@@ -6445,7 +6476,7 @@
\begin{scope}
\ExplSyntaxOn
\NewDocumentCommand \stars { m }
- { \prg_replicate:nn { \value { #1 } } { $ \star $ } }
+ { \prg_replicate:nn { \value { #1 } } { \( \star \) } }
\NiceMatrixOptions
{
notes =
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 2024-04-23 19:29:41 UTC (rev 71044)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex 2024-04-23 19:29:54 UTC (rev 71045)
@@ -615,12 +615,12 @@
key |tikz| (which must be a list of keys allowed for a TikZ path).
\colorbox{yellow!50}{\textbf{New 6.24}}\enskip In fact, in the list of the keys
-provided by the user as value of |tikz|, it's possible to put a key |offset|.
-That key is not provided by TikZ but by \pkg{nicematrix}. It will narrow the
-rectangular frame corresponding to the block by a margin (horizontally and
-vertically) equal to the value (of that key |offset|). That new frame, a bit
-narrower, will be executed by TikZ with options which are the other keys in the
-list of keys provided as value to the key |tikz| of |\Block|.
+provided by the user as value of |tikz|, it's possible to put a key
+\Definition{offset}. That key is not provided by TikZ but by \pkg{nicematrix}.
+It will narrow the rectangular frame corresponding to the block by a margin
+(horizontally and vertically) equal to the value (of that key |offset|). That
+new frame, a bit narrower, will be executed by TikZ with options which are the
+other keys in the list of keys provided as value to the key |tikz| of |\Block|.
For examples, cf. p.~\pageref{tikz-key-examples}.
\end{itemize}
@@ -741,7 +741,7 @@
For the mono-row blocks, the natural height and depth are taken into account
for the height and depth of the current row (as does a standard |\multicolumn|
of LaTeX), except when an option of vertical position has been used for the block
-(one of the keys |t|, |b|, |v-center|, |T| and |B| described in the part
+(one of the keys |t|, |b|, |m|, |T| and |B| described in the part
\ref{vertical-pos-block}, p.~\pageref{vertical-pos-block}).
\subsection{The mono-cell blocks}
@@ -909,14 +909,12 @@
\label{vertical-pos-block}
For the vertical position, the command |\Blocks| accepts the keys
-|v-center|\footnote{That key could not have been named |c| since the key |c|
-is used for the horizontal alignement.},
-|t|, |b|, |T| and |B|.
+|m|, |t|, |b|, |T| and |B|.
\begin{itemize}
\item \index{v-center (key of \texttt{\textbackslash Block})}
-With the key \Definition{v-center}, the content of the block is vertically centered.
+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
@@ -925,15 +923,14 @@
array involved in the block.
\item With the key \Definition{T}, the content of the block is set upwards.
-\colorbox{yellow!50}{\textbf{Modification 6.18}}\enskip No vertical margin is
-added. However, the contents of the block is (always) composed by
-\pkg{nicematrix} in a |{minipage}|, a |{tabular}| or an |{array}| and, hence,
-there will still remain a margin (in most cases).
+No vertical margin is added. However, the contents of the block is (always)
+composed by \pkg{nicematrix} in a |{minipage}|, a |{tabular}| or an |{array}|
+and, hence, there will still remain a margin (in most cases).
\item With the key \Definition{B}, the content of the block is set downwards.
\end{itemize}
-When no key is given, the key |v-center| applies (except in the mono-row blocks).
+When no key is given, the key |m| applies (except in the mono-row blocks).
@@ -1317,7 +1314,30 @@
\end{pNiceMatrix}$
+\medskip
+When the key |hlines| is in force, it's still possible to use |\Hline\Hline| to
+put a double horizontal rule. As well, it's possible to put \verb+||+ in the
+preamble (of an environment with preamble) to put a double vertical rule, even
+when the key |vlines| is in force.
+\medskip
+\begin{Code}[width=10.6cm]
+$\begin{NiceArray}{c\emph{||}ccccc}[hlines,vlines]
+ & a & b & c & d & e \\ \emph{\Hline\Hline}
+x & 0 & 0 & 0 & 0 & 0 \\
+y & 0 & 0 & 0 & 0 & 0 \\
+z & 0 & 0 & 0 & 0 & 0 \\
+\end{NiceArray}$
+\end{Code}
+$\begin{NiceArray}{c||ccccc}[hlines,vlines]
+ & a & b & c & d & e \\ \Hline\Hline
+x & 0 & 0 & 0 & 0 & 0 \\
+y & 0 & 0 & 0 & 0 & 0 \\
+z & 0 & 0 & 0 & 0 & 0 \\
+\end{NiceArray}$
+
+
+
\subsubsection{The keys hvlines and hvlines-except-borders}
\label{hvlines}
@@ -2053,15 +2073,16 @@
\index{respect-blocks (key of \texttt{\textbackslash rowcolors} du\newline \texttt{\textbackslash CodeBefore})}
\begin{itemize}
-\item The key |cols| describes a set of columns. The command |\rowcolors| will
-color only the cells of these columns. The value is a comma-separated list of
-intervals of the form $i$-$j$ (where $i$ or $j$ may be replaced by |*|).
-\item With the key |restart|, each interval of rows (specified by the first
-mandatory argument) begins with the same color.\footnote{Otherwise, the color
+\item The key \Definition{cols} describes a set of columns. The command
+|\rowcolors| will color only the cells of these columns. The value is a
+comma-separated list of intervals of the form $i$-$j$ (where $i$ or $j$ may be
+replaced by |*|).
+\item With the key \Definition{restart}, each interval of rows (specified by the
+first mandatory argument) begins with the same color.\footnote{Otherwise, the color
of a given row relies only upon the parity of its absolute number.}
-\item With the key |respect-blocks| the ``rows'' alternately colored may extend over
-several rows if they have to incorporate blocks (created with the command
-|\Block|: cf.~p.~\pageref{Block}).
+\item With the key \Definition{respect-blocks} the ``rows'' alternately colored
+may extend over several rows if they have to incorporate blocks (created with
+the command |\Block|: cf.~p.~\pageref{Block}).
\end{itemize}
\medskip
@@ -2174,7 +2195,8 @@
It's also possible to use in the command |\rowlistcolors| a color series
defined by the command |\definecolorseries| of \pkg{xcolor} (and initialized
with the command |\resetcolorseries|\footnote{For the initialization, in the
-following example, you have used the counter |iRow| which, when used in the
+following example, you have used the counter |iRow| (which corresponds to the
+internal TeX counter |\c at iRow|) which, when used in the
|\CodeBefore| (and in the |\CodeAfter|) corresponds to the number of rows of
the array: cf.~p~\pageref{iRow}. That leads to an adjustement of the gradation
of the colors to the size of the tabular.}).
@@ -2508,8 +2530,8 @@
\index{color!key of \texttt{\textbackslash RowStyle}}
The key \Definition{rowcolor} sets the color of the background and the key
\Definition{color} sets the color of the text.\footnote{The key |color| uses the command
-|\color| but inserts also an instruction |\leavevmode| before. This
-instruction prevents a extra vertical space in the cells which belong to
+|\color| but also inserts an instruction |\leavevmode| before. This
+instruction prevents an extra vertical space in the cells which belong to
columns of type |p|, |b|, |m|, |X| and |V| (which start in
vertical mode of LaTeX).}
\item \index{bold (key of \texttt{\textbackslash RowStyle})} The key
@@ -4185,7 +4207,7 @@
and columns (cf.~p.~\pageref{exterior}) and those in the empty corners (when the
key |corners| is used: cf.~p.~\pageref{corners}). It applies in fact to each
block (excepted those with the key |transparent|) and does not apply to the
-cells located within these blocks.
+individual cells located within these blocks.
\medskip
In fact, in the list of keys provided as argument of |\TikzEveryCell|, it's
@@ -4956,16 +4978,18 @@
\index{jCol (LaTeX counter)}
In the cells of the array, it's possible to use the LaTeX counters |iRow| and
-|jCol| which represent the number of the current row and the number of the
-current column\footnote{We recall that the exterior ``first row'' (if it
-exists) has the number~$0$ and that the exterior ``first column'' (if it
-exists) has also the number~$0$.}. Of course, the user must not change the
-value of these counters which are used internally by \pkg{nicematrix}.
+|jCol|\footnote{There counters are actual LaTeX counters: the underlying TeX
+ counters are |\c at iRow| and |\c at jCol|} which represent the number of the
+current row and the number of the current column. We recall that the exterior
+``first row'' (if it exists) has the number~$0$ and that the exterior ``first
+column'' (if it exists) has also the number~$0$. Of course, the user must not
+change the value of these counters |iRow| and |jCol| which are used internally
+by \pkg{nicematrix}.
-In the |\CodeBefore| (cf. p. \pageref{code-before}) and in the |\CodeAfter|
-(cf. p. \pageref{code-after}), |iRow| represents the total number of rows
-(except the potential exterior rows) and |jCol| represents the total number
-of columns (except the potential exterior columns).
+In the |\CodeBefore| (cf. p. \pageref{code-before}) and in the |\CodeAfter| (cf.
+p. \pageref{code-after}), |iRow| represents the total number of rows (except the
+potential exterior rows: cf. p.~\pageref{exterior}) and |jCol| represents the
+total number of columns (except the potential exterior columns).
\medskip
\begin{Code}[width=10.6cm]
@@ -5064,6 +5088,7 @@
environment of LaTeX which only put TeX commands before and after the content.}
\medskip
+\index{light-syntax-expanded}
\colorbox{yellow!50}{\textbf{New 6.27}}\enskip The key |light-syntax-expanded|
has the same behaviour as the key |light-syntax| but the body of the
environment is expanded (in the TeX sens\footnote{More precisely, it's a
@@ -5837,6 +5862,9 @@
}
\ExplSyntaxOff
+\medskip
+We have used the LaTeX |counters iRow| and |jCol| provided by \pkg{nicematrix} (cf.~p.~\pageref{iRow}).
+
\bigskip
Here is an example of utilisation:
@@ -6269,7 +6297,7 @@
\begin{Code}
\ExplSyntaxOn
\NewDocumentCommand { \emph{\stars} } { m }
- { \prg_replicate:nn { \value { #1 } } { $ \star $ } }
+ { \prg_replicate:nn { \value { #1 } } { \( \star \) } }
\ExplSyntaxOff
\end{Code}
%
@@ -6306,7 +6334,7 @@
\begin{scope}
\ExplSyntaxOn
\NewDocumentCommand \stars { m }
- { \prg_replicate:nn { \value { #1 } } { $ \star $ } }
+ { \prg_replicate:nn { \value { #1 } } { \( \star \) } }
\NiceMatrixOptions
{
notes =
@@ -7913,10 +7941,7 @@
The dotted lines are no longer drawn with TikZ nodes but with TikZ circles
(for efficiency).
-Modification of the code which is now twice faster.
-
-
\cleardoublepage
\phantomsection
Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx 2024-04-23 19:29:41 UTC (rev 71044)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx 2024-04-23 19:29:54 UTC (rev 71045)
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.27a}
-\def\myfiledate{2024/02/19}
+\def\myfileversion{6.27b}
+\def\myfiledate{2024/04/23}
%
%
%<*batchfile>
@@ -158,14 +158,23 @@
% this package for technical reasons.
%
% \bigskip
-% We load some packages.
% \begin{macrocode}
-\RequirePackage { array }
\RequirePackage { amsmath }
% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
+\RequirePackage { array }
+% \end{macrocode}
+% In the version 2.6a of \pkg{array}, important modifications have been done for
+% the Tagging Project.
+% \begin{macrocode}
+\bool_const:Nn \c_@@_tagging_array_bool { \cs_if_exist_p:N \ar at ialign }
+% \end{macrocode}
+%
+%
+% \bigskip
+% \begin{macrocode}
\cs_new_protected:Npn \@@_error:n { \msg_error:nn { nicematrix } }
\cs_new_protected:Npn \@@_warning:n { \msg_warning:nn { nicematrix } }
\cs_new_protected:Npn \@@_error:nn { \msg_error:nnn { nicematrix } }
@@ -234,6 +243,13 @@
% \end{macrocode}
%
% \bigskip
+% We will delete in the future the following lines which are only a security.
+% \begin{macrocode}
+\cs_set:Npn \int_if_zero:NT #1 { \int_compare:nNnT #1 = \c_zero_int }
+\cs_set:Npn \int_if_zero:NTF #1 { \int_compare:nNnTF #1 = \c_zero_int }
+% \end{macrocode}
+%
+% \bigskip
% \section{Security test}
%
% Within the package \pkg{nicematrix}, we will have to test whether a cell of a
@@ -420,8 +436,8 @@
%
% That's why we create |\c_@@_pgfortikzpicture_tl| and
% |\c_@@_endpgfortikzpicture_tl| which will be used to construct in a
-% |\AtBeginDocument| the correct version of some commands. The tokens
-% |\exp_not:N| are mandatory.
+% |\hook_gput_code:nnn { begindocument } { . } | the correct version of some
+% commands. The tokens |\exp_not:N| are mandatory.
% \begin{macrocode}
\tl_const:Nn \c_@@_pgfortikzpicture_tl { \exp_not:N \tikzpicture }
\tl_const:Nn \c_@@_endpgfortikzpicture_tl { \exp_not:N \endtikzpicture }
@@ -435,7 +451,7 @@
%
% We test whether the current class is \cls{revtex4-1} (deprecated) or
% \cls{revtex4-2} because these classes redefines |\array| (of \pkg{array}) in a
-% way incompatible with our programmation. At the date May 2023, the current
+% way incompatible with our programmation. At the date April 2024, the current
% version \cls{revtex4-2} is 4.2f (compatible with \pkg{booktabs}).
%
% \begin{macrocode}
@@ -456,10 +472,6 @@
}
% \end{macrocode}
%
-% \bigskip
-% \begin{macrocode}
-\cs_generate_variant:Nn \tl_if_single_token_p:n { V }
-% \end{macrocode}
%
%
% \bigskip
@@ -1469,7 +1481,7 @@
% If the final user has used the special color ``|nocolor|'', the following flag
% will be raised.
% \begin{macrocode}
-\bool_new:N \@@_nocolor_used_bool
+\bool_new:N \l_@@_nocolor_used_bool
% \end{macrocode}
%
% \medskip
@@ -1667,7 +1679,7 @@
\cs_set_nopar:Npn \l_tmpa_tl { ##1 }
\cs_set_nopar:Npn \l_tmpb_tl { ##1 }
}
- \int_step_inline:nnn { \l_tmpa_tl } { \l_tmpb_tl }
+ \int_step_inline:nnn \l_tmpa_tl \l_tmpb_tl
{ \clist_put_right:Nn \l_tmpa_clist { ####1 } }
}
\tl_set_eq:NN #1 \l_tmpa_clist
@@ -2444,7 +2456,7 @@
% The options |down|, |up| and |middle| are not documented for the final user
% because he should use the syntax with |^|, |_| and |:|. We use
% |\tl_put_right:Nn| and not |\tl_set:Nn| (or |.tl_set:N|) because we don't want
-% a direct use of |up=...| erased by a absent |^{...}|.
+% a direct use of |up=...| erased by an absent |^{...}|.
% \begin{macrocode}
down .code:n = \tl_put_right:Nn \l_@@_xdots_down_tl { #1 } ,
up .code:n = \tl_put_right:Nn \l_@@_xdots_up_tl { #1 } ,
@@ -3473,10 +3485,15 @@
% \medskip
% We keep in memory the standard version of |\ialign| because we will redefine
% |\ialign| in the environment |{NiceArrayWithDelims}| but restore the standard
-% version for use in the cells of the array.
+% version for use in the cells of the array. However, since version 2.6a
+% (version for the Tagging Project), \pkg{array} uses |\ar at ialign| instead of
+% |\ialign|. In that case, of course, you do a saving of |\ar at ialign|.
% \begin{macrocode}
-\cs_set_eq:NN \@@_old_ialign: \ialign
+\bool_if:NTF \c_@@_tagging_array_bool
+ { \cs_set_eq:NN \@@_old_ar at ialign: \ar at ialign }
+ { \cs_set_eq:NN \@@_old_ialign: \ialign }
% \end{macrocode}
+%
%
%
% The following command creates a |row| node (and not a row of nodes!).
@@ -3533,9 +3550,15 @@
% \end{macrocode}
%
%
+% \bigskip
% \begin{macrocode}
\cs_new_protected:Npn \@@_everycr_i:
{
+ \bool_if:NT \c_@@_tagging_array_bool
+ {
+ \tbl_if_row_was_started:T { \UseTaggingSocket { tbl / row / end } }
+ \tbl_update_cell_data_for_next_row:
+ }
\int_gzero:N \c at jCol
\bool_gset_false:N \g_@@_after_col_zero_bool
\bool_if:NF \g_@@_row_of_col_done_bool
@@ -3576,6 +3599,7 @@
}
}
% \end{macrocode}
+%
%
%
%
@@ -3651,6 +3675,34 @@
}
% \end{macrocode}
%
+% The box |\@arstrutbox| is a box constructed in the beginning of the
+% environment |{array}|. The construction of that box takes into account the
+% current value of |\arraystretch|\footnote{The option |small| of
+% \pkg{nicematrix} changes (among others) the value of |\arraystretch|. This is
+% done, of course, before the call of |{array}|.} and |\extrarowheight| (of
+% \pkg{array}). That box is inserted (via |\@arstrut|) in the beginning of each
+% row of the array. That's why we use the dimensions of that box to initialize
+% the variables which will be the dimensions of the potential first and last row
+% of the environment. This initialization must be done after the creation of
+% |\@arstrutbox| and that's why we do it in the |\ialign|.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_some_initialization:
+ {
+ \dim_gzero_new:N \g_@@_dp_row_zero_dim
+ \dim_gset:Nn \g_@@_dp_row_zero_dim { \box_dp:N \@arstrutbox }
+ \dim_gzero_new:N \g_@@_ht_row_zero_dim
+ \dim_gset:Nn \g_@@_ht_row_zero_dim { \box_ht:N \@arstrutbox }
+ \dim_gzero_new:N \g_@@_ht_row_one_dim
+ \dim_gset:Nn \g_@@_ht_row_one_dim { \box_ht:N \@arstrutbox }
+ \dim_gzero_new:N \g_@@_dp_ante_last_row_dim
+ \dim_gzero_new:N \g_@@_ht_last_row_dim
+ \dim_gset:Nn \g_@@_ht_last_row_dim { \box_ht:N \@arstrutbox }
+ \dim_gzero_new:N \g_@@_dp_last_row_dim
+ \dim_gset:Nn \g_@@_dp_last_row_dim { \box_dp:N \@arstrutbox }
+ }
+% \end{macrocode}
+%
+%
% \bigskip
% The following code |\@@_pre_array_ii:| is used in |{NiceArrayWithDelims}|. It
% exists as a standalone macro only for legibility.
@@ -3707,44 +3759,44 @@
% |\everycr| to |{ }| and we \emph{need} to have to change the value of
% |\everycr|.
% \begin{macrocode}
- \cs_set_nopar:Npn \ialign
- {
- \@@_redefine_everycr:
- \tabskip = \c_zero_skip
+ \bool_if:NTF \c_@@_tagging_array_bool
+ {
+ \cs_set_nopar:Npn \ar at ialign
+ {
+ \tbl_init_cell_data_for_table:
+ \@@_redefine_everycr:
+ \tabskip = \c_zero_skip
+ \@@_some_initialization:
% \end{macrocode}
%
-% The box |\@arstrutbox| is a box constructed in the beginning of the
-% environment |{array}|. The construction of that box takes into account the
-% current value of |\arraystretch|\footnote{The option |small| of
-% \pkg{nicematrix} changes (among others) the value of |\arraystretch|. This is
-% done, of course, before the call of |{array}|.} and |\extrarowheight| (of
-% \pkg{array}). That box is inserted (via |\@arstrut|) in the beginning of each
-% row of the array. That's why we use the dimensions of that box to initialize
-% the variables which will be the dimensions of the potential first and last row
-% of the environment. This initialization must be done after the creation of
-% |\@arstrutbox| and that's why we do it in the |\ialign|.
+% After its first use, the definition of |\ar at ialign| will revert
+% automatically to its default definition. With this programmation, we will
+% have, in the cells of the array, a clean version of |\ar at ialign|.
% \begin{macrocode}
- \dim_gzero_new:N \g_@@_dp_row_zero_dim
- \dim_gset:Nn \g_@@_dp_row_zero_dim { \box_dp:N \@arstrutbox }
- \dim_gzero_new:N \g_@@_ht_row_zero_dim
- \dim_gset:Nn \g_@@_ht_row_zero_dim { \box_ht:N \@arstrutbox }
- \dim_gzero_new:N \g_@@_ht_row_one_dim
- \dim_gset:Nn \g_@@_ht_row_one_dim { \box_ht:N \@arstrutbox }
- \dim_gzero_new:N \g_@@_dp_ante_last_row_dim
- \dim_gzero_new:N \g_@@_ht_last_row_dim
- \dim_gset:Nn \g_@@_ht_last_row_dim { \box_ht:N \@arstrutbox }
- \dim_gzero_new:N \g_@@_dp_last_row_dim
- \dim_gset:Nn \g_@@_dp_last_row_dim { \box_dp:N \@arstrutbox }
+ \cs_set_eq:NN \ar at ialign \@@_old_ar at ialign:
+ \halign
+ }
+ }
% \end{macrocode}
-% After its first use, the definition of |\ialign| will revert
-% automatically to its default definition. With this programmation, we will
-% have, in the cells of the array, a clean version of |\ialign|.
+% The following part will be deleted when we will delete the boolean
+% |\c_@@_tagging_array_bool| (when we consider the version 2.6a of \pkg{array}
+% is required).
% \begin{macrocode}
- \cs_set_eq:NN \ialign \@@_old_ialign:
- \halign
+ {
+ \cs_set_nopar:Npn \ialign
+ {
+ \@@_redefine_everycr:
+ \tabskip = \c_zero_skip
+ \@@_some_initialization:
+ \cs_set_eq:NN \ialign \@@_old_ialign:
+ \halign
+ }
}
% \end{macrocode}
-%
+%
+%
+
+%
% We keep in memory the old versions or |\ldots|, |\cdots|, etc. only because we
% use them inside |\phantom| commands in order that the new commands |\Ldots|,
% |\Cdots|, etc. give the same spacing (except when the option |nullify-dots| is
@@ -3790,9 +3842,10 @@
% We redefine |\multicolumn| and, since we want |\multicolumn| to be available
% in the potential environments |{tabular}| nested in the environments of
% \pkg{nicematrix}, we patch |{tabular}| to go back to the original definition.
+% A |\hook_gremove_code:nn| will be put in |\@@_after_array:|.
% \begin{macrocode}
\cs_set_eq:NN \multicolumn \@@_multicolumn:nnn
- \hook_gput_code:nnn { env / tabular / begin } { . }
+ \hook_gput_code:nnn { env / tabular / begin } { nicematrix }
{ \cs_set_eq:NN \multicolumn \@@_old_multicolumn }
\@@_revert_colortbl:
% \end{macrocode}
@@ -5087,7 +5140,7 @@
% optional argument between square brackets for a list of
% \emph{key}-\emph{value} pairs. Here are the corresponding keys.
% \begin{macrocode}
-\keys_define:nn { WithArrows / p-column }
+\keys_define:nn { nicematrix / p-column }
{
r .code:n = \str_set_eq:NN \l_@@_hpos_col_str \c_@@_r_str ,
r .value_forbidden:n = true ,
@@ -5183,7 +5236,7 @@
%
% \begin{macrocode}
\cs_new_protected:Npn \@@_keys_p_column:n #1
- { \keys_set_known:nnN { WithArrows / p-column } { #1 } \l_tmpa_tl }
+ { \keys_set_known:nnN { nicematrix / p-column } { #1 } \l_tmpa_tl }
% \end{macrocode}
%
% \medskip
@@ -5388,7 +5441,7 @@
% center the cell. Indeed, if there is only one row in the cell, it should not
% be centered vertically. It's not possible to know the number of rows of the
% cell. However, we consider (as in \pkg{array}) that if the height of the cell
-% is no more that the height of |\@arstrutbox|, there is only one row.
+% is no more that the height of |\strutbox|, there is only one row.
% \begin{macrocode}
\cs_new_protected:Npn \@@_center_cell_box:
{
@@ -5824,10 +5877,10 @@
% \medskip
% The following set of keys is for the specifier |X| in the preamble of the
% array. Such specifier may have as keys all the keys of
-% |{ WithArrows / p-column }| but also a key as 1, 2, 3, etc. The following set
+% |{ nicematrix / p-column }| but also a key as 1, 2, 3, etc. The following set
% of keys will be used to retrieve that value (in the counter |\l_@@_weight_int|).
% \begin{macrocode}
-\keys_define:nn { WithArrows / X-column }
+\keys_define:nn { nicematrix / X-column }
{ unknown .code:n = \int_set:Nn \l_@@_weight_int { \l_keys_key_str } }
% \end{macrocode}
%
@@ -5863,7 +5916,7 @@
% \end{macrocode}
% The unknown keys are put in |\l_tmpa_tl|
% \begin{macrocode}
- \keys_set:no { WithArrows / X-column } \l_tmpa_tl
+ \keys_set:no { nicematrix / X-column } \l_tmpa_tl
\int_compare:nNnT \l_@@_weight_int < \c_zero_int
{
\@@_error_or_warning:n { negative~weight }
@@ -5977,7 +6030,7 @@
% |\multicolumn|.
% \begin{macrocode}
\multispan { #1 }
- \cs_set_eq:NN \@@_update_max_cell_width: \prg_do_nothing: % added 2023-10-04
+ \cs_set_eq:NN \@@_update_max_cell_width: \prg_do_nothing:
\begingroup
\cs_set:Npn \@addamp
{ \legacy_if:nTF { @firstamp } { \@firstampfalse } { \@preamerr 5 } }
@@ -7084,7 +7137,7 @@
\hbox_overlap_right:n
{
\skip_horizontal:N \g_@@_width_last_col_dim
- \skip_horizontal:N \col at sep % added 2023-11-05
+ \skip_horizontal:N \col at sep
\bool_if:NT \l_@@_code_before_bool
{
\pgfsys at markposition
@@ -7357,7 +7410,6 @@
{
\bool_gset_true:N \g_@@_delims_bool
\str_gset:Nn \g_@@_name_env_str { #1 NiceMatrix }
- % added 2023/10/01
\int_if_zero:nT \l_@@_last_col_int
{
\bool_set_true:N \l_@@_last_col_without_value_bool
@@ -7376,7 +7428,6 @@
\NewDocumentEnvironment { NiceMatrix } { ! O { } }
{
\str_gset:Nn \g_@@_name_env_str { NiceMatrix }
- % added 2023/10/01
\int_if_zero:nT \l_@@_last_col_int
{
\bool_set_true:N \l_@@_last_col_without_value_bool
@@ -7526,6 +7577,14 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_after_array:
{
+% \end{macrocode}
+% There was a |\hook_gput_code:nnn { env / tabular / begin } { nicematrix }| in
+% the command |\@@_pre_array_ii:| in order to come back to the standard
+% definition of |\multicolumn| (in the tabulars used by the final user in the
+% cells of our array of \pkg{nicematrix}) and maybe another linked to
+% \pkg{colortbl}.
+% \begin{macrocode}
+ \hook_gremove_code:nn { env / tabular / begin } { nicematrix }
\group_begin:
% \end{macrocode}
% When the option |last-col| is used in the environments with explicit preambles
@@ -7737,7 +7796,8 @@
}
}
{ }
- \cs_set_eq:NN \ialign \@@_old_ialign:
+ \bool_if:NT \c_@@_tagging_array_bool
+ { \cs_set_eq:NN \ar at ialign \@@_old_ar at ialign: }
\cs_set_eq:NN \SubMatrix \@@_SubMatrix
\cs_set_eq:NN \UnderBrace \@@_UnderBrace
\cs_set_eq:NN \OverBrace \@@_OverBrace
@@ -7767,8 +7827,8 @@
% activated and Tikz is not able to solve the problem (even with the Tikz
% library \pkg{babel}).
% \begin{macrocode}
- \int_compare:nNnT { \char_value_catcode:n { 60 } } = { 13 }
- { \@@_rescan_for_spanish:N \g_nicematrix_code_after_tl }
+ % \int_compare:nNnT { \char_value_catcode:n { 60 } } = { 13 }
+ % { \@@_rescan_for_spanish:N \g_nicematrix_code_after_tl }
% \end{macrocode}
% \medskip
% And here's the |\CodeAfter|. Since the |\CodeAfter| may begin with an
@@ -10669,7 +10729,7 @@
\dim_compare:nNnTF { #1 } = \c_zero_dim
{
\bool_if:NTF
- \@@_nocolor_used_bool
+ \l_@@_nocolor_used_bool
\@@_cartesian_path_normal_ii:
{
\seq_if_empty:NTF \l_@@_corners_cells_seq
@@ -10796,8 +10856,7 @@
\dim_set:Nn \l_tmpb_dim { \pgf at y + 0.5 \arrayrulewidth }
\@@_qpoint:n { row - ####1 }
\dim_set:Nn \l_@@_tmpd_dim { \pgf at y + 0.5 \arrayrulewidth }
- \cs_if_exist:cF
- { @@ _ ####1 _ ##1 _ nocolor }
+ \cs_if_exist:cF { @@ _ ####1 _ ##1 _ nocolor }
{
\pgfpathrectanglecorners
{ \pgfpoint \l_@@_tmpc_dim \l_@@_tmpd_dim }
@@ -10829,7 +10888,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_cartesian_path_nocolor:n #1
{
- \bool_set_true:N \@@_nocolor_used_bool
+ \bool_set_true:N \l_@@_nocolor_used_bool
\@@_expand_clist:NN \l_@@_cols_tl \c at jCol
\@@_expand_clist:NN \l_@@_rows_tl \c at iRow
% \end{macrocode}
@@ -11073,7 +11132,7 @@
\cs_set_eq:NN \@@_old_rowcolor \rowcolor
\cs_new_protected:Npn \@@_revert_colortbl:
{
- \hook_gput_code:nnn { env / tabular / begin } { . }
+ \hook_gput_code:nnn { env / tabular / begin } { nicematrix }
{
\cs_set_eq:NN \cellcolor \@@_old_cellcolor
\cs_set_eq:NN \rowcolor \@@_old_rowcolor
@@ -11435,7 +11494,6 @@
\cs_new_protected:Npn \@@_vline_v:
{
\begin {tikzpicture }
- % added 2023/09/25
% \end{macrocode}
% By default, the color defined by |\arrayrulecolor| or by |rules/color| will be
% used, but it's still possible to change the color by using the key |color| or,
@@ -11758,7 +11816,6 @@
\cs_new_protected:Npn \@@_hline_v:
{
\begin { tikzpicture }
- % added 2023/09/25
% \end{macrocode}
% By default, the color defined by |\arrayrulecolor| or by |rules/color| will be
% used, but it's still possible to change the color by using the key |color| or,
@@ -12849,13 +12906,13 @@
% \bigskip
% \section{The blocks}
%
-% The code deals with the command |\Block|. This command has no direct link with
-% the environment |{NiceMatrixBlock}|.
+% The following code deals with the command |\Block|. This command has no direct
+% link with the environment |{NiceMatrixBlock}|.
%
% \bigskip
% The options of the command |\Block| will be analyzed first in the cell of the
% array (and once again when the block will be put in the array).
-% Here is the set of keys for the first pass.
+% Here is the set of keys for the first pass (in the cell of the array).
% \begin{macrocode}
\keys_define:nn { NiceMatrix / Block / FirstPass }
{
@@ -12895,8 +12952,8 @@
%
% The following command |\@@_Block:| will be linked to |\Block| in the
% environments of \pkg{nicematrix}. We define it with
-% |\NewExpandableDocumentCommand| because it has an optional argument between
-% |<| and |>|. It's mandatory to use an expandable command.
+% |\NewExpandableDocumentCommand| because it has an optional argument between~
+% |<| and~|>|. It's mandatory to use an expandable command.
%
% \begin{macrocode}
\cs_new_protected:Npn \@@_Block: { \@@_collect_options:n { \@@_Block_i: } }
@@ -13269,7 +13326,7 @@
\bool_if:NT \g_@@_rotate_bool
{
\bool_if:NTF \g_@@_rotate_c_bool
- { v-center }
+ { m }
{ \int_compare:nNnT \c at iRow = \l_@@_last_row_int T }
}
@@ -13479,8 +13536,9 @@
T .code:n = \str_set:Nn \l_@@_vpos_block_str T ,
b .code:n = \str_set:Nn \l_@@_vpos_block_str b ,
B .code:n = \str_set:Nn \l_@@_vpos_block_str B ,
- v-center .code:n = \str_set:Nn \l_@@_vpos_block_str { c } ,
- v-center .value_forbidden:n = true ,
+ m .code:n = \str_set:Nn \l_@@_vpos_block_str { c } ,
+ m .value_forbidden:n = true ,
+ v-center .meta:n = m ,
name .tl_set:N = \l_@@_block_name_str ,
name .value_required:n = true ,
name .initial:n = ,
@@ -13502,7 +13560,9 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_draw_blocks:
{
- \cs_set_eq:NN \ialign \@@_old_ialign:
+ \bool_if:NTF \c_@@_tagging_array_bool
+ { \cs_set_eq:NN \ar at ialign \@@_old_ar at ialign: }
+ { \cs_set_eq:NN \ialign \@@_old_ialign: }
\seq_map_inline:Nn \g_@@_blocks_seq { \@@_Block_iv:nnnnnn ##1 }
}
% \end{macrocode}
@@ -13618,16 +13678,13 @@
{
\bool_lazy_or:nnT \l_@@_hlines_block_bool \l_@@_vlines_block_bool
{ \@@_error:n { hlines~with~color } }
- }
-% \end{macrocode}
-% \bigskip
-% \begin{macrocode}
- \tl_if_empty:NF \l_@@_draw_tl
- {
\tl_gput_right:Nx \g_nicematrix_code_after_tl
{
\@@_stroke_block:nnn
- { \exp_not:n { #5 } } % #5 are the options
+% \end{macrocode}
+% |#5| are the options
+% \begin{macrocode}
+ { \exp_not:n { #5 } }
{ #1 - #2 }
{ \int_use:N \l_@@_last_row_int - \int_use:N \l_@@_last_col_int }
}
@@ -13990,7 +14047,7 @@
- base
}
}
- \dim_sub:Nn \l_tmpa_dim { 0.5 \arrayrulewidth } % added 2023-02-21
+ \dim_sub:Nn \l_tmpa_dim { 0.5 \arrayrulewidth }
% \end{macrocode}
% We retrieve (in |\pgf at x|) the $x$-value of the center of the block.
% \begin{macrocode}
@@ -14033,7 +14090,7 @@
% \end{macrocode}
%
%
-% % \bigskip
+% \bigskip
% The first argument of |\@@_stroke_block:nnn| is a list of options for the
% rectangle that you will stroke. The second argument is the upper-left cell of
% the block (with, as usual, the syntax $i$|-|$j$) and the third is the last
@@ -14055,7 +14112,7 @@
% the color fixed by |\arrayrulecolor| is used.
% \begin{macrocode}
\tl_if_eq:NNTF \l_@@_draw_tl \c_@@_default_tl
- { \CT at arc@ }
+ { \CT at arc@ }
{ \@@_color:o \l_@@_draw_tl }
}
\pgfsetcornersarced
@@ -16163,7 +16220,7 @@
The~preamble~of~your~\@@_full_name_env:\ announces~\int_use:N
\g_@@_static_num_of_col_int\ columns~but~you~use~only~\int_use:N \c at jCol.\\
The~columns~you~did~not~used~won't~be~created.\\
- You~won't~have~similar~error~till~the~end~of~the~document.
+ You~won't~have~similar~error~message~till~the~end~of~the~document.
}
% \end{macrocode}
%
Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty 2024-04-23 19:29:41 UTC (rev 71044)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty 2024-04-23 19:29:54 UTC (rev 71045)
@@ -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{6.27a}
-\def\myfiledate{2024/02/19}
+\def\myfileversion{6.27b}
+\def\myfiledate{2024/04/23}
\RequirePackage{pgfcore}
\usepgfmodule{shapes}
\RequirePackage{l3keys2e}
@@ -28,8 +28,9 @@
{\myfiledate}
{\myfileversion}
{Enhanced arrays with the help of PGF/TikZ}
+\RequirePackage { amsmath }
\RequirePackage { array }
-\RequirePackage { amsmath }
+\bool_const:Nn \c__nicematrix_tagging_array_bool { \cs_if_exist_p:N \ar at ialign }
\cs_new_protected:Npn \__nicematrix_error:n { \msg_error:nn { nicematrix } }
\cs_new_protected:Npn \__nicematrix_warning:n { \msg_warning:nn { nicematrix } }
\cs_new_protected:Npn \__nicematrix_error:nn { \msg_error:nnn { nicematrix } }
@@ -71,6 +72,8 @@
\__nicematrix_warning:n { #1 }
\__nicematrix_gredirect_none:n { #1 }
}
+\cs_set:Npn \int_if_zero:NT #1 { \int_compare:nNnT #1 = \c_zero_int }
+\cs_set:Npn \int_if_zero:NTF #1 { \int_compare:nNnTF #1 = \c_zero_int }
\__nicematrix_msg_new:nn { Internal~error }
{
Potential~problem~when~using~nicematrix.\\
@@ -175,7 +178,6 @@
{ \bool_const:Nn \c__nicematrix_revtex_bool \c_false_bool }
}
}
-\cs_generate_variant:Nn \tl_if_single_token_p:n { V }
\cs_new_protected:Npn \__nicematrix_provide_pgfsyspdfmark:
{
\iow_now:Nn \@mainaux
@@ -460,7 +462,7 @@
\str_new:N \l__nicematrix_hpos_block_str
\str_set:Nn \l__nicematrix_hpos_block_str { c }
\bool_new:N \l__nicematrix_hpos_of_block_cap_bool
-\bool_new:N \__nicematrix_nocolor_used_bool
+\bool_new:N \l__nicematrix_nocolor_used_bool
\str_new:N \l__nicematrix_vpos_block_str
\str_set:Nn \l__nicematrix_vpos_block_str { c }
\bool_new:N \l__nicematrix_draw_first_bool
@@ -507,7 +509,7 @@
\cs_set_nopar:Npn \l_tmpa_tl { ##1 }
\cs_set_nopar:Npn \l_tmpb_tl { ##1 }
}
- \int_step_inline:nnn { \l_tmpa_tl } { \l_tmpb_tl }
+ \int_step_inline:nnn \l_tmpa_tl \l_tmpb_tl
{ \clist_put_right:Nn \l_tmpa_clist { ####1 } }
}
\tl_set_eq:NN #1 \l_tmpa_clist
@@ -1442,7 +1444,9 @@
\@tabarray
[ \str_if_eq:VnTF \l__nicematrix_baseline_tl c c t ]
}
-\cs_set_eq:NN \__nicematrix_old_ialign: \ialign
+\bool_if:NTF \c__nicematrix_tagging_array_bool
+ { \cs_set_eq:NN \__nicematrix_old_ar at ialign: \ar at ialign }
+ { \cs_set_eq:NN \__nicematrix_old_ialign: \ialign }
\cs_new_protected:Npn \__nicematrix_create_row_node:
{
\int_compare:nNnT \c at iRow > \g__nicematrix_last_row_node_int
@@ -1481,6 +1485,11 @@
\cs_new:Npn \__nicematrix_everycr: { \noalign { \__nicematrix_everycr_i: } }
\cs_new_protected:Npn \__nicematrix_everycr_i:
{
+ \bool_if:NT \c__nicematrix_tagging_array_bool
+ {
+ \tbl_if_row_was_started:T { \UseTaggingSocket { tbl / row / end } }
+ \tbl_update_cell_data_for_next_row:
+ }
\int_gzero:N \c at jCol
\bool_gset_false:N \g__nicematrix_after_col_zero_bool
\bool_if:NF \g__nicematrix_row_of_col_done_bool
@@ -1548,6 +1557,20 @@
}
{ \cs_new_protected:Npn \__nicematrix_patch_booktabs: { } }
}
+\cs_new_protected:Npn \__nicematrix_some_initialization:
+ {
+ \dim_gzero_new:N \g__nicematrix_dp_row_zero_dim
+ \dim_gset:Nn \g__nicematrix_dp_row_zero_dim { \box_dp:N \@arstrutbox }
+ \dim_gzero_new:N \g__nicematrix_ht_row_zero_dim
+ \dim_gset:Nn \g__nicematrix_ht_row_zero_dim { \box_ht:N \@arstrutbox }
+ \dim_gzero_new:N \g__nicematrix_ht_row_one_dim
+ \dim_gset:Nn \g__nicematrix_ht_row_one_dim { \box_ht:N \@arstrutbox }
+ \dim_gzero_new:N \g__nicematrix_dp_ante_last_row_dim
+ \dim_gzero_new:N \g__nicematrix_ht_last_row_dim
+ \dim_gset:Nn \g__nicematrix_ht_last_row_dim { \box_ht:N \@arstrutbox }
+ \dim_gzero_new:N \g__nicematrix_dp_last_row_dim
+ \dim_gset:Nn \g__nicematrix_dp_last_row_dim { \box_dp:N \@arstrutbox }
+ }
\cs_new_protected:Npn \__nicematrix_pre_array_ii:
{
\int_gzero:N \g__nicematrix_total_X_weight_int
@@ -1570,24 +1593,29 @@
{ \__nicematrix_env: - row - \int_use:N \c at iRow - base }
}
}
- \cs_set_nopar:Npn \ialign
+ \bool_if:NTF \c__nicematrix_tagging_array_bool
{
- \__nicematrix_redefine_everycr:
- \tabskip = \c_zero_skip
- \dim_gzero_new:N \g__nicematrix_dp_row_zero_dim
- \dim_gset:Nn \g__nicematrix_dp_row_zero_dim { \box_dp:N \@arstrutbox }
- \dim_gzero_new:N \g__nicematrix_ht_row_zero_dim
- \dim_gset:Nn \g__nicematrix_ht_row_zero_dim { \box_ht:N \@arstrutbox }
- \dim_gzero_new:N \g__nicematrix_ht_row_one_dim
- \dim_gset:Nn \g__nicematrix_ht_row_one_dim { \box_ht:N \@arstrutbox }
- \dim_gzero_new:N \g__nicematrix_dp_ante_last_row_dim
- \dim_gzero_new:N \g__nicematrix_ht_last_row_dim
- \dim_gset:Nn \g__nicematrix_ht_last_row_dim { \box_ht:N \@arstrutbox }
- \dim_gzero_new:N \g__nicematrix_dp_last_row_dim
- \dim_gset:Nn \g__nicematrix_dp_last_row_dim { \box_dp:N \@arstrutbox }
- \cs_set_eq:NN \ialign \__nicematrix_old_ialign:
- \halign
+ \cs_set_nopar:Npn \ar at ialign
+ {
+ \tbl_init_cell_data_for_table:
+ \__nicematrix_redefine_everycr:
+ \tabskip = \c_zero_skip
+ \__nicematrix_some_initialization:
+ \cs_set_eq:NN \ar at ialign \__nicematrix_old_ar at ialign:
+ \halign
+ }
}
+ {
+ \cs_set_nopar:Npn \ialign
+ {
+ \__nicematrix_redefine_everycr:
+ \tabskip = \c_zero_skip
+ \__nicematrix_some_initialization:
+ \cs_set_eq:NN \ialign \__nicematrix_old_ialign:
+ \halign
+ }
+ }
+
\cs_set_eq:NN \__nicematrix_old_ldots \ldots
\cs_set_eq:NN \__nicematrix_old_cdots \cdots
\cs_set_eq:NN \__nicematrix_old_vdots \vdots
@@ -1625,7 +1653,7 @@
{ \cs_set_eq:NN \__nicematrix_tuning_last_row: \prg_do_nothing: }
\bool_if:NT \l__nicematrix_renew_dots_bool \__nicematrix_renew_dots:
\cs_set_eq:NN \multicolumn \__nicematrix_multicolumn:nnn
- \hook_gput_code:nnn { env / tabular / begin } { . }
+ \hook_gput_code:nnn { env / tabular / begin } { nicematrix }
{ \cs_set_eq:NN \multicolumn \__nicematrix_old_multicolumn }
\__nicematrix_revert_colortbl:
\tl_if_exist:NT \l__nicematrix_note_in_caption_tl
@@ -2282,7 +2310,7 @@
\__nicematrix_rec_preamble:n
}
\bool_new:N \l__nicematrix_bar_at_end_of_pream_bool
-\keys_define:nn { WithArrows / p-column }
+\keys_define:nn { nicematrix / p-column }
{
r .code:n = \str_set_eq:NN \l__nicematrix_hpos_col_str \c__nicematrix_r_str ,
r .value_forbidden:n = true ,
@@ -2346,7 +2374,7 @@
\__nicematrix_make_preamble_ii_iv:nnn { #2 } { minipage } { }
}
\cs_new_protected:Npn \__nicematrix_keys_p_column:n #1
- { \keys_set_known:nnN { WithArrows / p-column } { #1 } \l_tmpa_tl }
+ { \keys_set_known:nnN { nicematrix / p-column } { #1 } \l_tmpa_tl }
\cs_new_protected:Npn \__nicematrix_make_preamble_ii_iv:nnn #1 #2 #3
{
\use:e
@@ -2729,7 +2757,7 @@
}
\cs_new_protected:Npn \__nicematrix_make_preamble_X:w [ #1 ]
{ \__nicematrix_make_preamble_X_i:n { #1 } }
-\keys_define:nn { WithArrows / X-column }
+\keys_define:nn { nicematrix / X-column }
{ unknown .code:n = \int_set:Nn \l__nicematrix_weight_int { \l_keys_key_str } }
\cs_new_protected:Npn \__nicematrix_make_preamble_X_i:n #1
{
@@ -2738,7 +2766,7 @@
\int_zero_new:N \l__nicematrix_weight_int
\int_set_eq:NN \l__nicematrix_weight_int \c_one_int
\__nicematrix_keys_p_column:n { #1 }
- \keys_set:no { WithArrows / X-column } \l_tmpa_tl
+ \keys_set:no { nicematrix / X-column } \l_tmpa_tl
\int_compare:nNnT \l__nicematrix_weight_int < \c_zero_int
{
\__nicematrix_error_or_warning:n { negative~weight }
@@ -2796,7 +2824,7 @@
\cs_new:Npn \__nicematrix_multicolumn:nnn #1 #2 #3
{
\multispan { #1 }
- \cs_set_eq:NN \__nicematrix_update_max_cell_width: \prg_do_nothing: % added 2023-10-04
+ \cs_set_eq:NN \__nicematrix_update_max_cell_width: \prg_do_nothing:
\begingroup
\cs_set:Npn \@addamp
{ \legacy_if:nTF { @firstamp } { \@firstampfalse } { \@preamerr 5 } }
@@ -3476,7 +3504,7 @@
\hbox_overlap_right:n
{
\skip_horizontal:N \g__nicematrix_width_last_col_dim
- \skip_horizontal:N \col at sep % added 2023-11-05
+ \skip_horizontal:N \col at sep
\bool_if:NT \l__nicematrix_code_before_bool
{
\pgfsys at markposition
@@ -3646,7 +3674,6 @@
{
\bool_gset_true:N \g__nicematrix_delims_bool
\str_gset:Nn \g__nicematrix_name_env_str { #1 NiceMatrix }
- % added 2023/10/01
\int_if_zero:nT \l__nicematrix_last_col_int
{
\bool_set_true:N \l__nicematrix_last_col_without_value_bool
@@ -3660,7 +3687,6 @@
\NewDocumentEnvironment { NiceMatrix } { ! O { } }
{
\str_gset:Nn \g__nicematrix_name_env_str { NiceMatrix }
- % added 2023/10/01
\int_if_zero:nT \l__nicematrix_last_col_int
{
\bool_set_true:N \l__nicematrix_last_col_without_value_bool
@@ -3767,6 +3793,7 @@
}
\cs_new_protected:Npn \__nicematrix_after_array:
{
+ \hook_gremove_code:nn { env / tabular / begin } { nicematrix }
\group_begin:
\bool_if:NT \g__nicematrix_last_col_found_bool
{ \int_set_eq:NN \l__nicematrix_last_col_int \g__nicematrix_col_total_int }
@@ -3877,7 +3904,8 @@
}
}
{ }
- \cs_set_eq:NN \ialign \__nicematrix_old_ialign:
+ \bool_if:NT \c__nicematrix_tagging_array_bool
+ { \cs_set_eq:NN \ar at ialign \__nicematrix_old_ar at ialign: }
\cs_set_eq:NN \SubMatrix \__nicematrix_SubMatrix
\cs_set_eq:NN \UnderBrace \__nicematrix_UnderBrace
\cs_set_eq:NN \OverBrace \__nicematrix_OverBrace
@@ -3888,8 +3916,8 @@
\tl_gclear:N \g__nicematrix_pre_code_after_tl
\cs_set_eq:NN \CodeAfter \prg_do_nothing:
\seq_gclear:N \g__nicematrix_submatrix_names_seq
- \int_compare:nNnT { \char_value_catcode:n { 60 } } = { 13 }
- { \__nicematrix_rescan_for_spanish:N \g_nicematrix_code_after_tl }
+ % \int_compare:nNnT { \char_value_catcode:n { 60 } } = { 13 }
+ % { \__nicematrix_rescan_for_spanish:N \g_nicematrix_code_after_tl }
\bool_set_true:N \l__nicematrix_in_code_after_bool
\exp_last_unbraced:No \__nicematrix_CodeAfter_keys: \g_nicematrix_code_after_tl
\scan_stop:
@@ -5685,7 +5713,7 @@
\dim_compare:nNnTF { #1 } = \c_zero_dim
{
\bool_if:NTF
- \__nicematrix_nocolor_used_bool
+ \l__nicematrix_nocolor_used_bool
\__nicematrix_cartesian_path_normal_ii:
{
\seq_if_empty:NTF \l__nicematrix_corners_cells_seq
@@ -5780,8 +5808,7 @@
\dim_set:Nn \l_tmpb_dim { \pgf at y + 0.5 \arrayrulewidth }
\__nicematrix_qpoint:n { row - ####1 }
\dim_set:Nn \l__nicematrix_tmpd_dim { \pgf at y + 0.5 \arrayrulewidth }
- \cs_if_exist:cF
- { __nicematrix _ ####1 _ ##1 _ nocolor }
+ \cs_if_exist:cF { __nicematrix _ ####1 _ ##1 _ nocolor }
{
\pgfpathrectanglecorners
{ \pgfpoint \l__nicematrix_tmpc_dim \l__nicematrix_tmpd_dim }
@@ -5794,7 +5821,7 @@
\cs_new_protected:Npn \__nicematrix_cartesian_path: { \__nicematrix_cartesian_path:n \c_zero_dim }
\cs_new_protected:Npn \__nicematrix_cartesian_path_nocolor:n #1
{
- \bool_set_true:N \__nicematrix_nocolor_used_bool
+ \bool_set_true:N \l__nicematrix_nocolor_used_bool
\__nicematrix_expand_clist:NN \l__nicematrix_cols_tl \c at jCol
\__nicematrix_expand_clist:NN \l__nicematrix_rows_tl \c at iRow
\clist_map_inline:Nn \l__nicematrix_rows_tl
@@ -5915,7 +5942,7 @@
\cs_set_eq:NN \__nicematrix_old_rowcolor \rowcolor
\cs_new_protected:Npn \__nicematrix_revert_colortbl:
{
- \hook_gput_code:nnn { env / tabular / begin } { . }
+ \hook_gput_code:nnn { env / tabular / begin } { nicematrix }
{
\cs_set_eq:NN \cellcolor \__nicematrix_old_cellcolor
\cs_set_eq:NN \rowcolor \__nicematrix_old_rowcolor
@@ -6138,7 +6165,6 @@
\cs_new_protected:Npn \__nicematrix_vline_v:
{
\begin {tikzpicture }
- % added 2023/09/25
\CT at arc@
\tl_if_empty:NF \l__nicematrix_rule_color_tl
{ \tl_put_right:Nx \l__nicematrix_tikz_rule_tl { , color = \l__nicematrix_rule_color_tl } }
@@ -6341,7 +6367,6 @@
\cs_new_protected:Npn \__nicematrix_hline_v:
{
\begin { tikzpicture }
- % added 2023/09/25
\CT at arc@
\tl_if_empty:NF \l__nicematrix_rule_color_tl
{ \tl_put_right:Nx \l__nicematrix_tikz_rule_tl { , color = \l__nicematrix_rule_color_tl } }
@@ -7212,7 +7237,7 @@
\bool_if:NT \g__nicematrix_rotate_bool
{
\bool_if:NTF \g__nicematrix_rotate_c_bool
- { v-center }
+ { m }
{ \int_compare:nNnT \c at iRow = \l__nicematrix_last_row_int T }
}
@@ -7368,8 +7393,9 @@
T .code:n = \str_set:Nn \l__nicematrix_vpos_block_str T ,
b .code:n = \str_set:Nn \l__nicematrix_vpos_block_str b ,
B .code:n = \str_set:Nn \l__nicematrix_vpos_block_str B ,
- v-center .code:n = \str_set:Nn \l__nicematrix_vpos_block_str { c } ,
- v-center .value_forbidden:n = true ,
+ m .code:n = \str_set:Nn \l__nicematrix_vpos_block_str { c } ,
+ m .value_forbidden:n = true ,
+ v-center .meta:n = m ,
name .tl_set:N = \l__nicematrix_block_name_str ,
name .value_required:n = true ,
name .initial:n = ,
@@ -7383,7 +7409,9 @@
}
\cs_new_protected:Npn \__nicematrix_draw_blocks:
{
- \cs_set_eq:NN \ialign \__nicematrix_old_ialign:
+ \bool_if:NTF \c__nicematrix_tagging_array_bool
+ { \cs_set_eq:NN \ar at ialign \__nicematrix_old_ar at ialign: }
+ { \cs_set_eq:NN \ialign \__nicematrix_old_ialign: }
\seq_map_inline:Nn \g__nicematrix_blocks_seq { \__nicematrix_Block_iv:nnnnnn ##1 }
}
\cs_new_protected:Npn \__nicematrix_Block_iv:nnnnnn #1 #2 #3 #4 #5 #6
@@ -7455,13 +7483,10 @@
{
\bool_lazy_or:nnT \l__nicematrix_hlines_block_bool \l__nicematrix_vlines_block_bool
{ \__nicematrix_error:n { hlines~with~color } }
- }
- \tl_if_empty:NF \l__nicematrix_draw_tl
- {
\tl_gput_right:Nx \g_nicematrix_code_after_tl
{
\__nicematrix_stroke_block:nnn
- { \exp_not:n { #5 } } % #5 are the options
+ { \exp_not:n { #5 } }
{ #1 - #2 }
{ \int_use:N \l__nicematrix_last_row_int - \int_use:N \l__nicematrix_last_col_int }
}
@@ -7690,7 +7715,7 @@
- base
}
}
- \dim_sub:Nn \l_tmpa_dim { 0.5 \arrayrulewidth } % added 2023-02-21
+ \dim_sub:Nn \l_tmpa_dim { 0.5 \arrayrulewidth }
\pgfpointanchor
{
\__nicematrix_env: - #1 - #2 - block
@@ -9194,7 +9219,7 @@
The~preamble~of~your~\__nicematrix_full_name_env:\ announces~\int_use:N
\g__nicematrix_static_num_of_col_int\ columns~but~you~use~only~\int_use:N \c at jCol.\\
The~columns~you~did~not~used~won't~be~created.\\
- You~won't~have~similar~error~till~the~end~of~the~document.
+ You~won't~have~similar~error~message~till~the~end~of~the~document.
}
\__nicematrix_msg_new:nn { in~first~col }
{
More information about the tex-live-commits
mailing list.