texlive[73138] Master/texmf-dist: nicematrix (16dec24)
commits+karl at tug.org
commits+karl at tug.org
Mon Dec 16 21:49:43 CET 2024
Revision: 73138
https://tug.org/svn/texlive?view=revision&revision=73138
Author: karl
Date: 2024-12-16 21:49:43 +0100 (Mon, 16 Dec 2024)
Log Message:
-----------
nicematrix (16dec24)
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/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-12-16 20:49:19 UTC (rev 73137)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex 2024-12-16 20:49:43 UTC (rev 73138)
@@ -1,4 +1,4 @@
-% -*- coding: utf-8 ; -*-
+% -*- coding: utf-8 ; -*-
% Ce fichier doit être compilé avec LuaLaTeX uniquement.
\documentclass[dvipsnames]{article}% dvipsnames is for xcolor (loaded by TikZ, loaded by nicematrix)
\usepackage[french]{babel}
@@ -593,9 +593,11 @@
\item \index{fill (clé de \texttt{\textbackslash Block})}
la clé \Definition{fill} prend en argument une couleur et remplit le bloc
avec cette couleur ;
-\item \index{opacity! (clé de la commande \texttt{\textbackslash Block})}
+\item \index{opacity!clé de la commande \texttt{\textbackslash Block}}
la clé \Definition{opacity} fixe l'opacité de la couleur de remplissage donnée
-par |fill| ;
+par |fill| ;\footnote{Attention : cette fonctionnalité génère des
+ instructions de transparence dans le \textsc{pdf} résultant et certains
+ lecteurs de \textsc{pdf} n'acceptent pas la transparence.}
\item \index{draw (clé de \texttt{\textbackslash Block})}
la clé \Definition{draw} prend en argument une couleur et trace le cadre
avec cette couleur (la valeur par défaut de cette clé est la couleur courante
@@ -809,8 +811,7 @@
\item On peut tracer un cadre autour du bloc avec la clé |draw| de la commande
|\Block| ou colorier le fond avec des bords arrondis avec les clés |fill| et
|rounded-corners|.\footnote{Pour colorier simplement le fond d'une case, il n'y a pas besoin
- d'utiliser un bloc mono-case : on peut utiliser la commande |\cellcolor| si la
- clé |color-inside| est utilisée : voir p.~\pageref{color-inside}.}
+ d'utiliser un bloc mono-case : on peut utiliser la commande |\cellcolor|.}
\item On peut tracer une ou plusieurs bordures de la case avec la clé |borders|.
\end{itemize}
@@ -1870,13 +1871,13 @@
}
}
-\begin{NiceTabular}{ccc}[color-inside]
+\begin{NiceTabular}{ccc}
un & deux & trois \\
\emph{\DoubleRule}
quatre & \cellcolor{yellow} cinq & six \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccc}[color-inside]
+\begin{NiceTabular}{ccc}
un & deux & trois \\
\DoubleRule
quatre & \cellcolor{yellow} cinq & six \\
@@ -2153,8 +2154,8 @@
\begin{itemize}
\item le modèle colorimétrique (|RGB|, |rgb|, |HTML|, etc.) comme spécifié par
l'extension \pkg{xcolor} ;
-\item \index{opacity (clé des commandes comme\newline \texttt{\textbackslash
- rowcolor}, etc.)}
+\item \index{opacity!clé des commandes comme\newline \texttt{\textbackslash
+ rowcolor}, etc.}
une spécification d'opacité selon la forme \texttt{opacity =
\textsl{valeur}}.\footnote{Attention : cette fonctionnalité génère des instructions de
transparence dans le \textsc{pdf} résultant et certains lecteurs de
@@ -2660,8 +2661,6 @@
\subsection{Outils de coloriage en tableau}
-\label{color-inside}
-\index{color-inside}
\index{cellcolor@\texttt{\textbackslash cellcolor}!commande en tableau}
\index{rowcolor@\texttt{\textbackslash rowcolor}!commande en tableau}
\index{columncolor@\texttt{\textbackslash columncolor}!commande dans le
@@ -2668,11 +2667,7 @@
préambule d'un environnement}
On peut accéder aux outils de coloriage précédents avec une syntaxe proche de
-celle proposée par \pkg{colortbl} (même si \pkg{colortbl} n'est pas chargé). On
-doit pour cela utiliser la clé \Definition{color-inside}\footnote{Il existe un
- alias pour cette clé : \texttt{colortbl-like}.} dans l'environnement
-concerné.\footnote{Pour le moment, cette clé n'est \emph{pas} disponible dans
- |\NiceMatrixOptions|.}
+celle proposée par \pkg{colortbl} (même si \pkg{colortbl} n'est pas chargé).
On a alors accès aux commandes suivantes (les trois premières sont inspirées par
\pkg{colortbl} mais sont indépendantes de \pkg{colortbl}) :
@@ -2706,7 +2701,7 @@
\medskip
\begin{Code}
\NewDocumentCommand { \Blue } { } {\emph{\columncolor{blue!15}}}
-\begin{NiceTabular}[color-inside]{>{\Blue}c>{\Blue}cc}
+\begin{NiceTabular}{>{\Blue}c>{\Blue}cc}
\toprule
\emph{\rowcolor{red!15}}
Nom & Prénom & Année de naissance \\
@@ -2722,7 +2717,7 @@
\begin{center}
\NewDocumentCommand { \Blue } { } {\columncolor{blue!15}}
-\begin{NiceTabular}[color-inside]{>{\Blue}c>{\Blue}cc}
+\begin{NiceTabular}{>{\Blue}c>{\Blue}cc}
\toprule
\rowcolor{red!15}
Nom & Prénom & Année de naissance \\
@@ -2747,7 +2742,7 @@
\bigskip
\begin{Code}[width=10cm]
-\begin{NiceTabular}{c}[hvlines,color-inside]
+\begin{NiceTabular}{c}[hvlines]
un \\
deux \\
\emph{\rowlistcolors{red!15}}
@@ -2759,7 +2754,7 @@
sept \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{c}[hvlines,color-inside]
+\begin{NiceTabular}{c}[hvlines]
un \\
deux \\
\rowlistcolors{red!15}
@@ -2813,13 +2808,24 @@
\item
\index{rowcolor (clé de \texttt{\textbackslash RowStyle})}
-\index{color!clé de \texttt{\textbackslash RowStyle}}
-La clé \Definition{rowcolor} fixe la couleur de fond et la clé \Definition{color}
-fixe la couleur du texte.\footnote{La clé |color| utilise la commande |\color| mais
- insère aussi une instruction |\leavevmode| devant. Cela évite un espace
- vertical parasite dans les cases qui correspondent à des colonnes de type
- |p|, |b|, |m|, |X| et |V| (qui débutent en mode vertical de LaTeX).}
+\index{fill!clé de \texttt{\textbackslash RowStyle}}
+\index{opacity!clé de \texttt{\textbackslash RowStyle}}
+La clé \Definition{rowcolor} (alias : \Definition{fill}) fixe la couleur de fond
+et la clé \Definition{opacity}\footnote{Attention : cette clé génère des
+ instructions de transparence dans le \textsc{pdf} résultant et certains
+ lecteurs de \textsc{pdf} n'acceptent pas la transparence.} l'opacité de cette
+couleur de fond.
+\item
+\index{color!clé de \texttt{\textbackslash RowStyle}}
+La clé \Definition{color} fixe la couleur du texte.\footnote{La clé |color|
+ utilise la commande |\color| mais insère aussi une instruction |\leavevmode|
+ devant. Cela évite un espace vertical parasite dans les cases qui
+ correspondent à des colonnes de type |p|, |b|, |m|, et |X| (qui débutent en
+ mode vertical de LaTeX). Pour les colonnes de type |V| (de \pkg{varwidth}),
+ cela ne suffit malheureusement pas sauf si on utilise LuaLaTeX avec
+ \pkg{luacolor} (cf. question 460489 sur TeX StackExchange).}
+
\item \index{bold (clé de \texttt{\textbackslash RowStyle})}
La clé \Definition{bold} impose des caractères gras aux éléments de la rangée, qu'ils
soient en mode texte ou bien en mode mathématique.
@@ -3239,6 +3245,7 @@
sont des listes de tokens qui seront insérées au début de chaque case de la
rangée ou de la colonne considérée.
+\bigskip
\begin{Code}
\NiceMatrixOptions{\emph{code-for-first-row} = \color{red},
\emph{code-for-first-col} = \color{blue},
@@ -4439,8 +4446,8 @@
\pkg{nicematrix} (avec \textsc{pgf}) au-dessus de l'accolade (pour la commande
|\OverBrace|) ou au-dessous (pour |\UnderBrace|).
-\colorbox{yellow!50}{\textbf{Nouveau 2.9}}\enskip Il est possible de mettre des
-commandes |\\| dans ce dernier argument pour fomater le label sur plusieurs lignes.
+Il est possible de mettre des commandes |\\| dans ce dernier argument pour
+fomater le label sur plusieurs lignes.
\end{itemize}
\bigskip
@@ -5077,8 +5084,8 @@
décrit maintenant.
\begin{itemize}
\item Toutes les commandes de coloriage de cases, colonnes et rangées (que ce
-soit dans le |\CodeBefore| ou bien directement dans le tableau (quand la clé
-|color-inside| est utilisée) respectent ces coins arrondis pour le tableau.
+soit dans le |\CodeBefore| ou bien directement dans le tableau respectent ces
+coins arrondis pour le tableau.
\item Quand la clé |hvlines| est utilisée, les filets extérieurs sont tracés
avec des coins arrondis.\footnote{Bien sûr, lorsqu'il s'agit d'un environnement
@@ -7450,16 +7457,13 @@
\vspace{1cm}
Il est possible de colorier une rangée avec |\rowcolor| dans le |\CodeBefore|
-(ou avec |\rowcolor| dans une case de la rangée si on utilise la clé
-|color-inside|).
+(ou avec |\rowcolor| dans une case de la rangée.
-
-\index{color-inside|textit}
\index{rowcolor@\texttt{\textbackslash rowcolor}!commande en tableau|textit}
\begin{Code}
\begin{pNiceArray}{>{\strut}cccc}% <-- % obligatoire
- [margin, extra-margin=2pt,color-inside,no-cell-nodes]
+ [margin, extra-margin=2pt,no-cell-nodes]
\emph{\rowcolor{red!15}}A_{11} & A_{12} & A_{13} & A_{14} \\
A_{21} & \emph{\rowcolor{red!15}}A_{22} & A_{23} & A_{24} \\
A_{31} & A_{32} & \emph{\rowcolor{red!15}}A_{33} & A_{34} \\
@@ -7469,7 +7473,7 @@
-\[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,color-inside,no-cell-nodes]
+\[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,no-cell-nodes]
\rowcolor{red!15}A_{11} & A_{12} & A_{13} & A_{14} \\
A_{21} & \rowcolor{red!15}A_{22} & A_{23} & A_{24} \\
A_{31} & A_{32} & \rowcolor{red!15}A_{33} & A_{34} \\
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-12-16 20:49:19 UTC (rev 73137)
+++ trunk/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex 2024-12-16 20:49:43 UTC (rev 73138)
@@ -567,9 +567,11 @@
\item \index{fill (key of \texttt{\textbackslash Block})}
the key \Definition{fill} takes in as value a color and fills the block
with that color;
-\item \index{opacity (key of \texttt{\textbackslash Block})}
+\item \index{opacity!key of \texttt{\textbackslash Block}}
the key \Definition{opacity} sets the opacity of the filling color specified by
-|fill|;
+|fill|;\footnote{Caution: that feature creates instructions of
+ transparency in the \textsc{pdf} and some readers of \textsc{pdf} don't
+ support such instructions.}
\item \index{draw (key of \texttt{\textbackslash Block})}
the key \Definition{draw} takes in as value a color and strokes the
frame of the block with that color (the default value of that key is the
@@ -777,8 +779,7 @@
command |\Block| and to fill the background with rounded corners with the keys
|fill| and |rounded-corners|.\footnote{If one simply wishes to color the
background of a unique cell, there is no point using the command |\Block|:
-it's possible to use the command |\cellcolor| (when the key |color-inside| is
-used).}
+it's possible to use the command |\cellcolor|.}
\item It's possible to draw one or several borders of the cell with the key |borders|.
\end{itemize}
@@ -1810,13 +1811,13 @@
}
}
-\begin{NiceTabular}{ccc}[color-inside]
+\begin{NiceTabular}{ccc}
one & two & three \\
\emph{\DoubleRule}
four & \cellcolor{yellow} five & six \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{ccc}[color-inside]
+\begin{NiceTabular}{ccc}
one & two & three \\
\DoubleRule
four & \cellcolor{yellow} five & six \\
@@ -2088,10 +2089,11 @@
\begin{itemize}
\item the colorimetric space (|RGB|, |rgb|, |HTML|, etc) as specified by the
the extension \pkg{xcolor};
-\item \index{opacity (key of commands such as\newline \texttt{\textbackslash rowcolor}, etc.)}
+\item \index{opacity!key of commands such as\newline \texttt{\textbackslash rowcolor}, etc.}
a specification of opacity of the form \texttt{opacity =
- \textsl{value}}.\footnote{Caution : that feature creates instructions of
- transparency in the \textsc{pdf} and some \textsc{pdr} don't support such instructions.}
+ \textsl{value}}.\footnote{Caution: that feature creates instructions of
+ transparency in the \textsc{pdf} and some readers of \textsc{pdf} don't
+ support such instructions.}
\end{itemize}
\bigskip
@@ -2585,7 +2587,6 @@
\subsection{Color tools to be used inside the tabular}
-\index{color-inside}
\index{cellcolor@\texttt{\textbackslash cellcolor}!command in tabular}
\index{rowcolor@\texttt{\textbackslash rowcolor}!command in tabular}
\index{columncolor@\texttt{\textbackslash columncolor}!command in the preamble
@@ -2593,9 +2594,7 @@
It's possible to access the preceding tools with a syntax close to the syntax
-of \pkg{colortbl}. For that, one must use the key \Definition{color-inside}\footnote{There
- is an alias for that key : \texttt{colortbl-like}.} in the
-current environment.\footnote{Up to now, this key is \emph{not} available in |\NiceMatrixOptions|.}
+of \pkg{colortbl}.
There are several commands available (the first three ones are inspired by
\pkg{colortbl} but are \emph{independent} of \pkg{colortbl}):
@@ -2629,7 +2628,7 @@
\smallskip
\begin{Code}
\NewDocumentCommand { \Blue } { } { \emph{\columncolor{blue!15}} }
-\begin{NiceTabular}[color-inside]{>{\Blue}c>{\Blue}cc}
+\begin{NiceTabular}{>{\Blue}c>{\Blue}cc}
\toprule
\emph{\rowcolor{red!15}}
Last name & First name & Birth day \\
@@ -2645,7 +2644,7 @@
\begin{center}
\NewDocumentCommand { \Blue } { } { \columncolor{blue!15} }
-\begin{NiceTabular}[color-inside]{>{\Blue}c>{\Blue}cc}
+\begin{NiceTabular}{>{\Blue}c>{\Blue}cc}
\toprule
\rowcolor{red!15}
Last name & First name & Birth day \\
@@ -2669,7 +2668,7 @@
\bigskip
\begin{Code}[width=10cm]
-\begin{NiceTabular}{c}[hvlines,color-inside]
+\begin{NiceTabular}{c}[hvlines]
one \\
two \\
\emph{\rowlistcolors{red!15}}
@@ -2681,7 +2680,7 @@
seven \\
\end{NiceTabular}
\end{Code}
-\begin{NiceTabular}{c}[hvlines,color-inside]
+\begin{NiceTabular}{c}[hvlines]
one \\
two \\
\rowlistcolors{red!15}
@@ -2731,13 +2730,22 @@
\Definition{cell-space-limits} are available with the same meaning that the
corresponding global keys (cf. p.~\pageref{cell-space}).
\item \index{rowcolor (key of \texttt{\textbackslash RowStyle})}
+\index{fill!key of \texttt{\textbackslash RowStyle}}
+\index{opacity!key of \texttt{\textbackslash RowStyle}}
+The key \Definition{rowcolor} (alias: \Definition{fill}) sets the color of the
+background and \Definition{opacity}\footnote{Caution: that feature creates instructions of
+ transparency in the \textsc{pdf} and some readers of \textsc{pdf} don't
+ support such instructions.} sets its opacity.
+
+\item
\index{color!key of \texttt{\textbackslash RowStyle}}
-The key \Definition{rowcolor} sets the color of the background and the key
-\Definition{color} sets the color of the text.\footnote{The key |color| uses the command
-|\color| but also inserts an instruction |\leavevmode| before. This
-instruction prevents an extra vertical space in the cells which belong to
-columns of type |p|, |b|, |m|, |X| and |V| (which start in
-vertical mode of LaTeX).}
+The key \Definition{color} sets the color of the text.\footnote{The key
+ |color| uses the command |\color| but also inserts an instruction
+ |\leavevmode| before. This instruction prevents an extra vertical space in the
+ cells which belong to columns of type |p|, |b|, |m| and |X| (which start in
+ vertical mode of LaTeX). For the columns |V| (of \pkg{varwidth}), that's not
+ enough, except when LuaLaTeX is used with the package \pkg{luacolor} (see
+ question 460489 on TeX StackExchange).}
\item \index{bold (key of \texttt{\textbackslash RowStyle})} The key
\Definition{bold} enforces bold characters for the cells of the row, both in
math and text mode.
@@ -4337,8 +4345,8 @@
\pkg{nicematrix} (with \textsc{pgf}) above the brace (for the command
|\OverBrace|) or under the brace (for |\UnderBrace|).
-\colorbox{yellow!50}{\bfseries{New 6.29}}\enskip It's possible to use the
-command |\\| in this third argument in order to format the label on several lignes.
+It's possible to use the command |\\| in this third argument in order to format
+the label on several lignes.
\end{itemize}
\bigskip
@@ -4957,8 +4965,7 @@
Tikz.}). More precisely, that key has two effects that we describe now.
\begin{itemize}
\item All the commands for coloring the cells, columns and rows (in the
-|\CodeBefore| but also directly in the array when the key |color-inside| is
-used) will respect those rounded corners.
+|\CodeBefore| but also directly in the array will respect those rounded corners.
\item When the key |hvlines| is used, the exterior rules will be drawn with
rounded corners.\footnote{Of course, when used in an environment with delimiters
@@ -7281,10 +7288,8 @@
\vspace{1cm}
It's possible to color a row with |\rowcolor| in the |code-before| (or with
-|\rowcolor| in the first cell of the row if the key |color-inside| is
-used−even when \pkg{colortbl} is not loaded).
+|\rowcolor| in the first cell of the row.
-\index{color-inside|textit}
\index{rowcolor@\texttt{\textbackslash rowcolor}!command in tabular|textit}
@@ -7291,7 +7296,7 @@
\medskip
\begin{Code}
\begin{pNiceArray}{>{\strut}cccc}% <-- % mandatory
- [margin, extra-margin=2pt,color-inside,no-cell-nodes]
+ [margin, extra-margin=2pt,no-cell-nodes]
\emph{\rowcolor{red!15}}A_{11} & A_{12} & A_{13} & A_{14} \\
A_{21} & \emph{\rowcolor{red!15}}A_{22} & A_{23} & A_{24} \\
A_{31} & A_{32} & \emph{\rowcolor{red!15}}A_{33} & A_{34} \\
@@ -7299,7 +7304,7 @@
\end{pNiceArray}
\end{Code}
-\[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,color-inside,no-cell-nodes]
+\[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,no-cell-nodes]
\rowcolor{red!15}A_{11} & A_{12} & A_{13} & A_{14} \\
A_{21} & \rowcolor{red!15}A_{22} & A_{23} & A_{24} \\
A_{31} & A_{32} & \rowcolor{red!15}A_{33} & A_{34} \\
Modified: trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx 2024-12-16 20:49:19 UTC (rev 73137)
+++ trunk/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx 2024-12-16 20:49:43 UTC (rev 73138)
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{7.0}
-\def\myfiledate{2024/11/18}
+\def\myfileversion{7.0a}
+\def\myfiledate{2024/12/16}
%
%
%<*batchfile>
@@ -647,7 +647,7 @@
%
% \bigskip
% The following command must \emph{not} be protected since it will be used to
-% write instructions in the (internal) |\CodeBefore|.
+% write instructions in the |\g_@@_pre_code_before_tl|.
% \begin{macrocode}
\cs_generate_variant:Nn \@@_exp_color_arg:Nn { N o }
\cs_new:Npn \@@_exp_color_arg:Nn #1 #2
@@ -2130,15 +2130,6 @@
% \end{macrocode}
%
% \bigskip
-% By default, the commands |\cellcolor| and |\rowcolor| are available for the
-% user in the cells of the tabular (the user may use the commands provided by
-% |\colortbl|). However, if the key |color-inside| is used, these
-% commands are available.
-% \begin{macrocode}
-\bool_new:N \l_@@_color_inside_bool
-% \end{macrocode}
-%
-% \bigskip
% By default, the behaviour of |\cline| is changed in the environments of
% \pkg{nicematrix}: a |\cline| spreads the array by an amount equal to
% |\arrayrulewidth|. It's possible to disable this feature with the key
@@ -2465,6 +2456,10 @@
% \begin{macrocode}
\keys_define:nn { nicematrix / Global }
{
+ color-inside .code:n =
+ \@@_warning_gredirect_none:n { key~color-inside } ,
+ colortbl-like .code:n =
+ \@@_warning_gredirect_none:n { key~color-inside } ,
ampersand-in-blocks .bool_set:N = \l_@@_amp_in_blocks_bool ,
ampersand-in-blocks .default:n = true ,
&-in-blocks .meta:n = ampersand-in-blocks ,
@@ -2631,11 +2626,6 @@
name .value_required:n = true ,
code-after .tl_gset:N = \g_nicematrix_code_after_tl ,
code-after .value_required:n = true ,
- color-inside .code:n =
- \bool_set_true:N \l_@@_color_inside_bool
- \bool_set_true:N \l_@@_code_before_bool ,
- color-inside .value_forbidden:n = true ,
- colortbl-like .meta:n = color-inside
}
% \end{macrocode}
%
@@ -3082,9 +3072,10 @@
% \begin{macrocode}
\cs_set_nopar:Npn \@@_tuning_not_tabular_begin:
{
+ \m at th % added 2024/11/21
\c_math_toggle_token
% \end{macrocode}
-% A special value is provided by the following controls sequence when the key
+% A special value is provided by the following control sequence when the key
% |small| is in force.
% \begin{macrocode}
\@@_tuning_key_small:
@@ -3139,8 +3130,8 @@
{
\int_compare:nNnT \c at iRow = \c_one_int
{
- \dim_compare:nNnT { \box_ht:N \l_@@_cell_box } > \g_@@_ht_row_zero_dim
- { \dim_gset:Nn \g_@@_ht_row_zero_dim { \box_ht:N \l_@@_cell_box } }
+ \dim_compare:nNnT { \box_ht:N \l_@@_cell_box } > \g_@@_ht_row_one_dim
+ { \dim_gset:Nn \g_@@_ht_row_one_dim { \box_ht:N \l_@@_cell_box } }
}
}
}
@@ -3154,6 +3145,7 @@
{
\hbox_set:Nn \l_@@_cell_box
{
+ \m at th % add 2024/11/21
\c_math_toggle_token
\vcenter { \box_use:N \l_@@_cell_box }
\c_math_toggle_token
@@ -3619,22 +3611,7 @@
}
% \end{macrocode}
%
-%
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_test_color_inside:
- {
- \bool_if:NF \l_@@_color_inside_bool
- {
-% \end{macrocode}
-% We will issue an error only during the first run.
-% \begin{macrocode}
- \bool_if:NF \g_@@_aux_found_bool
- { \@@_error:n { without~color-inside } }
- }
- }
-% \end{macrocode}
%
-%
% \bigskip
% The following code has been simplified in the version 6.29a.
% \begin{macrocode}
@@ -3774,7 +3751,7 @@
}
}
% \end{macrocode}
-% The following part will be deleted when we will delete the boolean
+% The following part should be deleted when we will delete the boolean
% |\c_@@_recent_array_bool| (when we consider the version 2.6a of \pkg{array}
% is required). Moreover, \cls{revtex4-2} modifies \pkg{array} and provides
% commands which are meant to be the standard version of \pkg{array} but, at the
@@ -3792,8 +3769,21 @@
}
% \end{macrocode}
%
+% \medskip
+% It seems that there is a problem when \pkg{nicematrix} is used with in
+% \cls{revtex4-2} with the package \pkg{colortbl} loaded.
+% The following code prevent that problem but it does \emph{not} treat the
+% actual problem! It's only a patch \emph{ad hoc}.
%
-
+% That patch has been added in version 7.0x, 2024-11-27 (question by mail of
+% Tamra Nebabu).
+% \begin{macrocode}
+ \bool_if:NT \c_@@_revtex_bool
+ {
+ \IfPackageLoadedT { colortbl }
+ { \cs_set_protected:Npn \CT at setup { } }
+ }
+% \end{macrocode}
%
% We keep in memory the old versions or |\ldots|, |\cdots|, etc. only because we
% use them inside |\phantom| commands in order that the new commands |\Ldots|,
@@ -4060,18 +4050,18 @@
% part of the environment (and the closing |\c_math_toggle_token| also).
% \begin{macrocode}
\hbox_set:Nw \l_@@_the_array_box
- \bool_if:NT \c_@@_recent_array_bool
- { \UseTaggingSocket { tbl / hmode / begin } }
% \end{macrocode}
%
% \begin{macrocode}
\skip_horizontal:N \l_@@_left_margin_dim
\skip_horizontal:N \l_@@_extra_left_margin_dim
+ \bool_if:NT \c_@@_recent_array_bool
+ { \UseTaggingSocket { tbl / hmode / begin } }
% \end{macrocode}
%
% The following code is a workaround to specify to the tagging system that the
% following code is \emph{fake math} (it raises |\l__math_fakemath_bool| in
-% recent versions of LaTEX).
+% recent versions of LaTeX).
% \begin{macrocode}
\m at th
\c_math_toggle_token
@@ -4128,8 +4118,8 @@
%
%
% Now, we will create all the |col| nodes and |row| nodes with the informations
-% written in the |aux| file. You use the technique described in the page~1229 of
-% |pgfmanual.pdf|, version~3.1.4b.
+% written in the |aux| file. You use the technique described in the page~1247 of
+% |pgfmanual.pdf|, version~3.1.10.
% \begin{macrocode}
\pgfsys at markposition { \@@_env: - position }
\pgfsys at getposition { \@@_env: - position } \@@_picture_position:
@@ -4588,6 +4578,8 @@
}
}
\hbox_set_end:
+ \bool_if:NT \c_@@_recent_array_bool
+ { \UseTaggingSocket { tbl / hmode / end } }
% \end{macrocode}
% End of the construction of the array (in the box |\l_@@_the_array_box|).
%
@@ -4609,31 +4601,7 @@
% by~$n$.
% \begin{macrocode}
\int_compare:nNnT \g_@@_total_X_weight_int > \c_zero_int
- {
- \tl_gput_right:Ne \g_@@_aux_tl
- {
- \bool_set_true:N \l_@@_X_columns_aux_bool
- \dim_set:Nn \l_@@_X_columns_dim
- {
- \dim_compare:nNnTF
- {
- \dim_abs:n
- { \l_@@_width_dim - \box_wd:N \l_@@_the_array_box }
- }
- <
- { 0.001 pt }
- { \dim_use:N \l_@@_X_columns_dim }
- {
- \dim_eval:n
- {
- ( \l_@@_width_dim - \box_wd:N \l_@@_the_array_box )
- / \int_use:N \g_@@_total_X_weight_int
- + \l_@@_X_columns_dim
- }
- }
- }
- }
- }
+ { \@@_compute_width_X: }
% \end{macrocode}
%
% \bigskip
@@ -4681,8 +4649,7 @@
% \textbf{Now, we begin the real construction in the output flow of TeX}. First, we take
% into account a potential ``first column'' (we remind that this ``first
% column'' has been constructed in an overlapping position and that we have
-% computed its width in |\g_@@_width_first_col_dim|: see
-% p.~\pageref{overlap-left}).
+% computed its width in |\g_@@_width_first_col_dim|: see p.~\pageref{overlap-left}).
% \begin{macrocode}
\int_if_zero:nT \l_@@_first_col_int
{ \skip_horizontal:N \g_@@_width_first_col_dim }
@@ -4734,6 +4701,7 @@
% \begin{macrocode}
\hbox_set:Nn \l_tmpa_box
{
+ \m at th % added 2024/11/21
\c_math_toggle_token
\@@_color:o \l_@@_delimiters_color_tl
\exp_after:wN \left \g_@@_left_delim_tl
@@ -4790,7 +4758,7 @@
\bool_if:NT \l_@@_preamble_bool
{
\int_compare:nNnT \c at jCol < \g_@@_static_num_of_col_int
- { \@@_warning_gredirect_none:n { columns~not~used } }
+ { \@@_warning_gredirect_none:n { columns~not~used } }
}
\@@_after_array:
% \end{macrocode}
@@ -4822,6 +4790,43 @@
% \end{macrocode}
% This is the end of the environment |{NiceArrayWithDelims}|.
%
+%
+% \bigskip
+% The following command will be used only once. We have written that command for
+% legibility. If there is at least one |X|-column in the environment, we compute
+% the width that those columns will have (in the next compilation). In fact,
+% |l_@@_X_columns_dim| will be the width of a column of weight $1$. For a
+% |X|-column of weight~$n$, the width will be |\l_@@_X_columns_dim| multiplied
+% by~$n$.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_compute_width_X:
+ {
+ \tl_gput_right:Ne \g_@@_aux_tl
+ {
+ \bool_set_true:N \l_@@_X_columns_aux_bool
+ \dim_set:Nn \l_@@_X_columns_dim
+ {
+ \dim_compare:nNnTF
+ {
+ \dim_abs:n
+ { \l_@@_width_dim - \box_wd:N \l_@@_the_array_box }
+ }
+ <
+ { 0.001 pt }
+ { \dim_use:N \l_@@_X_columns_dim }
+ {
+ \dim_eval:n
+ {
+ ( \l_@@_width_dim - \box_wd:N \l_@@_the_array_box )
+ / \int_use:N \g_@@_total_X_weight_int
+ + \l_@@_X_columns_dim
+ }
+ }
+ }
+ }
+ }
+% \end{macrocode}
+%
% \vspace{1cm}
% \section{Construction of the preamble of the array}
%
@@ -6123,7 +6128,6 @@
% \begin{macrocode}
\RenewDocumentCommand \cellcolor { O { } m }
{
- \@@_test_color_inside:
\tl_gput_right:Ne \g_@@_pre_code_before_tl
{
\@@_rectanglecolor [ ##1 ]
@@ -6138,7 +6142,7 @@
% \medskip
% The following lines were in the original definition of |\multicolumn|.
% \begin{macrocode}
- \cs_set_nopar:Npn \@sharp { #3 }
+ \cs_set_nopar:Npn \@sharp { #3 }
\@arstrut
\@preamble
\null
@@ -6337,8 +6341,7 @@
%
% \medskip
% The command |\@@_put_box_in_flow_i:| is used when the value of
-% |\l_@@_baseline_tl| is different of |c| (which is the initial value and the
-% most used).
+% |\l_@@_baseline_tl| is different of |c| (the initial value).
% \begin{macrocode}
\cs_new_protected:Npn \@@_put_box_in_flow_i:
{
@@ -6723,6 +6726,7 @@
\dim_zero_new:N \l_@@_real_right_delim_dim
\hbox_set:Nn \l_tmpb_box
{
+ \m at th % added 2024/11/21
\c_math_toggle_token
\left #1
\vcenter
@@ -6738,6 +6742,7 @@
{ \box_wd:N \l_tmpb_box - \nulldelimiterspace }
\hbox_set:Nn \l_tmpb_box
{
+ \m at th % added 2024/11/21
\c_math_toggle_token
\left .
\vbox_to_ht:nn
@@ -6792,7 +6797,7 @@
}
}
{
- \@@_create_col_nodes:
+ \@@_create_col_nodes:
\endarray
}
% \end{macrocode}
@@ -7536,11 +7541,7 @@
\@@_settings_for_tabular:
\NiceArray { #2 }
}
- {
- \endNiceArray
- \bool_if:NT \c_@@_recent_array_bool
- { \UseTaggingSocket { tbl / hmode / end } }
- }
+ { \endNiceArray }
% \end{macrocode}
%
% \begin{macrocode}
@@ -7893,9 +7894,8 @@
%
% \medskip
% |\g_@@_pre_code_before_tl| is for instructions in the cells of the array such as
-% |\rowcolor| and |\cellcolor| (when the key |color-inside| is in
-% force). These instructions will be written on the |aux| file to be added to
-% the |code-before| in the next run.
+% |\rowcolor| and |\cellcolor|. These instructions will be written on the |aux|
+% file to be added to the |code-before| in the next run.
% \begin{macrocode}
\seq_if_empty:NF \g_@@_rowlistcolors_seq { \@@_clear_rowlistcolors_seq: }
\tl_if_empty:NF \g_@@_pre_code_before_tl
@@ -10117,7 +10117,7 @@
% \end{macrocode}
%
% \bigskip
-% |\@@_put_in_row_style| will be used several times by |\RowStyle|.
+% |\@@_put_in_row_style| will be used several times in |\RowStyle|.
% \begin{macrocode}
\cs_generate_variant:Nn \@@_put_in_row_style:n { e }
\cs_set_protected:Npn \@@_put_in_row_style:n #1
@@ -10161,8 +10161,14 @@
{ \int_set:Nn \l_@@_key_nb_rows_int { 500 } }
{ \int_set:Nn \l_@@_key_nb_rows_int { #1 } } ,
nb-rows .value_required:n = true ,
- rowcolor .tl_set:N = \l_tmpa_tl ,
- rowcolor .value_required:n = true ,
+ fill .tl_set:N = \l_@@_fill_tl ,
+ fill .value_required:n = true ,
+ opacity .tl_set:N = \l_@@_opacity_tl ,
+ opacity .value_required:n = true ,
+ rowcolor .tl_set:N = \l_@@_fill_tl ,
+ rowcolor .value_required:n = true ,
+ rounded-corners .dim_set:N = \l_@@_rounded_corners_dim ,
+ rounded-corners .default:n = 4 pt ,
unknown .code:n = \@@_error:n { Unknown~key~for~RowStyle }
}
% \end{macrocode}
@@ -10173,43 +10179,50 @@
\NewDocumentCommand \@@_RowStyle:n { O { } m }
{
\group_begin:
- \tl_clear:N \l_tmpa_tl
+ \tl_clear:N \l_@@_fill_tl
+ \tl_clear:N \l_@@_opacity_tl
\tl_clear:N \l_@@_color_tl
\int_set_eq:NN \l_@@_key_nb_rows_int \c_one_int
+ \dim_zero:N \l_@@_rounded_corners_dim
\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.
+% If the key |rowcolor| (of its alias |fill|) has been used.
% \begin{macrocode}
- \tl_if_empty:NF \l_tmpa_tl
+ \tl_if_empty:NF \l_@@_fill_tl
{
+ \@@_add_opacity_to_fill:
+ \tl_gput_right:Ne \g_@@_pre_code_before_tl
+ {
% \end{macrocode}
+% First, the case when the command |\RowStyle| is \emph{not} issued in the first
+% column of the array. In that case, the commande applies to the end of the row
+% in the row where the command |\RowStyle| is issued, but in the other whole
+% rows, if the key |nb-rows| is used.
+% \begin{macrocode}
+ \int_compare:nNnTF \c at jCol > \c_one_int
+ {
+% \end{macrocode}
% First, the end of the current row (we remind that |\RowStyle| applies to the
-% \emph{end} of the current row).
+% \emph{end} of the current row). The command |\@@_exp_color_arg:No| is
+% \emph{fully expandable}.
% \begin{macrocode}
- \tl_gput_right:Ne \g_@@_pre_code_before_tl
- {
+ \@@_exp_color_arg:No \@@_roundedrectanglecolor \l_@@_fill_tl
+ { \int_use:N \c at iRow - \int_use:N \c at jCol }
+ { \int_use:N \c at iRow - * }
+ { \dim_use:N \l_@@_rounded_corners_dim }
% \end{macrocode}
-% The command |\@@_exp_color_arg:No| is \emph{fully expandable}.
+% Then, the other rows (if there are several rows).
% \begin{macrocode}
- \@@_exp_color_arg:No \@@_rectanglecolor \l_tmpa_tl
- { \int_use:N \c at iRow - \int_use:N \c at jCol }
- { \int_use:N \c at iRow - * }
- }
+ \int_compare:nNnT \l_@@_key_nb_rows_int > \c_one_int
+ { \@@_rounded_from_row:n { \c at iRow + 1 } }
+ }
% \end{macrocode}
-% Then, the other rows (if there is several rows).
+% Now, directly all the rows in the case of a command |\RowStyle| issued in the
+% first column of the array.
% \begin{macrocode}
- \int_compare:nNnT \l_@@_key_nb_rows_int > \c_one_int
- {
- \tl_gput_right:Ne \g_@@_pre_code_before_tl
- {
- \@@_exp_color_arg:No \@@_rowcolor \l_tmpa_tl
- {
- \int_eval:n { \c at iRow + 1 }
- - \int_eval:n { \c at iRow + \l_@@_key_nb_rows_int - 1 }
- }
- }
+ { \@@_rounded_from_row:n { \c at iRow } }
}
}
\@@_put_in_row_style:n { \exp_not:n { #2 } }
@@ -10246,6 +10259,8 @@
}
}
% \end{macrocode}
+%
+%
% |\l_@@_color_tl| is the value of the key |color| of |\RowStyle|.
% \begin{macrocode}
\tl_if_empty:NF \l_@@_color_tl
@@ -10281,6 +10296,23 @@
}
% \end{macrocode}
%
+% \medskip
+% The following commande must \emph{not} be protected.
+% \begin{macrocode}
+\cs_new:Npn \@@_rounded_from_row:n #1
+ {
+ \@@_exp_color_arg:No \@@_roundedrectanglecolor \l_@@_fill_tl
+% \end{macrocode}
+% In the following code, the ``|- 1|'' is \emph{not} a subtraction.
+% \begin{macrocode}
+ { \int_eval:n { #1 } - 1 }
+ {
+ \int_eval:n { \c at iRow + \l_@@_key_nb_rows_int - 1 }
+ - \exp_not:n { \int_use:N \c at jCol }
+ }
+ { \dim_use:N \l_@@_rounded_corners_dim }
+ }
+% \end{macrocode}
%
% \bigskip
% \section{Colors of cells, rows and columns}
@@ -11040,12 +11072,10 @@
% \end{macrocode}
%
% \bigskip
-% When the user uses the key |color-inside|, the following command will
-% be linked to |\cellcolor| in the tabular.
+% The following command will be linked to |\cellcolor| in the tabular.
% \begin{macrocode}
\NewDocumentCommand \@@_cellcolor_tabular { O { } m }
{
- \@@_test_color_inside:
\tl_gput_right:Ne \g_@@_pre_code_before_tl
{
% \end{macrocode}
@@ -11061,12 +11091,10 @@
% \end{macrocode}
%
% \bigskip
-% When the user uses the key |color-inside|, the following command will
-% be linked to |\rowcolor| in the tabular.
+% The following command will be linked to |\rowcolor| in the tabular.
% \begin{macrocode}
\NewDocumentCommand \@@_rowcolor_tabular { O { } m }
{
- \@@_test_color_inside:
\tl_gput_right:Ne \g_@@_pre_code_before_tl
{
\@@_rectanglecolor [ #1 ] { \exp_not:n { #2 } }
@@ -11078,9 +11106,9 @@
% \end{macrocode}
%
% \bigskip
-% When the user uses the key |color-inside|, the following command will
-% be linked to |\rowcolors| in the tabular. The last argument (an optional
-% argument between square brackets is taken by curryfication).
+% The following command will be linked to |\rowcolors| in the tabular. The last
+% argument (an optional argument between square brackets is taken by
+% curryfication).
% \begin{macrocode}
\NewDocumentCommand { \@@_rowcolors_tabular } { O { } m m }
{ \@@_rowlistcolors_tabular [ #1 ] { { #2 } , { #3 } } }
@@ -11088,12 +11116,10 @@
% The braces around |#2| and |#3| are mandatory.
%
% \bigskip
-% When the user uses the key |color-inside|, the following command will
-% be linked to |\rowlistcolors| in the tabular.
+% The following command will be linked to |\rowlistcolors| in the tabular.
% \begin{macrocode}
\NewDocumentCommand { \@@_rowlistcolors_tabular } { O { } m O { } }
{
- \@@_test_color_inside:
\peek_remove_spaces:n
{ \@@_rowlistcolors_tabular:nnn { #1 } { #2 } { #3 } }
}
@@ -13371,6 +13397,8 @@
% In the other cases, we use a |{tabular}|.
% \begin{macrocode}
{
+ \bool_if:NT \c_@@_testphase_table_bool
+ { \tagpdfsetup { table / tagging = presentation } }
\use:e
{
\exp_not:N \begin { tabular }%
@@ -13928,27 +13956,10 @@
% \begin{macrocode}
\tl_if_empty:NF \l_@@_fill_tl
{
- \tl_if_empty:NF \l_@@_opacity_tl
- {
- \tl_if_head_eq_meaning:oNTF \l_@@_fill_tl [
- {
- \tl_set:Ne \l_@@_fill_tl
- {
- [ opacity = \l_@@_opacity_tl ,
- \tl_tail:o \l_@@_fill_tl
- }
- }
- {
- \tl_set:Ne \l_@@_fill_tl
- { [ opacity = \l_@@_opacity_tl ] { \exp_not:o \l_@@_fill_tl } }
- }
- }
+ \@@_add_opacity_to_fill:
\tl_gput_right:Ne \g_@@_pre_code_before_tl
{
- \exp_not:N \roundedrectanglecolor
- \tl_if_head_eq_meaning:oNTF \l_@@_fill_tl [
- { \l_@@_fill_tl }
- { { \l_@@_fill_tl } }
+ \@@_exp_color_arg:No \@@_roundedrectanglecolor \l_@@_fill_tl
{ #1 - #2 }
{ \int_use:N \l_@@_last_row_int - \int_use:N \l_@@_last_col_int }
{ \dim_use:N \l_@@_rounded_corners_dim }
@@ -13968,7 +13979,7 @@
{ \int_use:N \l_@@_last_row_int }
{ \int_use:N \l_@@_last_col_int }
% \end{macrocode}
-% We will have in that last field a list of list of Tikz keys.
+% We will have in that last field a list of lists of Tikz keys.
% \begin{macrocode}
}
}
@@ -14468,8 +14479,32 @@
}
% \end{macrocode}
%
-%
% \bigskip
+% The following command adds the value of |\l_@@_opacity_tl| (if not empty) to
+% the specification of color set in |\l_@@_fill_tl| (the information of opacity
+% is added in between square brackets before the color itself).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_opacity_to_fill:
+ {
+ \tl_if_empty:NF \l_@@_opacity_tl
+ {
+ \tl_if_head_eq_meaning:oNTF \l_@@_fill_tl [
+ {
+ \tl_set:Ne \l_@@_fill_tl
+ {
+ [ opacity = \l_@@_opacity_tl ,
+ \tl_tail:o \l_@@_fill_tl
+ }
+ }
+ {
+ \tl_set:Ne \l_@@_fill_tl
+ { [ opacity = \l_@@_opacity_tl ] { \exp_not:o \l_@@_fill_tl } }
+ }
+ }
+ }
+% \end{macrocode}
+%
+% \bigskip
% The first argument of |\@@_stroke_block:nnn| is a list of options for the
% rectangle that you will stroke. The second argument is the upper-left cell of
% the block (with, as usual, the syntax $i$|-|$j$) and the third is the last
@@ -16494,7 +16529,18 @@
}
% \end{macrocode}
%
+%
% \begin{macrocode}
+\@@_msg_new:nn { key~color-inside }
+ {
+ Key~deprecated.\\
+ The~key~'color-inside'~(and~its~alias~'colortbl-like')~is~now~point-less~
+ and~have~been~deprecated.\\
+ You~won't~have~similar~message~till~the~end~of~the~document.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
\@@_msg_new:nn { negative~weight }
{
Negative~weight.\\
@@ -17203,17 +17249,6 @@
That~key~will~be~ignored.
}
% \end{macrocode}
-%
-% \begin{macrocode}
-\@@_msg_new:nn { without~color-inside }
- {
- If~order~to~use~\token_to_str:N \cellcolor,~\token_to_str:N \rowcolor,~
- \token_to_str:N \rowcolors\ or~\token_to_str:N \rowlistcolors\
- outside~\token_to_str:N \CodeBefore,~you~
- should~have~used~the~key~'color-inside'~in~your~\@@_full_name_env:.\\
- You~can~go~on~but~you~may~need~more~compilations.
- }
-% \end{macrocode}
%
% \begin{macrocode}
\@@_msg_new:nn { color~in~custom-line~with~tikz }
@@ -17429,13 +17464,15 @@
}
{
The~available~keys~are~(in~alphabetic~order):~
- 'bold',~
- 'cell-space-top-limit',~
- 'cell-space-bottom-limit',~
- 'cell-space-limits',~
- 'color',~
- 'nb-rows'~and~
- 'rowcolor'.
+ bold,~
+ cell-space-top-limit,~
+ cell-space-bottom-limit,~
+ cell-space-limits,~
+ color,~
+ fill~(alias:~rowcolor),~
+ nb-rows,
+ opacity~and~
+ rounded-corners.
}
% \end{macrocode}
%
@@ -17523,7 +17560,6 @@
code-for-first-row,~
code-for-last-col,~
code-for-last-row,~
- color-inside,~
columns-width,~
corners,~
create-extra-nodes,~
@@ -17589,7 +17625,6 @@
code-for-first-row,~
code-for-last-col,~
code-for-last-row,~
- color-inside,~
columns-type,~
columns-width,~
corners,~
@@ -17655,7 +17690,6 @@
code-for-first-row,~
code-for-last-col,~
code-for-last-row,~
- color-inside,~
columns-width,~
corners,~
custom-line,~
Modified: trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty 2024-12-16 20:49:19 UTC (rev 73137)
+++ trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty 2024-12-16 20:49:43 UTC (rev 73138)
@@ -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{7.0}
-\def\myfiledate{2024/11/18}
+\def\myfileversion{7.0a}
+\def\myfiledate{2024/12/16}
\RequirePackage{pgfcore}
\usepgfmodule{shapes}
\RequirePackage{l3keys2e}
@@ -716,7 +716,6 @@
\tl_new:N \l__nicematrix_short_caption_tl
\tl_new:N \l__nicematrix_label_tl
\bool_new:N \l__nicematrix_caption_above_bool
-\bool_new:N \l__nicematrix_color_inside_bool
\bool_new:N \l__nicematrix_standard_cline_bool
\dim_new:N \l__nicematrix_cell_space_top_limit_dim
\dim_new:N \l__nicematrix_cell_space_bottom_limit_dim
@@ -821,6 +820,10 @@
}
\keys_define:nn { nicematrix / Global }
{
+ color-inside .code:n =
+ \__nicematrix_warning_gredirect_none:n { key~color-inside } ,
+ colortbl-like .code:n =
+ \__nicematrix_warning_gredirect_none:n { key~color-inside } ,
ampersand-in-blocks .bool_set:N = \l__nicematrix_amp_in_blocks_bool ,
ampersand-in-blocks .default:n = true ,
&-in-blocks .meta:n = ampersand-in-blocks ,
@@ -956,11 +959,6 @@
name .value_required:n = true ,
code-after .tl_gset:N = \g_nicematrix_code_after_tl ,
code-after .value_required:n = true ,
- color-inside .code:n =
- \bool_set_true:N \l__nicematrix_color_inside_bool
- \bool_set_true:N \l__nicematrix_code_before_bool ,
- color-inside .value_forbidden:n = true ,
- colortbl-like .meta:n = color-inside
}
\keys_define:nn { nicematrix / notes }
{
@@ -1203,6 +1201,7 @@
\cs_set_eq:NN \__nicematrix_tuning_key_small: \prg_do_nothing:
\cs_set_nopar:Npn \__nicematrix_tuning_not_tabular_begin:
{
+ \m at th % added 2024/11/21
\c_math_toggle_token
\__nicematrix_tuning_key_small:
}
@@ -1238,8 +1237,8 @@
{
\int_compare:nNnT \c at iRow = \c_one_int
{
- \dim_compare:nNnT { \box_ht:N \l__nicematrix_cell_box } > \g__nicematrix_ht_row_zero_dim
- { \dim_gset:Nn \g__nicematrix_ht_row_zero_dim { \box_ht:N \l__nicematrix_cell_box } }
+ \dim_compare:nNnT { \box_ht:N \l__nicematrix_cell_box } > \g__nicematrix_ht_row_one_dim
+ { \dim_gset:Nn \g__nicematrix_ht_row_one_dim { \box_ht:N \l__nicematrix_cell_box } }
}
}
}
@@ -1250,6 +1249,7 @@
{
\hbox_set:Nn \l__nicematrix_cell_box
{
+ \m at th % add 2024/11/21
\c_math_toggle_token
\vcenter { \box_use:N \l__nicematrix_cell_box }
\c_math_toggle_token
@@ -1504,14 +1504,6 @@
\cs_set_eq:NN \dots \__nicematrix_Ldots
\cs_set_eq:NN \hdotsfor \__nicematrix_Hdotsfor:
}
-\cs_new_protected:Npn \__nicematrix_test_color_inside:
- {
- \bool_if:NF \l__nicematrix_color_inside_bool
- {
- \bool_if:NF \g__nicematrix_aux_found_bool
- { \__nicematrix_error:n { without~color-inside } }
- }
- }
\hook_gput_code:nnn { begindocument } { . }
{
\IfPackageLoadedTF { colortbl }
@@ -1587,7 +1579,11 @@
\halign
}
}
-
+ \bool_if:NT \c__nicematrix_revtex_bool
+ {
+ \IfPackageLoadedT { colortbl }
+ { \cs_set_protected:Npn \CT at setup { } }
+ }
\cs_set_eq:NN \__nicematrix_old_ldots \ldots
\cs_set_eq:NN \__nicematrix_old_cdots \cdots
\cs_set_eq:NN \__nicematrix_old_vdots \vdots
@@ -1703,10 +1699,10 @@
\dim_gset_eq:NN \l__nicematrix_right_delim_dim \l__nicematrix_left_delim_dim
}
\hbox_set:Nw \l__nicematrix_the_array_box
+ \skip_horizontal:N \l__nicematrix_left_margin_dim
+ \skip_horizontal:N \l__nicematrix_extra_left_margin_dim
\bool_if:NT \c__nicematrix_recent_array_bool
{ \UseTaggingSocket { tbl / hmode / begin } }
- \skip_horizontal:N \l__nicematrix_left_margin_dim
- \skip_horizontal:N \l__nicematrix_extra_left_margin_dim
\m at th
\c_math_toggle_token
\bool_if:NTF \l__nicematrix_light_syntax_bool
@@ -1976,6 +1972,8 @@
}
}
\hbox_set_end:
+ \bool_if:NT \c__nicematrix_recent_array_bool
+ { \UseTaggingSocket { tbl / hmode / end } }
\bool_if:NT \l__nicematrix_width_used_bool
{
\int_if_zero:nT \g__nicematrix_total_X_weight_int
@@ -1982,31 +1980,7 @@
{ \__nicematrix_error_or_warning:n { width~without~X~columns } }
}
\int_compare:nNnT \g__nicematrix_total_X_weight_int > \c_zero_int
- {
- \tl_gput_right:Ne \g__nicematrix_aux_tl
- {
- \bool_set_true:N \l__nicematrix_X_columns_aux_bool
- \dim_set:Nn \l__nicematrix_X_columns_dim
- {
- \dim_compare:nNnTF
- {
- \dim_abs:n
- { \l__nicematrix_width_dim - \box_wd:N \l__nicematrix_the_array_box }
- }
- <
- { 0.001 pt }
- { \dim_use:N \l__nicematrix_X_columns_dim }
- {
- \dim_eval:n
- {
- ( \l__nicematrix_width_dim - \box_wd:N \l__nicematrix_the_array_box )
- / \int_use:N \g__nicematrix_total_X_weight_int
- + \l__nicematrix_X_columns_dim
- }
- }
- }
- }
- }
+ { \__nicematrix_compute_width_X: }
\int_compare:nNnT \l__nicematrix_last_row_int > { -2 }
{
\bool_if:NF \l__nicematrix_last_row_without_value_bool
@@ -2054,6 +2028,7 @@
{ \dim_zero:N \l_tmpb_dim }
\hbox_set:Nn \l_tmpa_box
{
+ \m at th % added 2024/11/21
\c_math_toggle_token
\__nicematrix_color:o \l__nicematrix_delimiters_color_tl
\exp_after:wN \left \g__nicematrix_left_delim_tl
@@ -2089,7 +2064,7 @@
\bool_if:NT \l__nicematrix_preamble_bool
{
\int_compare:nNnT \c at jCol < \g__nicematrix_static_num_of_col_int
- { \__nicematrix_warning_gredirect_none:n { columns~not~used } }
+ { \__nicematrix_warning_gredirect_none:n { columns~not~used } }
}
\__nicematrix_after_array:
\egroup
@@ -2103,6 +2078,32 @@
\iow_now:Nn \@mainaux { \ExplSyntaxOff }
\bool_if:NT \g__nicematrix_footnote_bool \endsavenotes
}
+\cs_new_protected:Npn \__nicematrix_compute_width_X:
+ {
+ \tl_gput_right:Ne \g__nicematrix_aux_tl
+ {
+ \bool_set_true:N \l__nicematrix_X_columns_aux_bool
+ \dim_set:Nn \l__nicematrix_X_columns_dim
+ {
+ \dim_compare:nNnTF
+ {
+ \dim_abs:n
+ { \l__nicematrix_width_dim - \box_wd:N \l__nicematrix_the_array_box }
+ }
+ <
+ { 0.001 pt }
+ { \dim_use:N \l__nicematrix_X_columns_dim }
+ {
+ \dim_eval:n
+ {
+ ( \l__nicematrix_width_dim - \box_wd:N \l__nicematrix_the_array_box )
+ / \int_use:N \g__nicematrix_total_X_weight_int
+ + \l__nicematrix_X_columns_dim
+ }
+ }
+ }
+ }
+ }
\cs_new_protected:Npn \__nicematrix_transform_preamble:
{
\__nicematrix_transform_preamble_i:
@@ -2833,7 +2834,6 @@
}
\RenewDocumentCommand \cellcolor { O { } m }
{
- \__nicematrix_test_color_inside:
\tl_gput_right:Ne \g__nicematrix_pre_code_before_tl
{
\__nicematrix_rectanglecolor [ ##1 ]
@@ -3199,6 +3199,7 @@
\dim_zero_new:N \l__nicematrix_real_right_delim_dim
\hbox_set:Nn \l_tmpb_box
{
+ \m at th % added 2024/11/21
\c_math_toggle_token
\left #1
\vcenter
@@ -3214,6 +3215,7 @@
{ \box_wd:N \l_tmpb_box - \nulldelimiterspace }
\hbox_set:Nn \l_tmpb_box
{
+ \m at th % added 2024/11/21
\c_math_toggle_token
\left .
\vbox_to_ht:nn
@@ -3720,11 +3722,7 @@
\__nicematrix_settings_for_tabular:
\NiceArray { #2 }
}
- {
- \endNiceArray
- \bool_if:NT \c__nicematrix_recent_array_bool
- { \UseTaggingSocket { tbl / hmode / end } }
- }
+ { \endNiceArray }
\cs_new_protected:Npn \__nicematrix_settings_for_tabular:
{
\bool_set_true:N \l__nicematrix_tabular_bool
@@ -5333,37 +5331,42 @@
{ \int_set:Nn \l__nicematrix_key_nb_rows_int { 500 } }
{ \int_set:Nn \l__nicematrix_key_nb_rows_int { #1 } } ,
nb-rows .value_required:n = true ,
- rowcolor .tl_set:N = \l_tmpa_tl ,
+ fill .tl_set:N = \l__nicematrix_fill_tl ,
+ fill .value_required:n = true ,
+ opacity .tl_set:N = \l__nicematrix_opacity_tl ,
+ opacity .value_required:n = true ,
+ rowcolor .tl_set:N = \l__nicematrix_fill_tl ,
rowcolor .value_required:n = true ,
+ rounded-corners .dim_set:N = \l__nicematrix_rounded_corners_dim ,
+ rounded-corners .default:n = 4 pt ,
unknown .code:n = \__nicematrix_error:n { Unknown~key~for~RowStyle }
}
\NewDocumentCommand \__nicematrix_RowStyle:n { O { } m }
{
\group_begin:
- \tl_clear:N \l_tmpa_tl
+ \tl_clear:N \l__nicematrix_fill_tl
+ \tl_clear:N \l__nicematrix_opacity_tl
\tl_clear:N \l__nicematrix_color_tl
\int_set_eq:NN \l__nicematrix_key_nb_rows_int \c_one_int
+ \dim_zero:N \l__nicematrix_rounded_corners_dim
\dim_zero:N \l_tmpa_dim
\dim_zero:N \l_tmpb_dim
\keys_set:nn { nicematrix / RowStyle } { #1 }
- \tl_if_empty:NF \l_tmpa_tl
+ \tl_if_empty:NF \l__nicematrix_fill_tl
{
+ \__nicematrix_add_opacity_to_fill:
\tl_gput_right:Ne \g__nicematrix_pre_code_before_tl
{
- \__nicematrix_exp_color_arg:No \__nicematrix_rectanglecolor \l_tmpa_tl
- { \int_use:N \c at iRow - \int_use:N \c at jCol }
- { \int_use:N \c at iRow - * }
- }
- \int_compare:nNnT \l__nicematrix_key_nb_rows_int > \c_one_int
- {
- \tl_gput_right:Ne \g__nicematrix_pre_code_before_tl
+ \int_compare:nNnTF \c at jCol > \c_one_int
{
- \__nicematrix_exp_color_arg:No \__nicematrix_rowcolor \l_tmpa_tl
- {
- \int_eval:n { \c at iRow + 1 }
- - \int_eval:n { \c at iRow + \l__nicematrix_key_nb_rows_int - 1 }
- }
+ \__nicematrix_exp_color_arg:No \__nicematrix_roundedrectanglecolor \l__nicematrix_fill_tl
+ { \int_use:N \c at iRow - \int_use:N \c at jCol }
+ { \int_use:N \c at iRow - * }
+ { \dim_use:N \l__nicematrix_rounded_corners_dim }
+ \int_compare:nNnT \l__nicematrix_key_nb_rows_int > \c_one_int
+ { \__nicematrix_rounded_from_row:n { \c at iRow + 1 } }
}
+ { \__nicematrix_rounded_from_row:n { \c at iRow } }
}
}
\__nicematrix_put_in_row_style:n { \exp_not:n { #2 } }
@@ -5417,6 +5420,16 @@
\g__nicematrix_row_style_tl
\ignorespaces
}
+\cs_new:Npn \__nicematrix_rounded_from_row:n #1
+ {
+ \__nicematrix_exp_color_arg:No \__nicematrix_roundedrectanglecolor \l__nicematrix_fill_tl
+ { \int_eval:n { #1 } - 1 }
+ {
+ \int_eval:n { \c at iRow + \l__nicematrix_key_nb_rows_int - 1 }
+ - \exp_not:n { \int_use:N \c at jCol }
+ }
+ { \dim_use:N \l__nicematrix_rounded_corners_dim }
+ }
\cs_generate_variant:Nn \__nicematrix_add_to_colors_seq:nn { e }
\cs_generate_variant:Nn \__nicematrix_add_to_colors_seq:nn { e e }
\cs_new_protected:Npn \__nicematrix_add_to_colors_seq:nn #1 #2
@@ -5853,7 +5866,6 @@
}
\NewDocumentCommand \__nicematrix_cellcolor_tabular { O { } m }
{
- \__nicematrix_test_color_inside:
\tl_gput_right:Ne \g__nicematrix_pre_code_before_tl
{
\__nicematrix_cellcolor [ #1 ] { \exp_not:n { #2 } }
@@ -5863,7 +5875,6 @@
}
\NewDocumentCommand \__nicematrix_rowcolor_tabular { O { } m }
{
- \__nicematrix_test_color_inside:
\tl_gput_right:Ne \g__nicematrix_pre_code_before_tl
{
\__nicematrix_rectanglecolor [ #1 ] { \exp_not:n { #2 } }
@@ -5876,7 +5887,6 @@
{ \__nicematrix_rowlistcolors_tabular [ #1 ] { { #2 } , { #3 } } }
\NewDocumentCommand { \__nicematrix_rowlistcolors_tabular } { O { } m O { } }
{
- \__nicematrix_test_color_inside:
\peek_remove_spaces:n
{ \__nicematrix_rowlistcolors_tabular:nnn { #1 } { #2 } { #3 } }
}
@@ -7161,6 +7171,8 @@
\end { minipage }
}
{
+ \bool_if:NT \c__nicematrix_testphase_table_bool
+ { \tagpdfsetup { table / tagging = presentation } }
\use:e
{
\exp_not:N \begin { tabular }%
@@ -7542,27 +7554,10 @@
}
\tl_if_empty:NF \l__nicematrix_fill_tl
{
- \tl_if_empty:NF \l__nicematrix_opacity_tl
- {
- \tl_if_head_eq_meaning:oNTF \l__nicematrix_fill_tl [
- {
- \tl_set:Ne \l__nicematrix_fill_tl
- {
- [ opacity = \l__nicematrix_opacity_tl ,
- \tl_tail:o \l__nicematrix_fill_tl
- }
- }
- {
- \tl_set:Ne \l__nicematrix_fill_tl
- { [ opacity = \l__nicematrix_opacity_tl ] { \exp_not:o \l__nicematrix_fill_tl } }
- }
- }
+ \__nicematrix_add_opacity_to_fill:
\tl_gput_right:Ne \g__nicematrix_pre_code_before_tl
{
- \exp_not:N \roundedrectanglecolor
- \tl_if_head_eq_meaning:oNTF \l__nicematrix_fill_tl [
- { \l__nicematrix_fill_tl }
- { { \l__nicematrix_fill_tl } }
+ \__nicematrix_exp_color_arg:No \__nicematrix_roundedrectanglecolor \l__nicematrix_fill_tl
{ #1 - #2 }
{ \int_use:N \l__nicematrix_last_row_int - \int_use:N \l__nicematrix_last_col_int }
{ \dim_use:N \l__nicematrix_rounded_corners_dim }
@@ -7920,6 +7915,24 @@
\pgfusepath { fill }
\endpgfpicture
}
+\cs_new_protected:Npn \__nicematrix_add_opacity_to_fill:
+ {
+ \tl_if_empty:NF \l__nicematrix_opacity_tl
+ {
+ \tl_if_head_eq_meaning:oNTF \l__nicematrix_fill_tl [
+ {
+ \tl_set:Ne \l__nicematrix_fill_tl
+ {
+ [ opacity = \l__nicematrix_opacity_tl ,
+ \tl_tail:o \l__nicematrix_fill_tl
+ }
+ }
+ {
+ \tl_set:Ne \l__nicematrix_fill_tl
+ { [ opacity = \l__nicematrix_opacity_tl ] { \exp_not:o \l__nicematrix_fill_tl } }
+ }
+ }
+ }
\cs_new_protected:Npn \__nicematrix_stroke_block:nnn #1 #2 #3
{
\group_begin:
@@ -9280,6 +9293,13 @@
You~should~not~use~'hvlines',~'rounded-corners'~and~'corners'~at~this~time.\\
The~output~will~not~be~reliable.
}
+\__nicematrix_msg_new:nn { key~color-inside }
+ {
+ Key~deprecated.\\
+ The~key~'color-inside'~(and~its~alias~'colortbl-like')~is~now~point-less~
+ and~have~been~deprecated.\\
+ You~won't~have~similar~message~till~the~end~of~the~document.
+ }
\__nicematrix_msg_new:nn { negative~weight }
{
Negative~weight.\\
@@ -9782,14 +9802,6 @@
command~'\token_to_str:N\Block')~but~tikz~is~not~loaded.~
That~key~will~be~ignored.
}
-\__nicematrix_msg_new:nn { without~color-inside }
- {
- If~order~to~use~\token_to_str:N \cellcolor,~\token_to_str:N \rowcolor,~
- \token_to_str:N \rowcolors\ or~\token_to_str:N \rowlistcolors\
- outside~\token_to_str:N \CodeBefore,~you~
- should~have~used~the~key~'color-inside'~in~your~\__nicematrix_full_name_env:.\\
- You~can~go~on~but~you~may~need~more~compilations.
- }
\__nicematrix_msg_new:nn { color~in~custom-line~with~tikz }
{
Erroneous~use.\\
@@ -9959,13 +9971,15 @@
}
{
The~available~keys~are~(in~alphabetic~order):~
- 'bold',~
- 'cell-space-top-limit',~
- 'cell-space-bottom-limit',~
- 'cell-space-limits',~
- 'color',~
- 'nb-rows'~and~
- 'rowcolor'.
+ bold,~
+ cell-space-top-limit,~
+ cell-space-bottom-limit,~
+ cell-space-limits,~
+ color,~
+ fill~(alias:~rowcolor),~
+ nb-rows,
+ opacity~and~
+ rounded-corners.
}
\__nicematrix_msg_new:nnn { Unknown~key~for~NiceMatrixOptions }
{
@@ -10045,7 +10059,6 @@
code-for-first-row,~
code-for-last-col,~
code-for-last-row,~
- color-inside,~
columns-width,~
corners,~
create-extra-nodes,~
@@ -10104,7 +10117,6 @@
code-for-first-row,~
code-for-last-col,~
code-for-last-row,~
- color-inside,~
columns-type,~
columns-width,~
corners,~
@@ -10167,7 +10179,6 @@
code-for-first-row,~
code-for-last-col,~
code-for-last-row,~
- color-inside,~
columns-width,~
corners,~
custom-line,~
More information about the tex-live-commits
mailing list.