summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nicematrix
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-09-18 03:08:21 +0000
committerNorbert Preining <norbert@preining.info>2022-09-18 03:08:21 +0000
commitbaa3e10650110291de10e0e8e6a1e48ac4579afe (patch)
tree8eff974515ba91e538c94002db56558182e59a4e /macros/latex/contrib/nicematrix
parent9ae94dce28ea17b97ef24019e324353cd6af4dba (diff)
CTAN sync 202209180308
Diffstat (limited to 'macros/latex/contrib/nicematrix')
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.pdfbin511972 -> 511473 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.tex57
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.dtx141
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.pdfbin1320819 -> 1325255 bytes
4 files changed, 181 insertions, 17 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
index aef19a755c..0ae8f26c90 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 6244fda93e..f7fa1fe561 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex
@@ -24,7 +24,6 @@
\usepackage{shortvrb}
\MakeShortVerb{\|}
-
\usepackage{fancyvrb}
\fvset{commandchars=\~\#\@,formatcom=\color{gray}}
@@ -967,13 +966,13 @@ par |\Cdots|, |\Vdots|, etc. : cf.~p.~\pageref{Cdots}.
\end{itemize}
\item Les coins sont créés par la clé |corners| détaillée un peu plus loin : cf.
p.~\pageref{corners}.
-\item Pour les rangées et colonnes extérieures, cf.~\pageref{exterior}.
+\item Pour les rangées et colonnes extérieures, cf. p.~\pageref{exterior}.
\end{itemize}
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 command |\Hline| admet
+\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}.
@@ -1183,7 +1182,7 @@ Cette commande |\diagbox| peut aussi être utilisée dans un |\Block|.
Il est possible de définir des commandes et des lettres pour des filets
personnalisés avec la clé |custom-line|, utilisable dans |\NiceMatrixOptions| ou
bien dans un environnement. Cette clé prend en argument une liste de paires de
-la forme \textsl{clé=valeur}. Il y a d'abord deux clés pour spécifier les outils
+la forme \textsl{clé=valeur}. Il y a d'abord trois clés pour spécifier les outils
qui permettront d'utiliser ce nouveau type de filet.
\begin{itemize}
@@ -1792,9 +1791,51 @@ Antoine \\
Stéphanie \\
\end{NiceTabular}
+\bigskip
+On peut aussi utiliser dans la commande |\rowlistcolors| une série de couleurs
+définie par la commande |\definecolorseries| de \pkg{xcolor} (et initialisée
+avec la commande |\resetcolorseries|\footnote{Pour l'initialisation, on a
+ utilisé dans l'exemple qui suit le compteur |iRow| qui, quand il est utilisé
+ dans le |\CodeBefore| (ou le |\CodeAfter|) désigne le nombre de rangées du
+ tableau : cf~p.~\pageref{iRow}. Cela permet un ajustement de la gradation des
+ couleurs à la taille du tableau.}).
+
+\smallskip
+\begin{BVerbatim}[boxwidth=12cm,baseline=c]
+\begin{NiceTabular}{c}
+\CodeBefore
+ ~emphase#\definecolorseries{BlueWhite}{rgb}{last}{blue}{white}@
+ ~emphase#\resetcolorseries{\value{iRow}}{BlueWhite}@
+ ~emphase#\rowlistcolors{1}{BlueWhite!!+}@
+\Body
+Mathilde \\
+Pierre \\
+Paul \\
+Amélie \\
+Jacques \\
+Antoine \\
+Stéphanie \\
+\end{NiceTabular}
+\end{BVerbatim}
+\begin{NiceTabular}{c}
+\CodeBefore
+ \definecolorseries{BlueWhite}{rgb}{last}{blue}{white}
+ \resetcolorseries[\value{iRow}]{BlueWhite}
+ \rowlistcolors{1}{BlueWhite!!+}
+\Body
+Mathilde \\
+Pierre \\
+Paul \\
+Amélie \\
+Jacques \\
+Antoine \\
+Stéphanie \\
+\end{NiceTabular}
+
\end{itemize}
-\medskip
+
+\vspace{1cm}
On rappelle que toutes les commandes de coloriage que l'on vient de décrire ne
colorient pas les cases qui sont dans les «coins». Dans l'exemple suivant, on
utilise la clé |corners| pour demander de considérer le coin \emph{north east} (NE).
@@ -3332,7 +3373,7 @@ $\begin{pNiceMatrix}
\subsection{La légendes des tableaux}
\colorbox{yellow!50}{\bfseries Nouveau 6.12}\enskip L'environnement
-|{NiceTabular}| proposent des clés |caption|, |short-caption| et |label| à
+|{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}|).
@@ -3462,7 +3503,7 @@ 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'eventuel |\CodeAfter|).
+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
@@ -3917,6 +3958,8 @@ En fait, l'option |small| correspond aux réglages suivants :
\subsection{Les compteurs iRow et jCol}
+\label{iRow}
+
Dans les cases du tableau, il est possible d'utiliser les compteurs LaTeX |iRow|
et |jCol| qui représentent le numéro de la rangée courante et le numéro de la
colonne courante\footnote{On rappelle que le numéro de la «première rangée» (si
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx
index 1884212f42..659e7fa56a 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix.dtx
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.13}
-\def\myfiledate{2022/08/24}
+\def\myfileversion{6.13a}
+\def\myfiledate{2022/09/17}
%
%
%<*batchfile>
@@ -1200,7 +1200,7 @@ version 2005/12/01 or later.
% It's also possible to define commands and letters for customized rules with
% the key |custom-line| available in |\NiceMatrixOptions| and in the options of
% individual environments. That key takes in as argument a list of
-% \textsl{key=value} pairs. First, there is two keys to define the tools which
+% \textsl{key=value} pairs. First, there is three keys to define the tools which
% will be used to use that new type of rule.
%
% \begin{itemize}
@@ -1754,7 +1754,6 @@ version 2005/12/01 or later.
% arguments for the colors, this command takes in an argument which is a
% (comma-separated) list of colors. In that list, the symbol |=| represent a
% color identical to the previous one.
-% \end{itemize}
%
% \smallskip
% \begin{BVerbatim}[boxwidth=10cm,baseline=c]
@@ -1784,8 +1783,49 @@ version 2005/12/01 or later.
% Alexandra \\
% \end{NiceTabular}
%
+% \bigskip
+% It's also possible to use in the command |\rowlistcolors| a color series
+% defined by the command |\definecolorseries| of \pkg{xcolor} (and initialized
+% with the command |\resetcolorseries|\footnote{For the initialization, in the
+% following example, you have used the counter |iRow| which, when used in the
+% |\CodeBefore| (and in the |\CodeAfter|) corresponds to the number of rows of
+% the array: cf.~p~\pageref{iRow}. That leads to an adjustement of the gradation
+% of the colors to the size of the tabular.}).
%
-% \medskip
+% \smallskip
+% \begin{BVerbatim}[boxwidth=12cm,baseline=c]
+% \begin{NiceTabular}{c}
+% \CodeBefore
+% ~emphase#\definecolorseries{BlueWhite}{rgb}{last}{blue}{white}@
+% ~emphase#\resetcolorseries{\value{iRow}}{BlueWhite}@
+% ~emphase#\rowlistcolors{1}{BlueWhite!!+}@
+% \Body
+% Peter \\
+% James \\
+% Abigail \\
+% Elisabeth \\
+% Claudius \\
+% Jane \\
+% Alexandra \\
+% \end{NiceTabular}
+% \end{BVerbatim}
+% \begin{NiceTabular}{c}
+% \CodeBefore
+% \definecolorseries{BlueWhite}{rgb}{last}{blue}{white}
+% \resetcolorseries[\value{iRow}]{BlueWhite}
+% \rowlistcolors{1}{BlueWhite!!+}
+% \Body
+% Peter \\
+% James \\
+% Abigail \\
+% Elisabeth \\
+% Claudius \\
+% Jane \\
+% Alexandra \\
+% \end{NiceTabular}
+% \end{itemize}
+%
+% \vspace{1cm}
% We recall that all the color commands we have described don't color the cells
% which are in the ``corners''. In the following example, we use the key
% |corners| to require the determination of the corner \emph{north east} (NE).
@@ -3876,6 +3916,8 @@ version 2005/12/01 or later.
%
% \subsection{The counters iRow and jCol}
%
+% \label{iRow}
+%
% In the cells of the array, it's possible to use the LaTeX counters |iRow| and
% |jCol| which represent the number of the current row and the number of the
% current column\footnote{We recall that the exterior ``first row'' (if it
@@ -5888,6 +5930,77 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+% \bigskip
+% \subsection*{Security test}
+%
+% Within the package \pkg{nicematrix}, we will have to test whether a cell of a
+% |{NiceTabular}| is empty. For the cells of the columns of type |p|, |b|, |m|,
+% |X| and |V|, we will test whether the cell is syntactically empty (that is to
+% say that there is only spaces between the ampersands |&|). That test will be
+% done with the command |\@@_test_if_empty:| by testing if the two first tokens
+% in the cells are (during the TeX process) are |\ignorespaces| and |\unskip|.
+%
+% However, if, one day, there is a changement in the implementation of
+% \pkg{array}, maybe that this test will be broken (and \pkg{nicematrix} also).
+%
+% That's why, by security, we will take a test in a small |{tabular}| composed
+% in the box |\l_tmpa_box| used as sandbox.
+%
+% \begin{macrocode}
+\@@_msg_new:nn { Internal~error }
+ {
+ A~fatal~internal~error~have~occurred.\\
+ If~you~see~this~message,~contact~the~author~of~the~package~'nicematrix'~
+ because~this~error~should~not~have~occurred.
+ }
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\@@_msg_new:nn { mdwtab~loaded }
+ {
+ The~packages~'mdwtab'~and~'nicematrix'~are~incompatible.~
+ This~error~is~fatal.
+ }
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_security_test:n #1
+ {
+ \peek_meaning:NTF \ignorespaces
+ { \@@_security_test_i:w }
+ { \@@_fatal:n { Internal~error } }
+ #1
+ }
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_security_test_i:w \ignorespaces #1
+ {
+ \peek_meaning:NF \unskip { \@@_fatal:n { Internal~error } }
+ #1
+ }
+% \end{macrocode}
+%
+% \bigskip
+% Here, the box |\l_tmpa_box| will be used as sandbox to take our security test.
+% \begin{macrocode}
+\hook_gput_code:nnn { begindocument } { . }
+ {
+ \@ifpackageloaded { mdwtab }
+ { \@@_fatal:n { mdwtab~loaded } }
+ {
+ \hbox_set:Nn \l_tmpa_box
+ {
+ \begin { tabular } { c > { \@@_security_test:n } c c }
+ text & & text
+ \end { tabular }
+ }
+ }
+ }
+% \end{macrocode}
%
% \bigskip
% \subsection*{Technical definitions}
@@ -8497,7 +8610,7 @@ version 2005/12/01 or later.
% we use the following technic:
% \begin{itemize}
% \item for the columns of type |p|, |m|, |b|, |V| (of \pkg{varwidth}) or |X|,
-% we test whether the cell is syntacticly empty with |\@@_test_if_empty:| and
+% we test whether the cell is syntactically empty with |\@@_test_if_empty:| and
% |\@@_test_if_empty_for_S:|
% \item if the width of the box |\l_@@_cell_box| (created with the content of
% the cell) is equal to zero, we consider the cell as empty (however,
@@ -10580,7 +10693,14 @@ version 2005/12/01 or later.
\peek_meaning:NT \unskip
{
\tl_gput_right:Nn \g_@@_cell_after_hook_tl
- { \box_set_wd:Nn \l_@@_cell_box \c_zero_dim }
+ {
+ \box_set_wd:Nn \l_@@_cell_box \c_zero_dim
+% \end{macrocode}
+% We put the following code in order to have a column with the correct width
+% even when all the cells of the column are empty.
+% \begin{macrocode}
+ \skip_horizontal:N \l_@@_col_width_dim
+ }
}
#1
}
@@ -11031,8 +11151,9 @@ version 2005/12/01 or later.
\@whilesw \if@tempswa \fi { \@tempswafalse \the \NC@list }
\tl_gclear:N \g_@@_preamble_tl
\exp_after:wN \@@_patch_m_preamble:n \the \@temptokena \q_stop
- \tl_gset_eq:NN #1 \g_@@_preamble_tl
\group_end:
+ \tl_set_eq:NN #1 \g_@@_preamble_tl
+ % \group_end:
}
% \end{macrocode}
%
@@ -12434,7 +12555,7 @@ version 2005/12/01 or later.
\bool_if:NTF \l_@@_in_code_after_bool
{ \@@_error_or_warning:n { TabularNote~in~CodeAfter } }
{
- \tl_if_empty:NF \g_@@_taublarnote_tl
+ \tl_if_empty:NF \g_@@_tabularnote_tl
{ \tl_gput_right:Nn \g_@@_tabularnote_tl { \par } }
\tl_gput_right:Nn \g_@@_tabularnote_tl { ##1 }
}
@@ -17359,7 +17480,7 @@ version 2005/12/01 or later.
{
{ \int_compare_p:nNn { #2 } = 1 }
{ \dim_compare_p:n { \l_@@_col_width_dim >= \c_zero_dim } }
- { ! \l_@@_respect_arraystretch_bool }
+ { ! \g_@@_rotate_bool } % added 2022/09/16
}
% \end{macrocode}
% When the block is mono-column in a column with a fixed width (eg |p{3cm}|).
diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf
index cd44a1841f..d2b0a1ca61 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix.pdf
Binary files differ