texlive[72697] Master/texmf-dist: nicematrix (29oct24)
commits+karl at tug.org
commits+karl at tug.org
Tue Oct 29 21:06:55 CET 2024
Revision: 72697
https://tug.org/svn/texlive?view=revision&revision=72697
Author: karl
Date: 2024-10-29 21:06:54 +0100 (Tue, 29 Oct 2024)
Log Message:
-----------
nicematrix (29oct24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-code.pdf
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf
trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex
trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins
trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-code.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex 2024-10-29 20:06:39 UTC (rev 72696)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex 2024-10-29 20:06:54 UTC (rev 72697)
@@ -1219,10 +1219,11 @@
|\bottomrule|, etc.) et que vous tenez absolument à mettre des filets verticaux
(ce qui est contraire à l'esprit à \pkg{booktabs}), vous constaterez que les
filets tracés par \pkg{nicematrix} sont compatibles avec \pkg{booktabs}.
+Remarquez que \pkg{nicematrix} ne charge \emph{pas} \pkg{booktabs}.
\medskip
\begin{Code}[width=10.5cm]
-$\begin{NiceArray}{\emph{|cccc|}} \toprule
+$\begin{NiceArray}{\emph{c|ccc}} \toprule
a & b & c & d \\ \midrule
1 & 2 & 3 & 4 \\
1 & 2 & 3 & 4 \\ \bottomrule
@@ -1229,7 +1230,7 @@
\end{NiceArray}$
\end{Code}
%
-$\begin{NiceArray}{|cccc|}
+$\begin{NiceArray}{c|ccc}
\toprule
a & b & c & d \\
\midrule
@@ -2998,9 +2999,9 @@
valeur initiale de ce paramètre est |\linewidth| (et non |\textwidth|).
Pour se rapprocher davantage de l'environnement |{tabularx}|, \pkg{nicematrix}
-propose aussi un environnement |{NiceTabularX}| avec une syntaxe similaire à
-celle de |{tabularx}|, c'est-à-dire que la largeur voulue pour le tableau est
-spécifiée en premier argument (obligatoire).
+propose aussi un environnement \Definition{\{NiceTabularX\}} avec une syntaxe
+similaire à celle de |{tabularx}|, c'est-à-dire que la largeur voulue pour le
+tableau est spécifiée en premier argument (obligatoire).
Comme avec les extensions \pkg{tabu}\footnote{L'extension \pkg{tabu} est
@@ -5178,7 +5179,7 @@
\Definition{columns-type} qui indique le type de colonne qui sera utilisé.
\medskip
-Les clés \Definition{l} et \Definition{l} sont des raccourcis pour
+Les clés \Definition{l} et \Definition{r} sont des raccourcis pour
|columns-type=l| et |columns-type=r|.
\medskip
@@ -5467,12 +5468,12 @@
\medskip
-\index{light-syntax-expanded}
-La clé |light-syntax-expanded| a le même comportement que la clé |light-syntax|
-mais avec cette différence que le corps de l'environnement est complètement
-développé (au sens de TeX\footnote{Plus précisément, il s'agit d'une expansion
- de type |e| de L3.}) avant découpe en lignes (mais après l'extraction de
-l'éventuel |\CodeAfter|).
+\index{light-syntax-expanded}
+La clé \Definition{light-syntax-expanded} a le même comportement que la clé
+|light-syntax| mais avec cette différence que le corps de l'environnement est
+complètement développé (au sens de TeX\footnote{Plus précisément, il s'agit
+ d'une expansion de type |e| de L3.}) avant découpe en lignes (mais après
+l'extraction de l'éventuel |\CodeAfter|).
\subsection{Couleur des délimiteurs}
@@ -5509,11 +5510,11 @@
\index{NiceArrayWithDelims@\texttt{\{NiceArrayWithDelims\}}}
En fait, l'environnement |{pNiceArray}| et ses variantes sont fondés sur un
-environnement plus général, appelé |{NiceArrayWithDelims}|. Les deux premiers
-arguments obligatoires de cet environnement sont les délimiteurs gauche et droit
-qui seront utilisés dans la construction de la matrice. Il est possible
-d'utiliser |{NiceArrayWithDelims}| si on a besoin de délimiteurs atypiques ou
-asymétriques.
+environnement plus général, appelé \Definition{\{NiceArrayWithDelims\}}. Les
+deux premiers arguments obligatoires de cet environnement sont les délimiteurs
+gauche et droit qui seront utilisés dans la construction de la matrice. Il est
+possible d'utiliser |{NiceArrayWithDelims}| si on a besoin de délimiteurs
+atypiques ou asymétriques.
\medskip
\begin{Code}[width=11cm]
@@ -6104,8 +6105,8 @@
\end{NiceMatrix}\]
\medskip
-Les nœuds de la forme $i$|.5| peuvent être utilisés par exemple pour barrer une
-ligne (si on a chargé TikZ).
+Les nœuds «décimaux» (comme $i$|.4|) peuvent être utilisés par exemple pour
+barrer une ligne (si on a chargé TikZ).
\smallskip
\begin{Code}[width=11cm]
@@ -6114,7 +6115,7 @@
3 & 3 & 1 & 0 \\
3 & 3 & 1 & 0
\CodeAfter
- \tikz \draw [red] (\emph{3.5}-|1) -- (\emph{3.5}-|last) ;
+ \tikz \draw [red] (\emph{3.4}-|1) -- (\emph{3.4}-|last) ;
\end{pNiceArray}$
\end{Code}
$\begin{pNiceArray}{ccc|c}
@@ -6122,7 +6123,7 @@
3 & 3 & 1 & 0 \\
3 & 3 & 1 & 0
\CodeAfter
- \tikz \draw [red] (3.5-|1) -- (3.5-|last) ;
+ \tikz \draw [red] (3.4-|1) -- (3.4-|last) ;
\end{pNiceArray}$
@@ -6460,6 +6461,14 @@
\index{Incompatibilités}
+
+L'extension \pkg{nicematrix} est incompatible avec certaines classes qui
+redéfinissent les environnements |{tabular}| et |{array}|. C'est en particulier
+le cas de la classe |socg-lipics-v2021|. Néanmoins, dans ce cas-là, il est
+possible de charger la classe avec l'option |notab| qui requiert justement que
+|{tabular}| ne soit pas redéfini.
+
+
\medskip
L'extension \pkg{nicematrix} n'est pas compatible avec la classe \cls{ieeeaccess}
car cette classe n'est pas compatible avec PGF-TikZ. Il existe néanmoins une
Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex 2024-10-29 20:06:39 UTC (rev 72696)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex 2024-10-29 20:06:54 UTC (rev 72697)
@@ -1080,32 +1080,30 @@
sub-blocks of \emph{the same size}.
\medskip
-\begin{Code}[width=85mm]
+\begin{Code}[width=90mm]
\begin{NiceTabular}{ll}%
[hvlines,\emph{ampersand-in-blocks}]
- & les cinq premiers entiers naturels \\
-3 & \Block{}{un&deux&trois} \\
-4 & \Block{}{un&deux&trois& quatre} \\
-5 & \Block{}{un&deux&trois&quatre&cinq} \\
+ & the five first naturels numbers \\
+3 & \Block{}{one & two & three} \\
+4 & \Block{}{one& two & three & four} \\
+5 & \Block{}{one & two & three & four & five} \\
\end{NiceTabular}
\end{Code}
%
\begin{NiceTabular}{ll}%
[hvlines,ampersand-in-blocks]
- & les cinq premiers entiers naturels \\
-3 & \Block{}{un & deux & trois} \\
-4 & \Block{}{un& deux & trois & quatre} \\
-5 & \Block{}{un & deux & trois & quatre & cinq} \\
+ & the five first naturels numbers \\
+3 & \Block{}{one & two & three} \\
+4 & \Block{}{one& two & three & four} \\
+5 & \Block{}{one & two & three & four & five} \\
\end{NiceTabular}
-
-
As we can see, the blocks (which was are in fact mono-cell blocks) are divided
into sub-blocks of the same size. However, maybe the following code would be prefered.
\medskip
-\begin{Code}[width=85mm]
+\begin{Code}[width=90mm]
\begin{NiceTabular}{lccccc}%
[hvlines,\emph{ampersand-in-blocks}]
& \Block{1-5}{the five first
@@ -1177,19 +1175,20 @@
\bigskip
\index{booktabs@\pkg{booktabs} (package)}
If you use \pkg{booktabs} (which provides |\toprule|, |\midrule|,
-|\bottomrule|, etc.) and if you really want to add vertical rules (which is
+|\bottomrule|, etc.) and if you actually want to add vertical rules (which is
not in the spirit of \pkg{booktabs}), you should notice that the vertical rules
-drawn by \pkg{nicematrix} are compatible with \pkg{booktabs}.
+drawn by \pkg{nicematrix} are compatible with \pkg{booktabs}. Remark that
+\pkg{nicematrix} does \emph{not} load \pkg{booktabs}.
\medskip
\begin{Code}[width=10.5cm]
-$\begin{NiceArray}{\emph{|cccc|}} \toprule
+$\begin{NiceArray}{\emph{c|ccc}} \toprule
a & b & c & d \\ \midrule
1 & 2 & 3 & 4 \\
1 & 2 & 3 & 4 \\ \bottomrule
\end{NiceArray}$
\end{Code}
-$\begin{NiceArray}{|cccc|}
+$\begin{NiceArray}{c|ccc}
\toprule
a & b & c & d \\
\midrule
@@ -2910,10 +2909,10 @@
\Definition{width} (in |{NiceTabular}| or in |\NiceMatrixOptions|). The initial
value of this parameter is |\linewidth| (and not |\textwidth|).
-For sake of similarity with the environment |{tabularx}|, \pkg{nicematrix}
-also provides an environment |{NiceTabularX}| with a syntax similar to the
-syntax of |{tabularx}|, that is to say with a first mandatory argument
-which is the width of the tabular.
+For sake of similarity with the environment |{tabularx}|, \pkg{nicematrix} also
+provides an environment \Definition{\{NiceTabularX\}} with a syntax similar to
+the syntax of |{tabularx}|, that is to say with a first mandatory argument which
+is the width of the tabular.
As with the packages \pkg{tabu}\footnote{The extension \pkg{tabu} is now
considered as deprecated.} and \pkg{tabularray}, the specifier |X| takes
@@ -5341,10 +5340,10 @@
\medskip
\index{light-syntax-expanded}
-The key |light-syntax-expanded| has the same behaviour as the key |light-syntax|
-but the body of the environment is expanded (in the TeX sens\footnote{More precisely, it's a
-expansion of type |e| of L3.}) before being splitted in lines (but
-after the extraction of a potential |\CodeAfter|).
+The key \Definition{light-syntax-expanded} has the same behaviour as the key
+|light-syntax| but the body of the environment is expanded (in the TeX
+sens\footnote{More precisely, it's a expansion of type |e| of L3.}) before being
+splitted in lines (but after the extraction of a potential |\CodeAfter|).
\subsection{Color of the delimiters}
@@ -5382,9 +5381,9 @@
\index{NiceArrayWithDelims@\texttt{\{NiceArrayWithDelims\}}}
In fact, the environment |{pNiceArray}| and its variants are based upon a
-more general environment, called |{NiceArrayWithDelims}|. The first two
-mandatory arguments of this environment are the left and right delimiters used
-in the construction of the matrix.
+more general environment, called \Definition{\{NiceArrayWithDelims\}}. The first
+two mandatory arguments of this environment are the left and right delimiters
+used in the construction of the matrix.
It's possible to use |{NiceArrayWithDelims}| if we want to use atypical or
asymetrical delimiters.
@@ -5969,8 +5968,8 @@
\bigskip
-The nodes of the form $i$|.5| may be used, for example to cross a row of a
-matrix (if TikZ is loaded).
+The ``decimal'' nodes (like $i$|.4|) may be used, for example to cross a row of
+a matrix (if TikZ is loaded).
\smallskip
\begin{Code}[width=11cm]
@@ -5979,7 +5978,7 @@
3 & 3 & 1 & 0 \\
3 & 3 & 1 & 0
\CodeAfter
- \tikz \draw [red] (\emph{3.5}-|1) -- (\emph{3.5}-|last) ;
+ \tikz \draw [red] (\emph{3.4}-|1) -- (\emph{3.4}-|last) ;
\end{pNiceArray}$
\end{Code}
$\begin{pNiceArray}{ccc|c}
@@ -5987,7 +5986,7 @@
3 & 3 & 1 & 0 \\
3 & 3 & 1 & 0
\CodeAfter
- \tikz \draw [red] (3.5-|1) -- (3.5-|last) ;
+ \tikz \draw [red] (3.4-|1) -- (3.4-|last) ;
\end{pNiceArray}$
\subsection{The nodes corresponding to the command \textbackslash SubMatrix}
@@ -6313,6 +6312,14 @@
\index{Incompatibilities}
+The extension \pkg{nicematrix} is usually not compatible with the classes and
+packages that redefine the environments |{tabular}| and |{array}|. In
+particular, it's the case of the class |socg-lipics-v2021|. However, in that
+case, it's possible to load the class with the key |notab| which requires that
+the environment |{tabular}| is not redefined.
+
+\medskip
+
The package \pkg{nicematrix} is not compatible with the class \cls{ieeeaccess}
because that class is not compatible with PGF/TikZ. However, there is a simple
workaround by writing:\footnote{See
@@ -6326,7 +6333,7 @@
-\bigskip
+\medskip
% the following requirement is still in force on April 23, 2024
In order to use \pkg{nicematrix} with the class \cls{aastex631}
(of the \emph{American Astronomical Society}), you have to
@@ -6338,7 +6345,7 @@
\BeforeBegin{NiceMatrix}{\let\begin\BeginEnvironment}
\end{Verbatim}
-\bigskip
+\medskip
In order to use \pkg{nicematrix} with the class \cls{sn-jnl} (of
\emph{Springer Nature}), \pkg{pgf} must
be loaded before the |\documentclass| with |\RequirePackage|:
@@ -6351,12 +6358,12 @@
However, it seems that this is no longer mandatory with the recent versions of
\cls{sn-jnl}.
-\bigskip
+\medskip
The package \pkg{nicematrix} is not fully compatible with the packages and classes
of LuaTeX-ja: the detection of the empty corners (cf. p.~\pageref{corners})
may be wrong in some circonstances.
-\bigskip
+\medskip
The package \pkg{nicematrix} is not fully compatible with the package
\pkg{arydshln} (because this package redefines many internals of \pkg{array})
and does not support the columns~|V| of \pkg{boldline} (because the letter |V| is
Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx 2024-10-29 20:06:39 UTC (rev 72696)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx 2024-10-29 20:06:54 UTC (rev 72697)
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.29}
-\def\myfiledate{2024/10/24}
+\def\myfileversion{6.29a}
+\def\myfiledate{2024/10/29}
%
%
%<*batchfile>
@@ -1180,17 +1180,8 @@
% \end{macrocode}
%
% \bigskip
-% |\l_@@_code_before_tl| may contain two types of informations:
-% \begin{itemize}
-% \item A |code-before| written in the |aux| file by a previous run. When the
-% |aux| file is read, this |code-before| is stored in
-% |\g_@@_code_before_|\textsl{i}|_tl| (where \textsl{i} is the number of the
-% environment) and, at the beginning of the environment, it will be put in
-% |\l_@@_code_before_tl|.
-% \item The final user can explicitly add material in |\l_@@_code_before_tl| by
-% using the key |code-before| or the keyword |\CodeBefore| (with the keyword
-% |\Body|).
-% \end{itemize}
+% The use of |\l_@@_code_before_tl| is not clear. Maybe that with the evolutions
+% of \pkg{nicematrix}, it has become obsolete. We should have a look at that.
% \begin{macrocode}
\tl_new:N \l_@@_code_before_tl
\bool_new:N \l_@@_code_before_bool
@@ -1215,10 +1206,12 @@
%
% \bigskip
% The L3 programming layer provides scratch dimensions |\l_tmpa_dim| and
-% |\l_tmpb_dim|. We creates two more in the same spirit.
+% |\l_tmpb_dim|. We creates several more in the same spirit.
% \begin{macrocode}
\dim_new:N \l_@@_tmpc_dim
\dim_new:N \l_@@_tmpd_dim
+\dim_new:N \l_@@_tmpe_dim
+\dim_new:N \l_@@_tmpf_dim
% \end{macrocode}
%
% \bigskip
@@ -2978,13 +2971,13 @@
% \bigskip
% \section{Important code used by \{NiceArrayWithDelims\} }
%
-% The pseudo-environment |\@@_cell_begin:w|--|\@@_cell_end:| will be used to format the
+% The pseudo-environment |\@@_cell_begin:|--|\@@_cell_end:| will be used to format the
% cells of the array. In the code, the affectations are global because this
% pseudo-environment will be used in the cells of a |\halign| (via an
% environment |{array}|).
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_cell_begin:w
+\cs_new_protected:Npn \@@_cell_begin:
{
% \end{macrocode}
% |\g_@@_cell_after_hook_tl| will be set during the composition of the box
@@ -3262,7 +3255,7 @@
% \item we test the existence of these nodes in order to determine whether a
% cell is empty when we search the extremities of a dotted line.
% \end{itemize}
-% However, it's very difficult to determine whether a cell is empty. Up to now
+% However, it's difficult to determine whether a cell is empty. Up to now
% we use the following technic:
% \begin{itemize}
% \item for the columns of type |p|, |m|, |b|, |V| (of \pkg{varwidth}) or |X|,
@@ -3394,7 +3387,7 @@
{ \@@_env: - \int_use:N \c at iRow - \int_use:N \c at jCol - NW }
% \end{macrocode}
% I don't know why the following adjustement is needed when the compilation is
-% done with XeLaTeX or with the classical way |latex|, |divps|, |ps2pdf| (or
+% done with XeLaTeX or with the classical way |latex|, |dvips|, |ps2pdf| (or
% Adobe Distiller). However, it seems to work.
% \begin{macrocode}
#1
@@ -3716,48 +3709,13 @@
}
% \end{macrocode}
%
-% \bigskip
-% |#1468| on GitHub (latex2e) exhibits a bug when a command with a last argument
-% which is optional is used in |>{...}| of \pkg{array}.
-%
-% In order to solve that problem, a modification is done to the command
-% |\inser at column| in the version 2.6g (2024/10/12) of \pkg{array}. However, with
-% that modification, our command |\@@_test_if_empty:| leads to a bug when the
-% first column of an array is of type |p{...}| and when the first cell of that
-% first column is empty.
-%
-% As a workaround, we will use a slight different version of |\insert at column|.
+% \vspace{1cm}
%
-%
-% \begin{macrocode}
-\bool_if:NT \c_@@_tagging_array_bool
- {
- \cs_new:Npn \@@_insert at column
- {
- \UseTaggingSocket{tbl/cell/begin}
- \the at toks \the \@tempcnta \ignorespaces
- \@sharp \textonly at unskip
- \the at toks \the \count@ \relax
- \UseTaggingSocket{tbl/cell/end}
- }
- }
-% \end{macrocode}
-% In the version 2.6g of \pkg{array}, a command |\@protected at firstofone| is
-% added:
-%
-% |\@protected at firstofone { \the at toks \the \@tempcnta \ignorespaces }|
-%
-%
-% \bigskip
-% The following code |\@@_pre_array_ii:| is used in |{NiceArrayWithDelims}|. It
-% exists as a standalone macro only for legibility.
% \label{prearray}
%
% \begin{macrocode}
\cs_new_protected:Npn \@@_pre_array_ii:
{
- \bool_if:NT \c_@@_tagging_array_bool
- { \cs_set_eq:NN \insert at column \@@_insert at column }
% \end{macrocode}
%
% \bigskip
@@ -3944,7 +3902,7 @@
% The counter |\c at jCol| will be used to count the columns of the array.
% Since we want to know the total number of columns of the matrix, we also
% create a counter |\g_@@_col_total_int|. These counters are updated in the
-% command |\@@_cell_begin:w| executed at the beginning of each cell.
+% command |\@@_cell_begin:| executed at the beginning of each cell.
% \begin{macrocode}
\int_gzero_new:N \g_@@_col_total_int
% \end{macrocode}
@@ -4014,7 +3972,7 @@
% \end{macrocode}
%
% \bigskip
-% If there is an exterior row, we patch a command used in |\@@_cell_begin:w| in order to
+% If there is an exterior row, we patch a command used in |\@@_cell_begin:| in order to
% keep track of some dimensions needed to the construction of that ``last row''.
% \begin{macrocode}
\int_compare:nNnT \l_@@_last_row_int > { -2 }
@@ -5087,7 +5045,7 @@
\tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl
\tl_gclear:N \g_@@_pre_cell_tl
\tl_gput_right:Nn \g_@@_array_preamble_tl
- { > \@@_cell_begin:w c < \@@_cell_end: }
+ { > \@@_cell_begin: c < \@@_cell_end: }
% \end{macrocode}
%
% We increment the counter of columns and then we test for the presence of a |<|.
@@ -5103,7 +5061,7 @@
\tl_gclear:N \g_@@_pre_cell_tl
\tl_gput_right:Nn \g_@@_array_preamble_tl
{
- > { \@@_cell_begin:w \tl_set_eq:NN \l_@@_hpos_cell_tl \c_@@_l_tl }
+ > { \@@_cell_begin: \tl_set_eq:NN \l_@@_hpos_cell_tl \c_@@_l_tl }
l
< \@@_cell_end:
}
@@ -5118,7 +5076,7 @@
\tl_gclear:N \g_@@_pre_cell_tl
\tl_gput_right:Nn \g_@@_array_preamble_tl
{
- > { \@@_cell_begin:w \tl_set_eq:NN \l_@@_hpos_cell_tl \c_@@_r_tl }
+ > { \@@_cell_begin: \tl_set_eq:NN \l_@@_hpos_cell_tl \c_@@_r_tl }
r
< \@@_cell_end:
}
@@ -5179,9 +5137,9 @@
\tl_gput_right:Ne \g_@@_array_preamble_tl
{
% \end{macrocode}
-% Here, the command |\dim_eval:n| is mandatory.
+% Here, the command |\dim_use:N| is mandatory.
% \begin{macrocode}
- \exp_not:N ! { \skip_horizontal:n { \dim_eval:n { \l_@@_rule_width_dim } } }
+ \exp_not:N ! { \skip_horizontal:N \dim_use:N \l_@@_rule_width_dim }
}
\tl_gput_right:Ne \g_@@_pre_code_after_tl
{
@@ -5307,7 +5265,7 @@
\use:e
{
\@@_make_preamble_ii_v:nnnnnnnn
- { \str_if_eq:nnTF \l_@@_vpos_col_str { p } { t } { b } }
+ { \str_if_eq:eeTF \l_@@_vpos_col_str { p } { t } { b } }
{ \dim_eval:n { #1 } }
{
% \end{macrocode}
@@ -5403,7 +5361,7 @@
}
{
\tl_gput_right:Nn \g_@@_array_preamble_tl
- { > { \@@_test_if_empty: } }
+ { > \@@_test_if_empty: }
}
\tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl
\tl_gclear:N \g_@@_pre_cell_tl
@@ -5418,7 +5376,7 @@
\dim_set:Nn \l_@@_col_width_dim { #2 }
\bool_if:NT \c_@@_testphase_table_bool
{ \tag_struct_begin:n { tag = Div } }
- \@@_cell_begin:w
+ \@@_cell_begin:
% \end{macrocode}
% We use the form |\minipage|--|\endminipage| (|\varwidth|--|\endvarwidth|) for
% compatibility with \pkg{collcell} (2023-10-31).
@@ -5466,47 +5424,34 @@
% \end{macrocode}
%
% \bigskip
+% The cell always begins with |\ignorespaces| with \pkg{array} and that's why we
+% retrieve that token.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_test_if_empty:
- { \peek_after:Nw \@@_test_if_empty_i: }
-
-\cs_new_protected:Npn \@@_test_if_empty_i:
- { \peek_meaning_remove:NT \ignorespaces { \@@_test_if_empty_ii: } }
-
-\cs_new_protected:Npn \@@_test_if_empty_ii:
- { \peek_after:Nw \@@_test_if_empty_iii: }
+\cs_new_protected:Npn \@@_test_if_empty: \ignorespaces
+ {
% \end{macrocode}
-%
-%
-% \bigskip
+% We open a special group with |\group_align_safe_begin:|. Thus, when
+% |\peek_meaning:NTF| will read the |&| (when the cell is empty), that lecture
+% won't trigger the end of the cell (since we are in a lower group...). If the
+% end of cell was trigerred, we would have other tokens in the TeX flow (and not
+% |&|).
% \begin{macrocode}
-\bool_if:NTF \c_@@_tagging_array_bool
- {
- \cs_new_protected:Npn \@@_test_if_empty_iii:
- { \peek_meaning:NTF \textonly at unskip \@@_nullify_cell: \ignorespaces }
- }
+ \group_align_safe_begin:
+ \peek_meaning:NTF &
+ {
+ \group_align_safe_end:
+ \tl_gput_right:Nn \g_@@_cell_after_hook_tl
+ {
% \end{macrocode}
-% In the old version of \pkg{array}, we test whether it begins by
-% |\ignorespaces\unskip|. However, in some circunstancies, for example when
-% |\collectcell| of \pkg{collcell} is used, the cell does not begin with
-% |\ignorespaces|. In that case, we consider as not empty...
-% First, we test if the next token is |\ignorespaces| and it's not very easy...
+% Be careful: here, we can't merely use
+% |\bool_gset_true: \g_@@_empty_cell_bool|,
+% in particular because of the columns of type~|X|.
% \begin{macrocode}
- {
- \cs_new_protected:Npn \@@_test_if_empty_iii:
- { \peek_meaning:NTF \unskip \@@_nullify_cell: \ignorespaces }
- }
-% \end{macrocode}
-%
-% \bigskip
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_nullify_cell:
- {
- \tl_gput_right:Nn \g_@@_cell_after_hook_tl
- {
- \box_set_wd:Nn \l_@@_cell_box \c_zero_dim
- \skip_horizontal:N \l_@@_col_width_dim
+ \box_set_wd:Nn \l_@@_cell_box \c_zero_dim
+ \skip_horizontal:N \l_@@_col_width_dim
+ }
}
+ { \group_align_safe_end: }
}
% \end{macrocode}
%
@@ -5515,10 +5460,7 @@
\cs_new_protected:Npn \@@_test_if_empty_for_S:
{
\peek_meaning:NT \__siunitx_table_skip:n
- {
- \tl_gput_right:Nn \g_@@_cell_after_hook_tl
- { \box_set_wd:Nn \l_@@_cell_box \c_zero_dim }
- }
+ { \bool_gset_true:N \g_@@_empty_cell_bool }
}
% \end{macrocode}
%
@@ -5628,7 +5570,7 @@
{
> {
\dim_set:Nn \l_@@_col_width_dim { #2 }
- \@@_cell_begin:w
+ \@@_cell_begin:
\tl_set_eq:NN \l_@@_hpos_cell_tl \c_@@_c_tl
}
c
@@ -5662,7 +5604,7 @@
% \begin{macrocode}
\dim_set:Nn \l_@@_col_width_dim { #4 }
\hbox_set:Nw \l_@@_cell_box
- \@@_cell_begin:w
+ \@@_cell_begin:
\cs_set_nopar:Npn \l_@@_hpos_cell_tl { #3 }
}
c
@@ -5716,7 +5658,7 @@
\tl_gput_right:Nn \g_@@_array_preamble_tl
{
> {
- \@@_cell_begin:w
+ \@@_cell_begin:
\keys_set:nn { siunitx } { #1 }
\siunitx_cell_begin:w
}
@@ -6024,7 +5966,7 @@
\tl_gput_right:Nn \g_@@_array_preamble_tl
{
> {
- \@@_cell_begin:w
+ \@@_cell_begin:
\bool_set_true:N \l_@@_X_bool
% \end{macrocode}
% You encounter a problem on 2023-03-04: for an environment with |X| columns,
@@ -6253,7 +6195,7 @@
{
\tl_gput_right:Nn \g_@@_preamble_tl
{
- > { \@@_cell_begin:w \cs_set_nopar:Npn \l_@@_hpos_cell_tl { #1 } }
+ > { \@@_cell_begin: \cs_set_nopar:Npn \l_@@_hpos_cell_tl { #1 } }
#1
< \@@_cell_end:
}
@@ -6294,7 +6236,7 @@
\tl_gput_right:Nn \g_@@_preamble_tl
{
> {
- \@@_cell_begin:w
+ \@@_cell_begin:
\begin { minipage } [ #1 ] { \dim_eval:n { #3 } }
\mode_leave_vertical:
\arraybackslash
@@ -6324,7 +6266,7 @@
> {
\dim_set:Nn \l_@@_col_width_dim { #4 }
\hbox_set:Nw \l_@@_cell_box
- \@@_cell_begin:w
+ \@@_cell_begin:
\cs_set_nopar:Npn \l_@@_hpos_cell_tl { #3 }
}
c
@@ -6415,7 +6357,7 @@
\@@_qpoint:n { row - \int_use:N \l_tmpa_int }
}
{
- \str_if_eq:onTF \l_@@_baseline_tl { t }
+ \str_if_eq:eeTF \l_@@_baseline_tl { t }
{ \int_set_eq:NN \l_tmpa_int \c_one_int }
{
\str_if_eq:onTF \l_@@_baseline_tl { b }
@@ -6714,7 +6656,7 @@
% \end{macrocode}
% We convert a value of |t| to a value of |1|.
% \begin{macrocode}
- \tl_if_eq:NnT \l_@@_baseline_tl { t }
+ \str_if_eq:eeT \l_@@_baseline_tl { t }
{ \cs_set_nopar:Npn \l_@@_baseline_tl { 1 } }
% \end{macrocode}
% Now, we convert the value of |\l_@@_baseline_tl| (which should represent an
@@ -13241,7 +13183,7 @@
\bool_set_false:N \l_tmpa_bool
\bool_if:NT \l_@@_amp_in_blocks_bool
% \end{macrocode}
-% |\tl_if_in:nnT| is faster than |\str_if_in:nnT|.
+% |\tl_if_in:nnT| is slightly faster than |\str_if_in:nnT|.
% \begin{macrocode}
{ \tl_if_in:nnT { #5 } { & } { \bool_set_true:N \l_tmpa_bool } }
\bool_case:nF
@@ -14238,6 +14180,7 @@
\pgfpicture
\pgfrememberpicturepositiononpagetrue
\pgf at relevantforpicturesizefalse
+
\@@_qpoint:n { row - #1 }
\dim_set_eq:NN \l_@@_tmpc_dim \pgf at y
\@@_qpoint:n { row - \int_eval:n { #3 + 1 } }
@@ -14282,20 +14225,17 @@
{
\pgfpoint
{
+ \l_tmpa_dim + ##1 \l_tmpb_dim -
\str_case:on \l_@@_hpos_block_str
{
- l { \l_tmpa_dim + ##1 \l_tmpb_dim - \l_tmpb_dim + \col at sep}
- c { \l_tmpa_dim + ##1 \l_tmpb_dim - 0.5 \l_tmpb_dim }
- r { \l_tmpa_dim + ##1 \l_tmpb_dim - \col at sep }
+ l { \l_tmpb_dim + \col at sep}
+ c { 0.5 \l_tmpb_dim }
+ r { \col at sep }
}
}
{ \l_@@_tmpc_dim }
}
- \pgfset
- {
- inner~xsep = \c_zero_dim ,
- inner~ysep = \c_zero_dim
- }
+ \pgfset { inner~sep = \c_zero_dim }
\pgfnode
{ rectangle }
{
@@ -14443,11 +14383,7 @@
}
{ \l_tmpa_tl }
}
- \pgfset
- {
- inner~xsep = \c_zero_dim ,
- inner~ysep = \c_zero_dim
- }
+ \pgfset { inner~sep = \c_zero_dim }
\pgfnode
{ rectangle }
{ \l_tmpa_tl }
@@ -14515,6 +14451,24 @@
% \end{macrocode}
%
%
+% \bigskip
+% For the command |\cellcolor| used within a sub-cell of a |\Block| (when the
+% character |&| is used inside the cell).
+% \begin{macrocode}
+\cs_set_protected:Npn \@@_fill:nnnnn #1 #2 #3 #4 #5
+ {
+ \pgfpicture
+ \pgfrememberpicturepositiononpagetrue
+ \pgf at relevantforpicturesizefalse
+ \pgfpathrectanglecorners
+ { \pgfpoint { #2 } { #3 } }
+ { \pgfpoint { #4 } { #5 } }
+ \pgfsetfillcolor { #1 }
+ \pgfusepath { fill }
+ \endpgfpicture
+ }
+% \end{macrocode}
+%
%
% \bigskip
% The first argument of |\@@_stroke_block:nnn| is a list of options for the
@@ -16052,8 +16006,10 @@
\halign
{
\hfil ## \hfil \crcr
- \@@_math_toggle: #1 \@@_math_toggle: \cr
- \noalign { \skip_vertical:n { 3 pt } \nointerlineskip }
+ \bool_if:NTF \l_@@_tabular_bool
+ { \begin { tabular } { c } #1 \end { tabular } }
+ { $ \begin { array } { c } #1 \end { array } $ }
+ \cr
\c_math_toggle_token
\overbrace
{
@@ -16105,8 +16061,10 @@
}
\c_math_toggle_token
\cr
- \noalign { \skip_vertical:n { 3 pt } \nointerlineskip }
- \@@_math_toggle: #1 \@@_math_toggle: \cr
+ \bool_if:NTF \l_@@_tabular_bool
+ { \begin { tabular } { c } #1 \end { tabular } }
+ { $ \begin { array } { c } #1 \end { array } $ }
+ \cr
}
}
\group_end:
@@ -16224,76 +16182,6 @@
% \section{The command \textbackslash ShowCellNames}
%
% \begin{macrocode}
-\NewDocumentCommand \@@_ShowCellNames_CodeBefore { }
- {
- \dim_gzero_new:N \g_@@_tmpc_dim
- \dim_gzero_new:N \g_@@_tmpd_dim
- \dim_gzero_new:N \g_@@_tmpe_dim
- \int_step_inline:nn \c at iRow
- {
- \begin { pgfpicture }
- \@@_qpoint:n { row - ##1 }
- \dim_set_eq:NN \l_tmpa_dim \pgf at y
- \@@_qpoint:n { row - \int_eval:n { ##1 + 1 } }
- \dim_gset:Nn \g_tmpa_dim { ( \l_tmpa_dim + \pgf at y ) / 2 }
- \dim_gset:Nn \g_tmpb_dim { \l_tmpa_dim - \pgf at y }
- \bool_if:NTF \l_@@_in_code_after_bool
- \end { pgfpicture }
- \int_step_inline:nn \c at jCol
- {
- \hbox_set:Nn \l_tmpa_box
- { \normalfont \Large \color { red ! 50 } ##1 - ####1 }
- \begin { pgfpicture }
- \@@_qpoint:n { col - ####1 }
- \dim_gset_eq:NN \g_@@_tmpc_dim \pgf at x
- \@@_qpoint:n { col - \int_eval:n { ####1 + 1 } }
- \dim_gset:Nn \g_@@_tmpd_dim { \pgf at x - \g_@@_tmpc_dim }
- \dim_gset_eq:NN \g_@@_tmpe_dim \pgf at x
- \endpgfpicture
- \end { pgfpicture }
- \fp_set:Nn \l_tmpa_fp
- {
- \fp_min:nn
- {
- \fp_min:nn
- {
- \dim_ratio:nn
- { \g_@@_tmpd_dim }
- { \box_wd:N \l_tmpa_box }
- }
- {
- \dim_ratio:nn
- { \g_tmpb_dim }
- { \box_ht_plus_dp:N \l_tmpa_box }
- }
- }
- { 1.0 }
- }
- \box_scale:Nnn \l_tmpa_box
- { \fp_use:N \l_tmpa_fp }
- { \fp_use:N \l_tmpa_fp }
- \pgfpicture
- \pgfrememberpicturepositiononpagetrue
- \pgf at relevantforpicturesizefalse
- \pgftransformshift
- {
- \pgfpoint
- { 0.5 * ( \g_@@_tmpc_dim + \g_@@_tmpe_dim ) }
- { \dim_use:N \g_tmpa_dim }
- }
- \pgfnode
- { rectangle }
- { center }
- { \box_use:N \l_tmpa_box }
- { }
- { }
- \endpgfpicture
- }
- }
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
\NewDocumentCommand \@@_ShowCellNames { }
{
\bool_if:NT \l_@@_in_code_after_bool
Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins 2024-10-29 20:06:39 UTC (rev 72696)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins 2024-10-29 20:06:54 UTC (rev 72697)
@@ -30,6 +30,7 @@
LaTeX version 2005/12/01 or later.
\endpreamble
+\askforoverwritefalse
\generate{\file{nicematrix.sty}{\from{nicematrix-code.dtx}{package}}}
\Msg{*********************************************************}
\Msg{*}
Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty 2024-10-29 20:06:39 UTC (rev 72696)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty 2024-10-29 20:06:54 UTC (rev 72697)
@@ -18,8 +18,8 @@
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%%
-\def\myfileversion{6.29}
-\def\myfiledate{2024/10/24}
+\def\myfileversion{6.29a}
+\def\myfiledate{2024/10/29}
\RequirePackage{pgfcore}
\usepgfmodule{shapes}
\RequirePackage{l3keys2e}
@@ -399,6 +399,8 @@
\dim_new:N \l__nicematrix_y_final_dim
\dim_new:N \l__nicematrix_tmpc_dim
\dim_new:N \l__nicematrix_tmpd_dim
+\dim_new:N \l__nicematrix_tmpe_dim
+\dim_new:N \l__nicematrix_tmpf_dim
\dim_new:N \g__nicematrix_dp_row_zero_dim
\dim_new:N \g__nicematrix_ht_row_zero_dim
\dim_new:N \g__nicematrix_ht_row_one_dim
@@ -1173,7 +1175,7 @@
sub-matrix .value_required:n = true ,
unknown .code:n = \__nicematrix_error:n { Unknown~key~for~CodeAfter }
}
-\cs_new_protected:Npn \__nicematrix_cell_begin:w
+\cs_new_protected:Npn \__nicematrix_cell_begin:
{
\tl_gclear:N \g__nicematrix_cell_after_hook_tl
\cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter_i:
@@ -1548,21 +1550,8 @@
\dim_gset:Nn \g__nicematrix_ht_last_row_dim { \box_ht:N \@arstrutbox }
\dim_gset:Nn \g__nicematrix_dp_last_row_dim { \box_dp:N \@arstrutbox }
}
-\bool_if:NT \c__nicematrix_tagging_array_bool
- {
- \cs_new:Npn \__nicematrix_insert at column
- {
- \UseTaggingSocket{tbl/cell/begin}
- \the at toks \the \@tempcnta \ignorespaces
- \@sharp \textonly at unskip
- \the at toks \the \count@ \relax
- \UseTaggingSocket{tbl/cell/end}
- }
- }
\cs_new_protected:Npn \__nicematrix_pre_array_ii:
{
- \bool_if:NT \c__nicematrix_tagging_array_bool
- { \cs_set_eq:NN \insert at column \__nicematrix_insert at column }
\int_gzero:N \g__nicematrix_total_X_weight_int
\__nicematrix_expand_clist:N \l__nicematrix_hlines_clist
\__nicematrix_expand_clist:N \l__nicematrix_vlines_clist
@@ -2234,7 +2223,7 @@
\tl_gput_right:No \g__nicematrix_array_preamble_tl \g__nicematrix_pre_cell_tl
\tl_gclear:N \g__nicematrix_pre_cell_tl
\tl_gput_right:Nn \g__nicematrix_array_preamble_tl
- { > \__nicematrix_cell_begin:w c < \__nicematrix_cell_end: }
+ { > \__nicematrix_cell_begin: c < \__nicematrix_cell_end: }
\int_gincr:N \c at jCol
\__nicematrix_rec_preamble_after_col:n
}
@@ -2244,7 +2233,7 @@
\tl_gclear:N \g__nicematrix_pre_cell_tl
\tl_gput_right:Nn \g__nicematrix_array_preamble_tl
{
- > { \__nicematrix_cell_begin:w \tl_set_eq:NN \l__nicematrix_hpos_cell_tl \c__nicematrix_l_tl }
+ > { \__nicematrix_cell_begin: \tl_set_eq:NN \l__nicematrix_hpos_cell_tl \c__nicematrix_l_tl }
l
< \__nicematrix_cell_end:
}
@@ -2257,7 +2246,7 @@
\tl_gclear:N \g__nicematrix_pre_cell_tl
\tl_gput_right:Nn \g__nicematrix_array_preamble_tl
{
- > { \__nicematrix_cell_begin:w \tl_set_eq:NN \l__nicematrix_hpos_cell_tl \c__nicematrix_r_tl }
+ > { \__nicematrix_cell_begin: \tl_set_eq:NN \l__nicematrix_hpos_cell_tl \c__nicematrix_r_tl }
r
< \__nicematrix_cell_end:
}
@@ -2294,7 +2283,7 @@
\__nicematrix_compute_rule_width:n { multiplicity = \l_tmpa_int , #2 }
\tl_gput_right:Ne \g__nicematrix_array_preamble_tl
{
- \exp_not:N ! { \skip_horizontal:n { \dim_eval:n { \l__nicematrix_rule_width_dim } } }
+ \exp_not:N ! { \skip_horizontal:N \dim_use:N \l__nicematrix_rule_width_dim }
}
\tl_gput_right:Ne \g__nicematrix_pre_code_after_tl
{
@@ -2362,7 +2351,7 @@
\use:e
{
\__nicematrix_make_preamble_ii_v:nnnnnnnn
- { \str_if_eq:nnTF \l__nicematrix_vpos_col_str { p } { t } { b } }
+ { \str_if_eq:eeTF \l__nicematrix_vpos_col_str { p } { t } { b } }
{ \dim_eval:n { #1 } }
{
\str_if_eq:nnTF \l__nicematrix_hpos_col_str { j }
@@ -2415,7 +2404,7 @@
}
{
\tl_gput_right:Nn \g__nicematrix_array_preamble_tl
- { > { \__nicematrix_test_if_empty: } }
+ { > \__nicematrix_test_if_empty: }
}
\tl_gput_right:No \g__nicematrix_array_preamble_tl \g__nicematrix_pre_cell_tl
\tl_gclear:N \g__nicematrix_pre_cell_tl
@@ -2425,7 +2414,7 @@
\dim_set:Nn \l__nicematrix_col_width_dim { #2 }
\bool_if:NT \c__nicematrix_testphase_table_bool
{ \tag_struct_begin:n { tag = Div } }
- \__nicematrix_cell_begin:w
+ \__nicematrix_cell_begin:
\use:c { #7 } [ #1 ] { #2 }
\everypar
{
@@ -2449,38 +2438,24 @@
}
}
}
-\cs_new_protected:Npn \__nicematrix_test_if_empty:
- { \peek_after:Nw \__nicematrix_test_if_empty_i: }
-
-\cs_new_protected:Npn \__nicematrix_test_if_empty_i:
- { \peek_meaning_remove:NT \ignorespaces { \__nicematrix_test_if_empty_ii: } }
-
-\cs_new_protected:Npn \__nicematrix_test_if_empty_ii:
- { \peek_after:Nw \__nicematrix_test_if_empty_iii: }
-\bool_if:NTF \c__nicematrix_tagging_array_bool
+\cs_new_protected:Npn \__nicematrix_test_if_empty: \ignorespaces
{
- \cs_new_protected:Npn \__nicematrix_test_if_empty_iii:
- { \peek_meaning:NTF \textonly at unskip \__nicematrix_nullify_cell: \ignorespaces }
- }
- {
- \cs_new_protected:Npn \__nicematrix_test_if_empty_iii:
- { \peek_meaning:NTF \unskip \__nicematrix_nullify_cell: \ignorespaces }
- }
-\cs_new_protected:Npn \__nicematrix_nullify_cell:
- {
- \tl_gput_right:Nn \g__nicematrix_cell_after_hook_tl
+ \group_align_safe_begin:
+ \peek_meaning:NTF &
{
- \box_set_wd:Nn \l__nicematrix_cell_box \c_zero_dim
- \skip_horizontal:N \l__nicematrix_col_width_dim
+ \group_align_safe_end:
+ \tl_gput_right:Nn \g__nicematrix_cell_after_hook_tl
+ {
+ \box_set_wd:Nn \l__nicematrix_cell_box \c_zero_dim
+ \skip_horizontal:N \l__nicematrix_col_width_dim
+ }
}
+ { \group_align_safe_end: }
}
\cs_new_protected:Npn \__nicematrix_test_if_empty_for_S:
{
\peek_meaning:NT \__siunitx_table_skip:n
- {
- \tl_gput_right:Nn \g__nicematrix_cell_after_hook_tl
- { \box_set_wd:Nn \l__nicematrix_cell_box \c_zero_dim }
- }
+ { \bool_gset_true:N \g__nicematrix_empty_cell_bool }
}
\cs_new_protected:Npn \__nicematrix_center_cell_box:
{
@@ -2539,7 +2514,7 @@
{
> {
\dim_set:Nn \l__nicematrix_col_width_dim { #2 }
- \__nicematrix_cell_begin:w
+ \__nicematrix_cell_begin:
\tl_set_eq:NN \l__nicematrix_hpos_cell_tl \c__nicematrix_c_tl
}
c
@@ -2562,7 +2537,7 @@
> {
\dim_set:Nn \l__nicematrix_col_width_dim { #4 }
\hbox_set:Nw \l__nicematrix_cell_box
- \__nicematrix_cell_begin:w
+ \__nicematrix_cell_begin:
\cs_set_nopar:Npn \l__nicematrix_hpos_cell_tl { #3 }
}
c
@@ -2598,7 +2573,7 @@
\tl_gput_right:Nn \g__nicematrix_array_preamble_tl
{
> {
- \__nicematrix_cell_begin:w
+ \__nicematrix_cell_begin:
\keys_set:nn { siunitx } { #1 }
\siunitx_cell_begin:w
}
@@ -2784,7 +2759,7 @@
\tl_gput_right:Nn \g__nicematrix_array_preamble_tl
{
> {
- \__nicematrix_cell_begin:w
+ \__nicematrix_cell_begin:
\bool_set_true:N \l__nicematrix_X_bool
\NotEmpty
\tl_gput_right:Nn \g__nicematrix_cell_after_hook_tl
@@ -2914,7 +2889,7 @@
{
\tl_gput_right:Nn \g__nicematrix_preamble_tl
{
- > { \__nicematrix_cell_begin:w \cs_set_nopar:Npn \l__nicematrix_hpos_cell_tl { #1 } }
+ > { \__nicematrix_cell_begin: \cs_set_nopar:Npn \l__nicematrix_hpos_cell_tl { #1 } }
#1
< \__nicematrix_cell_end:
}
@@ -2935,7 +2910,7 @@
\tl_gput_right:Nn \g__nicematrix_preamble_tl
{
> {
- \__nicematrix_cell_begin:w
+ \__nicematrix_cell_begin:
\begin { minipage } [ #1 ] { \dim_eval:n { #3 } }
\mode_leave_vertical:
\arraybackslash
@@ -2957,7 +2932,7 @@
> {
\dim_set:Nn \l__nicematrix_col_width_dim { #4 }
\hbox_set:Nw \l__nicematrix_cell_box
- \__nicematrix_cell_begin:w
+ \__nicematrix_cell_begin:
\cs_set_nopar:Npn \l__nicematrix_hpos_cell_tl { #3 }
}
c
@@ -3011,7 +2986,7 @@
\__nicematrix_qpoint:n { row - \int_use:N \l_tmpa_int }
}
{
- \str_if_eq:onTF \l__nicematrix_baseline_tl { t }
+ \str_if_eq:eeTF \l__nicematrix_baseline_tl { t }
{ \int_set_eq:NN \l_tmpa_int \c_one_int }
{
\str_if_eq:onTF \l__nicematrix_baseline_tl { b }
@@ -3183,7 +3158,7 @@
}
\cs_new_protected:Npn \__nicematrix_use_arraybox_with_notes:
{
- \tl_if_eq:NnT \l__nicematrix_baseline_tl { t }
+ \str_if_eq:eeT \l__nicematrix_baseline_tl { t }
{ \cs_set_nopar:Npn \l__nicematrix_baseline_tl { 1 } }
\pgfpicture
\__nicematrix_qpoint:n { row - 1 }
@@ -7713,6 +7688,7 @@
\pgfpicture
\pgfrememberpicturepositiononpagetrue
\pgf at relevantforpicturesizefalse
+
\__nicematrix_qpoint:n { row - #1 }
\dim_set_eq:NN \l__nicematrix_tmpc_dim \pgf at y
\__nicematrix_qpoint:n { row - \int_eval:n { #3 + 1 } }
@@ -7757,20 +7733,17 @@
{
\pgfpoint
{
+ \l_tmpa_dim + ##1 \l_tmpb_dim -
\str_case:on \l__nicematrix_hpos_block_str
{
- l { \l_tmpa_dim + ##1 \l_tmpb_dim - \l_tmpb_dim + \col at sep}
- c { \l_tmpa_dim + ##1 \l_tmpb_dim - 0.5 \l_tmpb_dim }
- r { \l_tmpa_dim + ##1 \l_tmpb_dim - \col at sep }
+ l { \l_tmpb_dim + \col at sep}
+ c { 0.5 \l_tmpb_dim }
+ r { \col at sep }
}
}
{ \l__nicematrix_tmpc_dim }
}
- \pgfset
- {
- inner~xsep = \c_zero_dim ,
- inner~ysep = \c_zero_dim
- }
+ \pgfset { inner~sep = \c_zero_dim }
\pgfnode
{ rectangle }
{
@@ -7888,11 +7861,7 @@
}
{ \l_tmpa_tl }
}
- \pgfset
- {
- inner~xsep = \c_zero_dim ,
- inner~ysep = \c_zero_dim
- }
+ \pgfset { inner~sep = \c_zero_dim }
\pgfnode
{ rectangle }
{ \l_tmpa_tl }
@@ -7941,6 +7910,18 @@
}
\group_end:
}
+\cs_set_protected:Npn \__nicematrix_fill:nnnnn #1 #2 #3 #4 #5
+ {
+ \pgfpicture
+ \pgfrememberpicturepositiononpagetrue
+ \pgf at relevantforpicturesizefalse
+ \pgfpathrectanglecorners
+ { \pgfpoint { #2 } { #3 } }
+ { \pgfpoint { #4 } { #5 } }
+ \pgfsetfillcolor { #1 }
+ \pgfusepath { fill }
+ \endpgfpicture
+ }
\cs_new_protected:Npn \__nicematrix_stroke_block:nnn #1 #2 #3
{
\group_begin:
@@ -8942,8 +8923,10 @@
\halign
{
\hfil ## \hfil \crcr
- \__nicematrix_math_toggle: #1 \__nicematrix_math_toggle: \cr
- \noalign { \skip_vertical:n { 3 pt } \nointerlineskip }
+ \bool_if:NTF \l__nicematrix_tabular_bool
+ { \begin { tabular } { c } #1 \end { tabular } }
+ { $ \begin { array } { c } #1 \end { array } $ }
+ \cr
\c_math_toggle_token
\overbrace
{
@@ -8989,8 +8972,10 @@
}
\c_math_toggle_token
\cr
- \noalign { \skip_vertical:n { 3 pt } \nointerlineskip }
- \__nicematrix_math_toggle: #1 \__nicematrix_math_toggle: \cr
+ \bool_if:NTF \l__nicematrix_tabular_bool
+ { \begin { tabular } { c } #1 \end { tabular } }
+ { $ \begin { array } { c } #1 \end { array } $ }
+ \cr
}
}
\group_end:
@@ -9089,73 +9074,6 @@
{ \cs_set_nopar:cpn { cell - ##1 - ####1 } { } }
}
}
-\NewDocumentCommand \__nicematrix_ShowCellNames_CodeBefore { }
- {
- \dim_gzero_new:N \g__nicematrix_tmpc_dim
- \dim_gzero_new:N \g__nicematrix_tmpd_dim
- \dim_gzero_new:N \g__nicematrix_tmpe_dim
- \int_step_inline:nn \c at iRow
- {
- \begin { pgfpicture }
- \__nicematrix_qpoint:n { row - ##1 }
- \dim_set_eq:NN \l_tmpa_dim \pgf at y
- \__nicematrix_qpoint:n { row - \int_eval:n { ##1 + 1 } }
- \dim_gset:Nn \g_tmpa_dim { ( \l_tmpa_dim + \pgf at y ) / 2 }
- \dim_gset:Nn \g_tmpb_dim { \l_tmpa_dim - \pgf at y }
- \bool_if:NTF \l__nicematrix_in_code_after_bool
- \end { pgfpicture }
- \int_step_inline:nn \c at jCol
- {
- \hbox_set:Nn \l_tmpa_box
- { \normalfont \Large \color { red ! 50 } ##1 - ####1 }
- \begin { pgfpicture }
- \__nicematrix_qpoint:n { col - ####1 }
- \dim_gset_eq:NN \g__nicematrix_tmpc_dim \pgf at x
- \__nicematrix_qpoint:n { col - \int_eval:n { ####1 + 1 } }
- \dim_gset:Nn \g__nicematrix_tmpd_dim { \pgf at x - \g__nicematrix_tmpc_dim }
- \dim_gset_eq:NN \g__nicematrix_tmpe_dim \pgf at x
- \endpgfpicture
- \end { pgfpicture }
- \fp_set:Nn \l_tmpa_fp
- {
- \fp_min:nn
- {
- \fp_min:nn
- {
- \dim_ratio:nn
- { \g__nicematrix_tmpd_dim }
- { \box_wd:N \l_tmpa_box }
- }
- {
- \dim_ratio:nn
- { \g_tmpb_dim }
- { \box_ht_plus_dp:N \l_tmpa_box }
- }
- }
- { 1.0 }
- }
- \box_scale:Nnn \l_tmpa_box
- { \fp_use:N \l_tmpa_fp }
- { \fp_use:N \l_tmpa_fp }
- \pgfpicture
- \pgfrememberpicturepositiononpagetrue
- \pgf at relevantforpicturesizefalse
- \pgftransformshift
- {
- \pgfpoint
- { 0.5 * ( \g__nicematrix_tmpc_dim + \g__nicematrix_tmpe_dim ) }
- { \dim_use:N \g_tmpa_dim }
- }
- \pgfnode
- { rectangle }
- { center }
- { \box_use:N \l_tmpa_box }
- { }
- { }
- \endpgfpicture
- }
- }
- }
\NewDocumentCommand \__nicematrix_ShowCellNames { }
{
\bool_if:NT \l__nicematrix_in_code_after_bool
More information about the tex-live-commits
mailing list.