summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nicematrix
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-02-19 03:02:00 +0000
committerNorbert Preining <norbert@preining.info>2023-02-19 03:02:00 +0000
commit9fb4a5e992bb10daf1cb0ad8f298a452e50caea8 (patch)
tree654b8fb7c54e92588bedee7210168c112a3c4af4 /macros/latex/contrib/nicematrix
parent4ff14bd6227f033e0d226f68a153f4a8c6458d16 (diff)
CTAN sync 202302190301
Diffstat (limited to 'macros/latex/contrib/nicematrix')
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.pdfbin511895 -> 527832 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.tex389
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.dtx540
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.pdfbin1331647 -> 1339763 bytes
4 files changed, 640 insertions, 289 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
index 54cdad4646..0d115788fc 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex
index 1adb3a823d..5f3101b372 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex
@@ -151,7 +151,7 @@ pour être utilisées à la compilation suivante. C'est pourquoi l'utilisation d
\medskip
La plupart des fonctionnalités de \pkg{nicematrix} sont accessibles sans avoir à
-utiliser explicitement \textsc{pgf} ou Tikz (ce dernier n'est d'ailleurs pas
+utiliser explicitement \textsc{pgf} ou TikZ (ce dernier n'est d'ailleurs pas
chargé par défaut).
\medskip
@@ -487,36 +487,10 @@ $\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
\end{bNiceArray}$
-\medskip
-On peut régler le positionnement horizontal du bloc avec l'une des clés |l|, |c| et |r|.
-
-
-\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-\Block~emphase#[r]@{3-3}<\LARGE>{A} & & & 0 \\
-& & & \Vdots \\
-& & & 0 \\
-\hline
-0 & \Cdots& 0 & 0
-\end{bNiceArray}$
-\end{BVerbatim}
-$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-\Block[r]{3-3}<\LARGE>{A} & & & 0 \\
-& & & \Vdots \\
-& & & 0 \\
-\hline
-0 & \Cdots& 0 & 0
-\end{bNiceArray}$
-
-
-
\interitem
-La commande |\Block| accepte en fait en premier argument optionnel (entre
-crochets) une liste de couples \textsl{clé=valeur}. Les clés sont les suivantes :
+La commande |\Block| accepte en premier argument optionnel (entre crochets) une
+liste de couples \textsl{clé=valeur}. Les clés sont les suivantes :
\begin{itemize}
-\item les clés |l|, |c| et |r| réglent le positionnement horizontal comme dit
-précédemment ;
\item la clé |fill| prend en argument une couleur et remplit le bloc avec cette
couleur ;
\item la clé |draw| prend en argument une couleur et trace le cadre avec cette
@@ -533,29 +507,30 @@ d'intérêt que si |draw|, |hvlines|, |hlines| ou |vlines| est utilisée) ;
\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 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 |\\|) ;
-\item quand la clé |tikz| est utilisée, le chemin Tikz correspondant au
-rectangle délimitant le bloc est exécuté avec Tikz\footnote{Tikz doit être
+ valeur initiale des \emph{rounded corners} de TikZ.}) ;
+\item quand la clé |tikz| est utilisée, le chemin TikZ correspondant au
+rectangle délimitant le bloc est exécuté avec TikZ\footnote{TikZ doit être
chargé préalablement (par défaut, \pkg{nicematrix} ne charge que
\textsc{pgf}), faute de quoi, une erreur sera levée.} en utilisant comme
-options la valeur de cette clé |tikz| (qui doit donc être une liste de clés Tikz
-applicables à un chemin de Tikz). Pour des exemples d'utilisation de cette clé
+options la valeur de cette clé |tikz| (qui doit donc être une liste de clés TikZ
+applicables à un chemin de TikZ). Pour des exemples d'utilisation de cette clé
|tikz|, voir p.~\pageref{tikz-key-examples} ;
-\item la clé |name| donne un nom au nœud Tikz rectangulaire correspondant au
-bloc ; on peut utiliser ce nom avec Tikz dans le |\CodeAfter| (cf.~p.~\pageref{code-after});
+\item la clé |name| donne un nom au nœud TikZ rectangulaire correspondant au
+bloc ; on peut utiliser ce nom avec TikZ dans le |\CodeAfter| (cf.~p.~\pageref{code-after});
\item la clé |respect-arraystretch| évite la remise à $1$ de |\arraystretch| en
début de bloc (qui a lieu par défaut) ;
\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| ; on peut en fait, dans la liste qui est la valeur de
la clé |borders| mettre une entrée de la forme |tikz={|\textsl{liste}|}| où
-\textsl{liste} est une liste de couples \textsl{clé=valeur} de Tikz spécifiant
+\textsl{liste} est une liste de couples \textsl{clé=valeur} de TikZ spécifiant
les caractéristiques graphiques des traits qui seront dessinés (pour un exemple,
voir p.~\pageref{tiretes}).
\end{itemize}
+Il existe aussi des clés de positionnement horizontal et vertical du bloc qui
+sont décrites ci-dessous (cf. \ref{horizontal-bloc} p.~\pageref{horizontal-bloc}).
+
\interitem
\textbf{On doit remarquer que, par défaut, les blocs ne créent pas d'espace}. Il
@@ -606,7 +581,8 @@ cette largeur.
\item La spécification d'alignement horizontal donnée par le type de
colonne (|c|, |r| ou |l|) est prise en compte pour le bloc (mais le bloc peut
-avoir sa propre spécification d'alignement horizontal).
+avoir sa propre spécification d'alignement horizontal :
+cf.~\ref{horizontal-bloc} p.~\pageref{horizontal-bloc}).
\item Les spécifications de fontes imposées à une colonne via la construction
|>{...}| dans le préambule du tableau sont prises en compte pour les
@@ -653,8 +629,6 @@ Pour les blocs mono-rangée, la hauteur (\emph{height}) et la profondeur
la rangée en cours (comme le fait la commande standard |\multicolumn| de LaTeX).
-
-
\subsection{Les blocs mono-case}
Les blocs mono-case héritent des caractéristiques des blocs mono-colonne et
@@ -669,7 +643,7 @@ fait, il y a plusieurs situations où leur utilisation peut présenter des avant
bloc sur plusieurs lignes.
\item On peut utiliser l'option d'alignement horizontal du bloc pour déroger à
-la consigne générale donnée dans le préambule pour cette colonne.
+la consigne générale donnée dans le préambule pour cette colonne (cf.~\ref{horizontal-bloc} p.~\pageref{horizontal-bloc}).
\item On peut tracer un cadre autour du bloc avec la clé |draw| de la commande
|\Block| ou colorier le fond avec des bords arrondis avec les clés |fill| et
@@ -711,6 +685,30 @@ défaut de ce premier argument obligatoire est |1-1|.}.
\subsection{Positionnement horizontal du contenu des blocs}
+\label{horizontal-bloc}
+
+La commande |\Block| admet les clés |l|, |c| et |r| pour la position horizontale
+du contenu du bloc (calé à gauche, centré ou bien calé à droite).
+
+\medskip
+\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
+\Block~emphase#[r]@{3-3}<\LARGE>{A} & & & 0 \\
+& & & \Vdots \\
+& & & 0 \\
+\hline
+0 & \Cdots& 0 & 0
+\end{bNiceArray}$
+\end{BVerbatim}
+$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
+\Block[r]{3-3}<\LARGE>{A} & & & 0 \\
+& & & \Vdots \\
+& & & 0 \\
+\hline
+0 & \Cdots& 0 & 0
+\end{bNiceArray}$
+
+\bigskip
Par défaut, le positionnement horizontal des contenus des blocs est calculé sur
le \emph{contenu} des colonnes impliquées. De ce fait, dans l'exemple suivant,
l'en-tête «Premier groupe» est correctement centré même si un espacement
@@ -755,6 +753,168 @@ Pour avoir un positionnement horizontal du contenu du bloc qui s'appuie sur les
limites des colonnes du tableau LaTeX (et non sur le contenu de ces colonnes),
il faut utiliser les clés |L|, |R| et |C| de la commande |\Block|.
+\medskip
+Voici le même exemple avec la clé |C| pour le premier bloc.
+
+\begin{center}
+\fvset{commandchars=\~\#\+}
+\begin{BVerbatim}
+\begin{NiceTabular}{@{}c!{\qquad}ccc~emphase#!{\qquad}+ccc~@{}}
+\toprule
+Rang & ~emphase#\Block[C]{1-3}{Premier groupe}+ & & & \Block{1-3}{Deuxième groupe} \\
+ & 1A & 1B & 1C & 2A & 2B & 2C \\
+\midrule
+ 1 & 0.657 & 0.913 & 0.733 & 0.830 & 0.387 & 0.893\\
+ 2 & 0.343 & 0.537 & 0.655 & 0.690 & 0.471 & 0.333\\
+ 3 & 0.783 & 0.885 & 0.015 & 0.306 & 0.643 & 0.263\\
+ 4 & 0.161 & 0.708 & 0.386 & 0.257 & 0.074 & 0.336\\
+\bottomrule
+\end{NiceTabular}
+\end{BVerbatim}
+\end{center}
+
+\medskip
+\begin{center}
+\begin{NiceTabular}{@{}c!{\qquad}ccc!{\qquad}ccc@{}}
+\toprule
+Rang & \Block[C]{1-3}{Premier groupe} & & & \Block{1-3}{Deuxième groupe} \\
+ & 1A & 1B & 1C & 2A & 2B & 2C \\
+\midrule
+ 1 & 0.657 & 0.913 & 0.733 & 0.830 & 0.387 & 0.893\\
+ 2 & 0.343 & 0.537 & 0.655 & 0.690 & 0.471 & 0.333\\
+ 3 & 0.783 & 0.885 & 0.015 & 0.306 & 0.643 & 0.263\\
+ 4 & 0.161 & 0.708 & 0.386 & 0.257 & 0.074 & 0.336\\
+\bottomrule
+\end{NiceTabular}
+\end{center}
+
+
+
+\subsection{Positionnement vertical du contenu des blocs}
+
+\colorbox{yellow!50}{\textbf{Nouveau 6.14}}
+
+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|.
+
+
+\begin{itemize}
+\item Avec la clé |v-center|, le contenu du bloc est centré verticalement.
+
+\item Avec la clé |t|, la ligne de base du contenu du bloc est alignée avec la
+ligne de base de la première rangée concernée par le bloc.
+
+\item Avec la clé |b|, la ligne de base de la dernière rangée du contenu du bloc
+(rappelons que le contenu du bloc peut comporter plusieurs rangées séparées par
+|\\|) est alignée avec la ligne de base de la dernière des rangées du tableau
+impliquées dans le bloc.
+
+\item Avec la clé |T|, le contenu du bloc est calé vers le haut (avec une marge
+égale au paramètre |inner ysep| de PGF/Tikz).
+
+\item Avec la clé |B|, le contenu du bloc est calé vers le bas (avec une marge
+égale au paramètre |inner ysep| de PGF/Tikz).
+\end{itemize}
+
+Quand aucune clé n'est donnée, c'est la clé |v-center| qui s'applique (sauf pour
+les blocs mono-rangée).
+
+\medskip
+\begin{scope}
+\NiceMatrixOptions{rules/color=[gray]{0.75}, hvlines}
+
+\begin{BVerbatim}
+\NiceMatrixOptions{rules/color=[gray]{0.75}, hvlines}
+\end{BVerbatim}
+
+\bigskip
+
+\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{NiceTabular}{ccc}
+\Block[fill=red!10,~emphase#t@,l]{4-2}{two\\lines}
+ & & \Huge first\\
+ & & second \\
+ & & third \\
+ & & fourth \\
+text & text \\
+\end{NiceTabular}
+\end{BVerbatim}
+\begin{NiceTabular}{ccc}
+\Block[fill=red!10,t,l]{4-2}{two\\lines}
+ & & \Huge first\\
+ & & second \\
+ & & third \\
+ & & fourth \\
+text & text \\
+\end{NiceTabular}
+
+
+\bigskip
+\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{NiceTabular}{ccc}
+\Block[fill=red!10,~emphase#b@,r]{4-2}{two\\lines}
+ & & \Huge first\\
+ & & second \\
+ & & third \\
+ & & fourth \\
+text & text \\
+\end{NiceTabular}
+\end{BVerbatim}
+\begin{NiceTabular}{ccc}
+\Block[fill=red!10,b,r]{4-2}{two\\lines}
+ & & \Huge first\\
+ & & second \\
+ & & third \\
+ & & fourth \\
+text & text \\
+\end{NiceTabular}
+
+\bigskip
+\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{NiceTabular}{ccc}
+\Block[fill=red!10,~emphase#T@,l]{4-2}{two\\lines}
+ & & \Huge first\\
+ & & second \\
+ & & third \\
+ & & fourth \\
+text & text \\
+\end{NiceTabular}
+\end{BVerbatim}
+\begin{NiceTabular}{ccc}
+\Block[fill=red!10,T,l]{4-2}{two\\lines}
+ & & \Huge first\\
+ & & second \\
+ & & third \\
+ & & fourth \\
+text & text \\
+\end{NiceTabular}
+
+
+\bigskip
+\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{NiceTabular}{ccc}
+\Block[fill=red!10,~emphase#B@,r]{4-2}{two\\lines}
+ & & \Huge first\\
+ & & second \\
+ & & third \\
+ & & fourth \\
+text & text \\
+\end{NiceTabular}
+\end{BVerbatim}
+\begin{NiceTabular}{ccc}
+\Block[fill=red!10,B,r]{4-2}{two\\lines}
+ & & \Huge first\\
+ & & second \\
+ & & third \\
+ & & fourth \\
+text & text \\
+\end{NiceTabular}
+
+\end{scope}
+
+
+
\section{Les filets horizontaux et verticaux}
\label{rules}
@@ -972,10 +1132,9 @@ p.~\pageref{corners}.
En particulier, cette remarque explique la différence entre la commande standard
|\hline| et la commande |\Hline| proposée par \pkg{nicematrix}.
-\colorbox{yellow!50}{\textbf{Nouveau 6.13}}\enskip La commande |\Hline| admet
-entre crochets un argument optionnel qui est une liste de couples
-\textsl{clé=valeur} qui décrivent un filet. Pour la description de ces clés,
-voir |custom-line| p.~\pageref{custom-line}.
+La commande |\Hline| admet entre crochets un argument optionnel qui est une
+liste de couples \textsl{clé=valeur} qui décrivent un filet. Pour la description
+de ces clés, voir |custom-line| p.~\pageref{custom-line}.
\medskip
\subsubsection{Les clés hlines et vlines}
@@ -1190,15 +1349,14 @@ qui permettront d'utiliser ce nouveau type de filet.
qui sera créée par \pkg{nicematrix} et que l'utilisateur pourra utiliser pour
tracer des filets horizontaux (de manière similaire à |\hline|) ;
-\item \colorbox{yellow!50}{\textbf{Nouveau 6.11}}\enskip la clé |ccommand|
-indique le nom (sans la contre-oblique) d'une commande qui sera créée par
-\pkg{nicematrix} et que l'utilisateur pourra utiliser pour tracer des filets
-horizontaux partiels (de manière similaire à |\cline|, d'où le nom |ccommand|) :
-l'argument de cette commande est une liste d'intervalles de colonnes spécifiés
-par la syntaxe $i$ ou $i$-$j$ ;\footnote{Il est recommandé de n'utiliser ces
- commandes qu'une seule fois par ligne car chaque utilisation crée un espace
- vertical entre les rangées correspondant à la largeur totale du trait qui sera
- tracé.}
+\item la clé |ccommand| indique le nom (sans la contre-oblique) d'une commande
+qui sera créée par \pkg{nicematrix} et que l'utilisateur pourra utiliser pour
+tracer des filets horizontaux partiels (de manière similaire à |\cline|, d'où le
+nom |ccommand|) : l'argument de cette commande est une liste d'intervalles de
+colonnes spécifiés par la syntaxe $i$ ou $i$-$j$ ;\footnote{Il est recommandé de
+ n'utiliser ces commandes qu'une seule fois par ligne car chaque utilisation
+ crée un espace vertical entre les rangées correspondant à la largeur totale du
+ trait qui sera tracé.}
\item la clé |letter| prend en argument une lettre\footnote{Les lettres
suivantes ne sont pas autorisées : \verb+lcrpmbVX|()[]!@<>+} qui pourra être
@@ -1268,20 +1426,20 @@ Produit C & 5 & 4 & 1 \\
\item \emph{Deuxième possibilité}\par\nobreak
-On peut utiliser la clé |tikz| (si Tikz est chargé, \pkg{nicematrix} ne
+On peut utiliser la clé |tikz| (si TikZ est chargé, \pkg{nicematrix} ne
chargeant par défaut que \textsc{pgf}). Dans ce cas-là, le filet est tracé
-directement avec Tikz en utilisant comme paramètres la valeur de la clé |tikz|
+directement avec TikZ en utilisant comme paramètres la valeur de la clé |tikz|
qui doit être une liste de couples \textsl{clé=valeur} applicables à un chemin
-Tikz.
+TikZ.
Par défaut aucune réservation de place n'est faite pour le filet qui sera tracé
-avec Tikz. On peut demander une réservation (horizontale pour un filet vertical
+avec TikZ. On peut demander une réservation (horizontale pour un filet vertical
et verticale pour un filet horizontal) avec la clé |total-width| qui est donc en
quelque sorte la largeur du filet qui sera tracé (cette largeur n'est \emph{pas}
calculée à partir des caractéristiques fournies par la clé |tikz|).
\bigskip
-Voici ce que l'on obtient avec la clé |dotted| de Tikz.
+Voici ce que l'on obtient avec la clé |dotted| de TikZ.
\begin{Verbatim}
\NiceMatrixOptions
@@ -1323,7 +1481,7 @@ sept & huit & neuf
\label{dotted}
Comme on le voit dans l'exemple précédent, les pointillés tracés par la clé
-|dotted| de Tikz ne sont pas ronds. C'est pourquoi l'extension \pkg{nicematrix}
+|dotted| de TikZ ne sont pas ronds. C'est pourquoi l'extension \pkg{nicematrix}
propose dans la clé |custom-line| une clé |dotted| qui va tracer des pointillés
ronds. La valeur initiale de la clé |total-width| est, dans ce cas-là, égale au
diamètre des points (l'utilisateur peut quand même utiliser la clé |total-width|
@@ -1476,7 +1634,7 @@ peut placer le contenu de ce |code-before| entre les mots-clés |\CodeBefore| et
De nouvelles commandes sont disponibles dans ce |\CodeBefore|: |\cellcolor|,
|\rectanglecolor|, |\rowcolor|, |\columncolor|, |\rowcolors|, |\rowlistcolors|,
|\chessboardcolors| et |\arraycolor|.\footnote{On pourra remarquer que, dans le
- |\CodeBefore|, des nœuds PGF-Tikz de la forme \verb+(i-|j)+ correspondant à la
+ |\CodeBefore|, des nœuds PGF-TikZ de la forme \verb+(i-|j)+ correspondant à la
position des filets éventuels sont également accessibles : cf.
p.~\pageref{nodes-i}.}
\label{code-before}
@@ -2091,7 +2249,7 @@ supprimé (il est évidemment possible de le supprimer en mettant |\tabcolsep| o
Il est possible de donner la valeur spéciale |auto| à l'option |columns-width|:
toutes les colonnes du tableau auront alors une largeur égale à la largeur de la
case la plus large du tableau.\footnote{Le résultat est atteint dès la première
- compilation (mais PGF-Tikz écrivant des informations dans le fichier |aux|,
+ compilation (mais PGF-TikZ écrivant des informations dans le fichier |aux|,
un message demandant une deuxième compilation apparaîtra).}\par\nobreak
\medskip
@@ -2252,7 +2410,7 @@ un très très très très long texte
Dans le cadre de
\pkg{nicematrix}, l'un des intérêts des colonnes de type |V| par rapport aux
colonnes de type |p|, |m| ou |b| est que, pour les cases d'une telle colonne,
-le nœud PGF-Tikz créé pour le contenu d'une telle case a une largeur ajustée
+le nœud PGF-TikZ créé pour le contenu d'une telle case a une largeur ajustée
au contenu de la cellule en question : cf. p.~\pageref{node-V}.
\medskip
@@ -2896,9 +3054,8 @@ clés simultanément. La valeur initiale de $0.3$~em (il est conseillé d'utilis
unité de mesure dépendante de la fonte courante).
\smallskip
-\colorbox{yellow!50}{\textbf{Nouveau 6.10}}\enskip Les clés
-|xdots/shorten-start| et |xdots/shorten-end| ont été introduites dans la
-version~6.10. Les versions précédentes ne proposaient que |xdots/shorten|.
+Les clés |xdots/shorten-start| et |xdots/shorten-end| ont été introduites dans
+la version~6.10. Les versions précédentes ne proposaient que |xdots/shorten|.
\medskip
\textbf{L'option xdots/inter}\par\nobreak
@@ -2912,7 +3069,7 @@ unité de mesure dépendante de la fonte courante).
\textbf{L'option xdots/line-style}\par\nobreak
\smallskip
-Il faut savoir que, par défaut, les lignes de Tikz tracées avec le paramètre
+Il faut savoir que, par défaut, les lignes de TikZ tracées avec le paramètre
|dotted| sont composées de points carrés et non pas ronds.\footnote{La raison de
départ est que le format \textsc{pdf} comporte un système de description de
lignes en tiretés, qui, puisqu'il est incorporé dans le \textsc{pdf}, est
@@ -2920,7 +3077,7 @@ Il faut savoir que, par défaut, les lignes de Tikz tracées avec le paramètre
partir de ce type de ligne de créer des lignes de points carrés alors qu'une
ligne de points ronds doit être construite explicitement point par point. Voir
néanmoins à l'adresse suivante pour un moyen d'avoir un style de pointillés
-ronds avec Tikz :\newline \small
+ronds avec TikZ :\newline \small
\url{https://tex.stackexchange.com/questions/52848/tikz-line-with-large-dots}}
@@ -2938,9 +3095,9 @@ appelé le style |standard|. Cette valeur est la valeur initiale du paramètre
|xdots/line-style|.
\medskip
-Néanmoins (quand Tikz est chargé), on peut utiliser pour |xdots/line-style|
-n'importe quel style proposé par Tikz, c'est-à-dire n'importe quelle suite
-d'options Tikz applicables à un chemin (à l'exception de «|color|»,
+Néanmoins (quand TikZ est chargé), on peut utiliser pour |xdots/line-style|
+n'importe quel style proposé par TikZ, c'est-à-dire n'importe quelle suite
+d'options TikZ applicables à un chemin (à l'exception de «|color|»,
«|shorten >|» et «|shorten <|»).
\medskip
@@ -3016,7 +3173,7 @@ quand même un argument optionnel (entre crochets).\footnote{Les clés autorisé
\medskip
Les utilisateurs expérimentés peuvent, en particulier, utiliser les nœuds
-PGF-Tikz créés par \pkg{nicematrix} dans le |\CodeAfter|. Ces nœuds sont décrits
+PGF-TikZ créés par \pkg{nicematrix} dans le |\CodeAfter|. Ces nœuds sont décrits
à partir de la page \pageref{PGF-nodes}.
\medskip
@@ -3034,8 +3191,8 @@ Chacun de ces deux arguments peut être :
\begin{itemize}
\item une spécification de case de la forme $i$-$j$ où $i$ est le numéro de
ligne et $j$ est le numéro de colonne ;
-\item \colorbox{yellow!50}{\textbf{Nouveau 6.10}}\enskip le nom d'un bloc (créé
-avec la commande |\Block| en utilisant la clé |name| de cette commande).
+\item le nom d'un bloc (créé avec la commande |\Block| en utilisant la clé
+|name| de cette commande).
\end{itemize}
Les options disponibles pour personnaliser les lignes pointillées créées par
|\Cdots|, |\Vdots|, etc. peuvent aussi être passées à cette commande (cf.
@@ -3267,7 +3424,7 @@ c & d & \frac12c+\frac14d \\
\medskip
Il existe aussi une clé |name| qui permet de donner un nom à une sous-matrice
créée par une commande |\SubMatrix|. Ce nom est utilisé pour créer des nœuds
-PGF-Tikz : voir p.~\pageref{node-sub-matrix}.
+PGF-TikZ : voir p.~\pageref{node-sub-matrix}.
\medskip
Il est également possible de spécifier des délimiteurs\footnote{Les délimiteurs
@@ -3385,9 +3542,8 @@ $\begin{pNiceMatrix}
\subsection{La légendes des tableaux}
-\colorbox{yellow!50}{\bfseries Nouveau 6.12}\enskip L'environnement
-|{NiceTabular}| propose des clés |caption|, |short-caption| et |label| à
-utiliser lorsque le tableau est inséré dans un environnment flottant
+L'environnement |{NiceTabular}| propose des clés |caption|, |short-caption| et
+|label| à utiliser lorsque le tableau est inséré dans un environnment flottant
(typiquement un environnement |{table}|).
\smallskip
@@ -3514,9 +3670,9 @@ tableau en un seul paragraphe.
\item Il existe une clé |tabularnote| qui permet d'insérer du texte dans la zone
des notes avant les notes numérotées.
-\colorbox{yellow!50}{\textbf{Nouveau 6.13} }\enskip Une syntaxe alternative est
-proposée : il est possible d'utiliser l'environnement |{TabularNote}| à la fin de
-l'environnement |{NiceTabular}| (mais \emph{avant} l'éventuel |\CodeAfter|).
+Une syntaxe alternative est proposée : il est possible d'utiliser
+l'environnement |{TabularNote}| à la fin de l'environnement |{NiceTabular}|
+(mais \emph{avant} l'éventuel |\CodeAfter|).
\item Si l'extension \pkg{booktabs} a été chargée (avant ou après
\pkg{nicematrix}), la clé |notes/bottomrule| permet de faire tracer un
@@ -3834,10 +3990,9 @@ charge par \pkg{nicematrix}.
\label{columns-type}
-\colorbox{yellow!50}{\textbf{Nouveau 6.11}}\enskip Les environnements sans
-préambule (|{NiceMatrix}|, |{pNiceMatrix}|, etc.) ainsi que la commande
-|\pAutoNiceMatrix| et ses variantes, acceptent la clé |columns-type| qui indique
-le type des colonne qui sera utilisé.
+Les environnements sans préambule (|{NiceMatrix}|, |{pNiceMatrix}|, etc.) ainsi
+que la commande |\pAutoNiceMatrix| et ses variantes, acceptent la clé
+|columns-type| qui indique le type des colonne qui sera utilisé.
\medskip
Les clés |l| et |r| sont des raccourcis pour |columns-type=l| et |columns-type=r|.
@@ -4143,14 +4298,14 @@ elle est sans effet.
Pour un exemple d'utilisation, voir \url{tex.stackexchange.com/questions/488566}
-\section{Utilisation de Tikz avec nicematrix}
+\section{Utilisation de TikZ avec nicematrix}
\label{name}\label{PGF-nodes}
\subsection{Les nœuds correspondant aux contenus des cases}
-L'extension \pkg{nicematrix} crée un nœud PGF-Tikz pour chaque case non vide
+L'extension \pkg{nicematrix} crée un nœud PGF-TikZ pour chaque case non vide
du tableau considéré. Ces nœuds sont utilisés, entre autres, pour tracer les
lignes en pointillés entre les cases du tableau.
@@ -4184,9 +4339,9 @@ de donner un nom à l'environnement. Une fois l'environnement nommé, les nœuds
sont accessibles à travers les noms «\textsl{nom}-$i$-$j$» où \textsl{nom} est
le nom donné au tableau et $i$ et $j$ les numéros de rangée et de colonne de la
case considérée. On peut les utiliser avec \textsc{pgf} mais l'utilisateur final
-préférera sans doute utiliser Tikz (qui est une sur-couche de \textsc{pgf}). Il
-faut néanmoins se souvenir que \pkg{nicematrix} ne charge pas Tikz par défaut.
-Dans les exemples qui suivent, on suppose que Tikz a été chargé par
+préférera sans doute utiliser TikZ (qui est une sur-couche de \textsc{pgf}). Il
+faut néanmoins se souvenir que \pkg{nicematrix} ne charge pas TikZ par défaut.
+Dans les exemples qui suivent, on suppose que TikZ a été chargé par
l'utilisateur.
\medskip
@@ -4212,7 +4367,7 @@ Ne pas oublier les options |remember picture| et |overlay|.
\medskip
-Dans le |\CodeAfter|, et si Tikz est chargé, les choses sont plus simples. On
+Dans le |\CodeAfter|, et si TikZ est chargé, les choses sont plus simples. On
peut (et on doit) désigner les nœuds sous la forme $i$-$j$ : il n'y a pas à
préciser l'environnement qui est évidemment l'environnement courant.
@@ -4273,7 +4428,7 @@ de la dernière ligne peuvent être désignés par |last|-$j$.
Quand l'extension \pkg{varwidth} est chargée, les colonnes de type |V| définies
par \pkg{varwidth} sont prises en charge par \pkg{nicematrix}. Il peut être
intéressant de préciser que, pour une cellule située dans une colonne de type
-|V|, le nœud PGF-Tikz créé par \pkg{nicematrix} pour le contenu de cette cellule
+|V|, le nœud PGF-TikZ créé par \pkg{nicematrix} pour le contenu de cette cellule
a une largeur ajustée au contenu de cette cellule. Cela est en contraste avec le
cas des colonnes de type |p|, |m| ou |b| dans lesquelles les nœuds ont toujours
une largeur égale à la largeur de la colonne. Dans l'exemple suivant, la
@@ -4569,7 +4724,7 @@ Voici un exemple d'utilisation de ces nœuds dans le |\CodeAfter|.
\label{nodes-i}
-L'extension \pkg{nicematrix} crée un nœud PGF-Tikz nommé simplement $i$ (précédé
+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é
@@ -4598,8 +4753,8 @@ muguet & dahlia
\medskip
-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
+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 |\CodeBefore|) à l'intersection du filet
horizontal~$i$ et du filet vertical~$j$ avec la syntaxe |(|$i$\verb+-|+$j$|)|.
@@ -4639,7 +4794,7 @@ horizontal~$i$ et du filet vertical~$j$ avec la syntaxe |(|$i$\verb+-|+$j$|)|.
\medskip
Les nœuds de la forme $i$|.5| peuvent être utilisés par exemple pour barrer une
-ligne (si on a chargé Tikz).
+ligne (si on a chargé TikZ).
\smallskip
\begin{BVerbatim}[boxwidth=11cm,baseline=c]
@@ -4669,7 +4824,7 @@ p.~\pageref{sub-matrix}.
\smallskip
Si une commande |\SubMatrix| est utilisée avec la clé |name| sous la forme
-|name=|\textsl{\ttfamily MonNom}, trois nœuds PGF-Tikz sont créés avec les noms
+|name=|\textsl{\ttfamily MonNom}, trois nœuds PGF-TikZ sont créés avec les noms
\textsl{\ttfamily MonNom}|-left|, \textsl{\ttfamily MonNom} et \textsl{\ttfamily
MonNom}|-right|.
@@ -4729,7 +4884,7 @@ compilation supplémentaire (car les instructions sont écrites dans le fichier
\medskip
\emph{Exemple} : On souhaite écrire une commande |\crossbox| qui barre en croix
la cellule courante. Cette commande prendra en argument optionnel une liste de
-couples \textsl{clé}-\textsl{valeur} qui sera passée à Tikz avant que la croix
+couples \textsl{clé}-\textsl{valeur} qui sera passée à TikZ avant que la croix
ne soit tracée.
@@ -4753,8 +4908,8 @@ utilise explicitement la variable publique |\g_nicematrix_code_before_tl|.
\tl_gput_right:Nx §emphase¤\g_nicematrix_code_before_tlμ
{
\__pantigny_crossbox:nnn
- { \int_use:c { c@iRow } }
- { \int_use:c { c@jCol } }
+ { \arabic { iRow } }
+ { \arabic { jCol } }
{ \exp_not:n { #1 } }
}
}
@@ -4777,8 +4932,8 @@ utilise explicitement la variable publique |\g_nicematrix_code_before_tl|.
\tl_gput_right:Nx \g_nicematrix_code_before_tl
{
\__pantigny_crossbox:nnn
- { \int_use:c { c@iRow } }
- { \int_use:c { c@jCol } }
+ { \arabic { iRow } }
+ { \arabic { jCol } }
{ \exp_not:n { #1 } }
}
}
@@ -4929,7 +5084,7 @@ vide si (et seulement si) son rendu TeX est de largeur nulle.
\medskip
\item Une case qui contient la commande |\NotEmpty| est non vide (et un nœud
-PGF-Tikz est créé pour cette case).
+PGF-TikZ est créé pour cette case).
\medskip
\item Une case avec seulement une commande |\Hspace| (ou |\Hspace*|) est vide.
@@ -4973,7 +5128,7 @@ environnements de l'extension \pkg{nicematrix} ne sont pas affectés).
\medskip
L'extension \pkg{nicematrix} n'est pas compatible avec la classe \cls{ieeeaccess}
-(car cette classe n'est pas compatible avec PGF-Tikz).\footnote{Voir
+(car cette classe n'est pas compatible avec PGF-TikZ).\footnote{Voir
\url{https://tex.stackexchange.com/questions/528975/error-loading-tikz-in-ieeeaccess-class}}
\medskip
@@ -5015,11 +5170,11 @@ cf.~p.~\pageref{custom-line}.
\label{tikz-key-examples}
-La clé |tikz| de la commande |\Block| n'est disponible que lorsque Tikz est
+La clé |tikz| de la commande |\Block| n'est disponible que lorsque TikZ est
chargé.\footnote{Par défaut, \pkg{nicematrix} ne charge que \textsc{pgf}, qui
- est une sous-couche de Tikz.}
+ est une sous-couche de TikZ.}
-Pour l'exemple suivant, la bibliothèque \pkg{patterns} de Tikz doit aussi être chargée.
+Pour l'exemple suivant, la bibliothèque \pkg{patterns} de TikZ doit aussi être chargée.
\begin{Verbatim}
\usetikzlibrary{patterns}
@@ -5275,7 +5430,7 @@ pointillées.
\interitem
On peut même tracer des lignes continues.\footnote{Dans ce document, la
- bibliothèque \pkg{arrows.meta} de Tikz a été chargée, ce qui a une incidence
+ bibliothèque \pkg{arrows.meta} de TikZ a été chargée, ce qui a une incidence
sur la forme des pointes de flèches.}
\begin{Verbatim}
@@ -5311,7 +5466,7 @@ $\begin{pNiceMatrix}[first-row,first-col]
\label{tiretes}
Dans l'exemple suivant, on utilise des commandes |\Block| pour tracer des filets
-en tiretés. Cet exemple nécessite que Tikz soit chargé (par
+en tiretés. Cet exemple nécessite que TikZ soit chargé (par
|\usepackage{tikz}|).
\begin{Verbatim}
@@ -5705,9 +5860,9 @@ pourquoi nous présentons ici une autre méthode pour surligner une rangée d'un
matrice.
\medskip
-Cet exemple et les suivants nécessitent d'avoir chargé Tikz (\pkg{nicematrix} ne
-charge que \textsc{pgf}, qui est une sous-couche de Tikz) ainsi que la
-bibliothèque Tikz |fit|, ce qui peut se faire avec les deux instructions
+Cet exemple et les suivants nécessitent d'avoir chargé TikZ (\pkg{nicematrix} ne
+charge que \textsc{pgf}, qui est une sous-couche de TikZ) ainsi que la
+bibliothèque TikZ |fit|, ce qui peut se faire avec les deux instructions
suivantes dans le préambule du document :
\begin{verbatim}
@@ -5716,8 +5871,8 @@ suivantes dans le préambule du document :
\end{verbatim}
\medskip
-Nous créons un nœud Tikz rectangulaire qui englobe les nœuds de la deuxième
-rangée en utilisant les outils de la bibliothèque Tikz \pkg{fit}. Ces nœuds ne
+Nous créons un nœud TikZ rectangulaire qui englobe les nœuds de la deuxième
+rangée en utilisant les outils de la bibliothèque TikZ \pkg{fit}. Ces nœuds ne
sont pas créés par défaut dans le |\CodeBefore| (par souci d'efficacité). Il
faut utiliser la clé |create-cell-nodes| du |\CodeBefore| pour demander leur création.
@@ -5924,6 +6079,8 @@ TeXLive sont disponibles sur le serveur \textsc{svn} de TeXLive :
\nolinkurl{www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty}
}
+\tableofcontents
+
\end{document}
% Local Variables:
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx
index 02d0f8e8b8..dceae17ad9 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix.dtx
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.13f}
-\def\myfiledate{2023/02/05}
+\def\myfileversion{6.14}
+\def\myfiledate{2023/02/18}
%
%
%<*batchfile>
@@ -533,28 +533,6 @@ version 2005/12/01 or later.
% \end{bNiceArray}$
% \end{scope}
%
-% \medskip
-% It's possible to set the horizontal position of the block with one of the keys
-% |l|, |c| and |r|.
-%
-%
-% \medskip
-% \begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-% $\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-% \Block~emphase#[r]@{3-3}<\LARGE>{A} & & & 0 \\
-% & & & \Vdots \\
-% & & & 0 \\
-% \hline
-% 0 & \Cdots& 0 & 0
-% \end{bNiceArray}$
-% \end{BVerbatim}
-% $\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-% \Block[r]{3-3}<\LARGE>{A} & & & 0 \\
-% & & & \Vdots \\
-% & & & 0 \\
-% \hline
-% 0 & \Cdots& 0 & 0
-% \end{bNiceArray}$
%
% \interitem
% In fact, the command |\Block| accepts as first optional argument (between
@@ -581,8 +559,6 @@ version 2005/12/01 or later.
% 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 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 |\\|);
% \item when the key |tikz| is used, the Tikz path corresponding of the
% rectangle which delimits the block is executed with Tikz\footnote{Tikz should
% be loaded (by default, \pkg{nicematrix} only loads \textsc{pgf}) and, if it's
@@ -602,6 +578,9 @@ version 2005/12/01 or later.
% \textsl{key=value} of Tikz specifying the graphical characteristics of the
% lines that will be drawn (for an example, see p.~\pageref{dashed}).
% \end{itemize}
+%
+% There is also keys for the horizontal and vertical positions of the content of
+% the block: cf.~\ref{horizontal-block} p.~\pageref{horizontal-block}).
%
% \interitem
% {\bfseries One must remark that, by default, the commands |\Blocks| don't create space}.
@@ -649,7 +628,9 @@ version 2005/12/01 or later.
% that width.
%
% \item The specification of the horizontal position provided by the type of
-% column (|c|, |r| or |l|) is taken into account for the blocks.
+% column (|c|, |r| or |l|) is taken into account for the blocks (but the
+% |\Block| may have its own specification of alignment:
+% cf.~\ref{horizontal-block} p.~\pageref{horizontal-block}).
%
% \item The specifications of font specified for the column by a construction
% |>{...}| in the preamble of the array are taken into account for the
@@ -749,6 +730,31 @@ version 2005/12/01 or later.
%
% \subsection{Horizontal position of the content of the block}
%
+% \label{horizontal-block}
+%
+% The command |\Block| accepts the keys |l|, |c| and |r| for the horizontal
+% position of its content.
+%
+% \medskip
+% \begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+% $\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
+% \Block~emphase#[r]@{3-3}<\LARGE>{A} & & & 0 \\
+% & & & \Vdots \\
+% & & & 0 \\
+% \hline
+% 0 & \Cdots& 0 & 0
+% \end{bNiceArray}$
+% \end{BVerbatim}
+% $\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
+% \Block[r]{3-3}<\LARGE>{A} & & & 0 \\
+% & & & \Vdots \\
+% & & & 0 \\
+% \hline
+% 0 & \Cdots& 0 & 0
+% \end{bNiceArray}$
+%
+%
+%
% By default, the horizontal position of the content of a block is computed
% by using the positions of the \emph{contents} of the columns implied in that
% block. That's why, in the following example, the header ``First group'' is
@@ -795,7 +801,167 @@ version 2005/12/01 or later.
% contents of those columns), one may use the key |L|, |R| and |C| of the
% command |\Block|.
%
+% \medskip
+% Here is the same example with the key |C| for the first block.
+%
+% \medskip
+% \begin{center}
+% \fvset{commandchars=\~\#\+}
+% \begin{BVerbatim}
+% \begin{NiceTabular}{@{}c!{\qquad}ccc~emphase#!{\qquad}+ccc@{}}
+% \toprule
+% Rank & ~emphase#\Block[C]{1-3}{First group}+ & & & \Block{1-3}{Second group} \\
+% & 1A & 1B & 1C & 2A & 2B & 2C \\
+% \midrule
+% 1 & 0.657 & 0.913 & 0.733 & 0.830 & 0.387 & 0.893\\
+% 2 & 0.343 & 0.537 & 0.655 & 0.690 & 0.471 & 0.333\\
+% 3 & 0.783 & 0.885 & 0.015 & 0.306 & 0.643 & 0.263\\
+% 4 & 0.161 & 0.708 & 0.386 & 0.257 & 0.074 & 0.336\\
+% \bottomrule
+% \end{NiceTabular}
+% \end{BVerbatim}
+% \end{center}
%
+% \bigskip
+% \begin{center}
+% \begin{NiceTabular}{@{}c!{\qquad}ccc!{\qquad}ccc@{}}
+% \toprule
+% Rank & \Block[C]{1-3}{First group} & & & \Block{1-3}{Second group} \\
+% & 1A & 1B & 1C & 2A & 2B & 2C \\
+% \midrule
+% 1 & 0.657 & 0.913 & 0.733 & 0.830 & 0.387 & 0.893\\
+% 2 & 0.343 & 0.537 & 0.655 & 0.690 & 0.471 & 0.333\\
+% 3 & 0.783 & 0.885 & 0.015 & 0.306 & 0.643 & 0.263\\
+% 4 & 0.161 & 0.708 & 0.386 & 0.257 & 0.074 & 0.336\\
+% \bottomrule
+% \end{NiceTabular}
+% \end{center}
+%
+%
+% \subsection{Vertical position of the content of the block}
+%
+% \colorbox{yellow!50}{\textbf{New 6.14}}
+%
+% For the vertical position, the commands |\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|.
+%
+% \begin{itemize}
+% \item With the key |v-center|, the content of the block is vertically
+% centered.
+% \item With the key |t|, the baseline of the content of the block is aligned
+% With the basline of the first row concerned by the block).
+% \item with the key |b|, the baseline of the last row of the content of the
+% block (we recall that the content of a block may contains several lines
+% separated by |\\|) is aligned with the baseline of the last of the rows of the
+% array involved in the block.
+% \item With the key |T|, the content of the block is set upwards with only a
+% margin equal to the PGF/Tikz parameter |inner ysep|.
+% \item With the key |B|, the content of the block is set downwards with only a
+% margin equal to the PGF/Tikz parameter |inner ysep|.
+% \end{itemize}
+%
+% When no key is given, the key |v-center| applies (excepted in the mono-row blocks).
+%
+%
+%
+% \medskip
+% \begin{scope}
+% \NiceMatrixOptions{rules/color=[gray]{0.75}, hvlines}
+%
+% \begin{BVerbatim}
+% \NiceMatrixOptions{rules/color=[gray]{0.75}, hvlines}
+% \end{BVerbatim}
+%
+% \bigskip
+%
+% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
+% \begin{NiceTabular}{ccc}
+% \Block[fill=red!10,~emphase#t@,l]{4-2}{two\\lines}
+% & & \Huge first\\
+% & & second \\
+% & & third \\
+% & & fourth \\
+% text & text \\
+% \end{NiceTabular}
+% \end{BVerbatim}
+% \begin{NiceTabular}{ccc}
+% \Block[fill=red!10,t,l]{4-2}{two\\lines}
+% & & \Huge first\\
+% & & second \\
+% & & third \\
+% & & fourth \\
+% text & text \\
+% \end{NiceTabular}
+%
+%
+% \bigskip
+% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
+% \begin{NiceTabular}{ccc}
+% \Block[fill=red!10,~emphase#b@,r]{4-2}{two\\lines}
+% & & \Huge first\\
+% & & second \\
+% & & third \\
+% & & fourth \\
+% text & text \\
+% \end{NiceTabular}
+% \end{BVerbatim}
+% \begin{NiceTabular}{ccc}
+% \Block[fill=red!10,b,r]{4-2}{two\\lines}
+% & & \Huge first\\
+% & & second \\
+% & & third \\
+% & & fourth \\
+% text & text \\
+% \end{NiceTabular}
+%
+% \bigskip
+% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
+% \begin{NiceTabular}{ccc}
+% \Block[fill=red!10,~emphase#T@,l]{4-2}{two\\lines}
+% & & \Huge first\\
+% & & second \\
+% & & third \\
+% & & fourth \\
+% text & text \\
+% \end{NiceTabular}
+% \end{BVerbatim}
+% \begin{NiceTabular}{ccc}
+% \Block[fill=red!10,T,l]{4-2}{two\\lines}
+% & & \Huge first\\
+% & & second \\
+% & & third \\
+% & & fourth \\
+% text & text \\
+% \end{NiceTabular}
+%
+%
+% \bigskip
+% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
+% \begin{NiceTabular}{ccc}
+% \Block[fill=red!10,~emphase#B@,r]{4-2}{two\\lines}
+% & & \Huge first\\
+% & & second \\
+% & & third \\
+% & & fourth \\
+% text & text \\
+% \end{NiceTabular}
+% \end{BVerbatim}
+% \begin{NiceTabular}{ccc}
+% \Block[fill=red!10,B,r]{4-2}{two\\lines}
+% & & \Huge first\\
+% & & second \\
+% & & third \\
+% & & fourth \\
+% text & text \\
+% \end{NiceTabular}
+%
+% \end{scope}
+%
+%
+%
+%
% \section{The rules}
%
% \label{rules}
@@ -1000,10 +1166,9 @@ version 2005/12/01 or later.
% In particular, this remark explains the difference between the standard
% command |\hline| and the command |\Hline| provided by \pkg{nicematrix}.
%
-% \colorbox{yellow!50}{\textbf{New 6.13}}\enskip The key |\Hline| takes in an
-% optional argument (between square brackets) which is a list of
-% \textsl{key=value} pairs. For the description of those keys, see |custom-line|
-% on p.~\pageref{custom-line}.
+% The key |\Hline| takes in an optional argument (between square brackets) which
+% is a list of \textsl{key=value} pairs. For the description of those keys, see
+% |custom-line| on p.~\pageref{custom-line}.
%
% \subsubsection{The keys hlines and vlines}
%
@@ -1211,14 +1376,13 @@ version 2005/12/01 or later.
% will be created by \pkg{nicematrix} and that will be available for the final
% user in order to draw horizontal rules (similarly to |\hline|);
%
-% \item \colorbox{yellow!50}{\textbf{New 6.11}}\enskip the key |cccommand| is
-% the name (without the backslash) of a command that will be created by
-% \pkg{nicematrix} and that will be available for the final user to order to
-% draw partial horizontal rules (similarly to |\cline|, hence the name
-% |ccommand|): the argument of that command is a list of intervals of columns
-% specified by the syntax~$i$ or $i$-$j$.\footnote{It's recommended to use such
-% commands only once in a row because each use will create space between the
-% rows corresponding to the total width of the rule.}
+% \item the key |cccommand| is the name (without the backslash) of a command
+% that will be created by \pkg{nicematrix} and that will be available for the
+% final user to order to draw partial horizontal rules (similarly to |\cline|,
+% hence the name |ccommand|): the argument of that command is a list of
+% intervals of columns specified by the syntax~$i$ or $i$-$j$.\footnote{It's
+% recommended to use such commands only once in a row because each use will
+% create space between the rows corresponding to the total width of the rule.}
%
% \item the key |letter| takes in as argument a letter\footnote{The following
% letters are forbidden: \verb+lcrpmbVX|()[]!@<>+} that the user will use in
@@ -1653,7 +1817,7 @@ version 2005/12/01 or later.
% \item The command |\rowcolors| (with a \emph{s}) takes its name from the
% command |\rowcolors| of \pkg{colortbl}. The \emph{s} emphasizes
% the fact that there is \emph{two} colors. This command colors alternately the
-% rows of the tabular with the tow colors (provided in second and third
+% rows of the tabular with the two colors (provided in second and third
% argument), beginning with the row whose number is given in first (mandatory)
% argument.
%
@@ -2862,11 +3026,6 @@ version 2005/12/01 or later.
% The initial value is 0.3~em (it is recommanded to use a unit of length
% dependent of the current font).
%
-% \smallskip
-% \colorbox{yellow!50}{\textbf{New 6.10}}\enskip The keys |xdots/shorten-start|
-% and |xdots/shorten-end| have been introduced in version 6.10. In the previous
-% versions, there was only |xdots/shorten|.
-%
% \bigskip
% \textbf{The option xdots/inter}\par\nobreak
%
@@ -2999,8 +3158,8 @@ version 2005/12/01 or later.
% \begin{itemize}
% \item a specification of cell of the form $i$-$j$ where is the
% number of the row and $j$ is the number of the column;
-% \item \colorbox{yellow!50}{\textbf{New 6.10}}\enskip the name of a block
-% (created by the command |\Block| with the key |name| of that command).
+% \item the name of a block (created by the command |\Block| with the key |name|
+% of that command).
% \end{itemize}
% The options available for the customisation of the dotted lines created by
% |\Cdots|, |\Vdots|, etc. are also available for this command (cf.
@@ -3351,10 +3510,9 @@ version 2005/12/01 or later.
% \subsection{Caption of a tabular}
%
% \smallskip
-% \colorbox{yellow!50}{\bfseries New 6.12}\enskip The environment
-% |{NiceTabular}| provides the keys |caption|, |short-caption| and |label| which
-% may be used when the tabular is inserted in a floating environment (typically
-% the environment |{table}|).
+% The environment |{NiceTabular}| provides the keys |caption|, |short-caption|
+% and |label| which may be used when the tabular is inserted in a floating
+% environment (typically the environment |{table}|).
%
% \smallskip
% With the key |caption|, the caption, when it is long, is wrapped at the width
@@ -3469,10 +3627,9 @@ version 2005/12/01 or later.
% \item There is a key |tabularnote| which provides a way to insert some text in
% the zone of the notes before the numbered tabular notes.
%
-% \colorbox{yellow!50}{\textbf{New 6.13}}\enskip An alternative syntaxe is
-% available with the environment |{TabularNote}|. That environment should be
-% used at the end of the environment |{NiceTabular}| (but \emph{before} a
-% potential instruction |\CodeAfter|).
+% An alternative syntaxe is available with the environment |{TabularNote}|. That
+% environment should be used at the end of the environment |{NiceTabular}| (but
+% \emph{before} a potential instruction |\CodeAfter|).
%
% \item If the package \pkg{booktabs} has been loaded (before or after
% \pkg{nicematrix}), the key |notes/bottomrule| draws a |\bottomrule| of
@@ -3790,11 +3947,10 @@ version 2005/12/01 or later.
%
% \label{columns-width}
%
-% \colorbox{yellow!50}{\textbf{New 6.11}}\enskip The environments without
-% preamble (|{NiceMatrix}|, |{pNiceMatrix}|, |{bNiceMatrix}|, etc.) and the
-% commande |\pAutoNiceMatrix| (and its variants) provide an option
-% |columns-type| to specify the type of column which will be used (the initial
-% value is, of course, |c|).
+% The environments without preamble (|{NiceMatrix}|, |{pNiceMatrix}|,
+% |{bNiceMatrix}|, etc.) and the commande |\pAutoNiceMatrix| (and its variants)
+% provide an option |columns-type| to specify the type of column which will be
+% used (the initial value is, of course, |c|).
%
% The keys |l| and |r| are shortcuts for |columns-type=l| and |columns-type=r|.
%
@@ -7084,8 +7240,8 @@ version 2005/12/01 or later.
% For the vertical position, the possible values are |c|, |t| and |b|. Of
% course, it would be interesting to program a key |T| and a key |B|.
% \begin{macrocode}
-\tl_new:N \l_@@_vpos_of_block_tl
-\tl_set:Nn \l_@@_vpos_of_block_tl { c }
+\str_new:N \l_@@_vpos_of_block_str
+\str_set:Nn \l_@@_vpos_of_block_str { c }
% \end{macrocode}
%
%
@@ -11138,7 +11294,7 @@ version 2005/12/01 or later.
% After a specifier of column, we have to test whether there is one or several
% |<{..}| because, after those potential |<{...}|, we have to insert
% |!{\skip_horizontal:N ...}| when the key |vlines| is used. In fact, we have
-% also to test wheter there is, after the |<{...}|, a |@{...}|.
+% also to test whether there is, after the |<{...}|, a |@{...}|.
% \begin{macrocode}
\cs_new_protected:Npn \@@_patch_preamble_xi:n #1
{
@@ -11162,7 +11318,7 @@ version 2005/12/01 or later.
}
}
\@@_patch_preamble:n { #1 }
- }
+ }
}
}
% \end{macrocode}
@@ -11188,15 +11344,16 @@ version 2005/12/01 or later.
}
{
\exp_args:NNx
- \clist_if_in:NnT \l_@@_vlines_clist { \int_eval:n { \c@jCol + 1 } }
+ \clist_if_in:NnTF \l_@@_vlines_clist { \int_eval:n { \c@jCol + 1 } }
{
\tl_gput_right:Nn \g_@@_preamble_tl
{ @ { #1 \skip_horizontal:N \arrayrulewidth } }
}
+ { \tl_gput_right:Nn \g_@@_preamble_tl { @ { #1 } } }
}
\@@_patch_preamble:n
}
-% \end{macrocode}
+% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
@@ -11212,7 +11369,6 @@ version 2005/12/01 or later.
\exp_after:wN \@@_patch_m_preamble:n \the \@temptokena \q_stop
\group_end:
\tl_set_eq:NN #1 \g_@@_preamble_tl
- % \group_end:
}
% \end{macrocode}
%
@@ -17342,9 +17498,9 @@ version 2005/12/01 or later.
R .value_forbidden:n = true ,
C .code:n = \str_set:Nn \l_@@_hpos_block_str c ,
C .value_forbidden:n = true ,
- t .code:n = \str_set:Nn \l_@@_vpos_of_block_tl t ,
+ t .code:n = \str_set:Nn \l_@@_vpos_of_block_str t ,
t .value_forbidden:n = true ,
- b .code:n = \str_set:Nn \l_@@_vpos_of_block_tl b ,
+ b .code:n = \str_set:Nn \l_@@_vpos_of_block_str b ,
b .value_forbidden:n = true ,
color .tl_set:N = \l_@@_color_tl ,
color .value_required:n = true ,
@@ -17560,27 +17716,32 @@ version 2005/12/01 or later.
{
{ \int_compare_p:nNn { #2 } = 1 }
{ \dim_compare_p:n { \l_@@_col_width_dim >= \c_zero_dim } }
- { ! \g_@@_rotate_bool } % added 2022/09/16
+ { ! \g_@@_rotate_bool }
}
% \end{macrocode}
% When the block is mono-column in a column with a fixed width (eg |p{3cm}|).
% \begin{macrocode}
- {
- \begin { minipage } [ \l_@@_vpos_of_block_tl ]
- { \l_@@_col_width_dim }
- \str_case:Vn \l_@@_hpos_block_str
- {
- c \centering
- r \raggedleft
- l \raggedright
- }
+ {
+ \use:x
+ {
+ \exp_not:N \begin { minipage }%
+ [ \str_lowercase:V { \l_@@_vpos_of_block_str } ]
+ { \l_@@_col_width_dim }
+ \str_case:Vn \l_@@_hpos_block_str
+ {
+ c \centering
+ r \raggedleft
+ l \raggedright
+ }
+ }
#5
\end { minipage }
}
{
\use:x
{
- \exp_not:N \begin { tabular } [ \l_@@_vpos_of_block_tl ]
+ \exp_not:N \begin { tabular }%
+ [ \str_lowercase:V { \l_@@_vpos_of_block_str } ]
{ @ { } \l_@@_hpos_block_str @ { } }
}
#5
@@ -17591,8 +17752,9 @@ version 2005/12/01 or later.
\c_math_toggle_token
\use:x
{
- \exp_not:N \begin { array } [ \l_@@_vpos_of_block_tl ]
- { @ { } \l_@@_hpos_block_str @ { } }
+ \exp_not:N \begin { array }%
+ [ \str_lowercase:V { \l_@@_vpos_of_block_str } ]
+ { @ { } \l_@@_hpos_block_str @ { } }
}
#5
\end { array }
@@ -17701,7 +17863,7 @@ version 2005/12/01 or later.
{ \str_set:Nn \l_@@_hpos_block_str c }
\use:x
{
- \exp_not:N \begin { tabular } [ \l_@@_vpos_of_block_tl ]
+ \exp_not:N \begin { tabular } [ \l_@@_vpos_of_block_str ]
{ @ { } \l_@@_hpos_block_str @ { } }
}
#5
@@ -17722,7 +17884,7 @@ version 2005/12/01 or later.
\c_math_toggle_token
\use:x
{
- \exp_not:N \begin { array } [ \l_@@_vpos_of_block_tl ]
+ \exp_not:N \begin { array } [ \l_@@_vpos_of_block_str ]
{ @ { } \l_@@_hpos_block_str @ { } }
}
#5
@@ -17795,18 +17957,21 @@ version 2005/12/01 or later.
C .code:n = \str_set:Nn \l_@@_hpos_block_str c
\bool_set_true:N \l_@@_hpos_of_block_cap_bool ,
C .value_forbidden:n = true ,
- t .code:n = \str_set:Nn \l_@@_vpos_of_block_tl t ,
+ t .code:n = \str_set:Nn \l_@@_vpos_of_block_str t ,
t .value_forbidden:n = true ,
- b .code:n = \str_set:Nn \l_@@_vpos_of_block_tl b ,
+ T .code:n = \str_set:Nn \l_@@_vpos_of_block_str T ,
+ T .value_forbidden:n = true ,
+ b .code:n = \str_set:Nn \l_@@_vpos_of_block_str b ,
b .value_forbidden:n = true ,
+ B .code:n = \str_set:Nn \l_@@_vpos_of_block_str B ,
+ B .value_forbidden:n = true ,
+ v-center .code:n = \str_set:Nn \l_@@_vpos_of_block_str { c } ,
+ v-center .value_forbidden:n = true ,
name .tl_set:N = \l_@@_block_name_str ,
name .value_required:n = true ,
name .initial:n = ,
respect-arraystretch .bool_set:N = \l_@@_respect_arraystretch_bool ,
respect-arraystretch .default:n = true ,
- v-center .bool_set:N = \l_@@_v_center_bool ,
- v-center .default:n = true ,
- v-center .initial:n = false ,
transparent .bool_set:N = \l_@@_transparent_bool ,
transparent .default:n = true ,
transparent .initial:n = false ,
@@ -17871,6 +18036,14 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+%
+% \medskip
+% |#1| is the first row of the block;
+% |#2| is the first column of the block;
+% |#3| is the last row of the block;
+% |#4| is the last column of the block;
+% |#5| is a list of \textsl{key=value} options;
+% |#6| is the label
% \begin{macrocode}
\cs_new_protected:Npn \@@_Block_v:nnnnnn #1 #2 #3 #4 #5 #6
{
@@ -17878,21 +18051,10 @@ version 2005/12/01 or later.
% The group is for the keys.
% \begin{macrocode}
\group_begin:
+ \int_compare:nNnT { #1 } = { #3 }
+ { \str_set:Nn \l_@@_vpos_of_block_str { t } }
\keys_set:nn { NiceMatrix / Block / SecondPass } { #5 }
% \end{macrocode}
-%
-%
-% We restrict the use of the key |v-center| to the case of a mono-row block.
-% \begin{macrocode}
- \bool_if:NT \l_@@_v_center_bool
- {
- \int_compare:nNnF { #1 } = { #3 }
- {
- \@@_error:n { Wrong~use~of~v-center }
- \bool_set_false:N \l_@@_v_center_bool
- }
- }
-% \end{macrocode}
%
% \begin{macrocode}
\bool_if:NT \l_@@_vlines_block_bool
@@ -18192,30 +18354,111 @@ version 2005/12/01 or later.
}
}
% \end{macrocode}
+%
+% We take into account the case of a block of one row in the ``first row'' or
+% the ``last row''.
+% \begin{macrocode}
+ \int_compare:nNnT { #1 } = 0
+ {
+ \int_compare:nNnT { #3 } = 0
+ { \l_@@_code_for_first_row_tl }
+ }
+ \int_compare:nNnT { #1 } = \l_@@_last_row_int
+ {
+ \int_compare:nNnT { #3 } = \l_@@_last_row_int
+ { \l_@@_code_for_last_row_tl }
+ }
+% \end{macrocode}
+%
% \medskip
-% Now, we will put the label of the block beginning with the case of a |\Block|
-% of one row.
+% Now, we will put the label of the block.
% \begin{macrocode}
- \bool_if:nTF
- { \int_compare_p:nNn { #1 } = { #3 } && ! \l_@@_v_center_bool }
+ \bool_lazy_any:nTF
{
+ { \str_if_eq_p:Vn \l_@@_vpos_of_block_str { c } }
+ { \str_if_eq_p:Vn \l_@@_vpos_of_block_str { T } }
+ { \str_if_eq_p:Vn \l_@@_vpos_of_block_str { B } }
+ }
+% \medskip
+% \begin{macrocode}
+ {
% \end{macrocode}
-% We take into account the case of a block of one row in the ``first row'' or
-% the ``last row''.
+% If we are in the first column, we must put the block as if it was with the key~|r|.
% \begin{macrocode}
- \int_compare:nNnTF { #1 } = 0
- { \l_@@_code_for_first_row_tl }
- {
- \int_compare:nNnT { #1 } = \l_@@_last_row_int
- \l_@@_code_for_last_row_tl
+ \int_compare:nNnT { #2 } = 0
+ { \str_set:Nn \l_@@_hpos_block_str r }
+ \bool_if:nT \g_@@_last_col_found_bool
+ {
+ \int_compare:nNnT { #2 } = \g_@@_col_total_int
+ { \str_set:Nn \l_@@_hpos_block_str l }
+ }
+% \end{macrocode}
+% \begin{macrocode}
+ \tl_set:Nx \l_tmpa_tl
+ {
+ \str_case:Vn \l_@@_vpos_of_block_str
+ {
+ c {
+ \str_case:Vn \l_@@_hpos_block_str
+ {
+ c { center }
+ l { west }
+ r { east }
+ }
+
+ }
+ T {
+ \str_case:Vn \l_@@_hpos_block_str
+ {
+ c { north }
+ l { north~west }
+ r { north~east }
+ }
+
+ }
+ B {
+ \str_case:Vn \l_@@_hpos_block_str
+ {
+ c { south}
+ l { south~west }
+ r { south~east }
+ }
+
+ }
+ }
+ }
+% \end{macrocode}
+% \begin{macrocode}
+ \pgftransformshift
+ {
+ \pgfpointanchor
+ {
+ \@@_env: - #1 - #2 - block
+ \bool_if:NF \l_@@_hpos_of_block_cap_bool { - short }
+ }
+ { \l_tmpa_tl }
}
+ \pgfset { inner~xsep = \c_zero_dim }
+ \pgfnode
+ { rectangle }
+ { \l_tmpa_tl }
+ { \box_use_drop:N \l_@@_cell_box } { } { }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+ {
% \end{macrocode}
-% If the block has only one row, we want the label of the block perfectly
-% aligned on the baseline of the row. That's why we have constructed a
-% |\pgfcoordinate| on the baseline of the row, in the first column of the array.
-% Now, we retrieve the $y$-value of that node and we store it in |\l_tmpa_dim|.
+%
% \begin{macrocode}
- \pgfextracty \l_tmpa_dim { \@@_qpoint:n { row - #1 - base } }
+ \pgfextracty \l_tmpa_dim
+ {
+ \@@_qpoint:n
+ {
+ row - \str_if_eq:VnTF \l_@@_vpos_of_block_str { b } { #3 } { #1 }
+ - base
+ }
+ }
% \end{macrocode}
% We retrieve (in |\pgf@x|) the $x$-value of the center of the block.
% \begin{macrocode}
@@ -18251,51 +18494,7 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-% \medskip
-% If the number of rows is different of $1$, we will put the label of the block
-% by using the short node (the label of the block has been composed in
-% |\l_@@_cell_box|).
-% \begin{macrocode}
- {
-% \end{macrocode}
-% 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
- { \str_set:Nn \l_@@_hpos_block_str r }
- \bool_if:nT \g_@@_last_col_found_bool
- {
- \int_compare:nNnT { #2 } = \g_@@_col_total_int
- { \str_set:Nn \l_@@_hpos_block_str l }
- }
- \pgftransformshift
- {
- \pgfpointanchor
- {
- \@@_env: - #1 - #2 - block
- \bool_if:NF \l_@@_hpos_of_block_cap_bool { - short }
- }
- {
- \str_case:Vn \l_@@_hpos_block_str
- {
- c { center }
- l { west }
- r { east }
- }
- }
- }
- \pgfset { inner~sep = \c_zero_dim }
- \pgfnode
- { rectangle }
- {
- \str_case:Vn \l_@@_hpos_block_str
- {
- c { center }
- l { west }
- r { east }
- }
- }
- { \box_use_drop:N \l_@@_cell_box } { } { }
- }
\endpgfpicture
\group_end:
}
@@ -20611,14 +20810,6 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-% \begin{macrocode}
-\@@_msg_new:nn { Wrong~use~of~v-center }
- {
- Wrong~use~of~v-center.\\
- You~should~not~use~the~key~'v-center'~here~because~your~block~is~not~
- mono-row.~However,~you~can~go~on.
- }
-% \end{macrocode}
%
% \begin{macrocode}
\@@_msg_new:nn { No~letter~and~no~command }
@@ -20964,9 +21155,9 @@ version 2005/12/01 or later.
\c_@@_available_keys_str
}
{
- The~available~keys~are~(in~alphabetic~order):~b,~borders,~c,~draw,~fill,~
- hlines,~hvlines,~l,~line-width,~name,~rounded-corners,~r,~respect-arraystretch,
- ~t,~tikz,~transparent~and~vlines.
+ The~available~keys~are~(in~alphabetic~order):~b,~B,~borders,~c,~draw,~fill,~
+ hlines,~hvlines,~l,~line-width,~name,~rounded-corners,~r,~respect-arraystretch,~
+ t,~T,~tikz,~transparent~and~vlines.
}
% \end{macrocode}
%
@@ -21371,7 +21562,10 @@ version 2005/12/01 or later.
% \small
% \nolinkurl{https:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty}
% }
+% \subsection*{Changes between version 6.13 and 6.14}
%
+% New keys for the command |\Block| for the vertical position of the content of
+% that block.
%
% \subsection*{Changes between version 6.12 and 6.13}
%
diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf
index 76fa5d3fe8..92cfeea69c 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix.pdf
Binary files differ