summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nicematrix
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-01-03 03:03:02 +0000
committerNorbert Preining <norbert@preining.info>2024-01-03 03:03:02 +0000
commit92effab22b73c432933e7eb8e12c1cefda221df9 (patch)
treecdf3576ee645074d1df994e376d9ca2483c81ec5 /macros/latex/contrib/nicematrix
parent6b10e9901a24325e837f0fdc2cbce8f43f18ccff (diff)
CTAN sync 202401030303
Diffstat (limited to 'macros/latex/contrib/nicematrix')
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-code.dtx90
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-code.pdfbin0 -> 973857 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.pdfbin596600 -> 596978 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.tex16
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.ins4
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.pdfbin612159 -> 611795 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.tex17
7 files changed, 77 insertions, 50 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix-code.dtx b/macros/latex/contrib/nicematrix/nicematrix-code.dtx
index cfb0eb00d0..dea9c0ecd7 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-code.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix-code.dtx
@@ -2,7 +2,7 @@
%
% This file should be compiled with $xelatex$.
%
-% Copyright (C) 2018-2023 by F. Pantigny
+% Copyright (C) 2018-2024 by F. Pantigny
% ------------------------------------------
%
% This file may be distributed and/or modified under the
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.26b}
-\def\myfiledate{2023/12/13}
+\def\myfileversion{6.26c}
+\def\myfiledate{2024/01/02}
%
%
%<*batchfile>
@@ -29,7 +29,7 @@
\preamble
-Copyright (C) 2018-2023 by F. Pantigny
+Copyright (C) 2018-2024 by F. Pantigny
-----------------------------------
This file may be distributed and/or modified under the
@@ -121,7 +121,7 @@ version 2005/12/01 or later.
% \pkg{nicematrix} relies upon the fact that the package |{array}| uses
% |\ialign| to begin the |\halign|.
%
-%
+%
% \bigskip
% \section{Declaration of the package and packages loaded}
%
@@ -1821,15 +1821,15 @@ version 2005/12/01 or later.
% argument of |\tabularnote|.}
% \item During the composition of the main tabular, the tabular notes will be
% numbered from |\g_@@_notes_caption_int|+1 and the notes will be stored in
-% |\g_@@_notes_seq|. Each composant of |\g_@@_notes_seq| will be a kind of
+% |\g_@@_notes_seq|. Each component of |\g_@@_notes_seq| will be a kind of
% couple of the form : \texttt{\{\textsl{label}\}\{\textsl{text of the
-% tabularnote}\}}. The first composante is the optional argument (between square
+% tabularnote}\}}. The first component is the optional argument (between square
% brackets) of the command |\tabularnote| (if the optional argument is not used,
% the value will be the special marker |\c_novalue_tl|).
% \item During the composition of the caption (value of |\l_@@_caption_tl|), the
% tabular notes will be numbered from $1$ to |\g_@@_notes_caption_int| and the
% notes themselves will be stored in |\g_@@_notes_in_caption_seq|. The structure
-% of the composantes of that sequence will be the same as for |\g_@@_notes_seq|.
+% of the components of that sequence will be the same as for |\g_@@_notes_seq|.
% \item After the composition of the main tabular and after the composition of
% the caption, the sequences |\g_@@_notes_in_caption_seq| and |\g_@@_notes_seq|
% will be merged (in that order) and the notes will be composed.
@@ -1973,6 +1973,11 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_test_first_novalue:nnn #1 #2 #3
+ { \tl_if_novalue:nT { #1 } { #3 } }
+% \end{macrocode}
+%
% \bigskip
% For the version in normal conditions, that is to say not in the |caption|.
% |#1| is the optional argument of |\tabularnote| (maybe equal to the special
@@ -1998,12 +2003,20 @@ version 2005/12/01 or later.
% \end{center}
% If the user have used |\tabularnote| without the optional argument, the
% \texttt{\textsl{label}} will be the special marker |\c_novalue_tl|.
+%
+% When we will go through the sequence |\g_@@_notes_seq|, we will count in
+% |\l_tmpb_int| the notes without explicit label in order to have the
+% ``current'' value of the counter |\c@tabularnote|.
% \begin{macrocode}
+ \int_zero:N \l_tmpb_int
\seq_map_indexed_inline:Nn \g_@@_notes_seq
{
+ \@@_test_first_novalue:nnn ##2 { \int_incr:N \l_tmpb_int }
\tl_if_eq:nnT { { #1 } { #2 } } { ##2 }
- {
- \int_set:Nn \l_tmpa_int { ##1 }
+ {
+ \tl_if_novalue:nTF { #1 }
+ { \int_set_eq:NN \l_tmpa_int \l_tmpb_int }
+ { \int_set:Nn \l_tmpa_int { ##1 } }
\seq_map_break:
}
}
@@ -4536,7 +4549,7 @@ version 2005/12/01 or later.
% Now, we prepare the token list for the instructions that we will have to write
% on the |aux| file at the end of the environment.
% \begin{macrocode}
- \tl_build_gbegin:N \g_@@_aux_tl
+ \tl_gclear:N \g_@@_aux_tl
% \end{macrocode}
%
% \begin{macrocode}
@@ -4609,7 +4622,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\int_compare:nNnT \g_@@_total_X_weight_int > \c_zero_int
{
- \tl_build_gput_right:Nx \g_@@_aux_tl
+ \tl_gput_right:Nx \g_@@_aux_tl
{
\bool_set_true:N \l_@@_X_columns_aux_bool
\dim_set:Nn \l_@@_X_columns_dim
@@ -4804,7 +4817,6 @@ version 2005/12/01 or later.
% We write on the |aux| file all the informations corresponding to the
% current environment.
% \begin{macrocode}
- \tl_build_gend:N \g_@@_aux_tl
\iow_now:Nn \@mainaux { \ExplSyntaxOn }
\iow_now:Nn \@mainaux { \char_set_catcode_space:n { 32 } }
\iow_now:Nx \@mainaux
@@ -6410,7 +6422,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\int_compare:nNnT \g_@@_notes_caption_int > \c_zero_int
{
- \tl_build_gput_right:Nx \g_@@_aux_tl
+ \tl_gput_right:Nx \g_@@_aux_tl
{
\tl_set:Nn \exp_not:N \l_@@_note_in_caption_tl
{ \int_use:N \g_@@_notes_caption_int }
@@ -7637,7 +7649,7 @@ version 2005/12/01 or later.
%
% \medskip
% \begin{macrocode}
- \tl_build_gput_right:Nx \g_@@_aux_tl
+ \tl_gput_right:Nx \g_@@_aux_tl
{
\seq_gset_from_clist:Nn \exp_not:N \g_@@_size_seq
{
@@ -7656,7 +7668,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\seq_if_empty:NF \g_@@_pos_of_blocks_seq
{
- \tl_build_gput_right:Nx \g_@@_aux_tl
+ \tl_gput_right:Nx \g_@@_aux_tl
{
\seq_gset_from_clist:Nn \exp_not:N \g_@@_pos_of_blocks_seq
{ \seq_use:Nnnn \g_@@_pos_of_blocks_seq , , , }
@@ -7664,7 +7676,7 @@ version 2005/12/01 or later.
}
\seq_if_empty:NF \g_@@_multicolumn_cells_seq
{
- \tl_build_gput_right:Nx \g_@@_aux_tl
+ \tl_gput_right:Nx \g_@@_aux_tl
{
\seq_gset_from_clist:Nn \exp_not:N \g_@@_multicolumn_cells_seq
{ \seq_use:Nnnn \g_@@_multicolumn_cells_seq , , , }
@@ -7872,7 +7884,7 @@ version 2005/12/01 or later.
\seq_if_empty:NF \g_@@_rowlistcolors_seq { \@@_clear_rowlistcolors_seq: }
\tl_if_empty:NF \g_@@_pre_code_before_tl
{
- \tl_build_gput_right:Nx \g_@@_aux_tl
+ \tl_gput_right:Nx \g_@@_aux_tl
{
\tl_gset:Nn \exp_not:N \g_@@_pre_code_before_tl
{ \exp_not:o \g_@@_pre_code_before_tl }
@@ -7881,7 +7893,7 @@ version 2005/12/01 or later.
}
\tl_if_empty:NF \g_nicematrix_code_before_tl
{
- \tl_build_gput_right:Nx \g_@@_aux_tl
+ \tl_gput_right:Nx \g_@@_aux_tl
{
\tl_gset:Nn \exp_not:N \g_@@_code_before_tl
{ \exp_not:o \g_nicematrix_code_before_tl }
@@ -10060,10 +10072,8 @@ version 2005/12/01 or later.
\keys_define:nn { NiceMatrix / RowStyle }
{
cell-space-top-limit .dim_set:N = \l_tmpa_dim ,
- cell-space-top-limit .initial:n = \c_zero_dim ,
cell-space-top-limit .value_required:n = true ,
cell-space-bottom-limit .dim_set:N = \l_tmpb_dim ,
- cell-space-bottom-limit .initial:n = \c_zero_dim ,
cell-space-bottom-limit .value_required:n = true ,
cell-space-limits .meta:n =
{
@@ -10095,6 +10105,8 @@ version 2005/12/01 or later.
\tl_clear:N \l_tmpa_tl % value of \rowcolor
\tl_clear:N \l_@@_color_tl
\int_set_eq:NN \l_@@_key_nb_rows_int \c_one_int
+ \dim_zero:N \l_tmpa_dim
+ \dim_zero:N \l_tmpb_dim
\keys_set:nn { NiceMatrix / RowStyle } { #1 }
% \end{macrocode}
% If the key |rowcolor| has been used.
@@ -10135,15 +10147,16 @@ version 2005/12/01 or later.
% \begin{macrocode}
\dim_compare:nNnT \l_tmpa_dim > \c_zero_dim
{
- \@@_put_in_row_style:n
+ \exp_args:Nx \@@_put_in_row_style:n
{
- \exp_not:n
- {
- \tl_gput_right:Nn \g_@@_cell_after_hook_tl
- {
- \dim_set:Nn \l_@@_cell_space_top_limit_dim
- { \dim_use:N \l_tmpa_dim }
- }
+ \tl_gput_right:Nn \exp_not:N \g_@@_cell_after_hook_tl
+ {
+% \end{macrocode}
+% It's not possible to chanage the following code by using |\dim_set_eq:NN|
+% (because of expansion).
+% \begin{macrocode}
+ \dim_set:Nn \l_@@_cell_space_top_limit_dim
+ { \dim_use:N \l_tmpa_dim }
}
}
}
@@ -10152,15 +10165,12 @@ version 2005/12/01 or later.
% \begin{macrocode}
\dim_compare:nNnT \l_tmpb_dim > \c_zero_dim
{
- \@@_put_in_row_style:n
+ \exp_args:Nx \@@_put_in_row_style:n
{
- \exp_not:n
- {
- \tl_gput_right:Nn \g_@@_cell_after_hook_tl
- {
- \dim_set:Nn \l_@@_cell_space_bottom_limit_dim
- { \dim_use:N \l_tmpb_dim }
- }
+ \tl_gput_right:Nn \exp_not:N \g_@@_cell_after_hook_tl
+ {
+ \dim_set:Nn \l_@@_cell_space_bottom_limit_dim
+ { \dim_use:N \l_tmpb_dim }
}
}
}
@@ -12345,7 +12355,7 @@ version 2005/12/01 or later.
% commands which color the |rows|, |columns| and |cells| must not color the
% cells in the corners.
% \begin{macrocode}
- \tl_build_gput_right:Nx \g_@@_aux_tl
+ \tl_gput_right:Nx \g_@@_aux_tl
{
\seq_set_from_clist:Nn \exp_not:N \l_@@_corners_cells_seq
{ \seq_use:Nnnn \l_@@_corners_cells_seq , , , }
@@ -17156,6 +17166,7 @@ version 2005/12/01 or later.
left-margin,~
light-syntax,~
matrix/columns-type,~
+ no-cell-nodes,~
notes~(several~subkeys),~
nullify-dots,~
pgf-node-code,~
@@ -17214,6 +17225,7 @@ version 2005/12/01 or later.
left-margin,~
light-syntax,~
name,~
+ no-cell-nodes,~
nullify-dots,~
pgf-node-code,~
renew-dots,~
@@ -17278,6 +17290,7 @@ version 2005/12/01 or later.
left-margin,~
light-syntax,~
name,~
+ no-cell-nodes,~
nullify-dots,~
pgf-node-code,~
r,~
@@ -17340,6 +17353,7 @@ version 2005/12/01 or later.
left-margin,~
light-syntax,~
name,~
+ no-cell-nodes,~
notes~(several~subkeys),~
nullify-dots,~
pgf-node-code,~
diff --git a/macros/latex/contrib/nicematrix/nicematrix-code.pdf b/macros/latex/contrib/nicematrix/nicematrix-code.pdf
new file mode 100644
index 0000000000..f05f5fc311
--- /dev/null
+++ b/macros/latex/contrib/nicematrix/nicematrix-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
index 456c820b75..5245e44dce 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 64ac62e240..3ba956b397 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex
@@ -316,6 +316,10 @@ $\begin{pNiceMatrix}
\end{pNiceMatrix}$
\end{scope}
+\bigskip
+Il est également possible de changer ces paramètres pour certaines lignes
+seulement grâce à la commande |\RowStyle| (cf.~p.~\pageref{RowStyle}).
+
\medskip
\section{La clé baseline}
@@ -1780,10 +1784,6 @@ Rappelons que l'extension \pkg{colortbl} peut être chargée directement par
\texttt{table} : |\usepackage[table]{xcolor}|.
\medskip
-Comme l'extension \pkg{nicematrix} est fondée sur \pkg{array}, il est possible
-d'utiliser \pkg{colortbl} avec \pkg{nicematrix}.
-
-\medskip
Il y a néanmoins deux inconvénients :
\begin{itemize}
\item L'extension \pkg{colortbl} patche \pkg{array}, ce qui entraîne des
@@ -5199,6 +5199,7 @@ environnement de \pkg{nicematrix}, elle est sans effet.
Pour un exemple d'utilisation, voir \url{tex.stackexchange.com/questions/488566}
+
\section{Utilisation de TikZ avec nicematrix}
\label{name}\label{PGF-nodes}
@@ -5207,6 +5208,8 @@ Pour un exemple d'utilisation, voir \url{tex.stackexchange.com/questions/488566}
\subsection{Les nœuds correspondant aux contenus des cases}
+\index{no-cell-nodes}
+
L'extension \pkg{nicematrix} crée un nœud PGF-TikZ\footnote{On rappelle que TikZ
est une sur-couche de PGF. L'extension \pkg{nicematrix} charge PGF et ne
charge pas TikZ. On parle de «nœud PGF-TikZ» pour rappeler que, en fait, les
@@ -5225,6 +5228,11 @@ lignes pointillées (cf.~p.~\pageref{Cdots}) et la détermination des «coins»
(cf. p.~\pageref{corners}).}
\medskip
+Comme la création de ces nœuds requiert du temps et de la mémoire, il est
+possible de la désactiver ponctuellement avec la clé |no-cell-nodes| pour
+accéler les compilations.
+
+\medskip
Tous les nœuds du document doivent avoir des noms deux à deux distincts et le
nom de ces nœuds doit donc faire intervenir le numéro de l'environnement
courant. Les environnements créés par \pkg{nicematrix} sont en effet numérotés
diff --git a/macros/latex/contrib/nicematrix/nicematrix.ins b/macros/latex/contrib/nicematrix/nicematrix.ins
index 171d3f7449..88bb4d6754 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.ins
+++ b/macros/latex/contrib/nicematrix/nicematrix.ins
@@ -1,5 +1,5 @@
%%
-%% Copyright (C) 2018-2023 by F. Pantigny
+%% Copyright (C) 2018-2024 by F. Pantigny
%%
%%
%% This file may be distributed and/or modified under the
@@ -17,7 +17,7 @@
\usedir{tex/latex/nicematrix}
\preamble
-Copyright (C) 2018-2023 by F. Pantigny
+Copyright (C) 2018-2024 by F. Pantigny
This file may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf
index cc1afcb859..e1f5e455dd 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix.tex b/macros/latex/contrib/nicematrix/nicematrix.tex
index 10dd6c789a..e1cd2af742 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix.tex
@@ -288,7 +288,9 @@ $\begin{pNiceMatrix}
\end{pNiceMatrix}$
\end{scope}
-
+\bigskip
+It's also possible to change these parameters for only a few rows by using the
+command |\RowStyle| provided by \pkg{nicematrix} (cf.~p.~\pageref{RowStyle}).
@@ -1728,10 +1730,6 @@ We recall that the package \pkg{colortbl} can be loaded directly with
|\usepackage[table]{xcolor}|.
\medskip
-Since the package \pkg{nicematrix} is based on \pkg{array}, it's possible to
-use \pkg{colortbl} with \pkg{nicematrix}.
-
-\medskip
However, there is two drawbacks:
\begin{itemize}
\item The package \pkg{colortbl} patches \pkg{array}, leading to some
@@ -5095,10 +5093,12 @@ For an example of utilisation, see \url{tex.stackexchange.com/questions/488566}
\label{name}\label{PGF-nodes}
\index{tikza@TikZ (utilisation with \pkg{nicematrix})}
-\index{node@\textbf{Nodes of PGF/TikZ|}(}
+\index{node@\textbf{Nodes of PGF/TikZ}|(}
\subsection{The nodes corresponding to the contents of the cells}
+\index{no-cell-nodes}
+
The package \pkg{nicematrix} creates a PGF/TikZ node\footnote{We recall that TikZ
is a layer over PGF. The extension \pkg{nicematrix} loads PGF but does not
load TikZ. We speak of PGF/TikZ nodes to emphase the fact that the PGF nodes
@@ -5119,6 +5119,11 @@ lines (cf. p.~\pageref{Cdots}) and the computation of the ``corners''
(cf.~p.~\pageref{corners}).}
\medskip
+The creation of those nodes needs time and memory. It's possible to desactive
+ponctually the creation of those nodes with the key |no-cell-nodes| in order to
+speed up the compilations.
+
+\medskip
The nodes of a document must have distinct names. That's why the names of the
nodes created by \pkg{nicematrix} contains the number of the current
environment. Indeed, the environments of \pkg{nicematrix} are numbered by a