summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nicematrix
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-10-21 03:02:35 +0000
committerNorbert Preining <norbert@preining.info>2020-10-21 03:02:35 +0000
commitd800950bfaacab9c6c4bf4d44206d60016b2f04d (patch)
treea47704a85d1a29b69fcede9454aa32ed2c7b5902 /macros/latex/contrib/nicematrix
parent6c4fb500d344400c932c5792f94aee3e34cbe6a7 (diff)
CTAN sync 202010210302
Diffstat (limited to 'macros/latex/contrib/nicematrix')
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.pdfbin423480 -> 423871 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.tex108
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.dtx368
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.pdfbin1048234 -> 1046980 bytes
4 files changed, 234 insertions, 242 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
index c60b8277c7..134a5ab09f 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 6f158b920f..be326a01d4 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex
@@ -369,10 +369,10 @@ u_n & 1 & 2 & 4 & 8 & 16 & 32 \\
\bigskip
-\colorbox{yellow!30}{\textbf{Nouveau 5.2}}\enskip On peut aussi utiliser la clé
-|baseline| pour aligner une matrice sur un filet horizontal (tracé par
-|\hline|). On doit pour cela donner la valeur |line-|\textsl{i} où \textsl{i}
-est le numéro de la rangée qui suit ce filet horizontal.
+On peut aussi utiliser la clé |baseline| pour aligner une matrice sur un filet
+horizontal (tracé par |\hline|). On doit pour cela donner la valeur
+|line-|\textsl{i} où \textsl{i} est le numéro de la rangée qui suit ce filet
+horizontal.
\smallskip
\begin{Verbatim}
@@ -469,8 +469,8 @@ $\begin{bNiceArray}{ccc|c}[margin]
\bigskip
-On peut régler le positionnement horizontal du bloc avec l'une des clés |l|, |c|
-et |r|.
+\colorbox{yellow!30}{Nouveau 5.3}\enskip On peut régler le positionnement
+horizontal du bloc avec l'une des clés |l|, |c| et |r|.
\medskip
@@ -526,7 +526,7 @@ arum & iris & jacinthe & muguet
\subsection{Les blocs mono-colonne}
-\colorbox{yellow!50}{\textbf{Nouveau 5.4}}\enskip Les blocs mono-colonne ont un
+\colorbox{yellow!30}{Nouveau 5.4}\enskip Les blocs mono-colonne ont un
comportement spécial.
\begin{itemize}
\item La largeur naturelle du contenu de ces blocs est prise en compte pour la
@@ -546,7 +546,7 @@ blocs mono-colonne de cette colonne (ce comportement est assez naturel).
\begin{scope}
\hfuzz=10cm
\begin{BVerbatim}[baseline=c,boxwidth=12cm]
-\begin{NiceTabular}{~LetterAt{}>{\bfseries}lr~LetterAt{}} \hline
+\begin{NiceTabular}{~LetterAt{}>{\color{blue}}lr~LetterAt{}} \hline
\Block{2-1}{Pierre} & 12 \\
& 13 \\ \hline
Jacques & 8 \\ \hline
@@ -559,7 +559,7 @@ Henri & 14 \\ \hline
& 19 \\ \hline
\end{NiceTabular}
\end{BVerbatim}
-\begin{NiceTabular}{@{}>{\bfseries}lr@{}} \hline
+\begin{NiceTabular}{@{}>{\color{blue}}lr@{}} \hline
\Block{2-1}{Pierre} & 12 \\
& 13 \\ \hline
Jacques & 8 \\ \hline
@@ -653,8 +653,7 @@ Marie & Pauline \\ \hline
\bigskip
-\colorbox{yellow!30}{\textbf{Nouveau 5.2}}\enskip En revanche, les filets
-verticaux ne sont pas tracés à l'intérieur des blocs.
+En revanche, les filets verticaux ne sont pas tracés à l'intérieur des blocs.
\bigskip
@@ -899,10 +898,9 @@ 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
-\colorbox{yellow!30}{\textbf{Nouveau 5.2}}\enskip 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}).
+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}).
\medskip
\begin{BVerbatim}[boxwidth=11cm,baseline=c]
@@ -1224,10 +1222,9 @@ Estelle & 15
\end{scope}
\bigskip
-\colorbox{yellow!30}{\textbf{Nouveau 5.2}}\enskip Il existe une option |respect-blocks|
-pour la commande |\rowcolors|. Avec cette option, les ``rangées'' colorées
-alternativement peuvent s'étendre sur plusieurs rangées réelles du tableau pour
-englober les blocs.
+Il existe une option |respect-blocks| pour la commande |\rowcolors|. Avec cette
+option, les ``rangées'' colorées alternativement peuvent s'étendre sur plusieurs
+rangées réelles du tableau pour englober les blocs.
\medskip
\begin{scope}
@@ -2266,8 +2263,12 @@ Pour améliorer la lisibilité du code, une syntaxe alternative est proposée :
peut spécifier les instructions du |code-after| à la fin de l'environnement,
après le mot-clé |\CodeAfter|\footnote{Dans certaines circonstances, on doit
mettre |\omit \CodeAfter|, |\omit| étant un mot-clé de TeX qui annule le motif
- de la cellule courante.}. Pour un exemple, voir page
-\pageref{exemple-CodeAfter}.
+ de la cellule courante.} (pour un exemple, voir page
+\pageref{exemple-CodeAfter}). \colorbox{yellow!50}{\textbf{Nouveau 5.5}}\enskip
+Avant la version 5.5, il fallait parfois mettre le mot-clé |\omit| devant
+|\CodeAfter| dans certains circonstances. Depuis la version 5.5, on ne doit
+\emph{jamais} mettre |\omit|.
+
\section{Les notes dans les tableaux}
@@ -2393,7 +2394,7 @@ colonne).
\item Si la clé |notes/para| est utilisée, les notes sont composées à la fin du
tableau en un seul paragraphe.
-\item \colorbox{yellow!50}{\textbf{Nouveau 5.4}}\enskip
+\item \colorbox{yellow!30}{Nouveau 5.4}\enskip
Il existe une clé |tabularnote| qui permet d'insérer du texte dans la zone
des notes avant les notes numérotées.
@@ -2594,16 +2595,15 @@ Pour un exemple de personnalisation des notes de tableau, voir p.~\pageref{ex:no
Si vous souhaitez utiliser l'environnement |{NiceTabular}| ou |{NiceTAbular*}|
dans un environnement |{threeparttable}| de l'extension éponyme, vous devez
-patcher |{threeparttable}| avec le code suivant.
+patcher |{threeparttable}| avec le code suivant (avec une version de LaTeX
+postérieure à 2020/10/01).
\begin{Verbatim}[commandchars=\~\#\!]
\makeatletter
-\AtBeginEnvironment{threeparttable}
+\AddToHook{env/threeparttable/begin}
{\TPT@hookin{NiceTabular}\TPT@hookin{NiceTabular*}}
\makeatother
\end{Verbatim}
-La commande |\AtBeginEnvironment| est une commande de l'extension \pkg{etoolbox}
-qui doit donc avoir été chargée au préalable.
\section{Autres fonctionnalités}
@@ -3097,7 +3097,7 @@ première colonne et de la dernière colonne. Dans l'exemple suivant, nous avons
utilisé les options |left-margin| et |right-margin|.\footnote{Les options
|left-margin| et |right-margin| prennent des dimensions comme valeurs mais, si
aucune valeur n'est donnée, c'est la valeur par défaut qui est utilisée et
- elle est égale à |\arraycolsep| (valeur initial : 5~pt). Il existe aussi une
+ elle est égale à |\arraycolsep| (valeur initiale : 5~pt). Il existe aussi une
option |margin| pour fixer à la fois |left-margin| et |right-margin|.}
\[\begin{pNiceMatrix}[
create-large-nodes,left-margin,right-margin,
@@ -3307,7 +3307,7 @@ L'extension \pkg{nicematrix} fournit deux variables internes mais publiques\foot
publique alors que toute variable dont le nom débute par |\g__nicematrix| ou
par |\l__nicematrix| est privée.} :
\begin{itemize}
-\item \colorbox{yellow!30}{\textbf{Nouveau 5.2}}\enskip |\g_nicematrix_code_before_tl| ;
+\item |\g_nicematrix_code_before_tl| ;
\item |\g_nicematrix_code_after_tl|.
\end{itemize}
@@ -3527,7 +3527,7 @@ a+b & \Cdots & a+b & 1
\end{scope}
\bigskip
-\colorbox{yellow!50}{\textbf{Nouveau 5.3}}\enskip On peut choisir l'instruction
+\colorbox{yellow!30}{Nouveau 5.3}\enskip On peut choisir l'instruction
|\Ddots| qui sera tracée en premier (et qui servira pour tracer les suivantes
quand la parallélisation est activée) avec la clé |draw-first| :
|\Ddots[draw-first]|\rlap{.}
@@ -4023,7 +4023,7 @@ $\begin{pNiceArray}{>{\strut}cccc}[create-large-nodes,margin,extra-margin = 2pt]
a_{11} & a_{12} & a_{13} & a_{14} \\
a_{21} & a_{22} & a_{23} & a_{24} \\
a_{31} & a_{32} & a_{33} & a_{34} \\
- a_{41} & a_{42} & a_{43} & a_{44}
+ a_{41} & a_{42} & a_{43} & a_{44} \\
\CodeAfter
\begin{tikzpicture}[~emphase#name suffix = -large@,
every node/.style = {draw,~emphase#inner sep = 0 pt@}]
@@ -4039,7 +4039,7 @@ $\begin{pNiceArray}{>{\strut}cccc}[create-large-nodes,margin,extra-margin = 2pt]
a_{11} & a_{12} & a_{13} & a_{14} \\
a_{21} & a_{22} & a_{23} & a_{24} \\
a_{31} & a_{32} & a_{33} & a_{34} \\
-a_{41} & a_{42} & a_{43} & a_{44}
+a_{41} & a_{42} & a_{43} & a_{44} \\
\CodeAfter
\begin{tikzpicture}[name suffix = -large,
every node/.style = {draw,inner sep = 0 pt}]
@@ -4058,8 +4058,8 @@ matrice.\footnote{Pour la commande |\cline|, voir la remarque
p.~\pageref{remark-cline}.}
\vspace{1cm} Il est possible de colorier une rangée avec |\rowcolor| dans le
-|code-before| (ou avec |\rowcolor| de \pkg{colortbl} dans la première case de la
-rangée ). Les possibilités de réglages sont néanmoins limitées. C'est pourquoi
+|code-before| (ou avec |\rowcolor| dans la première case de la
+rangée). Les possibilités de réglages sont néanmoins limitées. C'est pourquoi
nous présentons ici une autre méthode pour surligner une rangée de la matrice.
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}. Ce nœud est
@@ -4098,28 +4098,6 @@ $\begin{bNiceMatrix}[~emphase#code-after = {\tikz \node [highlight = (2-1) (2-3)
\end{bNiceMatrix}\]
-\bigskip
-Ce code échoue avec |latex|-|dvips|-|ps2pdf| parce que Tikz pour |dvips|, pour
-le moment, ne prend pas en charge les \emph{blend modes}. Néanmoins, le code
-suivant, dans le préambule du document LaTeX, devrait activer les \emph{blend
- modes} pour ce mode de compilation.
-
-
-\begin{scope} \small
-|\ExplSyntaxOn|
-
-|\makeatletter|
-
-|\tl_set:Nn \l_tmpa_tl {pgfsys-dvips.def}|
-
-|\tl_if_eq:NNT \l_tmpa_tl \pgfsysdriver|
-
-| {\cs_set:Npn\pgfsys@blend@mode#1{\special{ps:~/\tl_upper_case:n #1~.setblendmode}}}|
-
-|\makeatother|
-
-|\ExplSyntaxOff|
-\end{scope}
\vspace{1cm} On rappelle que dans le cas d'un ensemble de cases fusionnées (avec
la commande |\Block|), un nœud Tikz est créé pour l'ensemble des cases avec pour
@@ -4128,6 +4106,26 @@ la case en haut à gauche (où a été utilisée la commande |\Block|). Si on a
demandé la création des nœuds |medium|, alors un nœud de ce type est aussi créé
pour ce bloc avec un nom suffixé par |-medium|.
+\medskip
+\begin{BVerbatim}[baseline=c,boxwidth=11.6cm]
+$\begin{pNiceMatrix}[margin,create-medium-nodes]
+ \Block{3-3}<\Large>{A} & & & 0 \\
+ & \hspace*{1cm} & & \Vdots \\
+ & & & 0 \\
+ 0 & \Cdots& 0 & 0
+\CodeAfter
+ \tikz \node [~emphase#highlight = (1-1-block-medium)@] {} ;
+\end{pNiceMatrix}$
+\end{BVerbatim}
+$\begin{pNiceMatrix}[margin,create-medium-nodes]
+\Block{3-3}<\Large>{A} & & & 0 \\
+& \hspace*{1cm} & & \Vdots \\
+& & & 0 \\
+0 & \Cdots& 0 & 0
+\CodeAfter
+\tikz \node [highlight = (1-1-block-medium)] {} ;
+\end{pNiceMatrix}$
+
\vspace{1cm}
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx
index 22c7112ee0..0383626f2f 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix.dtx
@@ -15,8 +15,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{5.4}
-\def\myfiledate{2020/10/06}
+\def\myfileversion{5.5}
+\def\myfiledate{2020/10/20}
%
%
%<*batchfile>
@@ -410,10 +410,10 @@ version 2005/12/01 or later.
% \end{minipage}
%
% \bigskip
-% \colorbox{yellow!30}{\textbf{New 5.2}}\enskip It's also possible to use the
-% key |baseline| to align a matrix on an horizontal rule (drawn by |\hline|). In
-% this aim, one should give the value |line-|\textsl{i} where \textsl{i} is the
-% number of the row following the horizontal rule.
+% It's also possible to use the key |baseline| to align a matrix on an
+% horizontal rule (drawn by |\hline|). In this aim, one should give the value
+% |line-|\textsl{i} where \textsl{i} is the number of the row following the
+% horizontal rule.
%
% \smallskip
% \begin{Verbatim}
@@ -510,7 +510,7 @@ version 2005/12/01 or later.
% \end{scope}
%
% \medskip
-% \colorbox{yellow!50}{\textbf{New 5.3}}\enskip It's possible to set the
+% \colorbox{yellow!30}{New 5.3}\enskip It's possible to set the
% horizontal position of the block with one of the keys |l|, |c| and |r|.
%
%
@@ -565,7 +565,7 @@ version 2005/12/01 or later.
%
% \subsection{The mono-column blocks}
%
-% % \colorbox{yellow!50}{\textbf{New 5.4}}\enskip The mono-column blocks have a
+% % \colorbox{yellow!30}{New 5.4}\enskip The mono-column blocks have a
% special behaviour.
%
% \begin{itemize}
@@ -691,8 +691,7 @@ version 2005/12/01 or later.
%
%
% \bigskip
-% \colorbox{yellow!30}{\textbf{New 5.2}}\enskip However, the vertical rules are
-% not drawn in the blocks.
+% However, the vertical rules are not drawn in the blocks.
%
% \bigskip
% If you use \pkg{booktabs} (which provides |\toprule|, |\midrule|,
@@ -925,11 +924,10 @@ version 2005/12/01 or later.
% rectangles starting from the cell actually in the corner of the array.
%
% \bigskip
-% \colorbox{yellow!30}{\textbf{New 5.2}}\enskip 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 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}).
%
% \bigskip
% \begin{BVerbatim}[boxwidth=11cm,baseline=c]
@@ -1243,9 +1241,9 @@ version 2005/12/01 or later.
% \end{scope}
%
% \bigskip
-% \colorbox{yellow!30}{\textbf{New 5.2}}\enskip There is a key |respect-blocks|
-% for the instruction |\rowcolors|. With that key, the ``rows'' alternately
-% colored may extend over several rows if they have to incorporate blocks.
+% There is a key |respect-blocks| for the instruction |\rowcolors|. With that
+% key, the ``rows'' alternately colored may extend over several rows if they
+% have to incorporate blocks.
%
% \medskip
% \begin{scope}
@@ -2255,10 +2253,10 @@ version 2005/12/01 or later.
% \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
-% environment, after the keyword |\CodeAfter|\footnote{In some circonstancies,
-% one must put |\omit \CodeAfter|. |\omit| is a keyword of TeX which cancels
-% the pattern of the current cell.}. For an example, cf.
-% p.~\pageref{example-CodeAfter}.
+% environment, after the keyword |\CodeAfter| (for an example, cf.
+% p.~\pageref{example-CodeAfter}). \colorbox{yellow!50}{\textbf{New 5.5}}\enskip
+% Before the version 5.5, it was necessary, in some circonstancies, to put the
+% keyword |\omit| before |\CodeAfter|. Since version~5.5, one must never put~|\omit|.
%
%
%
@@ -2358,8 +2356,8 @@ version 2005/12/01 or later.
% \item If the key |notes/para| is used, the notes are composed at the end of
% the array in a single paragraph (as with the key |para| of \pkg{threeparttable}).
%
-% \item \colorbox{yellow!50}{\textbf{New 5.4}}\enskip There is a key
-% |tabularnote| which provides a way to insert some texte in the zone of the
+% \item \colorbox{yellow!30}{New 5.4}\enskip There is a key
+% |tabularnote| which provides a way to insert some text in the zone of the
% notes before the numbered tabular notes.
%
% \item If the package \pkg{booktabs} has been loaded (before or after
@@ -2580,16 +2578,15 @@ version 2005/12/01 or later.
%
% If you wish to use the environment |{NiceTabular}| or |{NiceTabular*}| in an
% environment |{threeparttable}| of the eponymous package, you have to patch the
-% environment |{threeparttable}| with the following code:
+% environment |{threeparttable}| with the following code (with a version of
+% LaTeX at least 2020/10/01).
% \begin{Verbatim}[commandchars=\~\#\!]
% \makeatletter
-% \AtBeginEnvironment{threeparttable}
+% \AddToHook{env/threeparttable/begin}
% {\TPT@hookin{NiceTabular}\TPT@hookin{NiceTabular*}}
% \makeatother
% \end{Verbatim}
%
-% The command |\AtBeginEnvironment| is a command of the package \pkg{etoolbox}
-% which must have been loaded previously.
%
%
% \section{Other features}
@@ -3286,7 +3283,7 @@ version 2005/12/01 or later.
% public and each variable with name beginning with |\g__nicematrix| or
% |\l__nicematrix| is private.}:
% \begin{itemize}
-% \item \colorbox{yellow!30}{\textbf{New 5.2}}\enskip |\g_nicematrix_code_before_tl| ;
+% \item |\g_nicematrix_code_before_tl| ;
% \item |\g_nicematrix_code_after_tl|.
% \end{itemize}
%
@@ -3500,9 +3497,9 @@ version 2005/12/01 or later.
%
% \end{scope}
%
-% \colorbox{yellow!50}{\textbf{New 5.3}}\enskip It's possible to specify the
+% \colorbox{yellow!30}{New 5.3}\enskip It's possible to specify the
% instruction |\Ddots| which will be drawn first (and which will be used to draw
-% the other diagonal dotted line when the parallelization is in force) with the
+% the other diagonal dotted lines when the parallelization is in force) with the
% key |draw-first|: |\Ddots[draw-first]|.
%
% \subsection{The ``empty'' cells}
@@ -3990,7 +3987,7 @@ version 2005/12/01 or later.
% a_{11} & a_{12} & a_{13} & a_{14} \\
% a_{21} & a_{22} & a_{23} & a_{24} \\
% a_{31} & a_{32} & a_{33} & a_{34} \\
-% a_{41} & a_{42} & a_{43} & a_{44}
+% a_{41} & a_{42} & a_{43} & a_{44} \\
% \CodeAfter
% \begin{tikzpicture}[~emphase#name suffix = -large@,
% every node/.style = {draw,~emphase#inner sep = 0 pt@}]
@@ -4006,7 +4003,7 @@ version 2005/12/01 or later.
% a_{11} & a_{12} & a_{13} & a_{14} \\
% a_{21} & a_{22} & a_{23} & a_{24} \\
% a_{31} & a_{32} & a_{33} & a_{34} \\
-% a_{41} & a_{42} & a_{43} & a_{44}
+% a_{41} & a_{42} & a_{43} & a_{44} \\
% \CodeAfter
% \begin{tikzpicture}[name suffix = -large,
% every node/.style = {draw,inner sep = 0 pt}]
@@ -4066,27 +4063,6 @@ version 2005/12/01 or later.
% \end{bNiceMatrix}\]
%
%
-% \bigskip
-% This code fails with |latex|-|dvips|-|ps2pdf| because Tikz for |dvips|, as for
-% now, doesn't support blend modes. However, the following code, in the
-% preamble, should activate blend modes in this way of compilation.
-%
-%
-% \begin{scope} \small
-% |\ExplSyntaxOn|
-%
-% |\makeatletter|
-%
-% |\tl_set:Nn \l_tmpa_tl {pgfsys-dvips.def}|
-%
-% |\tl_if_eq:NNT \l_tmpa_tl \pgfsysdriver|
-%
-% | {\cs_set:Npn\pgfsys@blend@mode#1{\special{ps:~/\tl_upper_case:n #1~.setblendmode}}}|
-%
-% |\makeatother|
-%
-% |\ExplSyntaxOff|
-% \end{scope}
%
% \vspace{1cm}
% We recall that, for a rectangle of merged cells (with the command |\Block|), a
@@ -4431,21 +4407,6 @@ version 2005/12/01 or later.
\RequirePackage { xparse }
% \end{macrocode}
%
-% \begin{macrocode}
-\cs_set_eq:NN \box_use_drop_i:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_ii:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_iii:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_iv:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_v:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_vi:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_vii:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_viii:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_ix:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_x:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_xi:N \box_use_drop:N
-\cs_set_eq:NN \box_use_drop_xii:N \box_use_drop:N
-% \end{macrocode}
-%
% \bigskip
% \begin{macrocode}
\cs_new_protected:Npn \@@_error:n { \msg_error:nn { nicematrix } }
@@ -6284,6 +6245,12 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_Cell:
{
% \end{macrocode}
+% At the beginning of the cell, we link |\CodeAfter| to a command which do
+% \emph{not} begin with |\omit| (whereas the standard version of |\CodeAfter|
+% begins with |\omit|).
+% \begin{macrocode}
+ \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i:n
+% \end{macrocode}
% We increment |\c@jCol|, which is the counter of the columns.
% \begin{macrocode}
\int_gincr:N \c@jCol
@@ -6469,11 +6436,11 @@ version 2005/12/01 or later.
% \end{itemize}
% \begin{macrocode}
\bool_if:NTF \g_@@_empty_cell_bool
- { \box_use_drop_i:N \l_@@_cell_box }
+ { \box_use_drop:N \l_@@_cell_box }
{
\dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > \c_zero_dim
\@@_node_for_the_cell:
- { \box_use_drop_ii:N \l_@@_cell_box }
+ { \box_use_drop:N \l_@@_cell_box }
}
\bool_gset_false:N \g_@@_empty_cell_bool
}
@@ -6496,7 +6463,7 @@ version 2005/12/01 or later.
\pgfnode
{ rectangle }
{ base }
- { \box_use_drop_iii:N \l_@@_cell_box }
+ { \box_use_drop:N \l_@@_cell_box }
{ \@@_env: - \int_use:N \c@iRow - \int_use:N \c@jCol }
{ }
\str_if_empty:NF \l_@@_name_str
@@ -6863,7 +6830,7 @@ version 2005/12/01 or later.
\cs_set_eq:NN \rotate \@@_rotate:
\cs_set_eq:NN \OnlyMainNiceMatrix \@@_OnlyMainNiceMatrix:n
\cs_set_eq:NN \dotfill \@@_old_dotfill:
- \cs_set_eq:NN \CodeAfter \@@_CodeAfter:n
+ \cs_set_eq:NN \CodeAfter \@@_CodeAfter:
\cs_set_eq:NN \diagbox \@@_diagbox:nn
\bool_if:NT \l_@@_colortbl_like_bool \@@_colortbl_like:
\bool_if:NT \l_@@_renew_dots_bool \@@_renew_dots:
@@ -7334,27 +7301,16 @@ version 2005/12/01 or later.
\int_compare:nNnT \l_@@_first_col_int = 0
{
\skip_horizontal:N \col@sep
- \dim_if_exist:cTF { g_@@_ block _ width _col _ 0 _ dim }
- {
- \skip_horizontal:n
- {
- \dim_max:nn
- {
- \dim_use:c { g_@@_ block _ width _col _ 0 _ dim }
- - 2 \col@sep
- }
- \g_@@_width_first_col_dim
- }
- \dim_gzero:c { g_@@_ block _ width _col _ 0 _ dim }
- }
- { \skip_horizontal:N \g_@@_width_first_col_dim }
+ \skip_horizontal:N \g_@@_width_first_col_dim
}
% \end{macrocode}
%
% The construction of the real box is different when |\l_@@_NiceArray_bool| is
% true (|{NiceArray}| or |{NiceTabular}|) and in the other environments because,
-% in |{NiceArray}| or |{NiceTabular}|, we have no delimiter to put. We begin
-% with this case.
+% in |{NiceArray}| or |{NiceTabular}|, we have no delimiter to put (but we have
+% tabular notes to put). We begin with this case.
+%
+% Remark that, in all cases, |@@_use_arraybox_with_notes_c:| is used.
% \begin{macrocode}
\bool_if:NTF \l_@@_NiceArray_bool
{
@@ -7447,36 +7403,22 @@ version 2005/12/01 or later.
% \begin{macrocode}
\bool_if:NT \g_@@_last_col_found_bool
{
- \dim_if_exist:cTF
- { g_@@_ block _ width _col _ \int_use:N \g_@@_col_total_int _ dim }
- {
- \skip_horizontal:n
- {
- \dim_max:nn
- {
- \dim_use:c
- {
- g_@@_ block _ width _col _
- \int_use:N \g_@@_col_total_int
- _ dim
- }
- }
- { \g_@@_width_first_col_dim + \col@sep }
- }
- }
- {
- \skip_horizontal:N \g_@@_width_last_col_dim
- \skip_horizontal:N \col@sep
- }
+ \skip_horizontal:N \g_@@_width_last_col_dim
+ \skip_horizontal:N \col@sep
}
\@@_after_array:
+% \end{macrocode}
+% The aim of the following |\egroup| (the corresponding |\bgroup| is, of course,
+% at the beginning of the environment) is to be able to put an exposant to a matrix in
+% a mathematical formula.
+% \begin{macrocode}
\egroup
\bool_if:NT \c_@@_footnote_bool \endsavenotes
}
% \end{macrocode}
% This is the end of the environment |{NiceArrayWithDelims}|.
%
-%
+% \vspace{1cm}
% \subsection*{We construct the preamble of the array}
%
% The transformation of the preamble is an operation in several steps.
@@ -7773,7 +7715,7 @@ version 2005/12/01 or later.
\hbox_set_end:
\bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box:
\@@_adjust_width_box:
- \makebox [ #4 ] [ #3 ] { \box_use_drop_iv:N \l_@@_cell_box }
+ \makebox [ #4 ] [ #3 ] { \box_use_drop:N \l_@@_cell_box }
}
}
% \end{macrocode}
@@ -7855,7 +7797,7 @@ version 2005/12/01 or later.
\box_set_ht:Nn \l_tmpa_box { \box_ht:N \l_tmpa_box + \l_tmpa_dim }
\box_set_dp:Nn \l_tmpa_box { \box_dp:N \l_tmpa_box + \l_tmpb_dim }
\str_if_eq:VnTF \l_@@_baseline_str { c }
- { \box_use_drop_v:N \l_tmpa_box }
+ { \box_use_drop:N \l_tmpa_box }
\@@_put_box_in_flow_i:
}
% \end{macrocode}
@@ -7913,78 +7855,98 @@ version 2005/12/01 or later.
% Now, |\g_tmpa_dim| contains the value of the $y$ translation we have to to.
% \begin{macrocode}
\endpgfpicture
- \box_move_up:nn \g_tmpa_dim { \box_use_drop_vi:N \l_tmpa_box }
- \box_use_drop_vii:N \l_tmpa_box
+ \box_move_up:nn \g_tmpa_dim { \box_use_drop:N \l_tmpa_box }
+ \box_use_drop:N \l_tmpa_box
}
% \end{macrocode}
%
% \bigskip
+% The following command is \emph{always} used by |{NiceArrayWithDelims}| (even
+% if, in fact, there is no tabular notes: in fact, it's not possible to know
+% whether there is or not before the composition of the blocks).
% \begin{macrocode}
\cs_new_protected:Npn \@@_use_arraybox_with_notes_c:
{
- \bool_lazy_and:nnTF
- { \int_compare_p:nNn \c@tabularnote = 0 }
- { \tl_if_empty_p:V \l_@@_tabularnote_tl }
- { \box_use_drop_viii:N \l_@@_the_array_box }
- {
- \begin { minipage } { \box_wd:N \l_@@_the_array_box }
- \box_use_drop_ix:N \l_@@_the_array_box
- \skip_vertical:N 0.65ex
+% \end{macrocode}
+% We need a |{minipage}| because we will insert a LaTeX list for the tabular
+% notes (that means that a |\vtop{\hsize=...}| is not enough).
+% \begin{macrocode}
+ \begin { minipage } [ t ] { \box_wd:N \l_@@_the_array_box }
+ \box_use_drop:N \l_@@_the_array_box
+% \end{macrocode}
+% We have to draw the blocks right now because there may be tabular notes in
+% some blocks (which are not mono-column: the blocks which are mono-column
+% have been composed in boxes yet)... and we have to create (potentially) the
+% extra nodes before creating the blocks since there are |medium| nodes to create
+% for the blocks.
+% \begin{macrocode}
+ \@@_create_extra_nodes:
+ \seq_if_empty:NF \g_@@_blocks_seq \@@_draw_blocks:
+ \bool_lazy_or:nnT
+ { \int_compare_p:nNn \c@tabularnote > 0 }
+ { ! \tl_if_empty_p:V \l_@@_tabularnote_tl }
+ \@@_insert_tabularnotes:
+ \end { minipage }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_insert_tabularnotes:
+ {
+ \skip_vertical:N 0.65ex
% \end{macrocode}
% The TeX group is for potential specifications in the
% |\l_@@_notes_code_before_tl|.
% \begin{macrocode}
- \group_begin:
- \l_@@_notes_code_before_tl
- \tl_if_empty:NF \l_@@_tabularnote_tl { \l_@@_tabularnote_tl \par }
+ \group_begin:
+ \l_@@_notes_code_before_tl
+ \tl_if_empty:NF \l_@@_tabularnote_tl { \l_@@_tabularnote_tl \par }
% \end{macrocode}
% We compose the tabular notes with a list of \pkg{enumitem}. The |\strut| and
% the |\unskip| are designed to give the ability to put a |\bottomrule| at the
% end of the notes with a good vertical space.
% \begin{macrocode}
- \int_compare:nNnF \c@tabularnote = 0
+ \int_compare:nNnT \c@tabularnote > 0
+ {
+ \bool_if:NTF \l_@@_notes_para_bool
{
- \bool_if:NTF \l_@@_notes_para_bool
- {
- \begin { tabularnotes* }
- \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut
- \end { tabularnotes* }
+ \begin { tabularnotes* }
+ \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut
+ \end { tabularnotes* }
% \end{macrocode}
% The following |\par| is mandatory for the event that the user has put
% |\footnotesize| (for example) in the |notes/code-before|.
% \begin{macrocode}
- \par
- }
- {
- \tabularnotes
- \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut
- \endtabularnotes
- }
+ \par
}
- \unskip
- \group_end:
- \bool_if:NT \l_@@_notes_bottomrule_bool
{
- \bool_if:NTF \c_@@_booktabs_loaded_bool
- {
+ \tabularnotes
+ \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut
+ \endtabularnotes
+ }
+ }
+ \unskip
+ \group_end:
+ \bool_if:NT \l_@@_notes_bottomrule_bool
+ {
+ \bool_if:NTF \c_@@_booktabs_loaded_bool
+ {
% \end{macrocode}
% The two dimensions |\aboverulesep| et |\heavyrulewidth| are parameters defined
% by \pkg{booktabs}.
% \begin{macrocode}
- \skip_vertical:N \aboverulesep
+ \skip_vertical:N \aboverulesep
% \end{macrocode}
% |\CT@arc@| is the specification of color defined by \pkg{colortbl} but you use it
% even if \pkg{colortbl} is not loaded.
% \begin{macrocode}
- { \CT@arc@ \hrule height \heavyrulewidth }
- }
- { \@@_error:n { bottomule~without~booktabs } }
+ { \CT@arc@ \hrule height \heavyrulewidth }
}
- \l_@@_notes_code_after_tl
- \end { minipage }
- \seq_gclear:N \g_@@_tabularnotes_seq
- \int_gzero:N \c@tabularnote
+ { \@@_error:n { bottomule~without~booktabs } }
}
+ \l_@@_notes_code_after_tl
+ \seq_gclear:N \g_@@_tabularnotes_seq
+ \int_gzero:N \c@tabularnote
}
% \end{macrocode}
%
@@ -8007,12 +7969,12 @@ version 2005/12/01 or later.
\dim_gadd:Nn \g_tmpa_dim \g_@@_ht_row_zero_dim
\dim_gadd:Nn \g_tmpa_dim \g_@@_dp_row_zero_dim
}
- \box_move_up:nn \g_tmpa_dim { \@@_use_arraybox_with_notes_c: }
+ \box_move_up:nn \g_tmpa_dim { \hbox { \@@_use_arraybox_with_notes_c: } }
}
% \end{macrocode}
%
% \medskip
-% Now, the general case (hence the |g| in the name).
+% Now, the general case.
% \begin{macrocode}
\cs_new_protected:Npn \@@_use_arraybox_with_notes:
{
@@ -8058,7 +8020,7 @@ version 2005/12/01 or later.
\dim_gadd:Nn \g_tmpa_dim \g_@@_ht_row_zero_dim
\dim_gadd:Nn \g_tmpa_dim \g_@@_dp_row_zero_dim
}
- \box_move_up:nn \g_tmpa_dim { \@@_use_arraybox_with_notes_c: }
+ \box_move_up:nn \g_tmpa_dim { \hbox { \@@_use_arraybox_with_notes_c: } }
}
% \end{macrocode}
%
@@ -8499,7 +8461,7 @@ version 2005/12/01 or later.
{
\dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > \c_zero_dim
\@@_node_for_the_cell:
- { \box_use_drop_x:N \l_@@_cell_box }
+ { \box_use_drop:N \l_@@_cell_box }
\skip_horizontal:N \l_@@_left_delim_dim
\skip_horizontal:N \l_@@_left_margin_dim
\skip_horizontal:N \l_@@_extra_left_margin_dim
@@ -8844,13 +8806,6 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
- \bool_if:nTF \l_@@_medium_nodes_bool
- {
- \bool_if:NTF \l_@@_large_nodes_bool
- \@@_create_medium_and_large_nodes:
- \@@_create_medium_nodes:
- }
- { \bool_if:NT \l_@@_large_nodes_bool \@@_create_large_nodes: }
\int_zero_new:N \l_@@_initial_i_int
\int_zero_new:N \l_@@_initial_j_int
\int_zero_new:N \l_@@_final_i_int
@@ -8913,14 +8868,6 @@ version 2005/12/01 or later.
\bool_if:NT \l_@@_vlines_bool \@@_draw_vlines:
% \end{macrocode}
%
-% \bigskip
-% We draw the blocks. We have to revert to a clean version of |\ialign| because
-% there may be tabulars in the |\Block| instructions that will be composed now.
-% \begin{macrocode}
- \cs_set_eq:NN \ialign \@@_old_ialign:
- \seq_if_empty:NF \g_@@_blocks_seq \@@_draw_blocks:
-% \end{macrocode}
-%
% \begin{macrocode}
\g_@@_internal_code_after_tl
\tl_gclear:N \g_@@_internal_code_after_tl
@@ -9003,6 +8950,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
%
+%
% \bigskip
% We recall that, when externalization is used, |\tikzpicture| and
% |\endtikzpicture| (or |\pgfpicture| and |\endpgfpicture|) must be directly
@@ -11953,6 +11901,26 @@ version 2005/12/01 or later.
\cs_generate_variant:Nn \dim_max:nn { v n }
% \end{macrocode}
%
+%
+% \bigskip
+% The following command is called in |\@@_use_arraybox_with_notes_c:| just
+% before the construction of the blocks (if the creation of medium nodes is
+% required, medium nodes are also created for the blocks dans that construction
+% uses the standard medium nodes).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_create_extra_nodes:
+ {
+ \bool_if:nTF \l_@@_medium_nodes_bool
+ {
+ \bool_if:NTF \l_@@_large_nodes_bool
+ \@@_create_medium_and_large_nodes:
+ \@@_create_medium_nodes:
+ }
+ { \bool_if:NT \l_@@_large_nodes_bool \@@_create_large_nodes: }
+ }
+% \end{macrocode}
+%
+%
% \bigskip
% We have three macros of creation of nodes: |\@@_create_medium_nodes:|,
% |\@@_create_large_nodes:| and |\@@_create_medium_and_large_nodes:|.
@@ -12387,11 +12355,12 @@ version 2005/12/01 or later.
{ g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
{
% \end{macrocode}
-% The main aim of the following |\color_ensure_current:| is to retrieve in the
-% box a color specified for that column in the preamble (e.g. something like
-% |>{\color{red}}|).
+% If the user has specified a color for the column in the preamble of the array,
+% we want to fix that color in the box we construct. We do that with
+% |\set@color| and not |\color_ensure_current:| because that command seems to be
+% bugged: it doesn't work in XeLaTeX when \pkg{fontspec} is loaded.
% \begin{macrocode}
- \color_ensure_current:
+ \set@color
\bool_if:NTF \l_@@_NiceTabular_bool
{
\group_begin:
@@ -12541,10 +12510,15 @@ version 2005/12/01 or later.
%
% \bigskip
% The command |\@@_draw_blocks:| will draw all the blocks. This command is used
-% after the construction of the array.
+% after the construction of the array. We have to revert to a clean version of
+% |\ialign| because there may be tabulars in the |\Block| instructions that will
+% be composed now.
% \begin{macrocode}
\cs_new_protected:Npn \@@_draw_blocks:
- { \seq_map_inline:Nn \g_@@_blocks_seq { \@@_Block_iii:nnnnnn ##1 } }
+ {
+ \cs_set_eq:NN \ialign \@@_old_ialign:
+ \seq_map_inline:Nn \g_@@_blocks_seq { \@@_Block_iii:nnnnnn ##1 }
+ }
% \end{macrocode}
%
% \begin{macrocode}
@@ -12787,7 +12761,7 @@ version 2005/12/01 or later.
r { base~east }
}
}
- { \box_use_drop_xi:N \l_@@_cell_box } { } { }
+ { \box_use_drop:N \l_@@_cell_box } { } { }
}
% \end{macrocode}
%
@@ -12828,7 +12802,7 @@ version 2005/12/01 or later.
r { east }
}
}
- { \box_use_drop_xii:N \l_@@_cell_box } { } { }
+ { \box_use_drop:N \l_@@_cell_box } { } { }
}
\endpgfpicture
}
@@ -13060,21 +13034,34 @@ version 2005/12/01 or later.
% definition of the environment |{@@-light-syntax}| on
% p.~\pageref{code-light-syntax}.
%
-% The command |\CodeAfter| catches everything until the end of the current
-% environment (of \pkg{nicematrix}).
+% \medskip
+% In the environments of \pkg{nicematrix}, |\CodeAfter| will be linked to the
+% following command |\@@_CodeAfter:|. That macro must \emph{not} be protected
+% since it begins with |\omit|.
+% \begin{macrocode}
+\cs_new:Npn \@@_CodeAfter: { \omit \@@_CodeAfter_i:n }
+% \end{macrocode}
%
-% First, we go until the next command |\end|.
+% \medskip
+% However, in each cell of the environment, the command |\CodeAfter| will be
+% linked to the following command |\@@_CodeAfter_i:n| which do \emph{not} begins
+% with |\omit| (and thus, the user will be able to use |\CodeAfter| without
+% error and without the need to prefix by |\omit|.
+%
+% \smallskip
+% We have to catch everything until the end of the current environment (of
+% \pkg{nicematrix}). First, we go until the next command |\end|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_CodeAfter:n #1 \end
+\cs_new_protected:Npn \@@_CodeAfter_i:n #1 \end
{
\tl_gput_right:Nn \g_nicematrix_code_after_tl { #1 }
- \@@_CodeAfter_i:n
+ \@@_CodeAfter_ii:n
}
% \end{macrocode}
%
% We catch the argument of the command |\end| (in |#1|).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_CodeAfter_i:n #1
+\cs_new_protected:Npn \@@_CodeAfter_ii:n #1
{
% \end{macrocode}
% If this is really the end of the current environment (of \pkg{nicematrix}), we
@@ -13089,7 +13076,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
{
\tl_gput_right:Nn \g_nicematrix_code_after_tl { \end { #1 } }
- \@@_CodeAfter:n
+ \@@_CodeAfter_i:n
}
}
% \end{macrocode}
@@ -14217,7 +14204,14 @@ version 2005/12/01 or later.
% Key |tabularnote|.
%
% Different behaviour for the mono-column blocks.
-%
+%
+% \subsection*{Changes between versions 5.3 and 5.4}
+%
+% The user must never put |\omit| before |\CodeAfter|.
+%
+% Correction of a bug: the tabular notes |\tabularnotes| were not composed when
+% present in a block (except a mono-column block).
+%
% \PrintIndex
%
% \tableofcontents
diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf
index 12313e198a..64a08064d4 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix.pdf
Binary files differ