From 8ccafc1be8d24ff0c4126d40847afbedab7fc7fb Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 9 Apr 2021 03:02:31 +0000 Subject: CTAN sync 202104090302 --- .../latex/contrib/nicematrix/nicematrix-french.pdf | Bin 426449 -> 455133 bytes .../latex/contrib/nicematrix/nicematrix-french.tex | 340 ++++++++---- macros/latex/contrib/nicematrix/nicematrix.dtx | 598 +++++++++++++-------- macros/latex/contrib/nicematrix/nicematrix.pdf | Bin 1183755 -> 1212783 bytes 4 files changed, 604 insertions(+), 334 deletions(-) (limited to 'macros/latex/contrib/nicematrix') diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf index f9d2004bed..98af2c5843 100644 Binary files a/macros/latex/contrib/nicematrix/nicematrix-french.pdf and b/macros/latex/contrib/nicematrix/nicematrix-french.pdf differ diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex index 8656d61f09..d92e274140 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.tex +++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex @@ -58,7 +58,7 @@ \NewDocumentCommand {\cls} {m} {\textsf{#1}} \setlength{\parindent}{0pt} - +\skip \footins = 2 \bigskipamount \begin{document} @@ -143,7 +143,9 @@ L'idée de \pkg{nicematrix} est de créer des nœuds \textsc{pgf} derrière les tableaux créés par \pkg{array} et de les utiliser pour développer de nouvelles fonctionnalités. Comme toujours avec \textsc{pgf}, les coordonnées de ces nœuds sont écrites dans le fichier |.aux| pour être utilisées à la compilation suivante. C'est pourquoi l'utilisation de \pkg{nicematrix} nécessite \textbf{plusieurs compilations - successives}. + successives}.\footnote{Si vous utilisez Overleaf, Overleaf effectue + automatiquement le nombre de + compilations nécessaire.} \bigskip La plupart des fonctionnalités de \pkg{nicematrix} sont accessibles sans avoir à utiliser explicitement @@ -188,6 +190,12 @@ Les environnements |{NiceMatrix}|, |{pNiceMatrix}|, etc. sont similaires aux environnements correspondants de l'\pkg{amsmath} (qui est chargée par \pkg{nicematrix}) : |{matrix}|, |{pmatrix}|, etc. +\medskip +\textbf{On conseille d'utiliser prioritairement les environnements classiques et de +n'utiliser les environnements de \pkg{nicematrix} que lorsqu'on utilise les +fonctionnalités supplémentaires offertes par ces environnements (cela permet +d'économiser la mémoire).} + \medskip Tous les environnements de l'extension \pkg{nicematrix} acceptent, entre crochets, une liste optionnelle de paires de la forme \textsl{clé=valeur}. @@ -195,14 +203,13 @@ crochets, une liste optionnelle de paires de la forme \textsl{clé=valeur}. cette liste d'options.} \bigskip -\textbf{Important} +\textbf{Important}\par\nobreak Avant la version 5.0, il fallait, pour des raisons techniques, utiliser les lettres |L|, |C| et |R| au lieu de |l|, |c| et |r| dans les préambules des -environnements de \pkg{nicematrix}. - -Pour pouvoir continuer à utiliser ces lettres |L|, |C| et |R|, \pkg{nicematrix} -doit être chargé avec l'option |define-L-C-R|. +environnements de \pkg{nicematrix}. Pour pouvoir continuer à utiliser ces +lettres |L|, |C| et |R|, \pkg{nicematrix} doit être chargé avec l'option +|define-L-C-R|. \begin{Verbatim} \usepackage[define-L-C-R]{nicematrix} \end{Verbatim} @@ -516,14 +523,16 @@ tableau) ; trace également le cadre avec cette couleur. \item la clé |line-width| fixe la largeur des filets servant pour le cadre (n'a d'intérêt que si |draw| est utilisée) ; -\item \colorbox{yellow!50}{\textbf{Nouveau 5.12}}\enskip la clé -|rounded-corners| impose des coins arrondis (pour le cadre dessiné par |draw| et -le fond dessiné par |fill|) avec un rayon égal à la valeur de cette clé (la -valeur par défaut est 4~pt\footnote{Cette valeur par défaut est la valeur - initiale des \emph{rounded corners} de Tikz.}). -\item \colorbox{yellow!50}{\textbf{Nouveau 5.13}}\enskip la clé |borders| permet -de ne tracer que certaines des bordures du bloc : cette clé prend comme valeur -une liste d'éléments parmi les suivants : |left|, |right|, |top| et |bottom|. +\item la clé |rounded-corners| impose des coins arrondis (pour le cadre dessiné +par |draw| et le fond dessiné par |fill|) avec un rayon égal à la valeur de +cette clé (la valeur par défaut est 4~pt\footnote{Cette valeur par défaut est la + valeur initiale des \emph{rounded corners} de Tikz.}) ; +\item la clé |borders| permet de ne tracer que certaines des bordures du bloc : +cette clé prend comme valeur une liste d'éléments parmi les suivants : |left|, +|right|, |top| et |bottom| ; +\item \colorbox{yellow!50}{\bfseries Nouveau 5.14}\enskip les clés |t| et |b| +réglent la ligne de base qui sera donnée au bloc quand celui-ci est constitué de +plusieurs lignes (séparées par la commande |\\|). \end{itemize} @@ -641,6 +650,8 @@ la consigne générale donnée dans le préambule pour cette colonne. |rounded-corners|.\footnote{Pour colorier simplement le fond d'une case, il n'y a pas besoin d'utiliser un bloc mono-case : on peut utiliser la commande |\cellcolor| si la clé |colortbl-like| est utilisée : voir p.~\pageref{colortbl-like}.} + +\item On peut tracer ou plusieurs bordures de la case avec la clé |borders|. \end{itemize} \medskip @@ -752,7 +763,8 @@ Marie & Pauline \\ \hline \bigskip En revanche, les filets verticaux ne sont pas tracés à l'intérieur des blocs -(créés par |\Block|: cf.~p.~\pageref{Block}). +(créés par |\Block|: cf.~p.~\pageref{Block}) ni dans les coins (dont la création +est demandée par la clé |corners|: cf.~p.~\pageref{corners}). \bigskip @@ -903,30 +915,48 @@ p.~\pageref{OnlyMainNiceMatrix}. \bigskip -\subsection{La commande \textbackslash Hline} +\subsection{Les outils de nicematrix pour tracer des filets} -On a dit que les traits verticaux spécifiés par un symbole «\verb+|+» dans le -préambule (pour les environnements à préambule, bien entendu) n'étaient pas -tracés dans les blocs.\footnote{Ces blocs sont ceux créés par les commandes - \verb|\Block| et \verb|\multicolumn| mais aussi ceux délimités implicitement - par des lignes en pointillés continues (créées par \verb|\Cdots|, etc.).} +Les outils proposés par \pkg{nicematrix} pour tracer des filets sont les +suivants : +\begin{itemize} +\item les clés |hlines|, |vlines| et |hvlines| ; +\item le spécificateur «\verb+|+» dans le préambule (pour les environnements à +préambule) ; +\item la commande |\Hline|. +\end{itemize} -\smallskip -\colorbox{yellow!50}{\textbf{Nouveau 5.13}}\enskip Pour proposer des filets horizontaux -ayant le même comportement, l'extension \pkg{nicematrix} fournit la commande -|\Hline|. +\bigskip +\textbf{Ces outils ont en commun de ne pas tracer les filets dans les blocs ni + dans les coins vides (quand la clé |corners| est utilisée).} +\begin{itemize} +\item Les blocs en question sont : +\begin{itemize} +\item ceux créés par la commande |\Block|\footnote{Et aussi la commande \verb|\multicolumn| même s'il + est recommandé d'utiliser plutôt \verb|\Block| quand on utilise l'extension + \pkg{nicematrix}.} de \pkg{nicematrix} présentée +p.~\pageref{Block}; +\item ceux délimités implicitement par des lignes en pointillés continues, créées +par |\Cdots|, |\Vdots|, etc. : cf.~p.~\pageref{Cdots}. +\end{itemize} +\item Les coins sont créés par la clé |corners| détaillée un peu plus loin : cf. +p.~\pageref{corners}. +\end{itemize} +En particulier, cette remarque explique la différence entre la commande standard +|\hline| et la commande |\Hline| proposée par \pkg{nicematrix}. \bigskip -\subsection{Les clés hlines et vlines} +\subsubsection{Les clés hlines et vlines} -La clé |hlines| demande un tracé de tous les filets horizontaux et la clé -|vlines| demande un tracé de tous les filets verticaux (sauf dans les blocs, -créés par |\Block| et dans les blocs virtuels déterminés par des lignes en -pointillés : |\Cdots|, |\Vdots|, etc.). En fait, dans les environnements avec -délimiteurs (comme |{pNiceMatrix}| ou |{bNiceArray}|), les filets extérieurs ne -sont pas tracés (ce qui est le comportement certainement attendu). +\medskip +Les clés |hlines| et |vlines| (qui, bien sûr, tracent des filets horizontaux et +verticaux) prennent comme valeur une liste de numéros qui sont les numéros des +filets à tracer. Si aucune valeur n'est donnée, tous les filets sont tracés. +En fait, pour les environnements avec délimiteurs (comme |{pNiceMatrix}| ou +|{bNiceArray}|), la clé |vlines| ne trace pas les filets extérieurs (ce qui est +le comportement certainement attendu). \medskip \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] @@ -942,25 +972,19 @@ $\begin{pNiceMatrix}[vlines,rules/width=0.2pt] 1 & 2 & 3 & 4 & 5 & 6 \end{pNiceMatrix}$ -\medskip -\colorbox{yellow!50}{\textbf{Nouveau 5.13}}\enskip Il est possible de donner à -la clé |vlines| une liste de numéros qui seront les numéros des filets verticaux -qui seront tracés. Il en est de même pour |hlines|. -\subsection{La clé hvlines} +\subsubsection{La clé hvlines} \label{hvlines} -La clé |hvlines| demande le tracé de tous les filets horizontaux et verticaux -(sauf dans les blocs et dans les blocs virtuels déterminés par des -lignes en pointillés et sauf les filets correspondants à des clés |draw| de -commandes |\Block|, filets qui sont tracés avec leurs caractéristiques). +La clé |hvlines|, qui ne prend pas de valeur, est la conjonction des clés +|hlines| et |vlines|. -\medskip +\smallskip \begin{Verbatim} \begin{NiceTabular}{cccc}[~emphase#hvlines@,rules/color=blue,rules/width=1pt] rose & tulipe & marguerite & dahlia \\ -violette & \Block[~emphase#draw=red@]{2-2}{\LARGE fleurs} & & souci \\ +violette & \Block[draw=red]{2-2}{\LARGE fleurs} & & souci \\ pervenche & & & lys \\ arum & iris & jacinthe & muguet \end{NiceTabular} @@ -975,78 +999,116 @@ arum & iris & jacinthe & muguet \end{NiceTabular} \end{center} +\bigskip +\subsubsection{Les coins (vides)} +\label{corners} -\subsection{La clé hvlines-except-corners} +Les quatre coins d'un tableau seront notés |NW|, |SW|, |NE| et |SE| (\emph{north west}, \emph{south west}, \emph{north + east} et \emph{south east} en anglais). -\label{except-corners} +\smallskip +Pour chacun de ces coins, on appellera \emph{coin vide} (ou tout simplement +\emph{coin}) la réunion de toutes les cases vides situées dans au moins un +rectangle entièrement constitué de cases vides partant de ce coin.\footnote{Pour + être complet, on doit préciser que toute case située dans un bloc (même si + elle vide) n'est pas prise en compte pour la détermination des coins. Ce + comportement est naturel.} -La clé |hvlines-except-corners| demande le tracé de tous les filets horizontaux -et verticaux sauf dans les blocs (y compris dans les blocs virtuels déterminés par des -lignes en pointillés) et sauf dans les coins vides. +\smallskip +On peut néanmoins imposer à une case sans contenu d'être considérée +comme non vide par \pkg{nicematrix} avec la commande |\NotEmpty|. -\medskip -\begin{Verbatim} -\begin{NiceTabular}{*{6}{c}}[~emphase#hvlines-except-corners@,cell-space-top-limit=3pt] +\bigskip +\begin{minipage}{9cm} +Dans l'exemple ci-contre (où B est au centre d'un bloc de taille $2\times 2$), +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] +\CodeBefore + \rectanglecolor{blue!10}{1-1}{4-2} + \rectanglecolor{blue!10}{1-1}{1-4} + \rectanglecolor{blue!10}{1-6}{3-6} + \rectanglecolor{blue!10}{7-1}{9-1} + \rectanglecolor{blue!10}{7-5}{9-6} +\Body & & & & A \\ & & A & A & A \\ & & & A \\ & & A & A & A & A \\ A & A & A & A & A & A \\ A & A & A & A & A & A \\ + & A & A & A \\ & \Block{2-2}{B} & & A \\ & & & A \\ - & A & A & A \\ \end{NiceTabular} -\end{Verbatim} -% -\begin{center} -\begin{NiceTabular}{*{6}{c}}[hvlines-except-corners,cell-space-top-limit=3pt] + + +\bigskip +\colorbox{yellow!50}{\textbf{Nouveau 5.14}}\enskip Quand la clé |corners| est +utilisée, \pkg{nicematrix} calcule les coins vides et ces coins sont alors pris +en compte par les outils de tracés de filets (les filets ne seront pas tracés +dans ces coins vides). \emph{Remarque} : Dans les versions précédentes de +\pkg{nicematrix}, il n'y avait qu'une clé |hvlines-except-corners| (maintenant +considérée comme obsolète). + +\bigskip +\begin{BVerbatim}[boxwidth=11cm,baseline=c] +\NiceMatrixOptions{cell-space-top-limit=3pt} +\begin{NiceTabular}{*{6}{c}}[~emphase#corners@,hvlines] & & & & A \\ & & A & A & A \\ & & & A \\ & & A & A & A & A \\ A & A & A & A & A & A \\ A & A & A & A & A & A \\ + & A & A & A \\ & \Block{2-2}{B} & & A \\ & & & A \\ +\end{NiceTabular} +\end{BVerbatim} +\begin{NiceTabular}{*{6}{c}}[corners,hvlines,cell-space-top-limit=3pt] + & & & & A \\ + & & A & A & A \\ + & & & A \\ + & & A & A & A & A \\ +A & A & A & A & A & A \\ +A & A & A & A & A & A \\ & A & A & A \\ + & \Block{2-2}{B} & & A \\ + & & & A \\ \end{NiceTabular} -\end{center} - -Comme on le voit, un «coin vide» est constitué de la réunion de tous les -rectangles vides partant de la case située exactement dans le coin. -\bigskip -On peut passer en argument de |\hvlines-except-corners| une liste de coins à -prendre en considération, les coins étant désignés par |NW|, |SW|, |NE| et |SE| -(\emph{north west}, \emph{south west}, \emph{north east} et \emph{south east}). +\vspace{1cm} +On peut aussi donner comme valeur à la clé |corners| une liste de coins à +prendre en considération (les coins sont notés |NW|, |SW|, |NE| et |SE| et +doivent être séparés par des virgules). \medskip \begin{BVerbatim}[boxwidth=11cm,baseline=c] -\begin{NiceTabular}{*{6}{c}}% - [~emphase#hvlines-except-corners=NE@,cell-space-top-limit=3pt] +\NiceMatrixOptions{cell-space-top-limit=3pt} +\begin{NiceTabular}{*{6}{c}}[~emphase#corners=NE@,hvlines] 1\\ 1&1\\ 1&2&1\\ 1&3&3&1\\ 1&4&6&4&1\\ -1&5&10&10&5&1 + & & & & &1 \end{NiceTabular} \end{BVerbatim} \begin{NiceTabular}{*{6}{c}}% - [c,hvlines-except-corners=NE,cell-space-top-limit=3pt] + [c,corners=NE,hvlines,cell-space-top-limit=3pt] 1\\ 1&1\\ 1&2&1\\ 1&3&3&1\\ 1&4&6&4&1\\ -1&5&10&10&5&1 + & & & & &1 \end{NiceTabular} -\medskip +\bigskip $\triangleright$ Le concept de coins est aussi utilisé par la commande |\arraycolor| dans le |\CodeBefore| qui accepte en option une clé -|except-corners| : cf.~p.~\pageref{arraycolor}. +|except-corners|: cf.~p.~\pageref{arraycolor}. \subsection{La commande \textbackslash diagbox} @@ -1202,9 +1264,9 @@ L'extension \pkg{nicematrix} fournit une clé |code-before| pour du code qui ser exécuté avant le tracé du tableau. \smallskip -\colorbox{yellow!50}{\textbf{Nouveau 5.12}}\enskip Une syntaxe alternative est -proposée : on peut placer le contenu de ce |code-before| entre les mots-clés -|\CodeBefore| et |\Body| juste au début de l'environnement. +Une syntaxe alternative est proposée : on peut placer le contenu de ce +|code-before| entre les mots-clés |\CodeBefore| et |\Body| juste au début de +l'environnement. \begin{Verbatim} \begin{pNiceArray}{~textsl#preamble@} @@ -1216,7 +1278,7 @@ proposée : on peut placer le contenu de ce |code-before| entre les mots-clés \end{Verbatim} \smallskip -De nouvelles commandes sont disponibles dans ce |\CodeBefore| : +De nouvelles commandes sont disponibles dans ce |\CodeBefore|: |\cellcolor|, |\rectanglecolor|, |\rowcolor|, |\columncolor|, |\rowcolors| |\chessboardcolors| et |\arraycolor|.\footnote{On pourra remarquer que, dans le \verb|\CodeBefore|, des nœuds PGF/Tikz de la forme \verb+(i-|j)+ correspondant @@ -1369,12 +1431,12 @@ correspond à l'espace colorimétrique). Les clés disponibles sont |cols|, \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$. +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 couleur.\footnote{Autrement, la couleur d'une rangée ne dépend que de la parité - de son numéro.} + de son numéro absolu.} \item Avec la clé |respect-blocks|, qui est de type booléen, les «rangées» @@ -1488,13 +1550,12 @@ $\begin{pNiceMatrix}[baseline=1, r, margin] On a utilisé la clé |r| qui impose que toutes les colonnes soient alignées à droite (cf. p.~\pageref{key-R}). -\item \colorbox{yellow!50}{\textbf{Nouveau 5.13}}\enskip La commande -|\arraycolor| prend en argument obligatoire une couleur et colorie tout le -tableau (sauf les éventuelles rangées et colonnes extérieures: cf.~p.~\pageref{exterior}) avec cette -couleur. Elle est surtout intéressante du fait de la clé |except-corners| -qu'elle accepte entre crochets en troisième argument (optionnel). La définition -des coins a été donnée p.~\pageref{except-corners} quand on a présenté la clé -|hvlines-except-corners|. +\item La commande |\arraycolor| prend en argument obligatoire une couleur et +colorie tout le tableau (sauf les éventuelles rangées et colonnes extérieures: +cf.~p.~\pageref{exterior}) avec cette couleur. Elle est surtout intéressante du +fait de la clé |except-corners| qu'elle accepte entre crochets en troisième +argument (optionnel). La définition des coins a été donnée p.~\pageref{corners} +quand on a présenté la clé~|corners|. \label{arraycolor} @@ -2406,10 +2467,10 @@ b & a & b & \Ddots & & \Vdots \\ Les lignes pointillées délimitent des blocs virtuels qui ont le même comportement vis à vis des filets que les blocs créés par |\Block| (les filets -spécifiés par le spécificateur \verb+|+ dans le préambule et par les clés -|vlines|, |hlines|, |hvlines| et |hvlines-except-corners| ne sont pas tracés -dans les blocs). - +spécifiés par le spécificateur \verb+|+ dans le préambule, la commande |\Hline| +et par les clés |vlines|, |hlines| et |hvlines| ne sont pas tracés dans les +blocs).\footnote{En revanche, la commande \verb|\line| dans le \verb|\CodeAfter| + (cf.~p.~\pageref{line-in-code-after}) ne crée pas de bloc.} \medskip \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] @@ -2433,7 +2494,7 @@ $\begin{bNiceMatrix}[margin,hvlines] \label{code-after} On a présenté p.~\pageref{code-before} la clé |code-before|. Il existe en fait une clé similaire |code-after| qui peut être utilisée pour indiquer du code qui -sera exécuté après la construction du tableau. +sera exécuté \emph{après} la construction du tableau. \medskip Pour améliorer la lisibilité du code, une syntaxe alternative est proposée : on @@ -2454,12 +2515,17 @@ Par ailleurs, deux commandes spéciales sont disponibles dans le |\CodeAfter| : \subsection{La commande \textbackslash line dans le \textbackslash CodeAfter} +\label{line-in-code-after} La commande |\line| permet de tracer directement des lignes en pointillés entre les cases. Elle prend deux arguments correspondant aux deux cases à relier, chacun de la forme $i$-$j$ où $i$ est le numéro de ligne et $j$ est le numéro de -colonne. Elle peut par exemple être utilisée pour tracer une ligne entre deux -cases adjacentes comme dans l'exemple suivant. -\label{line-in-code-after} +colonne. Les options disponibles pour personnaliser les lignes pointillées créées par +|\Cdots|, |\Vdots|, etc. peuvent aussi être passées à cette commande (cf. +p.~\pageref{customization}). + +\medskip +Cette commande peut par exemple être utilisée pour tracer une ligne entre deux +cases adjacentes. \medskip \begin{BVerbatim}[baseline=c,boxwidth=11cm] @@ -2483,10 +2549,29 @@ I & 0 & \Cdots &0 \\ \end{pNiceMatrix}$ \end{scope} +\bigskip +Elle peut aussi être utilisée pour tracer une ligne diagonale non parallèle aux +autres lignes diagonales (par défaut, les lignes tracées par |\Ddots| sont +«parallélisées» : cf~p.~\pageref{parallelization}). + \medskip -Les options disponibles pour personnaliser les lignes pointillées créées par -|\Cdots|, |\Vdots|, etc. peuvent aussi être passées à cette commande (cf. -p.~\pageref{customization}). +\begin{BVerbatim} +\begin{bNiceMatrix} +1 & \Cdots & & 1 & 2 & \Cdots & 2 \\ +0 & \Ddots & & \Vdots & \Vdots & \hspace*{2.5cm} & \Vdots \\ +\Vdots & \Ddots & & & & & \\ +0 & \Cdots & 0 & 1 & 2 & \Cdots & 2 +~emphase#\CodeAfter \line[shorten=6pt]{1-5}{4-7}@ +\end{bNiceMatrix} +\end{BVerbatim} +\[\begin{bNiceMatrix} +1 & \Cdots & & 1 & 2 & \Cdots & 2 \\ +0 & \Ddots & & \Vdots & \Vdots & \hspace*{2.5cm} & \Vdots \\ +\Vdots & \Ddots & & & & & \\ +0 & \Cdots & 0 & 1 & 2 & \Cdots & 2 +\CodeAfter \line[shorten=6pt]{1-5}{4-7} +\end{bNiceMatrix}\] + \subsection{La commande \textbackslash SubMatrix dans le \textbackslash CodeAfter} @@ -3314,7 +3399,8 @@ lignes en pointillés entre les cases du tableau. \smallskip Néanmoins, on peut forcer la création d'un nœud avec la commande |\NotEmpty|.\footnote{Il faut toutefois remarquer qu'avec cette commande, la case est considérée comme non vide, ce qui a des conséquences sur le tracé des -lignes pointillées (cf.~p.~\pageref{Cdots}).} +lignes pointillées (cf.~p.~\pageref{Cdots}) et la déterminations des «coins» +(cf. p.~\pageref{corners}).} \bigskip Tous les nœuds du document doivent avoir des noms deux à deux distincts et le @@ -3632,25 +3718,28 @@ noix & noisette & brugnon \label{noeuds-i} -\colorbox{yellow!30}{Nouveau 5.11}\enskip L'extension \pkg{nicematrix} -crée un nœud PGF-Tikz nommé simplement $i$ (précédé du préfixe habituel) à -l'intersection du filet horizontal de numéro $i$ et du filet vertical de -numéro~$j$ (ou plutôt la position potentielle de ces filets car ils ne sont -peut-être pas tracés). Ces nœuds sont accessibles dans le |\CodeAfter| mais -aussi dans le |code-before|. +L'extension \pkg{nicematrix} crée un nœud PGF-Tikz nommé simplement $i$ (précédé +du préfixe habituel) à l'intersection du filet horizontal de numéro $i$ et du +filet vertical de numéro~$i$ (ou plutôt la position potentielle de ces filets +car ils ne sont peut-être pas tracés). Le dernier nœud a aussi un alias nommé +simplement |last|. + +\smallskip +\colorbox{yellow!50}{\textbf{Nouveau 5.14}}\enskip Il existe aussi un nœud nommé +$i$|.5| à mi-chemin entre le nœud $i$ et le nœud $i+1$. +Ces nœuds sont accessibles dans le +|\CodeAfter| mais aussi dans le |\CodeBefore|. -\colorbox{yellow!50}{Nouveau 5.13}\enskip Le dernier nœud a aussi un alias nommé -|last|. \begin{center} \begin{NiceTabular}{ccc}[hvlines,rules={width=1pt,color=gray}] -rose & tulipe & lys \\ -arum & iris & violette \\ -muguet & dahlia & souci + & tulipe & lys \\ +arum & & violette mauve \\ +muguet & dahlia \CodeAfter \tiny \begin{tikzpicture} -\foreach \i in {1,2,3,4} +\foreach \i in {1,1.5,2,2.5,3,3.5,4} { \fill [red] (\i) circle (0.5mm) ; \node [red,above right] at (\i) {\i} ; @@ -3663,7 +3752,7 @@ muguet & dahlia & souci \bigskip Si on utilise Tikz (on rappelle que \pkg{nicematrix} ne charge pas Tikz mais uniquement \textsc{pgf} qui est une sous-couche de Tikz), on peut donc accéder -(dans le |\CodeAfter| mais aussi dans le |code-before|) à l'intersection du filet +(dans le |\CodeAfter| mais aussi dans le |\CodeBefore|) à l'intersection du filet horizontal~$i$ et du filet vertical~$j$ avec la syntaxe |(|$i$\verb+-|+$j$|)|. @@ -3700,8 +3789,30 @@ horizontal~$i$ et du filet vertical~$j$ avec la syntaxe |(|$i$\verb+-|+$j$|)|. 1 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & 1 \end{NiceMatrix}\] +\bigskip +Les nœuds de la forme $i$|.5| peuvent être utilisés par exemple pour barrer une +ligne (si on a chargé Tikz). + +\smallskip +\begin{BVerbatim}[boxwidth=11cm,baseline=c] +$\begin{pNiceArray}{ccc|c} +2 & 1 & 3 & 0 \\ +3 & 3 & 1 & 0 \\ +3 & 3 & 1 & 0 +\CodeAfter + \tikz \draw [red] (~emphase#3.5@-|1) -- (~emphase#3.5@-|last) ; +\end{pNiceArray}$ +\end{BVerbatim} +$\begin{pNiceArray}{ccc|c} +2 & 1 & 3 & 0 \\ +3 & 3 & 1 & 0 \\ +3 & 3 & 1 & 0 +\CodeAfter + \tikz \draw [red] (3.5-|1) -- (3.5-|last) ; +\end{pNiceArray}$ -\subsection{Les nœuds correspondant aux commandes \textbackslash SubMatrix} + +\subsection{Les nœuds correspondants aux commandes \textbackslash SubMatrix} \label{node-sub-matrix} @@ -3880,6 +3991,8 @@ est sans effet. \subsection{Lignes diagonales} +\label{parallelization} + Par défaut, toutes les lignes diagonales\footnote{On parle des lignes créées par |\Ddots| et non des lignes créées par une commande |\line| dans le |\CodeAfter|.} d'un même tableau sont «parallélisées». Cela signifie que la @@ -4382,9 +4495,8 @@ précédentes. C'est que les parenthèses, en LaTeX, n'ont pas toutes la même largeur suivant leur taille. \medskip -\colorbox{yellow!50}{\textbf{Nouveau 5.12}}\enskip Pour résoudre ce problème, on -peut demander que les délimiteurs soient composés avec leur largeur maximale -grâce à la clé booléenne |delimiters/max-width|. +Pour résoudre ce problème, on peut demander que les délimiteurs soient composés +avec leur largeur maximale grâce à la clé booléenne |delimiters/max-width|. \begin{Verbatim}[formatcom=\small\color{gray}] ~emphase#\begin{NiceMatrixBlock}[auto-columns-width]@ diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx index 38269b145c..fb4ebed732 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.dtx +++ b/macros/latex/contrib/nicematrix/nicematrix.dtx @@ -15,8 +15,8 @@ % % \fi % \iffalse -\def\myfileversion{5.13} -\def\myfiledate{2021/03/23} +\def\myfileversion{5.14} +\def\myfiledate{2021/04/08} % % %<*batchfile> @@ -70,6 +70,7 @@ version 2005/12/01 or later. \usepackage{varwidth} \def\LetterAt{@} \parindent 0pt +\skip \footins = 2 \bigskipamount \EnableCrossrefs \makeatletter @@ -190,7 +191,8 @@ version 2005/12/01 or later. % use these nodes to develop new features. As usual with \textsc{pgf}, the % coordinates of these nodes are written in the |.aux| to be used on the next % compilation and that's why \pkg{nicematrix} may need \textbf{several -% compilations}. +% compilations}.\footnote{If you use Overleaf, Overleaf will do automatically +% the right number of compilations.} % % \bigskip % Most features of \pkg{nicematrix} may be used without explicit use of @@ -239,13 +241,18 @@ version 2005/12/01 or later. % corresponding environments of \pkg{amsmath} (which is loaded by % \pkg{nicematrix}): |{matrix}|, |{pmatrix}|, etc. % +% \medskip +% \textbf{It's recommended to use primarily the classical environments and to use the +% environments of \pkg{nicematrix} only when some feature provided by these +% environments is used (this will save memory).} +% % \medskip % All the environments of the package \pkg{nicematrix} accept, between square % brackets, an optional list of \textsl{key=value} pairs. \textbf{There must be % no space before the opening bracket (|[|) of this list of options.} % %\bigskip -% \textbf{Important} +% \textbf{Important}\par\nobreak % % Before the version 5.0, it was mandatory to use, for technical reasons, the % letters |L|, |C| et |R| instead of |l|, |c| et |r| in the preambles of the @@ -561,15 +568,16 @@ version 2005/12/01 or later. % content of the block but draws also the frame of the block with that color; % \item the key |line-width| is the width (thickness) of the frame (this key % should be used only when the key |draw| is in force); -% \item \colorbox{yellow!50}{\textbf{New 5.12}}\enskip the key |rounded-corners| -% requires rounded corners (for the frame drawn by |draw| and the shape drawn by -% |fill|) with a radius equal to the value of that key (the default value is -% 4~pt\footnote{This value is the initial value of the \emph{rounded corners} of -% Tikz.}). -% \item \colorbox{yellow!50}{\textbf{New 5.13}}\enskip the key |borders| provides -% the ability to draw only some borders of the blocks; the value of that key is -% a (comma-separated) list of elements covered by |left|, |right|, |top| and -% |bottom|. +% \item the key |rounded-corners| requires rounded corners (for the frame drawn +% by |draw| and the shape drawn by |fill|) with a radius equal to the value of +% that key (the default value is 4~pt\footnote{This value is the initial value +% of the \emph{rounded corners} of Tikz.}); +% \item the key |borders| provides the ability to draw only some borders of the +% blocks; the value of that key is a (comma-separated) list of elements covered +% by |left|, |right|, |top| and |bottom|; +% \item \colorbox{yellow!50}{\bfseries New 5.14}\enskip the keys |t| and |b| fix +% the base line that will be given to the block when it has a multi-line content +% (the lines are separated by |\\|). % \end{itemize} % % \interitem @@ -679,6 +687,8 @@ version 2005/12/01 or later. % background of a unique celle, there is no point using the command |\Block|: % it's possible to use the command |\cellcolor| (when the key |colortbl-like| is % used).} +% +% \item It's possible to draw one or several borders of the cell with the key |borders|. % \end{itemize} % % \bigskip @@ -785,7 +795,8 @@ version 2005/12/01 or later. % % \bigskip % However, the vertical rules are not drawn in the blocks (created by |\Block|: -% cf.~p.~\pageref{Block}). +% cf.~p.~\pageref{Block}) nor in the corners (created by the key |corner|: +% cf.~p.~\pageref{corners}). % % \bigskip % If you use \pkg{booktabs} (which provides |\toprule|, |\midrule|, @@ -926,26 +937,45 @@ version 2005/12/01 or later. % page~\pageref{OnlyMainNiceMatrix}. % % -% \subsection{The command \textbackslash Hline} +% \subsection{The tools of nicematrix for the rules} % -% We have said that the vertical rules specified by a symbol ``\verb+|+'' in the -% preamble (for the environments with preamble, of course) are not drawn in the -% blocks.\footnote{Those blocks are those created by the commands \verb|\Block| -% and |\multicolumn| but also those implicitely determined by the continuous -% dotted lines (created by \verb|\Cdots|, etc.).} +% Here are the tools provided by \pkg{nicematrix} for the rules. +% \begin{itemize} +% \item the keys |hlines|, |vlines| and |hvlines|; +% \item the specifier ``\verb+|+'' in the preamble (for the environments with +% preamble); +% \item the command |\Hline|. +% \end{itemize} +% +% \medskip +% \textbf{All these tools don't draw the rules in the blocks nor in the +% empty corners (when the key |corners| is used).} +% \begin{itemize} +% \item These blocks are: +% \begin{itemize} +% \item the blocks created by the command |\Block|\footnote{And also the command \verb|\multicolumn| also +% it's recommended to use instead |\Block| in the environments of +% \pkg{nicematrix}.} presented +% p.~\pageref{Block}; +% \item the blocks implicitely delimited by the continuous dotted lines created +% by |\Cdots|, |Vdots|, etc. (cf.~p.~\pageref{Cdots}). +% \end{itemize} +% \item The corners are created by the key |corners| explained below (see p.~\pageref{corners}). +% \end{itemize} % -% \smallskip -% \colorbox{yellow!50}{\textbf{New 5.13}}\enskip In order to have horizontal -% rules with the same behaviour, \pkg{nicematrix} provides the command |\Hline|. +% In particular, this remark explains the difference between the standard +% command |\hline| and the command |\Hline| provided by \pkg{nicematrix}. % % -% \subsection{The keys hlines and vlines} +% \subsubsection{The keys hlines and vlines} % -% The key |hlines| draws all the horizontal rules and the key |vlines| draws all -% the vertical rules excepted in the blocks, created by |\Block| and the virtual -% blocks determined by dotted lines: |\Cdots|, |\Vdots|, etc.. In fact, in the -% environments with delimiters (as |{pNiceMatrix}| or |{bNiceArray}|) the -% exterior rules are not drawn (as expected). +% The keys |hlines| and |vlines| (which draw, of course, horizontal and vertical +% rules) take in as value a list of numbers which are the numbers of the rules +% to draw. +% +% In fact, for the environments with delimiters (such as |{pNiceMatrix}| or +% |{bNiceArray}|), the key |vlines| don't draw the exterior rules (this is +% certainly the expected behaviour). % % \medskip % \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] @@ -962,21 +992,13 @@ version 2005/12/01 or later. % \end{pNiceMatrix}$ % % -% \bigskip -% \colorbox{yellow!50}{\textbf{New 5.13}}\enskip It's possible to provide to the -% key |vlines| a (comma-separated) list of numbers, which are the numbers of the -% vertical rules to draw. The key |hlines| has a similar behaviour. % -% -% \subsection{The key hvlines} +% \subsubsection{The key hvlines} % \label{hvlines} % -% The key |hvlines| draws all the vertical and horizontal rules (excepted -% in the blocks and the virtual blocks determined by dotted lines and excepted -% the rules corresponding of the frame of the blocks using the key |draw| which -% are drawn with their own characteristics). +% The key |hvlines| (no value) is the conjonction of the keys |hlines| and |vlines|. % -% \medskip +% \smallskip % \begin{Verbatim} % \setlength{\arrayrulewidth}{1pt} % \begin{NiceTabular}{cccc}[~emphase#hvlines@,rules/color=blue] @@ -998,71 +1020,104 @@ version 2005/12/01 or later. % \end{center} % % -% \subsection{The key hvlines-except-corners} +% \subsubsection{The (empty) corners} % -% \label{except-corners} +% \label{corners} % -% The key |hvlines-except-corners| draws all the horizontal and vertical rules, -% excepted in the blocks (and the virtual blocks determined by dotted lines) and -% excepted in the empty corners. +% The four |corners| of an array will be designed by |NW|, |SW|, |NE| and |SE| +% (\emph{north west}, \emph{south west}, \emph{north east} and \emph{south east}). % -% \medskip -% \begin{Verbatim} -% \begin{NiceTabular}{*{6}{c}}[~emphase#hvlines-except-corners@,cell-space-top-limit=3pt] +% For each of these corners, we will call \emph{empty corner} (or simply +% \emph{corner}) the reunion of all the empty rectangles starting from the cell +% actually in the corner of the array.\footnote{For sake of completeness, we +% should also say that a cell contained in a block (even an empty cell) is not +% taken into account for the determination of the corners. That behaviour is natural.} +% +% However, it's possible, for a cell without content, to require \pkg{nicemarix} +% to consider that cell as not empty with the key |\NotEmpty|. +% +%\bigskip +% \begin{minipage}{9cm} +% In the example on the right (where B is in the center of a block of size +% $2\times2$), we have colored in blue the four (empty) corners of the array. +% \end{minipage}\hspace{2cm}% +% \begin{NiceTabular}{*{6}{c}}[cell-space-top-limit=3pt] +% \CodeBefore +% \rectanglecolor{blue!10}{1-1}{4-2} +% \rectanglecolor{blue!10}{1-1}{1-4} +% \rectanglecolor{blue!10}{1-6}{3-6} +% \rectanglecolor{blue!10}{7-1}{9-1} +% \rectanglecolor{blue!10}{7-5}{9-6} +% \Body % & & & & A \\ % & & A & A & A \\ % & & & A \\ % & & A & A & A & A \\ % A & A & A & A & A & A \\ % A & A & A & A & A & A \\ +% & A & A & A \\ % & \Block{2-2}{B} & & A \\ % & & & A \\ -% & A & A & A \\ % \end{NiceTabular} -% \end{Verbatim} -% % -% \begin{center} -% \begin{NiceTabular}{*{6}{c}}[hvlines-except-corners,cell-space-top-limit=3pt] +% +% \bigskip +% \colorbox{yellow!50}{\textbf{New 5.14}}\enskip When the key |corners| is used, +% \pkg{nicematrix} computes the (empty) corners and these corners will be taken +% into account by the tools for drawing the rules (the rules won't be drawn in +% the corners). \emph{Remark}: In the previous versions of \pkg{nicematrix}, +% there was only a key |hvlines-except-corners| (now considered as obsolete). +% +% \bigskip +% \begin{BVerbatim}[boxwidth=11cm,baseline=c] +% \NiceMatrixOptions{cell-space-top-limit=3pt} +% \begin{NiceTabular}{*{6}{c}}[~emphase#corners@,hvlines] % & & & & A \\ % & & A & A & A \\ % & & & A \\ % & & A & A & A & A \\ % A & A & A & A & A & A \\ % A & A & A & A & A & A \\ +% & A & A & A \\ % & \Block{2-2}{B} & & A \\ % & & & A \\ +% \end{NiceTabular} +% \end{BVerbatim} +% \begin{NiceTabular}{*{6}{c}}[corners,hvlines,cell-space-top-limit=3pt] +% & & & & A \\ +% & & A & A & A \\ +% & & & A \\ +% & & A & A & A & A \\ +% A & A & A & A & A & A \\ +% A & A & A & A & A & A \\ % & A & A & A \\ +% & \Block{2-2}{B} & & A \\ +% & & & A \\ % \end{NiceTabular} -% \end{center} % -% As we can see, an ``empty corner'' is composed by the reunion of all the empty -% rectangles starting from the cell actually in the corner of the array. % % \bigskip -% It's possible to give as value to the key |\hvlines-except-corners| a list of -% the corners to take into consideration. The corners are designed by |NW|, -% |SW|, |NE| and |SE| (\emph{north west}, \emph{south west}, \emph{north east} -% and \emph{south east}). +% It's also possible to provide to the key |corners| a (comma-separated) list of +% corners (designed by |NW|, |SW|, |NE| and |SE|). % -% \bigskip +% \medskip % \begin{BVerbatim}[boxwidth=11cm,baseline=c] -% \begin{NiceTabular}{*{6}{c}}% -% [~emphase#hvlines-except-corners=NE@,cell-space-top-limit=3pt] +% \NiceMatrixOptions{cell-space-top-limit=3pt} +% \begin{NiceTabular}{*{6}{c}}[~emphase#corners=NE@,hvlines] % 1\\ % 1&1\\ % 1&2&1\\ % 1&3&3&1\\ % 1&4&6&4&1\\ -% 1&5&10&10&5&1 +% & & & & &1 % \end{NiceTabular} % \end{BVerbatim} -% \begin{NiceTabular}{*{6}{c}}[c,hvlines-except-corners=NE,cell-space-top-limit=3pt] +% \begin{NiceTabular}{*{6}{c}}[c,corners=NE,hvlines,cell-space-top-limit=3pt] % 1\\ % 1&1\\ % 1&2&1\\ % 1&3&3&1\\ % 1&4&6&4&1\\ -% 1&5&10&10&5&1 +% & & & & &1 % \end{NiceTabular} % % \bigskip @@ -1213,10 +1268,10 @@ version 2005/12/01 or later. % The extension \pkg{nicematrix} provides a key |code-before| for some code that % will be executed before the drawing of the tabular. % -% \medskip -% \colorbox{yellow!50}{\textbf{New 5.12}}\enskip An alternative syntax is -% provided: it's possible to put the content of that |code-before| between the -% keywords |\CodeBefore| and |\Body| at the beginning of the environment. +% \medskip +% An alternative syntax is provided: it's possible to put the content of that +% |code-before| between the keywords |\CodeBefore| and |\Body| at the beginning +% of the environment. % % \begin{Verbatim} % \begin{pNiceArray}{~textsl#preamble@} @@ -1379,10 +1434,10 @@ version 2005/12/01 or later. % \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$. +% 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 -% of a given row relies only upon the parity of its number.} +% 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}). @@ -1489,14 +1544,12 @@ version 2005/12/01 or later. % p.~\pageref{key-R}). % % -% \item \colorbox{yellow!50}{\textbf{New 5.13}}\enskip -% The command |\arraycolor| takes in as mandatory argument a color and color -% the whole tabular with that color (excepted the potential exterior rows and -% columns: cf.~p.~\pageref{exterior}). This command is useful thanks to its key -% |except-corners| (in the third argument, which is a optional argument between -% square brackets). The definition of these ``corners'' has been given -% p.~\pageref{except-corners} when we have presented the key -% |hvlines-except-corners|. +% \item The command |\arraycolor| takes in as mandatory argument a color and +% color the whole tabular with that color (excepted the potential exterior rows +% and columns: cf.~p.~\pageref{exterior}). This command is useful thanks to its +% key |except-corners| (in the third argument, which is a optional argument +% between square brackets). The definition of these ``corners'' has been given +% p.~\pageref{corners} when we have presented the key |corners|. % % \label{arraycolor} % @@ -2387,8 +2440,10 @@ version 2005/12/01 or later. % % The dotted lines determine virtual blocks which have the same behaviour % regarding the rules (the rules specified by the specifier \verb+|+ in the -% preamble and by the keys |hlines|, |vlines|, |hvlines| and -% |hvlines-except-corners| are not drawn within the blocks). +% preamble, by the command |\Hline| and by the keys |hlines|, |vlines| and +% |hvlines| are not drawn within the blocks).\footnote{On the other side, the +% command \verb|\line| in the \verb|\CodeAfter| +% (cf.~p.~\pageref{line-in-code-after}) does \emph{not} create block.} % % \medskip % \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] @@ -2412,19 +2467,19 @@ version 2005/12/01 or later. % % \label{code-after} % The option |code-after| may be used to give some code that will be executed -% after the construction of the matrix.\footnote{There is also a key +% \emph{after} the construction of the matrix.\footnote{There is also a key % |code-before| described p.~\pageref{code-before}.} % % \medskip % For the legibility of the code, an alternative syntax is provided: it's -% possible to give the instructions of the |\code-after| at the end of the +% possible to give the instructions of the |code-after| at the end of the % environment, after the keyword |\CodeAfter|. Although |\CodeAfter| is a % keyword, it takes in an optional argument (between square brackets). The keys % accepted form a subset of the keys of the command |\WithArrowsOptions|. % % % \medskip -% The experienced users may use, for instance, the PGF/Tikz nodes created by +% The experienced users may, for instance, use the PGF/Tikz nodes created by % \pkg{nicematrix} in the |\CodeAfter|. These nodes are described further % beginning on p.~\pageref{PGF-nodes}. % @@ -2434,11 +2489,16 @@ version 2005/12/01 or later. % % \subsection{The command \textbackslash line in the \textbackslash CodeAfter} % +% \label{line-in-code-after} % The command |\line| draws directly dotted lines between nodes. It takes in two % arguments for the two cells to link, both of the form $i$-$j$ where is the -% number of the row and $j$ is the number of the column. It may be used, for -% example, to draw a dotted line between two adjacent -% cells. \label{line-in-code-after} +% number of the row and $j$ is the number of the column. The options available +% for the customisation of the dotted lines created by |\Cdots|, |\Vdots|, etc. +% are also available for this command (cf. p.~\pageref{customisation}). +% +% \bigskip +% This command may be used, for example, to draw a dotted line between two +% adjacent cells. % % \medskip % \begin{BVerbatim}[baseline=c,boxwidth=11cm] @@ -2462,10 +2522,29 @@ version 2005/12/01 or later. % \end{pNiceMatrix}$ % \end{scope} % +% \bigskip +% It can also be used to draw a diagonal line not parallel to the other diagonal +% lines (by default, the dotted lines drawn by |\Ddots| are ``parallelized'': +% cf.~p.~\pageref{parallelization}). +% % \medskip -% The options available for the customisation of the dotted lines created by -% |\Cdots|, |\Vdots|, etc. are also available for this command (cf. -% p.~\pageref{customisation}). +% \begin{BVerbatim} +% \begin{bNiceMatrix} +% 1 & \Cdots & & 1 & 2 & \Cdots & 2 \\ +% 0 & \Ddots & & \Vdots & \Vdots & \hspace*{2.5cm} & \Vdots \\ +% \Vdots & \Ddots & & & & & \\ +% 0 & \Cdots & 0 & 1 & 2 & \Cdots & 2 +% ~emphase#\CodeAfter \line[shorten=6pt]{1-5}{4-7}@ +% \end{bNiceMatrix} +% \end{BVerbatim} +% \[\begin{bNiceMatrix} +% 1 & \Cdots & & 1 & 2 & \Cdots & 2 \\ +% 0 & \Ddots & & \Vdots & \Vdots & \hspace*{2.5cm} & \Vdots \\ +% \Vdots & \Ddots & & & & & \\ +% 0 & \Cdots & 0 & 1 & 2 & \Cdots & 2 +% \CodeAfter \line[shorten=6pt]{1-5}{4-7} +% \end{bNiceMatrix}\] +% % % % \subsection{The command \textbackslash SubMatrix in the \textbackslash CodeAfter} @@ -3277,10 +3356,11 @@ version 2005/12/01 or later. % \textbf{Caution} : By default, no node is created in a empty cell. % % \smallskip -% However, it's possible to impose the creation of a node with the command |\NotEmpty|. -% \footnote{One should note that, with that command, the cell is considered as -% non-empty, which has consequencies for the continuous dotted lines (cf. -% p.~\pageref{Cdots}).} +% However, it's possible to impose the creation of a node with the command +% |\NotEmpty|. \footnote{One should note that, with that command, the cell is +% considered as non-empty, which has consequencies for the continuous dotted +% lines (cf. p.~\pageref{Cdots}) and the computation of the ``corners'' +% (cf.~p.~\pageref{corners}).} % % \medskip % The nodes of a document must have distinct names. That's why the names of the @@ -3589,24 +3669,26 @@ version 2005/12/01 or later. % \subsection{The nodes which indicate the position of the rules} % % \label{nodes-i} -% \colorbox{yellow!30}{New 5.11}\enskip The package \pkg{nicematrix} -% creates a PGF/Tikz node merely called $i$ (with the classical prefix) at the -% intersection of the horizontal rule of number~$i$ and the vertical rule of -% number~$j$ (more specifically the potential position of those rules because -% maybe there are not actually drawn). These nodes are available in the -% |code-before| and the |\CodeAfter|. -% -% \colorbox{yellow!50}{\textbf{New 5.13}}\enskip The last node has also an alias called -% |last|. +% The package \pkg{nicematrix} creates a PGF/Tikz node merely called $i$ (with +% the classical prefix) at the intersection of the horizontal rule of number~$i$ +% and the vertical rule of number~$i$ (more specifically the potential position +% of those rules because maybe there are not actually drawn). The last node has +% also an alias called |last|. +% +% \colorbox{yellow!50}{\textbf{New 5.14}}\enskip There is also a node called +% $i$|.5| midway between the node $i$ and the node $i+1$. +% +% These nodes are available in the |\CodeBefore| and the |\CodeAfter|. +% % \begin{center} % \begin{NiceTabular}{ccc}[hvlines,rules/width=1pt,rules/color=gray] -% rose & tulipe & lys \\ -% arum & iris & violette \\ -% muguet & dahlia & souci +% & tulipe & lys \\ +% arum & & violette mauve \\ +% muguet & dahlia % \CodeAfter % \tiny % \begin{tikzpicture} -% \foreach \i in {1,2,3,4} +% \foreach \i in {1,1.5,2,2.5,3,3.5,4} % { % \fill [red] (\i) circle (0.5mm) ; % \node [red,above right] at (\i) {\i} ; @@ -3618,7 +3700,7 @@ version 2005/12/01 or later. % \bigskip % If we use Tikz (we remind that \pkg{nicematrix} does not load Tikz by default, % by only \textsc{pgf}, which is a sub-layer of Tikz), we can access, in the -% |\CodeAfter| but also in the |code-before|, to the intersection of the +% |\CodeAfter| but also in the |\CodeBefore|, to the intersection of the % (potential) horizontal rule~$i$ and the (potential) vertical rule~$j$ with the % syntax |(|$i$\verb+-|+$j$|)|. % @@ -3655,6 +3737,29 @@ version 2005/12/01 or later. % 1 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & 1 % \end{NiceMatrix}\] % +% +% \bigskip +% The nodes of the form $i$|.5| may be used, for example to cross a row of a +% matrix (if Tikz is loaded). +% +% \smallskip +% \begin{BVerbatim}[boxwidth=11cm,baseline=c] +% $\begin{pNiceArray}{ccc|c} +% 2 & 1 & 3 & 0 \\ +% 3 & 3 & 1 & 0 \\ +% 3 & 3 & 1 & 0 +% \CodeAfter +% \tikz \draw [red] (~emphase#3.5@-|1) -- (~emphase#3.5@-|last) ; +% \end{pNiceArray}$ +% \end{BVerbatim} +% $\begin{pNiceArray}{ccc|c} +% 2 & 1 & 3 & 0 \\ +% 3 & 3 & 1 & 0 \\ +% 3 & 3 & 1 & 0 +% \CodeAfter +% \tikz \draw [red] (3.5-|1) -- (3.5-|last) ; +% \end{pNiceArray}$ +% % \subsection{The nodes corresponding to the command \textbackslash SubMatrix} % % \label{node-sub-matrix} @@ -3829,6 +3934,7 @@ version 2005/12/01 or later. % % \subsection{Diagonal lines} % +% \label{parallelization} % By default, all the diagonal lines\footnote{We speak of the lines created by % |\Ddots| and not the lines created by a command |\line| in |code-after|.} of a % same array are ``parallelized''. That means that the first diagonal line is @@ -4319,9 +4425,9 @@ version 2005/12/01 or later. % (smaller parenthesis are a bit slimer). % % \medskip -% \colorbox{yellow!50}{\textbf{New 5.12}}\enskip In order the solve that -% problem, it's possible to require the delimiters to be composed with the -% maximal width, thanks to the boolean key |delimiters/max-width|. +% In order the solve that problem, it's possible to require the delimiters to be +% composed with the maximal width, thanks to the boolean key +% |delimiters/max-width|. % % \begin{Verbatim}[formatcom=\small\color{gray}] % ~emphase#\begin{NiceMatrixBlock}[auto-columns-width]@ @@ -4689,7 +4795,7 @@ version 2005/12/01 or later. % \end{pNiceArray}\] % % -% \subsection{Utilisation of \textbackslash SubMatrix in the code-before} +% \subsection{Utilisation of \textbackslash SubMatrix in the \textbackslash CodeBefore} % % In the following example, we illustrate the mathematical product of two % matrices. @@ -5658,7 +5764,7 @@ version 2005/12/01 or later. % % \medskip % We are able to determine the number of columns specified in the preamble (for -% the environments with explicit preamble, of course and without the potential +% the environments with explicit preamble of course and without the potential % exterior columns). % \begin{macrocode} \int_new:N \g_@@_static_num_of_col_int @@ -5693,10 +5799,15 @@ version 2005/12/01 or later. % \end{macrocode} % % \medskip -% The parameter of position of the label of a block (|c|, |r| or |l|). +% The parameters of position of the label of a block. For the horizontal +% position, the possible values are |c|, |r| and |l|. For the vertical position, +% the possible values are |c|, |t| and |b|. Of course, it would be intesting to +% program a key |T| and a key |B|. % \begin{macrocode} -\tl_new:N \l_@@_pos_of_block_tl -\tl_set:Nn \l_@@_pos_of_block_tl { c } +\tl_new:N \l_@@_hpos_of_block_tl +\tl_set:Nn \l_@@_hpos_of_block_tl { c } +\tl_new:N \l_@@_vpos_of_block_tl +\tl_set:Nn \l_@@_vpos_of_block_tl { c } % \end{macrocode} % % \medskip @@ -6186,12 +6297,9 @@ version 2005/12/01 or later. % % % \bigskip -% The flag |\l_@@_except_corners_bool| will be raised when the key -% |except-corners| will be used. In that case, the corners will be computed -% before we draw rules and the rules won't be drawn in the corners. As expected, -% the key |hvlines-except-corners| raises the key |except-corners|. +% The following parameter correspond to the key |corners|. % \begin{macrocode} -\clist_new:N \l_@@_except_corners_clist +\clist_new:N \l_@@_corners_clist % \end{macrocode} % % \begin{macrocode} @@ -6435,15 +6543,18 @@ version 2005/12/01 or later. \keys_define:nn { NiceMatrix / Env } { delimiters/max-width .bool_set:N = \l_@@_delimiters_max_width_bool , - except-corners .clist_set:N = \l_@@_except_corners_clist , - except-corners .default:n = { NW , SW , NE , SE } , +% \end{macrocode} +% The key |hvlines-except-corners| is now deprecated. +% \begin{macrocode} hvlines-except-corners .code:n = { - \clist_set:Nn \l_@@_except_corners_clist { #1 } + \clist_set:Nn \l_@@_corners_clist { #1 } \clist_set:Nn \l_@@_vlines_clist { all } \clist_set:Nn \l_@@_hlines_clist { all } } , hvlines-except-corners .default:n = { NW , SW , NE , SE } , + corners .clist_set:N = \l_@@_corners_clist , + corners .default:n = { NW , SW , NE , SE } , code-before .code:n = { \tl_if_empty:nF { #1 } @@ -6828,7 +6939,6 @@ version 2005/12/01 or later. % \begin{macrocode} \int_compare:nNnT \c@jCol = 1 { \int_compare:nNnT \l_@@_first_col_int = 1 \@@_begin_of_row: } - \int_gset:Nn \g_@@_col_total_int { \int_max:nn \g_@@_col_total_int \c@jCol } % \end{macrocode} % The content of the cell is composed in the box |\l_@@_cell_box| because we want % to compute some dimensions of the box. The |\hbox_set_end:| corresponding to @@ -7023,6 +7133,7 @@ version 2005/12/01 or later. \@@_node_for_the_cell: { \box_use_drop:N \l_@@_cell_box } } + \int_gset:Nn \g_@@_col_total_int { \int_max:nn \g_@@_col_total_int \c@jCol } \bool_gset_false:N \g_@@_empty_cell_bool \bool_gset_false:N \g_@@_not_empty_cell_bool } @@ -8136,7 +8247,7 @@ version 2005/12/01 or later. % \end{macrocode} % % First, we have to store our preamble in the token register |\@temptokena| -% (those ``token registers'' are not supported by \pkg{expl3}). +% (those ``token registers'' are \emph{not} supported by \pkg{expl3}). % \begin{macrocode} \exp_args:NV \@temptokena \g_@@_preamble_tl % \end{macrocode} @@ -9862,6 +9973,22 @@ version 2005/12/01 or later. } % \end{macrocode} % +% \bigskip +% We define a new \textsc{pgf} shape for the diag nodes because we want to +% provide a anchor called |.5| for those nodes. +% \begin{macrocode} +\pgfdeclareshape { @@_diag_node } + { + \savedanchor { \five } + { + \dim_gset_eq:NN \pgf@x \l_tmpa_dim + \dim_gset_eq:NN \pgf@y \l_tmpb_dim + } + \anchor { 5 } { \five } + \anchor { center } { \pgfpointorigin } + } +% \end{macrocode} +% % % \bigskip % The following command creates the diagonal nodes (in fact, if the matrix is @@ -9871,13 +9998,35 @@ version 2005/12/01 or later. { \pgfpicture \pgfrememberpicturepositiononpagetrue - \int_step_inline:nn { \int_max:nn \c@iRow \c@jCol + 1 } + \int_step_inline:nn { \int_max:nn \c@iRow \c@jCol } { - \@@_qpoint:n { row - \int_min:nn { ##1 } { \c@iRow + 1 } } - \dim_set_eq:NN \l_tmpa_dim \pgf@y \@@_qpoint:n { col - \int_min:nn { ##1 } { \c@jCol + 1 } } - \pgfcoordinate { \@@_env: - ##1 } { \pgfpoint \pgf@x \l_tmpa_dim } + \dim_set_eq:NN \l_tmpa_dim \pgf@x + \@@_qpoint:n { row - \int_min:nn { ##1 } { \c@iRow + 1 } } + \dim_set_eq:NN \l_tmpb_dim \pgf@y + \@@_qpoint:n { col - \int_min:nn { ##1 + 1 } { \c@jCol + 1 } } + \dim_set_eq:NN \l_tmpc_dim \pgf@x + \@@_qpoint:n { row - \int_min:nn { ##1 + 1 } { \c@iRow + 1 } } + \dim_set_eq:NN \l_tmpd_dim \pgf@y + \pgftransformshift { \pgfpoint \l_tmpa_dim \l_tmpb_dim } +% \end{macrocode} +% Now, |\l_tmpa_dim| and |\l_tmpb_dim| become the width and the height of the +% node (of shape |@à_diag_node|) that we will construct. +% \begin{macrocode} + \dim_set:Nn \l_tmpa_dim { ( \l_tmpc_dim - \l_tmpa_dim ) / 2 } + \dim_set:Nn \l_tmpb_dim { ( \l_tmpd_dim - \l_tmpb_dim ) / 2 } + \pgfnode { @@_diag_node } { center } { } { \@@_env: - ##1 } { } } +% \end{macrocode} +% Now, the last node. Of course, that is only a |coordinate| because there is +% not |.5| anchor for that node. +% \begin{macrocode} + \int_set:Nn \l_tmpa_int { \int_max:nn \c@iRow \c@jCol + 1 } + \@@_qpoint:n { row - \int_min:nn { \l_tmpa_int } { \c@iRow + 1 } } + \dim_set_eq:NN \l_tmpa_dim \pgf@y + \@@_qpoint:n { col - \int_min:nn { \l_tmpa_int } { \c@jCol + 1 } } + \pgfcoordinate + { \@@_env: - \int_use:N \l_tmpa_int } { \pgfpoint \pgf@x \l_tmpa_dim } \pgfnodealias { \@@_env: - last } { \@@_env: - \int_eval:n { \int_max:nn \c@iRow \c@jCol + 1 } } @@ -9885,35 +10034,6 @@ version 2005/12/01 or later. } % \end{macrocode} % -% \bigskip -% As for now, the ½ nodes are not documented and they are created only in the -% native \textsc{utf8} engines, that is to say XeLaTeX and LuaLaTeX. -% \begin{macrocode} -\bool_if:nT - { \sys_if_engine_xetex_p: || \sys_if_engine_luatex_p: } - { \tl_put_right:Nn \@@_create_diag_nodes: \@@_create_half_nodes: } -% \end{macrocode} -% -% \begin{macrocode} -\cs_new_protected:Npn \@@_create_half_nodes: - { - \int_step_inline:nn { \int_max:nn \c@iRow \c@jCol } - { - \pgfpicture - \pgfrememberpicturepositiononpagetrue - \pgfcoordinate { \@@_env: - ##1 ½ } - { - \pgfpointscale { 0.5 } - { - \pgfpointadd - { \@@_qpoint:n { ##1 } } - { \@@_qpoint:n { \int_eval:n { ##1 + 1 } } } - } - } - \endpgfpicture - } - } -% \end{macrocode} % % \bigskip % \subsection*{We draw the dotted lines} @@ -10754,21 +10874,13 @@ version 2005/12/01 or later. { \bool_if:NTF \l_@@_initial_open_bool { - % \@@_qpoint:n { row - \int_use:N \l_@@_initial_i_int } - % \dim_set_eq:NN \l_@@_y_initial_dim \pgf@y \@@_open_y_initial_dim: - % \@@_qpoint:n { col - \@@_succ:n \l_@@_initial_j_int } - % \dim_set_eq:NN \l_@@_x_initial_dim \pgf@x \@@_open_x_initial_dim: } { \@@_set_initial_coords_from_anchor:n { south~west } } \bool_if:NTF \l_@@_final_open_bool { - % \@@_qpoint:n { row - \@@_succ:n \l_@@_final_i_int } - % \dim_set_eq:NN \l_@@_y_final_dim \pgf@y \@@_open_y_final_dim: - % \@@_qpoint:n { col - \int_use:N \l_@@_final_j_int } - % \dim_set_eq:NN \l_@@_x_final_dim \pgf@x \@@_open_x_final_dim: } { \@@_set_final_coords_from_anchor:n { north~east } } @@ -11247,10 +11359,6 @@ version 2005/12/01 or later. \exp_args:NNe \@@_old_multicolumn { #1 } -% \end{macrocode} -% We will have to replace |\tl_lower_case:n| in the future since it seems to be -% deprecated. -% \begin{macrocode} { \exp_args:Ne \str_case:nn { \str_foldcase:n { #2 } } { @@ -11925,7 +12033,7 @@ version 2005/12/01 or later. % \end{macrocode} % First, we compute the corners. % \begin{macrocode} - \clist_set:Nn \l_@@_except_corners_clist { #3 } + \clist_set:Nn \l_@@_corners_clist { #3 } \@@_compute_corners: % \end{macrocode} % Now, for each cell of the array (excepted the potential exterior rows and @@ -12151,8 +12259,13 @@ version 2005/12/01 or later. \tl_if_in:NnTF \l_tmpa_tl { - } { \@@_cut_on_hyphen:w ##1 \q_stop } { \@@_cut_on_hyphen:w ##1 - ##1 \q_stop } - \tl_if_empty:NT \l_tmpa_tl { \tl_set:Nn \l_tmpa_tl { 1 } } - \tl_if_empty:NT \l_tmpb_tl + \bool_lazy_or:nnT + { \tl_if_blank_p:V \l_tmpa_tl } + { \str_if_eq_p:Vn \l_tmpa_tl { * } } + { \tl_set:Nn \l_tmpa_tl { 1 } } + \bool_lazy_or:nnT + { \tl_if_blank_p:V \l_tmpb_tl } + { \str_if_eq_p:Vn \l_tmpb_tl { * } } { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } } \int_compare:nNnT \l_tmpb_tl > \c@jCol { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } } @@ -12220,7 +12333,7 @@ version 2005/12/01 or later. % \end{macrocode} % % \bigskip -% When the user uses the key |colortbll-like|, the following command will +% When the user uses the key |colortbl-like|, the following command will % be linked to |\rowcolor| in the tabular. % \begin{macrocode} \NewDocumentCommand \@@_rowcolor_tabular { O { } m } @@ -12234,15 +12347,23 @@ version 2005/12/01 or later. } % \end{macrocode} % +% % \bigskip % \begin{macrocode} \NewDocumentCommand \@@_columncolor_preamble { O { } m } { - \int_compare:nNnT \c@iRow = 1 +% \end{macrocode} +% With the following line, we test whether the cell is the first one we +% encounter in its column (don't forget that some rows may be incomplete). +% \begin{macrocode} + \int_compare:nNnT \c@jCol > \g_@@_col_total_int { % \end{macrocode} % You use |gput_left| because we want the specification of colors for the % columns drawn before the specifications of color for the rows (and the cells). +% Be careful: maybe this is not effective since we have an analyze of the +% instructions in the |\CodeBefore| in order to fill color by color (to avoid +% the thin white lines). % \begin{macrocode} \tl_gput_left:Nx \g_nicematrix_code_before_tl { @@ -12360,7 +12481,7 @@ version 2005/12/01 or later. { \@@_test_vline_in_block:nnnn ##1 } \seq_map_inline:Nn \g_@@_pos_of_stroken_blocks_seq { \@@_test_vline_in_stroken_block:nnnn ##1 } - \clist_if_empty:NF \l_@@_except_corners_clist + \clist_if_empty:NF \l_@@_corners_clist \@@_test_in_corner_v: \bool_if:NTF \g_tmpa_bool { @@ -12474,7 +12595,7 @@ version 2005/12/01 or later. % The following command draws a complete vertical rule in the column |#1| (|#2| % is the number of consecutive rules specified by the number of \verb+|+ in the % preamble). This command will be used if there is no block in the array (and -% the key |except-corners| is not used). +% the key |corners| is not used). % \begin{macrocode} \cs_new_protected:Npn \@@_vline_i_complete:nn #1 #2 { \@@_vline_ii:nnnn { #1 } { #2 } 1 { \int_use:N \c@iRow } } @@ -12483,7 +12604,7 @@ version 2005/12/01 or later. % \bigskip % The command |\@@_draw_hlines:| draws all the vertical rules excepted in the % blocks, in the virtual blocks (determined by a command such as |\Cdots|) and in -% the corners (if the key |except-corners| is used). +% the corners (if the key |corners| is used). % \begin{macrocode} \cs_new_protected:Npn \@@_draw_vlines: { @@ -12541,7 +12662,7 @@ version 2005/12/01 or later. { \@@_test_hline_in_block:nnnn ##1 } \seq_map_inline:Nn \g_@@_pos_of_stroken_blocks_seq { \@@_test_hline_in_stroken_block:nnnn ##1 } - \clist_if_empty:NF \l_@@_except_corners_clist \@@_test_in_corner_h: + \clist_if_empty:NF \l_@@_corners_clist \@@_test_in_corner_h: \bool_if:NTF \g_tmpa_bool { \tl_if_empty:NT \l_tmpc_tl @@ -12657,7 +12778,7 @@ version 2005/12/01 or later. % \bigskip % The command |\@@_draw_hlines:| draws all the horizontal rules excepted in the % blocks (even the virtual drawn determined by commands such as |\Cdots| and in -% the corners (if the key |except-corners| is used). +% the corners (if the key |corners| is used). % \begin{macrocode} \cs_new_protected:Npn \@@_draw_hlines: { @@ -12775,9 +12896,9 @@ version 2005/12/01 or later. % \end{macrocode} % % \bigskip -% \subsubsection*{The key except-corners} +% \subsubsection*{The key corners} % -% When the key |except-corners| is raised, the rules are not drawn in the +% When the key |corners| is raised, the rules are not drawn in the % corners. Of course, we have to compute the corners before we begin to draw the % rules. % @@ -12789,7 +12910,7 @@ version 2005/12/01 or later. % empty cells (and not in a block) considered in the corners of the array. % \begin{macrocode} \seq_clear_new:N \l_@@_empty_corner_cells_seq - \clist_map_inline:Nn \l_@@_except_corners_clist + \clist_map_inline:Nn \l_@@_corners_clist { \str_case:nnF { ##1 } { @@ -13611,12 +13732,16 @@ version 2005/12/01 or later. % \begin{macrocode} \keys_define:nn { NiceMatrix / Block / FirstPass } { - l .code:n = \tl_set:Nn \l_@@_pos_of_block_tl l , + l .code:n = \tl_set:Nn \l_@@_hpos_of_block_tl l , l .value_forbidden:n = true , - r .code:n = \tl_set:Nn \l_@@_pos_of_block_tl r , + r .code:n = \tl_set:Nn \l_@@_hpos_of_block_tl r , r .value_forbidden:n = true , - c .code:n = \tl_set:Nn \l_@@_pos_of_block_tl c , + c .code:n = \tl_set:Nn \l_@@_hpos_of_block_tl c , c .value_forbidden:n = true , + t .code:n = \tl_set:Nn \l_@@_vpos_of_block_tl t , + t .value_forbidden:n = true , + b .code:n = \tl_set:Nn \l_@@_vpos_of_block_tl b , + b .value_forbidden:n = true , color .tl_set:N = \l_@@_color_tl , color .value_required:n = true , } @@ -13680,15 +13805,19 @@ version 2005/12/01 or later. { \int_set:Nn \l_tmpb_int { #2 } } % \end{macrocode} % +% \medskip +% If the block is mono-column. % \begin{macrocode} \int_compare:nNnTF \l_tmpb_int = 1 { \tl_if_empty:NTF \l_@@_cell_type_tl - { \tl_set:Nn \l_@@_pos_of_block_tl c } - { \tl_set_eq:NN \l_@@_pos_of_block_tl \l_@@_cell_type_tl } + { \tl_set:Nn \l_@@_hpos_of_block_tl c } + { \tl_set_eq:NN \l_@@_hpos_of_block_tl \l_@@_cell_type_tl } } - { \tl_set:Nn \l_@@_pos_of_block_tl c } + { \tl_set:Nn \l_@@_hpos_of_block_tl c } % \end{macrocode} +% The value of |\l_@@_hpos_of_block_tl| may be modified by the keys of the +% command |\Block| that we will analyze now. % % \medskip % \begin{macrocode} @@ -13775,18 +13904,24 @@ version 2005/12/01 or later. % the tabular is the same as the external alignment of the tabular (that is to % say the position of the block in its zone of merged cells). % \begin{macrocode} - \bool_if:NT \g_@@_rotate_bool { \tl_set:Nn \l_@@_pos_of_block_tl c } + \bool_if:NT \g_@@_rotate_bool { \tl_set:Nn \l_@@_hpos_of_block_tl c } \bool_if:NTF \l_@@_NiceTabular_bool { - \exp_args:Nnx \begin { tabular } - { @ { } \l_@@_pos_of_block_tl @ { } } + \use:x + { + \exp_not:N \begin { tabular } [ \l_@@_vpos_of_block_tl ] + { @ { } \l_@@_hpos_of_block_tl @ { } } + } #5 \end { tabular } } { \c_math_toggle_token - \exp_args:Nnx \begin { array } - { @ { } \l_@@_pos_of_block_tl @ { } } + \use:x + { + \exp_not:N \begin { array } [ \l_@@_vpos_of_block_tl ] + { @ { } \l_@@_hpos_of_block_tl @ { } } + } #5 \end { array } \c_math_toggle_token @@ -13847,11 +13982,11 @@ version 2005/12/01 or later. % \end{macrocode} % In the list of options |#3|, maybe there is a key for the horizontal alignment % (|l|, |r| or |c|). In that case, that key has been read and stored in -% |\l_@@_pos_of_block_tl|. However, maybe there were no key of the horizontal +% |\l_@@_hpos_of_block_tl|. However, maybe there were no key of the horizontal % alignement and that's why we put a key corresponding to the value of -% |\l_@@_pos_of_block_tl|, which is fixed by the type of current column. +% |\l_@@_hpos_of_block_tl|, which is fixed by the type of current column. % \begin{macrocode} - { \exp_not:n { #3 } , \l_@@_pos_of_block_tl } + { \exp_not:n { #3 } , \l_@@_hpos_of_block_tl } { \box_use_drop:c { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } @@ -13890,9 +14025,12 @@ version 2005/12/01 or later. % say the position of the block in its zone of merged cells). % \begin{macrocode} \bool_if:NT \g_@@_rotate_bool - { \tl_set:Nn \l_@@_pos_of_block_tl c } - \exp_args:Nnx \begin { tabular } - { @ { } \l_@@_pos_of_block_tl @ { } } + { \tl_set:Nn \l_@@_hpos_of_block_tl c } + \use:x + { + \exp_not:N \begin { tabular } [ \l_@@_vpos_of_block_tl ] + { @ { } \l_@@_hpos_of_block_tl @ { } } + } #5 \end { tabular } \group_end: @@ -13903,10 +14041,15 @@ version 2005/12/01 or later. \dim_set_eq:NN \extrarowheight \c_zero_dim #4 \bool_if:NT \g_@@_rotate_bool - { \tl_set:Nn \l_@@_pos_of_block_tl c } + { \tl_set:Nn \l_@@_hpos_of_block_tl c } \c_math_toggle_token - \exp_args:Nnx \begin { array } - { @ { } \l_@@_pos_of_block_tl @ { } } #5 \end { array } + \use:x + { + \exp_not:N \begin { array } [ \l_@@_vpos_of_block_tl ] + { @ { } \l_@@_hpos_of_block_tl @ { } } + } + #5 + \end { array } \c_math_toggle_token \group_end: } @@ -13937,12 +14080,16 @@ version 2005/12/01 or later. borders .value_required:n = true , line-width .dim_set:N = \l_@@_line_width_dim , line-width .value_required:n = true , - l .code:n = \tl_set:Nn \l_@@_pos_of_block_tl l , + l .code:n = \tl_set:Nn \l_@@_hpos_of_block_tl l , l .value_forbidden:n = true , - r .code:n = \tl_set:Nn \l_@@_pos_of_block_tl r , + r .code:n = \tl_set:Nn \l_@@_hpos_of_block_tl r , r .value_forbidden:n = true , - c .code:n = \tl_set:Nn \l_@@_pos_of_block_tl c , + c .code:n = \tl_set:Nn \l_@@_hpos_of_block_tl c , c .value_forbidden:n = true , + t .code:n = \tl_set:Nn \l_@@_vpos_of_block_tl t , + t .value_forbidden:n = true , + b .code:n = \tl_set:Nn \l_@@_vpos_of_block_tl b , + b .value_forbidden:n = true , unknown .code:n = \@@_error:n { Unknown~key~for~Block } } % \end{macrocode} @@ -14266,7 +14413,7 @@ version 2005/12/01 or later. \pgfpointanchor { \@@_env: - #1 - #2 - block - short } { - \str_case:Vn \l_@@_pos_of_block_tl + \str_case:Vn \l_@@_hpos_of_block_tl { c { center } l { west } @@ -14281,7 +14428,7 @@ version 2005/12/01 or later. \pgfnode { rectangle } { - \str_case:Vn \l_@@_pos_of_block_tl + \str_case:Vn \l_@@_hpos_of_block_tl { c { base } l { base~west } @@ -14302,18 +14449,18 @@ version 2005/12/01 or later. % If we are in the first column, we must put the block as if it was with the key~|r|. % \begin{macrocode} \int_compare:nNnT { #2 } = 0 - { \tl_set:Nn \l_@@_pos_of_block_tl r } + { \tl_set:Nn \l_@@_hpos_of_block_tl r } \bool_if:nT \g_@@_last_col_found_bool { \int_compare:nNnT { #2 } = \g_@@_col_total_int - { \tl_set:Nn \l_@@_pos_of_block_tl l } + { \tl_set:Nn \l_@@_hpos_of_block_tl l } } \pgftransformshift { \pgfpointanchor { \@@_env: - #1 - #2 - block - short } { - \str_case:Vn \l_@@_pos_of_block_tl + \str_case:Vn \l_@@_hpos_of_block_tl { c { center } l { west } @@ -14325,7 +14472,7 @@ version 2005/12/01 or later. \pgfnode { rectangle } { - \str_case:Vn \l_@@_pos_of_block_tl + \str_case:Vn \l_@@_hpos_of_block_tl { c { center } l { west } @@ -14659,7 +14806,7 @@ version 2005/12/01 or later. % \end{macrocode} % We put the cell with |\diagbox| in the sequence |\g_@@_pos_of_blocks_seq| % because a cell with |\diagbox| must be considered as non empty by the key -% |except-corners|. +% |corners|. % \begin{macrocode} \seq_gput_right:Nx \g_@@_pos_of_blocks_seq { @@ -15857,7 +16004,7 @@ version 2005/12/01 or later. \@@_msg_new:nn { bad~corner } { #1~is~an~incorrect~specification~for~a~corner~(in~the~keys~ - 'except-corners'~and~'hvlines-except-corners').~The~available~ + 'corners'~and~'except-corners').~The~available~ values~are:~NW,~SW,~NE~and~SE.\\ If~you~go~on,~this~specification~of~corner~will~be~ignored. } @@ -16093,6 +16240,7 @@ version 2005/12/01 or later. code-for-first-row,~ code-for-last-col,~ code-for-last-row,~ + corners,~ create-extra-nodes,~ create-medium-nodes,~ create-large-nodes,~ @@ -16102,7 +16250,6 @@ version 2005/12/01 or later. first-row,~ hlines,~ hvlines,~ - hvlines-except-corners,~ last-col,~ last-row,~ left-margin,~ @@ -16144,6 +16291,7 @@ version 2005/12/01 or later. code-for-last-row,~ colortbl-like,~ columns-width,~ + corners,~ create-extra-nodes,~ create-medium-nodes,~ create-large-nodes,~ @@ -16154,7 +16302,6 @@ version 2005/12/01 or later. first-row,~ hlines,~ hvlines,~ - hvlines-except-corners,~ last-col,~ last-row,~ left-margin,~ @@ -16168,6 +16315,7 @@ version 2005/12/01 or later. rules~(with~the~subkeys~'color'~and~'width'),~ small,~ t,~ + tabularnote,~ vlines,~ xdots/color,~ xdots/shorten~and~ @@ -16202,6 +16350,7 @@ version 2005/12/01 or later. code-for-last-row,~ colortbl-like,~ columns-width,~ + corners,~ create-extra-nodes,~ create-medium-nodes,~ create-large-nodes,~ @@ -16212,7 +16361,6 @@ version 2005/12/01 or later. first-row,~ hlines,~ hvlines,~ - hvlines-except-corners,~ l,~ last-col,~ last-row,~ @@ -16256,6 +16404,7 @@ version 2005/12/01 or later. code-for-last-row,~ colortbl-like,~ columns-width,~ + corners,~ create-extra-nodes,~ create-medium-nodes,~ create-large-nodes,~ @@ -16265,7 +16414,6 @@ version 2005/12/01 or later. first-row,~ hlines,~ hvlines,~ - hvlines-except-corners,~ last-col,~ last-row,~ left-margin,~ @@ -16278,6 +16426,7 @@ version 2005/12/01 or later. right-margin,~ rules~(with~the~subkeys~'color'~and~'width'),~ t,~ + tabularnote,~ vlines,~ xdots/color,~ xdots/shorten~and~ @@ -16766,6 +16915,15 @@ version 2005/12/01 or later. % The keys |vlines| and |hlines| takes in as value a (comma-separated) list of % numbers (for the rules to draw). % +% +% \subsection*{Changes between versions 5.13 and 5.14} +% +% Nodes of the forme |(1.5)|, |(2.5)|, |(3.5)|, etc. +% +% Keys |t| and |b| for the command |\Block|. +% +% Key |corners|. +% % \PrintIndex % % \tableofcontents diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf index 00cce2d6b7..c228e67e67 100644 Binary files a/macros/latex/contrib/nicematrix/nicematrix.pdf and b/macros/latex/contrib/nicematrix/nicematrix.pdf differ -- cgit v1.2.3