summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nicematrix/nicematrix.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-10-19 03:01:14 +0000
committerNorbert Preining <norbert@preining.info>2021-10-19 03:01:14 +0000
commitd045bcbc99b0eda65a444496d60d16ea2d063c65 (patch)
tree86dd463beaafa251038cf6f29adadd6276da1250 /macros/latex/contrib/nicematrix/nicematrix.dtx
parentad3ad18aa939862832c90a74bcf41e8a5570ff65 (diff)
CTAN sync 202110190301
Diffstat (limited to 'macros/latex/contrib/nicematrix/nicematrix.dtx')
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.dtx1271
1 files changed, 855 insertions, 416 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx
index 034b863418..8da12f0a1c 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix.dtx
@@ -15,8 +15,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.2}
-\def\myfiledate{2021/09/09}
+\def\myfileversion{6.3}
+\def\myfiledate{2021/10/18}
%
%
%<*batchfile>
@@ -56,7 +56,8 @@ version 2005/12/01 or later.
\usetikzlibrary{fit,patterns}
\usepackage{nicematrix}
\usepackage{siunitx}
-
+\usepackage{varwidth}
+\usepackage[auto-lang=false]{lipsum}
\NewDocumentEnvironment {scope} {} {} {}
\def\interitem{\vspace{7mm plus 2 mm minus 3mm}}
@@ -66,7 +67,6 @@ version 2005/12/01 or later.
\titlespacing*{\section}{0pt}{6.5ex plus 1ex minus .2ex}{4.3ex plus .2ex}
\titlespacing*{\subsection}{0pt}{4.5ex plus 1ex minus .2ex}{2ex plus .2ex}
\usepackage{footnotehyper}
-\usepackage{varwidth}
\def\LetterAt{@}
\parindent 0pt
\skip \footins = 2 \bigskipamount
@@ -160,7 +160,7 @@ version 2005/12/01 or later.
% |texmf| tree. However, the best is to install \pkg{nicematrix} with a TeX
% distribution such as MiKTeX, TeXlive or MacTeX.
%
-% \bigskip
+% \medskip
% \emph{Remark}: If you use LaTeX via Internet with, for example, Overleaf, you
% can upload the file |nicematrix.sty| in the repertory of your
% project in order to take full advantage of the latest version de
@@ -170,21 +170,24 @@ version 2005/12/01 or later.
% \small
% \url{https:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty}}
%
-% \bigskip
+% \medskip
% This package can be used with |xelatex|, |lualatex|, |pdflatex| but also by
% the classical workflow |latex|-|dvips|-|ps2pdf| (or Adobe Distiller).
% \textsl{However, the file nicematrix.dtx of the present documentation should
% be compiled with XeLaTeX.}
%
-% \bigskip
+% \medskip
% This package requires and \textbf{loads} the packages \pkg{l3keys2e},
% \pkg{array}, \pkg{amsmath}, \pkg{pgfcore} and the module \pkg{shapes} of
% \textsc{pgf} (\pkg{tikz}, which is a layer over \textsc{pgf} is \emph{not}
% loaded). The final user only has to load the package with
% |\usepackage{nicematrix}|.
%
+% \medskip
+% If you use TeXLive as TeX distribution, you should note that TeXLive 2020 at
+% least is required by \pkg{nicematrix}.
%
-% \bigskip
+% \medskip
% The idea of \pkg{nicematrix} is to create \textsc{pgf} nodes under the cells
% and the positions of the rules of the tabular created by \pkg{array} and to
% use these nodes to develop new features. As usual with \textsc{pgf}, the
@@ -193,11 +196,11 @@ version 2005/12/01 or later.
% compilations}.\footnote{If you use Overleaf, Overleaf will do automatically
% the right number of compilations.}
%
-% \bigskip
+% \medskip
% Most features of \pkg{nicematrix} may be used without explicit use of
% \textsc{pgf} or Tikz (which, in fact, is not loaded by default).
%
-% \bigskip
+% \medskip
% A command |\NiceMatrixOptions| is provided to fix the options (the
% scope of the options fixed by this command is the current TeX group: they are
% semi-global).
@@ -239,9 +242,9 @@ version 2005/12/01 or later.
% \pkg{nicematrix}): |{matrix}|, |{pmatrix}|, etc.
%
% \medskip
-% L'environnement |{NiceTabularX}| is similar to the environment |{tabularx}|
+% The environment |{NiceTabularX}| is similar to the environment |{tabularx}|
% from the eponymous package.\footnote{In fact, it's possible to use directly the
-% |X| columns in the environnement |{NiceTabular}| (and the required
+% |X| columns in the environment |{NiceTabular}| (and the required
% width for the tabular is fixed by the key |width|): cf. p.~\pageref{X-columns}}.
%
% \medskip
@@ -468,9 +471,9 @@ version 2005/12/01 or later.
% block extends until the last row (idem for the columns).
%
% \item The second argument is the content of the block. It's possible to use
-% |\\| in that content to have a content on several lines. In |{NiceTabular}|
-% the content of the block is composed in text mode whereas, in the other
-% environments, it is composed in math mode.
+% |\\| in that content to have a content on several lines. In |{NiceTabular}|,
+% |{NiceTabular*}| and |{NiceTabularX}|, the content of the block is composed in
+% text mode whereas, in the other environments, it is composed in math mode.
% \end{itemize}
%
%
@@ -479,17 +482,17 @@ version 2005/12/01 or later.
%
% \medskip
% \begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-% $\begin{bNiceArray}{ccc|c}[margin]
+% $\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
% ~emphase#\Block{3-3}{A}@ & & & 0 \\
-% & \hspace*{1cm} & & \Vdots \\
+% & & & \Vdots \\
% & & & 0 \\
% \hline
% 0 & \Cdots& 0 & 0
% \end{bNiceArray}$
% \end{BVerbatim}
-% $\begin{bNiceArray}{ccc|c}[margin]
+% $\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
% \Block{3-3}{A} & & & 0 \\
-% & \hspace*{1cm} & & \Vdots \\
+% & & & \Vdots \\
% & & & 0 \\
% \hline
% 0 & \Cdots& 0 & 0
@@ -507,18 +510,18 @@ version 2005/12/01 or later.
%
% \medskip
% \begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-% $\begin{bNiceArray}{ccc|c}[margin]
+% $\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
% \Block{3-3}~emphase#<\Large>@{A} & & & 0 \\
-% & \hspace*{1cm} & & \Vdots \\
+% 0 & & & \Vdots \\
% & & & 0 \\
% \hline
% 0 & \Cdots& 0 & 0
% \end{bNiceArray}$
% \end{BVerbatim}
% \begin{scope}
-% $\begin{bNiceArray}{ccc|c}[margin]
+% $\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
% \Block{3-3}<\Large>{A} & & & 0 \\
-% & \hspace*{1cm} & & \Vdots \\
+% & & & \Vdots \\
% & & & 0 \\
% \hline
% 0 & \Cdots& 0 & 0
@@ -532,17 +535,17 @@ version 2005/12/01 or later.
%
% \medskip
% \begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-% $\begin{bNiceArray}{ccc|c}[margin]
+% $\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
% \Block~emphase#[r]@{3-3}<\LARGE>{A} & & & 0 \\
-% & \hspace*{1cm} & & \Vdots \\
+% & & & \Vdots \\
% & & & 0 \\
% \hline
% 0 & \Cdots& 0 & 0
% \end{bNiceArray}$
% \end{BVerbatim}
-% $\begin{bNiceArray}{ccc|c}[margin]
+% $\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
% \Block[r]{3-3}<\LARGE>{A} & & & 0 \\
-% & \hspace*{1cm} & & \Vdots \\
+% & & & \Vdots \\
% & & & 0 \\
% \hline
% 0 & \Cdots& 0 & 0
@@ -575,13 +578,14 @@ version 2005/12/01 or later.
% when it has a multi-line content (the lines are separated by |\\|);
% \item the keys |hvlines| draws all the vertical and horizontal rules in the
% block;
-% \item \colorbox{yellow!50}{\textbf{New 5.19}}\enskip when the key |tikz| is
-% used, the Tikz path corresponding of the rectangle which delimits the block is
-% executed with Tikz\footnote{Tikz should be loaded (by default,
-% \pkg{nicematrix} only loads \textsc{pgf}) and, if it's not, an error will be
-% raised.} by using as options the value of that key |tikz| (which must be a
-% list of keys allowed for a Tikz path). For examples, cf.
-% p.~\pageref{tikz-key-examples}.
+% \item when the key |tikz| is used, the Tikz path corresponding of the
+% rectangle which delimits the block is executed with Tikz\footnote{Tikz should
+% be loaded (by default, \pkg{nicematrix} only loads \textsc{pgf}) and, if it's
+% not, an error will be raised.} by using as options the value of that key
+% |tikz| (which must be a list of keys allowed for a Tikz path). For examples,
+% cf. p.~\pageref{tikz-key-examples};
+% \item \colorbox{yellow!50}{\textbf{New 6.3}}\enskip the key |name| provides a
+% name to the rectangular Tikz node corresponding to the block.
% \end{itemize}
%
% \interitem
@@ -596,24 +600,24 @@ version 2005/12/01 or later.
% \bigskip
% \begin{BVerbatim}
% \begin{NiceTabular}{cwc{2cm}wc{3cm}c}
-% rose & tulipe & marguerite & dahlia \\
-% violette
+% rose & tulip & daisy & dahlia \\
+% violet
% & ~emphase#\Block[draw=red,fill=[RGB]{204,204,255},rounded-corners]{2-2}@
-% ~emphase#{\LARGE De très jolies fleurs}@
-% & & souci \\
-% pervenche & & & lys \\
-% arum & iris & jacinthe & muguet
+% ~emphase#{\LARGE Some beautiful flowers}@
+% & & marigold \\
+% iris & & & lis \\
+% arum & periwinkle & forget-me-not & hyacinth
% \end{NiceTabular}
% \end{BVerbatim}
%
% \medskip
% \begin{center}
% \begin{NiceTabular}{cwc{2cm}wc{3cm}c}
-% rose & tulipe & marguerite & dahlia \\
-% violette & \Block[draw=red,fill=[RGB]{204,204,255},rounded-corners]{2-2}
-% {\LARGE De très jolies fleurs} & & souci \\
-% pervenche & & & lys \\
-% arum & iris & jacinthe & muguet
+% rose & tulip & daisy & dahlia \\
+% violet & \Block[draw=red,fill=[RGB]{204,204,255},rounded-corners]{2-2}
+% {\LARGE Some beautiful flowers} & & marigold \\
+% iris & & & lis \\
+% arum & periwinkle & forget-me-not & hyacinth
% \end{NiceTabular}
% \end{center}
%
@@ -993,7 +997,8 @@ version 2005/12/01 or later.
%
% The keys |hlines| and |vlines| (which draw, of course, horizontal and vertical
% rules) take in as value a list of numbers which are the numbers of the rules
-% to draw.
+% to draw.\footnote{It's possible to put in that list some intervals of integers
+% with the syntax $i$|-|$j$.}
%
% In fact, for the environments with delimiters (such as |{pNiceMatrix}| or
% |{bNiceArray}|), the key |vlines| don't draw the exterior rules (this is
@@ -1306,9 +1311,9 @@ version 2005/12/01 or later.
% \begin{Verbatim}
% \begin{pNiceArray}{~textsl#preamble@}
% ~emphase#\CodeBefore@
-% ~textsl#instructions of the code-before@
+% ~textsl#instructions of the code-before@
% ~emphase#\Body@
-% ~textsl#contents of the environnement@
+% ~textsl#contents of the environment@
% \end{pNiceArray}
% \end{Verbatim}
%
@@ -1771,43 +1776,50 @@ version 2005/12/01 or later.
%
% \label{RowStyle}
%
-% \colorbox{yellow!50}{\bfseries New 5.18}\enskip The command |\RowStyle| takes
-% in as argument some formatting intructions that will be applied to each cell
-% on the rest of the current row.
+% The command |\RowStyle| takes in as argument some formatting intructions that
+% will be applied to each cell on the rest of the current row.
%
% \medskip
% That command also takes in as optional argument (between square brackets)
% a list of key-value pairs.
% \begin{itemize}
+% \item \colorbox{yellow!50}{\bfseries New 6.3}\enskip The key |nb-rows| sets
+% the number of rows to which the specifications of the current command will
+% apply.
% \item The keys |cell-space-top-limit|, |cell-space-bottom-limit| and
% |cell-space-limits| are available with the same meaning that the corresponding
% global keys (cf. p.~\pageref{cell-space}).
-% \item \colorbox{yellow!50}{\bfseries New 6.1}\enskip The key |color| sets the
+% \item \colorbox{yellow!50}{\bfseries New 6.3}\enskip The key |rowcolor| sets
+% the color of the background and the key |color| sets the
% color of the text.\footnote{The key |color| uses the command
% |\color| but inserts also an instruction |\leavevmode| before. This
% instruction prevents a extra vertical space in the cells which belong to
% columns of type |p|, |b|, |m| and |X| (which start in
% vertical mode).}
+% \item \colorbox{yellow!50}{\bfseries New 6.3}\enskip The key |bold| enforces
+% bold characters for the cells of the row, both in math mode and text mode.
% \end{itemize}
%
% \medskip
-% \begin{BVerbatim}[boxwidth=11cm,baseline=c]
-% \begin{NiceTabular}{cccc}[colortbl-like]
+% \begin{BVerbatim}[boxwidth=12cm,baseline=c]
+% \begin{NiceTabular}{cccc}
% \hline
% ~emphase#\RowStyle[cell-space-limits=3pt]{\rotate}@
% first & second & third & fourth \\
-% \rowcolor{blue!50}~emphase#\RowStyle[color=white]{\sffamily}@
+% ~emphase#\RowStyle[nb-rows=2,rowcolor=blue!50,color=white]{\sffamily}@
% 1 & 2 & 3 & 4 \\
+% I & II & III & IV
% \end{NiceTabular}
% \end{BVerbatim}
-% \begin{NiceTabular}{cccc}[colortbl-like]
+% \begin{NiceTabular}{cccc}
% \hline
% \RowStyle[cell-space-limits=3pt]{\rotate}
% first & second & third & fourth \\
-% \rowcolor{blue!50}\RowStyle[color=white]{\sffamily}
+% \RowStyle[nb-rows=2,color=white]{\sffamily}
% 1 & 2 & 3 & 4 \\
+% I & II & III & IV \\
% \end{NiceTabular}
-%
+%
% \medskip
% The command |\rotate| is described p.~\pageref{rotate}.
%
@@ -1944,34 +1956,102 @@ version 2005/12/01 or later.
% \end{array}$
% \end{NiceMatrixBlock}
%
+% \subsection{The columns V of varwidth}
+%
+% \colorbox{yellow!50}{\textbf{New 6.3}}
+%
+% \smallskip
+% Let's recall first the behaviour of the environment |{varwidth}| of the
+% eponymous package \pkg{varwidth}. That environment is similar to the classical
+% environment |{minipage}| but the width provided in the argument is only the
+% \emph{maximal} width of the created box. In the general case, the width of the
+% box constructed by an environment |{varwidth}| is the natural width of its
+% contents.
+%
+% \medskip
+% That point is illustrated on the following examples.
+%
+% \medskip
+% \begin{BVerbatim}[baseline=c,boxwidth=6cm]
+% \fbox{%
+% \begin{~emphase#varwidth@}{8cm}
+% \begin{itemize}
+% \item first item
+% \item second item
+% \end{itemize}
+% \end{~emphase#varwidth@}}
+% \end{BVerbatim}
+% \fbox{\begin{varwidth}{8cm}
+% \begin{itemize}
+% \item first item
+% \item second item
+% \end{itemize}
+% \end{varwidth}}
+%
+% \bigskip
+% \begin{BVerbatim}[baseline=c,boxwidth=6cm]
+% \fbox{%
+% \begin{~emphase#minipage@}{8cm}
+% \begin{itemize}
+% \item first item
+% \item second item
+% \end{itemize}
+% \end{~emphase#minipage@}}
+% \end{BVerbatim}
+% \fbox{\begin{minipage}{8cm}
+% \begin{itemize}
+% \item first item
+% \item second item
+% \end{itemize}
+% \end{minipage}}
+%
+%
+% \bigskip
+% The package \pkg{varwidth} provides also the column type |V|. A column of type
+% |V{|$\langle$\textsl{dim}$\rangle$|}| encapsulates all its cells in a
+% |{varwidth}| with the argument $\langle$\textsl{dim}$\rangle$ (and does also some tuning).
+%
+% \smallskip
+% When the package \pkg{varwidth} is loaded, the columns |V| of \pkg{varwidth}
+% are supported by \pkg{nicematrix}. Concerning \pkg{nicematrix}, one of the
+% interests of this type of columns is that, for a cell of a column of type~|V|,
+% the PGF/Tikz node created by \pkg{nicematrix} for the content of that cell has
+% a width adjusted to the content of the cell : cf. p.~\pageref{node-V}.
+%
+%
% \subsection{The columns X}
%
% \label{X-columns}
% \colorbox{yellow!50}{\textbf{New 6.0}}
%
+% \smallskip
% The environment |{NiceTabular}| provides |X| columns similar to those provided
% by the environment |{tabularx}| of the eponymous package.
%
-% The required width of the tabular may be specified with the key |width|. The
-% initial value of this parameter is |\linewidth|.
+% The required width of the tabular may be specified with the key |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 first mandatory argument
% which is the width of the tabular.\footnote{If \pkg{tabularx} is loaded, one
% must use |{NiceTabularX}| (and not |{NiceTabular}|) in order to use the
-% columns `X` (this point comes from a conflict in the definitions of the
-% specifier `X`).}
+% columns |X| (this point comes from a conflict in the definitions of the
+% specifier |X|).}
%
% As with the packages \pkg{tabu} and \pkg{tabularray}, the specifier |X| takes
% in an optional argument (between square brackets) which is a list of keys.
% \begin{itemize}
-% \item It's possible to give a weight for the column by providing an integer
-% directly as argument of the specifier |X|. For example, a column |X[2]| will
-% have a width double of the width of a column |X| (which has a weight equal to $1$).
+% \item It's possible to give a weight for the column by providing a positive
+% integer directly as argument of the specifier |X|. For example, a column
+% |X[2]| will have a width double of the width of a column |X| (which has a
+% weight equal to $1$).\footnote{The negative values of the weight, as provided
+% by \pkg{tabu} (which is now obsolete), are not supported by \pkg{nicematrix}.
+% If such a value is used, an error will be raised.}
% \item It's possible to specify an horizontal alignment with one of the
-% letters |l|, |c| and |r| (which inserts respectively |\raggedright|,
+% letters |l|, |c| and |r| (which insert respectively |\raggedright|,
% |\centering| and |\raggedleft| followed by |\arraybackslash|).
-% \item It's possible to specify a vertical alignement with one of the keys
+% \item It's possible to specify a vertical alignment with one of the keys
% |t| (alias |p|), |m| and |b| (which construct respectively columns of type
% |p|, |m| and |b|). The default value is |t|.
% \end{itemize}
@@ -2659,7 +2739,7 @@ version 2005/12/01 or later.
%
% \medskip
% Moreover, two special commands are available in the |\CodeAfter|: |line| and
-% |\SubMatrix|.
+% |\SubMatrix|. We will now present these commands.
%
% \subsection{The command \textbackslash line in the \textbackslash CodeAfter}
%
@@ -2775,9 +2855,9 @@ version 2005/12/01 or later.
% \end{NiceArray}$
%
% \bigskip
-% \colorbox{yellow!50}{\bfseries New 5.18}\enskip In fact, the command
-% |\SubMatrix| also takes in two optional arguments specified by the
-% traditional symbols |^| and |_| for material in superscript and subscript.
+% In fact, the command |\SubMatrix| also takes in two optional arguments
+% specified by the traditional symbols |^| and |_| for material in superscript
+% and subscript.
%
% \medskip
% \begin{scope}
@@ -3692,6 +3772,47 @@ version 2005/12/01 or later.
% a & a & a
% \end{pNiceMatrix}\]
%
+%
+% \colorbox{yellow!50}{\bfseries New 6.3}\enskip The nodes of the last column
+% (excepted the potential «last column» specified by |last-col|) may also be
+% indicated by $i$-|last|. Similarly, the nodes of the last row may be indicated
+% by |last|-$j$.
+%
+% \subsubsection{Les colonnes V de varwidth}
+%
+% \label{node-V}
+% When the extension \pkg{varwidth} is loaded, the columns of the type |V|
+% defined by \pkg{varwidth} are supported by \pkg{nicematrix}. It may be
+% interessant to notice that, for a cell of a column of type |V|, the PGF/Tikz
+% node created by \pkg{nicematrix} for the content of that cell has a width
+% adjusted to the content of the cell. This is in contrast to the case of the
+% columns of type |p|, |m| or |b| for which the nodes have always a width equal
+% to the width of the column.
+%
+% \begin{Verbatim}
+% \begin{NiceTabular}{V{8cm}}
+% \bfseries \large
+% Titre \\
+% \lipsum[1]
+% \CodeAfter
+% \tikz \draw [rounded corners] (1-1) -| (last-|2) -- (last-|1) |- (1-1) ;
+% \end{NiceTabular}
+% \end{Verbatim}
+%
+%
+% \begin{center}
+% \begin{NiceTabular}{V{8cm}}
+% \bfseries \large
+% Titre \\
+% \lipsum[1]
+% \CodeAfter
+% \tikz \draw [rounded corners] (1-1) -| (last-|2) -- (last-|1) |- (1-1) ;
+% \end{NiceTabular}
+% \end{center}
+%
+% We have used the nodes corresponding to the position of the potential rules,
+% which are described below (cf. p.~\pageref{nodes-i}).
+%
%
% \subsection{The ``medium nodes'' and the ``large nodes''}
%
@@ -4300,7 +4421,7 @@ version 2005/12/01 or later.
% \medskip
% \item A cell of a column of type |p|, |m| or |t| is always considered as not
% emtpy. \emph{Caution} : One should not rely upon that point because it may
-% change if a future version of \pkg{nicematrix}.
+% change in a future version of \pkg{nicematrix}.
% % \end{itemize}
%
%
@@ -4345,7 +4466,28 @@ version 2005/12/01 or later.
%
% \bigskip
% The package \pkg{nicematrix} is not compatible with the class \cls{ieeeaccess}
-% (because that class is not compatible with PGF/Tikz).
+% (because that class is not compatible with PGF/Tikz).\footnote{See
+% \url{https://tex.stackexchange.com/questions/528975/error-loading-tikz-in-ieeeaccess-class}}
+%
+% \bigskip
+% In order to use \pkg{nicematrix} with the class \cls{aastex631}, you have to
+% add the following lines in the preamble of your document :
+%
+% \begin{Verbatim}
+% \BeforeBegin{NiceTabular}{\let\begin\BeginEnvironment\let\end\EndEnvironment}
+% \BeforeBegin{NiceArray}{\let\begin\BeginEnvironment}
+% \BeforeBegin{NiceMatrix}{\let\begin\BeginEnvironment}
+% \end{Verbatim}
+%
+% \bigskip
+% In order to use \pkg{nicematrix} with the class \cls{sn-jnln}, \pkg{pgf} must
+% be loaded before the |\documentclass|:
+%
+% \begin{Verbatim}
+% \RequirePackage{pgf}
+% \documentclass{sn-jnl}
+% \end{Verbatim}
+%
%
% \section{Examples}
%
@@ -5203,7 +5345,7 @@ version 2005/12/01 or later.
% \end{Verbatim}
%
%
-%\section{Implementation}
+% \section{Implementation}
%
% By default, the package \pkg{nicematrix} doesn't patch any existing code.
%
@@ -5302,8 +5444,12 @@ version 2005/12/01 or later.
\bool_new:N \c_@@_enumitem_loaded_bool
\bool_new:N \c_@@_tabularx_loaded_bool
\bool_new:N \c_@@_tikz_loaded_bool
+\bool_new:N \c_@@_varwidth_loaded_bool
\AtBeginDocument
{
+ \@ifpackageloaded { varwidth }
+ { \bool_set_true:N \c_@@_varwidth_loaded_bool }
+ { }
\@ifpackageloaded { arydshln }
{ \bool_set_true:N \c_@@_arydshln_loaded_bool }
{ }
@@ -5329,7 +5475,8 @@ version 2005/12/01 or later.
%
% That's why we create |\c_@@_pgfortikzpicture_tl| and
% |\c_@@_endpgfortikzpicture_tl| which will be used to construct in a
-% |\AtBeginDocument| the correct version of some commands.
+% |\AtBeginDocument| the correct version of some commands. The tokens
+% |\exp_not:N| are mandatory.
% \begin{macrocode}
\bool_set_true:N \c_@@_tikz_loaded_bool
\tl_const:Nn \c_@@_pgfortikzpicture_tl { \exp_not:N \tikzpicture }
@@ -5653,7 +5800,7 @@ version 2005/12/01 or later.
\renewcommand*{\NC@rewrite@S}[1][]
{
% \end{macrocode}
-% |\@temptokena| is a toks (not supported by \pkg{expl3}).
+% |\@temptokena| is a toks (not supported by the L3 programming layer).
% \begin{macrocode}
\@temptokena \exp_after:wN
{ \tex_the:D \@temptokena \@@_S: [ ##1 ] }
@@ -5773,6 +5920,14 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
+% The following counter corresponds to the key |nb-rows| of the command
+% |\RowStyle|.
+% \begin{macrocode}
+\int_new:N \l_@@_key_nb_rows_int
+% \end{macrocode}
+%
+%
+% \bigskip
% The following token list will contain the type of horizontal alignment of the
% current cell as provided by the corresponding column. The possible values are
% |r|, |l|, |c|. For exemple, a column |p[l]{3cm}| will provide the value |l|
@@ -5798,6 +5953,13 @@ version 2005/12/01 or later.
\dim_new:N \g_@@_blocks_ht_dim
\dim_new:N \g_@@_blocks_dp_dim
% \end{macrocode}
+%
+% \bigskip
+% The following dimension correspond to the key |width| (which may be fixed in
+% |\NiceMatrixOptions| but also in an environment |{NiceTabular}|).
+% \begin{macrocode}
+\dim_new:N \l_@@_width_dim
+% \end{macrocode}
%
% \bigskip
% The sequence |\g_@@_names_seq| will be the list of all the names of
@@ -5933,6 +6095,7 @@ version 2005/12/01 or later.
% \bigskip
% The following token list corresponds to the option |code-after| (it's also
% possible to set the value of that parameter with the keyword |\CodeAfter|).
+% That parameter is \emph{public}.
% \begin{macrocode}
\tl_new:N \g_nicematrix_code_after_tl
% \end{macrocode}
@@ -6089,10 +6252,10 @@ version 2005/12/01 or later.
\seq_new:N \g_@@_blocks_seq
% \end{macrocode}
% We also manage a sequence of the \emph{positions} of the blocks. In that
-% sequence, each block is represented by only the four first components:
-% |{|\textsl{imin}|}{|\textsl{jmin}|}{|\textsl{imax}|}{|\textsl{jmax}|}|. A
-% block with the key |hvlines| won't appear in that sequence (otherwise, the
-% lines in that block would not be drawn!).
+% sequence, each block is represented by only five components:
+% |{|\textsl{imin}|}{|\textsl{jmin}|}{|\textsl{imax}|}{|\textsl{jmax}|}{|%
+% \textsl{name}|}|. A block with the key |hvlines| won't appear in that
+% sequence (otherwise, the lines in that block would not be drawn!).
% \begin{macrocode}
\seq_new:N \g_@@_pos_of_blocks_seq
% \end{macrocode}
@@ -6105,8 +6268,9 @@ version 2005/12/01 or later.
% dotted lines are created in the array by |\Cdots|, |\Vdots|, |\Ddots|, etc.
% However, their positions, that is to say, their extremities, will be
% determined only after the construction of the array. In this sequence, each
-% item contains four components:
-% |{|\textsl{imin}|}{|\textsl{jmin}|}{|\textsl{imax}|}{|\textsl{jmax}|}|.
+% item contains five components:
+% |{|\textsl{imin}|}{|\textsl{jmin}|}{|\textsl{imax}|}{|\textsl{jmax}|}{|%
+% \textsl{name}|}|.
% \begin{macrocode}
\seq_new:N \g_@@_pos_of_xdots_seq
% \end{macrocode}
@@ -6141,8 +6305,9 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \medskip
-% The following flag will be raised if the key |width| has been raised. You use
-% it to raise an error when this key is used while no column |X| is used.
+% The following flag will be raised if the key |width| is used in an environment
+% |{NiceTabular}| (not in a comamnd |\NiceMatrixOptions|). You use it to raise
+% an error when this key is used while no column |X| is used.
% \begin{macrocode}
\bool_new:N \l_@@_width_used_bool
% \end{macrocode}
@@ -6171,7 +6336,7 @@ version 2005/12/01 or later.
%
% \medskip
% The following sequence will be used when the command |\SubMatrix| is used in
-% the |code-before| (and not in the |\CodeAfter|). It will contain the position of
+% the |\CodeBefore| (and not in the |\CodeAfter|). It will contain the position of
% all the sub-matrices specified in the |code-before|. Each sub-matrix is
% represented by an ``object'' of the forme |{|$i$|}{|$j$|}{|$k$|}{|$l$|}|
% where $i$ and $j$ are the number of row and column of the upper-left cell and
@@ -6277,11 +6442,6 @@ version 2005/12/01 or later.
\bool_new:N \l_@@_dotted_bool
% \end{macrocode}
%
-% \bigskip
-% The following dimension will be used to trim the rules drawn in the array.
-% \begin{macrocode}
-\dim_new:N \l_@@_trim_dim
-% \end{macrocode}
%
% \bigskip
% \textbf{Variables for the exterior rows and columns}\par\nobreak
@@ -6373,6 +6533,44 @@ version 2005/12/01 or later.
% \end{macrocode}
% This boolean is set to |false| at the end of |\@@_pre_array_ii:|.
% \end{itemize}
+%
+% \bigskip
+% \textbf{Some utilities}
+%
+% \begin{macrocode}
+\cs_set_protected:Npn \@@_cut_on_hyphen:w #1-#2\q_stop
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_set:Nn \l_tmpb_tl { #2 }
+ }
+% \end{macrocode}
+%
+%
+% The following takes as argument the name of a |clist| and which should be a
+% list of intervals of integers. It \emph{expands} that list, that is to say,
+% it replaces (by a sort of |mapcan| or |flat_map|) the interval by the explicit
+% list of the integers.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_expand_clist:N #1
+ {
+ \clist_if_in:NnF #1 { all }
+ {
+ \clist_clear:N \l_tmpa_clist
+ \clist_map_inline:Nn #1
+ {
+ \tl_if_in:nnTF { ##1 } { - }
+ { \@@_cut_on_hyphen:w ##1 \q_stop }
+ {
+ \tl_set:Nn \l_tmpa_tl { ##1 }
+ \tl_set:Nn \l_tmpb_tl { ##1 }
+ }
+ \int_step_inline:nnn { \l_tmpa_tl } { \l_tmpb_tl }
+ { \clist_put_right:Nn \l_tmpa_clist { ####1 } }
+ }
+ \tl_set_eq:NN #1 \l_tmpa_clist
+ }
+ }
+% \end{macrocode}
%
% \bigskip
% \subsection*{The command \textbackslash tabularnote}
@@ -6603,7 +6801,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \medskip
-% The command |\@@_pgf_rect_node:nnn| is a variant of |\@@_pgf_rect_node:nnnn|:
+% The command |\@@_pgf_rect_node:nnn| is a variant of |\@@_pgf_rect_node:nnnnn|:
% it takes two \textsc{pgf} points as arguments instead of the four dimensions
% which are the coordinates.
% \begin{macrocode}
@@ -7195,6 +7393,8 @@ version 2005/12/01 or later.
% \begin{macrocode}
\keys_define:nn { NiceMatrix / NiceMatrixOptions }
{
+ width .code:n = \dim_set:Nn \l_@@_width_dim { #1 } ,
+ width .value_required:n = true ,
last-col .code:n = \tl_if_empty:nF { #1 }
{ \@@_error:n { last-col~non~empty~for~NiceMatrixOptions } }
\int_zero:N \l_@@_last_col_int ,
@@ -7370,6 +7570,7 @@ version 2005/12/01 or later.
{
% \end{macrocode}
% The dimension |width| will be used if at least a column of type |X| is used.
+% If there is no column of type |X|, an error will be raised.
% \begin{macrocode}
width .code:n = \dim_set:Nn \l_@@_width_dim { #1 }
\bool_set_true:N \l_@@_width_used_bool ,
@@ -7409,10 +7610,10 @@ version 2005/12/01 or later.
\tl_gclear:N \g_@@_post_action_cell_tl
% \end{macrocode}
% At the beginning of the cell, we link |\CodeAfter| to a command which do
-% \emph{not} begin with |\omit| (whereas the standard version of |\CodeAfter|
-% begins with |\omit|).
+% begins with |\\| (whereas the standard version of |\CodeAfter| begins does
+% not).
% \begin{macrocode}
- \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i:n
+ \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i:
% \end{macrocode}
% We increment |\c@jCol|, which is the counter of the columns.
% \begin{macrocode}
@@ -7425,10 +7626,9 @@ version 2005/12/01 or later.
\int_compare:nNnT \c@jCol = 1
{ \int_compare:nNnT \l_@@_first_col_int = 1 \@@_begin_of_row: }
% \end{macrocode}
-% The content of the cell is composed in the box |\l_@@_cell_box| because we want
-% to compute some dimensions of the box. The |\hbox_set_end:| corresponding to
-% this |\hbox_set:Nw| will be in the |\@@_cell_end:| (and the potential
-% |\c_math_toggle_token| also).
+% The content of the cell is composed in the box |\l_@@_cell_box|. The
+% |\hbox_set_end:| corresponding to this |\hbox_set:Nw| will be in the
+% |\@@_cell_end:| (and the potential |\c_math_toggle_token| also).
% \begin{macrocode}
\hbox_set:Nw \l_@@_cell_box
\bool_if:NF \l_@@_NiceTabular_bool
@@ -7448,7 +7648,6 @@ version 2005/12/01 or later.
\color { nicematrix }
% \end{macrocode}
%
-%
% \begin{macrocode}
\g_@@_row_style_tl
% \end{macrocode}
@@ -7485,7 +7684,6 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_new_protected:Npn \@@_begin_of_row:
{
- \tl_gclear:N \g_@@_row_style_tl
\int_gincr:N \c@iRow
\dim_gset_eq:NN \g_@@_dp_ante_last_row_dim \g_@@_dp_last_row_dim
\dim_gset:Nn \g_@@_dp_last_row_dim { \box_dp:N \@arstrutbox }
@@ -7691,17 +7889,17 @@ version 2005/12/01 or later.
\hbox_set:Nn \l_@@_cell_box
{
\box_move_up:nn { \box_ht:N \l_@@_cell_box}
- \hbox_overlap_left:n
- {
- \pgfsys@markposition
- { \@@_env: - \int_use:N \c@iRow - \int_use:N \c@jCol - NW }
+ \hbox_overlap_left:n
+ {
+ \pgfsys@markposition
+ { \@@_env: - \int_use:N \c@iRow - \int_use:N \c@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
% Adobe Distiller). However, it seems to work.
% \begin{macrocode}
- #1
- }
+ #1
+ }
\box_use:N \l_@@_cell_box
\box_move_down:nn { \box_dp:N \l_@@_cell_box }
\hbox_overlap_left:n
@@ -7865,8 +8063,8 @@ version 2005/12/01 or later.
{
\@@_create_row_node:
% \end{macrocode}
-% We don't draw the rules of the key |hlines| (or |hvlines|) but we reserve the
-% vertical space for theses rules.
+% We don't draw now the rules of the key |hlines| (or |hvlines|) but we reserve the
+% vertical space for theses rules (the rules will be drawn by \textsc{pgf}).
% \begin{macrocode}
\tl_if_empty:NF \l_@@_hlines_clist
{
@@ -7955,12 +8153,18 @@ version 2005/12/01 or later.
% into account the color of the encompassing text. As a workaround, you peek the
% color in force at the beginning of the environment and we will it in each cell.
% \begin{macrocode}
- \xglobal \colorlet { nicematrix } { . }
+ \xglobal \colorlet { nicematrix } { . }
% \end{macrocode}
% The number of letters |X| in the preamble of the array.
% \begin{macrocode}
- \int_gzero:N \g_@@_total_X_weight_int
+ \int_gzero:N \g_@@_total_X_weight_int
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \@@_expand_clist:N \l_@@_hlines_clist
+ \@@_expand_clist:N \l_@@_vlines_clist
% \end{macrocode}
+%
% If \pkg{booktabs} is loaded, we have to patch the macro |\@BTnormal| which is
% a macro of \pkg{booktabs}. The macro |\@BTnormal| draws an horizontal rule but
% it occurs after a vertical skip done by a low level TeX command. When this
@@ -8112,7 +8316,6 @@ version 2005/12/01 or later.
\seq_gclear:N \g_@@_multicolumn_sizes_seq
% \end{macrocode}
%
-%
% The counter |\c@iRow| will be used to count the rows of the array (its
% incrementation will be in the first cell of the row).
% \begin{macrocode}
@@ -8329,54 +8532,6 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-% \bigskip
-% \begin{macrocode}
-\keys_define:nn { NiceMatrix / RowStyle }
- {
- cell-space-top-limit .code:n =
- {
- \tl_gput_right:Nn \g_@@_row_style_tl
- {
- \tl_gput_right:Nn \g_@@_post_action_cell_tl
- { \dim_set:Nn \l_@@_cell_space_top_limit_dim { #1 } }
- }
- } ,
- cell-space-top-limit .value_required:n = true ,
- cell-space-bottom-limit .code:n =
- {
- \tl_gput_right:Nn \g_@@_row_style_tl
- {
- \tl_gput_right:Nn \g_@@_post_action_cell_tl
- { \dim_set:Nn \l_@@_cell_space_bottom_limit_dim { #1 } }
- }
- } ,
- cell-space-bottom-limit .value_required:n = true ,
- cell-space-limits .meta:n =
- {
- cell-space-top-limit = #1 ,
- cell-space-bottom-limit = #1 ,
- } ,
- color .code:n =
- {
- \leavevmode \color { #1 }
- \tl_gput_right:Nn \g_@@_row_style_tl
- { \leavevmode \color { #1 } }
- } ,
- color .value_required:n = true ,
- unknown .code:n = \@@_error:n { Unknown~key~for~RowStyle }
- }
-% \end{macrocode}
-%
-% \bigskip
-% \begin{macrocode}
-\NewDocumentCommand \@@_RowStyle:n { O { } m }
- {
- \tl_gset:Nn \g_@@_row_style_tl { #2 }
- \keys_set:nn { NiceMatrix / RowStyle } { #1 }
- #2
- \ignorespaces
- }
-% \end{macrocode}
%
% \bigskip
% \subsection*{The \textbackslash CodeBefore}
@@ -8398,7 +8553,7 @@ version 2005/12/01 or later.
\int_set_eq:NN \g_@@_row_total_int { \seq_item:Nn \c_@@_size_seq 3 }
\int_set_eq:NN \g_@@_col_total_int { \seq_item:Nn \c_@@_size_seq 6 }
% \end{macrocode}
-%
+%
%
% 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
@@ -8441,6 +8596,12 @@ version 2005/12/01 or later.
\endpgfpicture
% \end{macrocode}
%
+% \medskip
+% Now, the recreation of the nodes of the blocks \emph{which have a name}.
+% \begin{macrocode}
+ \@@_create_blocks_nodes:
+% \end{macrocode}
+%
% \begin{macrocode}
\bool_if:NT \c_@@_tikz_loaded_bool
{
@@ -8472,7 +8633,7 @@ version 2005/12/01 or later.
\group_begin:
% \end{macrocode}
%
-% We compose the |code-before| in math mode in order to nullify the spaces put
+% We compose the |\CodeBefore| in math mode in order to nullify the spaces put
% by the user between instructions in the |code-before|.
% \begin{macrocode}
\bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token
@@ -8572,10 +8733,66 @@ version 2005/12/01 or later.
}
}
}
+ \int_step_inline:nn \c@iRow
+ {
+ \pgfnodealias
+ { \@@_env: - ##1 - last }
+ { \@@_env: - ##1 - \int_use:N \c@jCol }
+ }
+ \int_step_inline:nn \c@jCol
+ {
+ \pgfnodealias
+ { \@@_env: - last - ##1 }
+ { \@@_env: - \int_use:N \c@iRow - ##1 }
+ }
\@@_create_extra_nodes:
}
% \end{macrocode}
%
+% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_create_blocks_nodes:
+ {
+ \pgfpicture
+ \pgf@relevantforpicturesizefalse
+ \pgfrememberpicturepositiononpagetrue
+ \seq_map_inline:Nn \g_@@_pos_of_blocks_seq
+ { \@@_create_one_block_node:nnnnn ##1 }
+ \endpgfpicture
+ }
+% \end{macrocode}
+%
+% The following command is called |\@@_create_one_block_node:nnnnn| but, in
+% fact, it creates a node only if the last argument (|#5|) which is the name of
+% the block, is not empty.\footnote{Moreover, there is also in the list
+% |\g_@@_pos_of_blocks_seq| the positions of the dotted lines (created by
+% |\Cdots|, etc.) and, for these entries, there is, of course, no name (the
+% fifth component is empty).}
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_create_one_block_node:nnnnn #1 #2 #3 #4 #5
+ {
+ \tl_if_empty:nF { #5 }
+ {
+ \@@_qpoint:n { col - #2 }
+ \dim_set_eq:NN \l_tmpa_dim \pgf@x
+ \@@_qpoint:n { #1 }
+ \dim_set_eq:NN \l_tmpb_dim \pgf@y
+ \@@_qpoint:n { col - \@@_succ:n { #4 } }
+ \dim_set_eq:NN \l_tmpc_dim \pgf@x
+ \@@_qpoint:n { \@@_succ:n { #3 } }
+ \dim_set_eq:NN \l_tmpd_dim \pgf@y
+ \@@_pgf_rect_node:nnnnn
+ { \@@_env: - #5 }
+ { \dim_use:N \l_tmpa_dim }
+ { \dim_use:N \l_tmpb_dim }
+ { \dim_use:N \l_tmpc_dim }
+ { \dim_use:N \l_tmpd_dim }
+ }
+ }
+% \end{macrocode}
+%
+%
+% \bigskip
% \begin{macrocode}
\cs_new_protected:Npn \@@_patch_for_revtex:
{
@@ -8602,7 +8819,7 @@ version 2005/12/01 or later.
\NewDocumentEnvironment { NiceArrayWithDelims }
{ m m O { } m ! O { } t \CodeBefore }
{
- \bool_if:NT \c_@@_revtex_bool \@@_patch_for_revtex:
+ \bool_if:NT \c_@@_revtex_bool \@@_patch_for_revtex:
% \end{macrocode}
%
% \begin{macrocode}
@@ -9055,19 +9272,26 @@ version 2005/12/01 or later.
\@@_newcolumntype W [ 2 ] { \@@_W: { ##1 } { ##2 } }
% \end{macrocode}
%
+% \bigskip
+% If the package \pkg{varwidth} has defined the column type |V|, we protect from
+% expansion by redefining it to |\@@_V:| (which will be catched by our system).
+% \begin{macrocode}
+ \cs_if_exist:NT \NC@find@V { \@@_newcolumntype V { \@@_V: } }
+% \end{macrocode}
+%
% First, we have to store our preamble in the token register |\@temptokena|
% (those ``token registers'' are \emph{not} supported by the L3 programming layer).
% \begin{macrocode}
- \exp_args:NV \@temptokena \g_@@_preamble_tl
+ \exp_args:NV \@temptokena \g_@@_preamble_tl
% \end{macrocode}
% Initialisation of a flag used by \pkg{array} to detect the end of the expansion.
% \begin{macrocode}
- \@tempswatrue
+ \@tempswatrue
% \end{macrocode}
% The following line actually does the expansion (it's has been copied from
% |array.sty|). The expanded version is still in |\@temptokena|.
% \begin{macrocode}
- \@whilesw \if@tempswa \fi { \@tempswafalse \the \NC@list }
+ \@whilesw \if@tempswa \fi { \@tempswafalse \the \NC@list }
% \end{macrocode}
%
%
@@ -9080,24 +9304,24 @@ version 2005/12/01 or later.
% |\@@_patch_preamble:n|. In the same time, we will count the columns with the
% counter |\c@jCol|.
% \begin{macrocode}
- \int_gzero:N \c@jCol
- \tl_gclear:N \g_@@_preamble_tl
+ \int_gzero:N \c@jCol
+ \tl_gclear:N \g_@@_preamble_tl
% \end{macrocode}
% |\g_tmpb_bool| will be raised if you have a \verb+|+ at the end of the preamble.
% \begin{macrocode}
- \bool_gset_false:N \g_tmpb_bool
- \tl_if_eq:NnTF \l_@@_vlines_clist { all }
- {
- \tl_gset:Nn \g_@@_preamble_tl
- { ! { \skip_horizontal:N \arrayrulewidth } }
- }
- {
- \clist_if_in:NnT \l_@@_vlines_clist 1
- {
- \tl_gset:Nn \g_@@_preamble_tl
- { ! { \skip_horizontal:N \arrayrulewidth } }
- }
- }
+ \bool_gset_false:N \g_tmpb_bool
+ \tl_if_eq:NnTF \l_@@_vlines_clist { all }
+ {
+ \tl_gset:Nn \g_@@_preamble_tl
+ { ! { \skip_horizontal:N \arrayrulewidth } }
+ }
+ {
+ \clist_if_in:NnT \l_@@_vlines_clist 1
+ {
+ \tl_gset:Nn \g_@@_preamble_tl
+ { ! { \skip_horizontal:N \arrayrulewidth } }
+ }
+ }
% \end{macrocode}
% The sequence |\g_@@_cols_vlsim_seq| will contain the numbers of the columns
% where you will to have to draw vertical lines in the potential sub-matrices
@@ -9209,27 +9433,29 @@ version 2005/12/01 or later.
p { \@@_patch_preamble_iv:n #1 }
b { \@@_patch_preamble_iv:n #1 }
m { \@@_patch_preamble_iv:n #1 }
- \@@_w: { \@@_patch_preamble_v:nnnn { } #1 }
- \@@_W: { \@@_patch_preamble_v:nnnn { \cs_set_eq:NN \hss \hfil } #1 }
- \@@_S: { \@@_patch_preamble_vi:n }
- ( { \@@_patch_preamble_vii:nn #1 }
- [ { \@@_patch_preamble_vii:nn #1 }
- \{ { \@@_patch_preamble_vii:nn #1 }
- ) { \@@_patch_preamble_viii:nn #1 }
- ] { \@@_patch_preamble_viii:nn #1 }
- \} { \@@_patch_preamble_viii:nn #1 }
- X { \@@_patch_preamble_ix:n }
+ \@@_V: { \@@_patch_preamble_v:n }
+ V { \@@_patch_preamble_v:n }
+ \@@_w: { \@@_patch_preamble_vi:nnnn { } #1 }
+ \@@_W: { \@@_patch_preamble_vi:nnnn { \cs_set_eq:NN \hss \hfil } #1 }
+ \@@_S: { \@@_patch_preamble_vii:n }
+ ( { \@@_patch_preamble_viii:nn #1 }
+ [ { \@@_patch_preamble_viii:nn #1 }
+ \{ { \@@_patch_preamble_viii:nn #1 }
+ ) { \@@_patch_preamble_ix:nn #1 }
+ ] { \@@_patch_preamble_ix:nn #1 }
+ \} { \@@_patch_preamble_ix:nn #1 }
+ X { \@@_patch_preamble_x:n }
% \end{macrocode}
% When \pkg{tabularx} is loaded, a local redefinition of the specifier `X` is
% done to replace `X` by `\@@_X`. Thus, our column type `X` will be used in the
% `{NiceTabularX}`.
% \begin{macrocode}
- \@@_X { \@@_patch_preamble_ix:n }
+ \@@_X { \@@_patch_preamble_x:n }
\q_stop { }
}
{
\str_if_eq:VnTF \l_@@_letter_for_dotted_lines_str { #1 }
- { \@@_patch_preamble_xi:n #1 }
+ { \@@_patch_preamble_xii:n #1 }
{
\str_if_eq:VnTF \l_@@_letter_vlism_tl { #1 }
{
@@ -9270,7 +9496,7 @@ version 2005/12/01 or later.
% We increment the counter of columns and then we test for the presence of a |<|.
% \begin{macrocode}
\int_gincr:N \c@jCol
- \@@_patch_preamble_x:n
+ \@@_patch_preamble_xi:n
}
% \end{macrocode}
%
@@ -9404,18 +9630,19 @@ version 2005/12/01 or later.
% \begin{macrocode}
\str_set:Nn \l_@@_hpos_col_str { j }
\keys_set:nn { WithArrows / p-column } { #1 }
- \@@_patch_preamble_iv_iv:n { #2 }
+ \@@_patch_preamble_iv_iv:nn { #2 } { minipage }
}
% \end{macrocode}
%
% \medskip
-% The argument is the width of the column.
+% The first argument is the width of the column. The second is the type of
+% environment: |minipage| or |varwidth|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_iv_iv:n #1
+\cs_new_protected:Npn \@@_patch_preamble_iv_iv:nn #1 #2
{
\use:x
{
- \@@_patch_preamble_iv_v:nnnnnn
+ \@@_patch_preamble_iv_v:nnnnnnn
{ \str_if_eq:VnTF \l_@@_vpos_col_str { p } { t } { b } }
{ \dim_eval:n { #1 } }
{
@@ -9441,13 +9668,14 @@ version 2005/12/01 or later.
{ \str_if_eq:VnT \l_@@_vpos_col_str { m } \@@_center_cell_box: }
{ \str_if_eq:VnT \l_@@_hpos_col_str { si } \siunitx_cell_begin:w }
{ \str_if_eq:VnT \l_@@_hpos_col_str { si } \siunitx_cell_end: }
+ { #2 }
}
% \end{macrocode}
%
% We increment the counter of columns, and then we test for the presence of a |<|.
% \begin{macrocode}
\int_gincr:N \c@jCol
- \@@_patch_preamble_x:n
+ \@@_patch_preamble_xi:n
}
% \end{macrocode}
%
@@ -9460,16 +9688,20 @@ version 2005/12/01 or later.
% column.
%
% |#3| is the coding for the horizontal position of the content of the cell
-% (|\centering|, |\raggedright|, |\raggedleft| or nothing).
+% (|\centering|, |\raggedright|, |\raggedleft| or nothing). It's also possible
+% to put in that |#3| some code to fix the value of |\l_@@_hpos_cell_str| which
+% will be available in each cell of the column.
%
-% |#4| is an extra-code which contains |\l_@@_center_cell_box| (when the column
+% |#4| is an extra-code which contains |\@@_center_cell_box:| (when the column
% is a |m| column) or nothing (in the other cases).
%
% |#5| is a code put just before the |c|.
%
% |#6| is a code put just after the |c|.
+%
+% |#7| is the type of environment: |minipage| or |varwidth|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_iv_v:nnnnnn #1 #2 #3 #4 #5 #6
+\cs_new_protected:Npn \@@_patch_preamble_iv_v:nnnnnnn #1 #2 #3 #4 #5 #6 #7
{
\tl_gput_right:Nn \g_@@_preamble_tl
{
@@ -9481,7 +9713,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\dim_set:Nn \l_@@_col_width_dim { #2 }
\@@_cell_begin:w
- \begin { minipage } [ #1 ] { #2 }
+ \begin { #7 } [ #1 ] { #2 }
% \end{macrocode}
% The following lines have been taken from |array.sty|.
% \begin{macrocode}
@@ -9509,7 +9741,8 @@ version 2005/12/01 or later.
% The following line has been taken from |array.sty|.
% \begin{macrocode}
\@finalstrut \@arstrutbox
- \end { minipage }
+ % \bool_if:NT \g_@@_rotate_bool { \raggedright \hsize = 3 cm }
+ \end { #7 }
% \end{macrocode}
% If the letter in the preamble is |m|, |#3| will be equal to
% |\@@_center_cell_box:| (see just below).
@@ -9549,18 +9782,42 @@ version 2005/12/01 or later.
( \box_ht:N \l_@@_cell_box - \box_ht:N \@arstrutbox
+ \baselineskip ) / 2
}
- { \box_use:N \l_@@_cell_box }
+ { \box_use:N \l_@@_cell_box }
}
}
}
}
% \end{macrocode}
%
+% \medskip
+% For |V| (similar to the |V| of \pkg{varwidth}).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_preamble_v:n #1
+ {
+ \str_if_eq:nnTF { #1 } { [ }
+ { \@@_patch_preamble_v_i:w [ }
+ { \@@_patch_preamble_v_i:w [ ] { #1 } }
+ }
+\cs_new_protected:Npn \@@_patch_preamble_v_i:w [ #1 ]
+ { \@@_patch_preamble_v_ii:nn { #1 } }
+\cs_new_protected:Npn \@@_patch_preamble_v_ii:nn #1 #2
+ {
+ \str_set:Nn \l_@@_vpos_col_str { p }
+ \str_set:Nn \l_@@_hpos_col_str { j }
+ \keys_set:nn { WithArrows / p-column } { #1 }
+ \bool_if:NTF \c_@@_varwidth_loaded_bool
+ { \@@_patch_preamble_iv_iv:nn { #2 } { varwidth } }
+ {
+ \@@_error:n { varwidth~not~loaded }
+ \@@_patch_preamble_iv_iv:nn { #2 } { minipage }
+ }
+ }
+% \end{macrocode}
%
% \medskip
% For |w| and |W|
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_v:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_patch_preamble_vi:nnnn #1 #2 #3 #4
{
\tl_gput_right:Nn \g_@@_preamble_tl
{
@@ -9589,7 +9846,7 @@ version 2005/12/01 or later.
% We increment the counter of columns and then we test for the presence of a |<|.
% \begin{macrocode}
\int_gincr:N \c@jCol
- \@@_patch_preamble_x:n
+ \@@_patch_preamble_xi:n
}
% \end{macrocode}
%
@@ -9598,17 +9855,17 @@ version 2005/12/01 or later.
% during the first expansion of the preamble (done with the tools of standard
% LaTeX and \pkg{array}).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_vi:n #1
+\cs_new_protected:Npn \@@_patch_preamble_vii:n #1
{
\str_if_eq:nnTF { #1 } { [ }
- { \@@_patch_preamble_vi_i:w [ }
- { \@@_patch_preamble_vi_i:w [ ] { #1 } }
+ { \@@_patch_preamble_vii_i:w [ }
+ { \@@_patch_preamble_vii_i:w [ ] { #1 } }
}
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_vi_i:w [ #1 ]
- { \@@_patch_preamble_vi_ii:n { #1 } }
+\cs_new_protected:Npn \@@_patch_preamble_vii_i:w [ #1 ]
+ { \@@_patch_preamble_vii_ii:n { #1 } }
% \end{macrocode}
%
% For version of \pkg{siunitx} at least equal to 3.0, the adaptation is different
@@ -9621,7 +9878,7 @@ version 2005/12/01 or later.
{
\cs_if_exist:NTF \siunitx_cell_begin:w
{
- \cs_new_protected:Npn \@@_patch_preamble_vi_ii:n #1
+ \cs_new_protected:Npn \@@_patch_preamble_vii_ii:n #1
{
\tl_gput_right:Nn \g_@@_preamble_tl
{
@@ -9637,11 +9894,11 @@ version 2005/12/01 or later.
% We increment the counter of columns and then we test for the presence of a |<|.
% \begin{macrocode}
\int_gincr:N \c@jCol
- \@@_patch_preamble_x:n
+ \@@_patch_preamble_xi:n
}
}
{
- \cs_new_protected:Npn \@@_patch_preamble_vi_ii:n #1
+ \cs_new_protected:Npn \@@_patch_preamble_vii_ii:n #1
{
\tl_gput_right:Nn \g_@@_preamble_tl
{
@@ -9650,7 +9907,7 @@ version 2005/12/01 or later.
< { \c_@@_table_print_tl \@@_cell_end: }
}
\int_gincr:N \c@jCol
- \@@_patch_preamble_x:n
+ \@@_patch_preamble_xi:n
}
}
}
@@ -9660,7 +9917,7 @@ version 2005/12/01 or later.
% \medskip
% For |(|, |[| and |\{|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_vii:nn #1 #2
+\cs_new_protected:Npn \@@_patch_preamble_viii:nn #1 #2
{
\bool_if:NT \l_@@_small_bool { \@@_fatal:n { Delimiter~with~small } }
% \end{macrocode}
@@ -9681,15 +9938,15 @@ version 2005/12/01 or later.
}
{
\tl_gput_right:Nn \g_@@_preamble_tl { ! { \enskip } }
- \@@_patch_preamble_vii_i:nn { #1 } { #2 }
+ \@@_patch_preamble_viii_i:nn { #1 } { #2 }
}
}
- { \@@_patch_preamble_vii_i:nn { #1 } { #2 } }
+ { \@@_patch_preamble_viii_i:nn { #1 } { #2 } }
}
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_vii_i:nn #1 #2
+\cs_new_protected:Npn \@@_patch_preamble_viii_i:nn #1 #2
{
\tl_gput_right:Nx \g_@@_internal_code_after_tl
{ \@@_delimiter:nnn #1 { \@@_succ:n \c@jCol } \c_true_bool }
@@ -9710,11 +9967,11 @@ version 2005/12/01 or later.
% considered as the right delimiter of the environment if the environment is
% |{NiceArray}|).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_viii:nn #1 #2
+\cs_new_protected:Npn \@@_patch_preamble_ix:nn #1 #2
{
\bool_if:NT \l_@@_small_bool { \@@_fatal:n { Delimiter~with~small } }
\tl_if_in:nnTF { ) ] \} } { #2 }
- { \@@_patch_preamble_viii_i:nnn #1 #2 }
+ { \@@_patch_preamble_ix_i:nnn #1 #2 }
{
\tl_if_eq:nnTF { \q_stop } { #2 }
{
@@ -9739,7 +9996,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_viii_i:nnn #1 #2 #3
+\cs_new_protected:Npn \@@_patch_preamble_ix_i:nnn #1 #2 #3
{
\tl_if_eq:nnTF { \q_stop } { #3 }
{
@@ -9771,17 +10028,17 @@ version 2005/12/01 or later.
% (between square brackets). That's why we test whether there is a |[| after the
% letter |X|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_ix:n #1
+\cs_new_protected:Npn \@@_patch_preamble_x:n #1
{
\str_if_eq:nnTF { #1 } { [ }
- { \@@_patch_preamble_ix_i:w [ }
- { \@@_patch_preamble_ix_i:w [ ] #1 }
+ { \@@_patch_preamble_x_i:w [ }
+ { \@@_patch_preamble_x_i:w [ ] #1 }
}
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_ix_i:w [ #1 ]
- { \@@_patch_preamble_ix_ii:n { #1 } }
+\cs_new_protected:Npn \@@_patch_preamble_x_i:w [ #1 ]
+ { \@@_patch_preamble_x_ii:n { #1 } }
% \end{macrocode}
% |#1| is the optional argument of the |X| specifier (a list of
% \emph{key}-\emph{value} pairs).
@@ -9800,7 +10057,7 @@ version 2005/12/01 or later.
% \medskip
% In the following command, |#1| is the list of the options of the specifier |X|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_ix_ii:n #1
+\cs_new_protected:Npn \@@_patch_preamble_x_ii:n #1
{
% \end{macrocode}
% The possible values of |\l_@@_hpos_col_str| are |j| (for \emph{justified} which is
@@ -9826,6 +10083,12 @@ version 2005/12/01 or later.
\int_set:Nn \l_@@_weight_int { 1 }
\keys_set_known:nnN { WithArrows / p-column } { #1 } \l_tmpa_tl
\keys_set:nV { WithArrows / X-column } \l_tmpa_tl
+ \int_compare:nNnT \l_@@_weight_int < 0
+ {
+ \exp_args:Nnx \@@_error:nn { negative~weight }
+ { \int_use:N \l_@@_weight_int }
+ \int_set:Nn \l_@@_weight_int { - \l_@@_weight_int }
+ }
\int_gadd:Nn \g_@@_total_X_weight_int \l_@@_weight_int
% \end{macrocode}
%
@@ -9834,7 +10097,11 @@ version 2005/12/01 or later.
% written in the |aux| file).
% \begin{macrocode}
\bool_if:NTF \l_@@_X_columns_aux_bool
- { \@@_patch_preamble_iv_iv:n { \l_@@_weight_int \l_@@_X_columns_dim } }
+ {
+ \@@_patch_preamble_iv_iv:nn
+ { \l_@@_weight_int \l_@@_X_columns_dim }
+ { minipage }
+ }
{
\tl_gput_right:Nn \g_@@_preamble_tl
{
@@ -9859,14 +10126,14 @@ version 2005/12/01 or later.
}
}
\int_gincr:N \c@jCol
- \@@_patch_preamble_x:n
+ \@@_patch_preamble_xi:n
}
}
% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_xi:n #1
+\cs_new_protected:Npn \@@_patch_preamble_xii:n #1
{
\tl_gput_right:Nn \g_@@_preamble_tl
{ ! { \skip_horizontal:N 2\l_@@_radius_dim } }
@@ -9885,10 +10152,10 @@ version 2005/12/01 or later.
% |<{..}| because, after those potential |<{...}|, we have to insert
% |!{\skip_horizontal:N ...}| when the key |vlines| is used.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_x:n #1
+\cs_new_protected:Npn \@@_patch_preamble_xi:n #1
{
\str_if_eq:nnTF { #1 } { < }
- \@@_patch_preamble_xii:n
+ \@@_patch_preamble_xiii:n
{
\tl_if_eq:NnTF \l_@@_vlines_clist { all }
{
@@ -9909,10 +10176,10 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_xii:n #1
+\cs_new_protected:Npn \@@_patch_preamble_xiii:n #1
{
\tl_gput_right:Nn \g_@@_preamble_tl { < { #1 } }
- \@@_patch_preamble_x:n
+ \@@_patch_preamble_xi:n
}
% \end{macrocode}
%
@@ -9977,6 +10244,7 @@ version 2005/12/01 or later.
{ \int_eval:n { \c@jCol + 1 } }
{ \int_use:N \c@iRow }
{ \int_eval:n { \c@jCol + #1 } }
+ { } % for the name of the block
}
}
% \end{macrocode}
@@ -10021,7 +10289,6 @@ version 2005/12/01 or later.
b { \@@_patch_m_preamble_iv:nnn b #1 }
\@@_w: { \@@_patch_m_preamble_v:nnnn { } #1 }
\@@_W: { \@@_patch_m_preamble_v:nnnn { \cs_set_eq:NN \hss \hfil } #1 }
- \@@_true_c: { \@@_patch_m_preamble_vi:n #1 }
\q_stop { }
}
{ \@@_fatal:nn { unknown~column~type } { #1 } }
@@ -10125,20 +10392,6 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-% \medskip
-% For |\@@_true_c:| which will appear in our redefinition of the columns of type
-% |S| (of \pkg{siunitx}).
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_m_preamble_vi:n #1
- {
- \tl_gput_right:Nn \g_@@_preamble_tl { c }
-% \end{macrocode}
-% We test for the presence of a |<|.
-% \begin{macrocode}
- \@@_patch_m_preamble_x:n
- }
-% \end{macrocode}
-%
%
% After a specifier of column, we have to test whether there is one or several
% |<{..}| because, after those potential |<{...}|, we have to insert
@@ -10280,9 +10533,9 @@ version 2005/12/01 or later.
% The |\hbox| avoids that the |pgfpicture| inside |\@@_draw_blocks| adds a extra
% vertical space before the notes.
% \begin{macrocode}
- \hbox:n
- {
- \box_use_drop:N \l_@@_the_array_box
+ \hbox
+ {
+ \box_use_drop:N \l_@@_the_array_box
% \end{macrocode}
% We have to draw the blocks right now because there may be tabular notes in
% some blocks (which are not mono-column: the blocks which are mono-column
@@ -10290,9 +10543,9 @@ version 2005/12/01 or later.
% extra nodes before creating the blocks since there are |medium| nodes to create
% for the blocks.
% \begin{macrocode}
- \@@_create_extra_nodes:
- \seq_if_empty:NF \g_@@_blocks_seq \@@_draw_blocks:
- }
+ \@@_create_extra_nodes:
+ \seq_if_empty:NF \g_@@_blocks_seq \@@_draw_blocks:
+ }
\bool_lazy_or:nnT
{ \int_compare_p:nNn \c@tabularnote > 0 }
{ ! \tl_if_empty_p:V \l_@@_tabularnote_tl }
@@ -10834,12 +11087,12 @@ version 2005/12/01 or later.
\pgfcoordinate { \@@_env: - col - \@@_succ:n \g_tmpa_int }
{
\bool_lazy_and:nnTF \l_@@_Matrix_bool \l_@@_NiceArray_bool
- {
- \pgfpoint
- { - 0.5 \arrayrulewidth - \arraycolsep }
- \c_zero_dim
- }
- { \pgfpoint { - 0.5 \arrayrulewidth } \c_zero_dim }
+ {
+ \pgfpoint
+ { - 0.5 \arrayrulewidth - \arraycolsep }
+ \c_zero_dim
+ }
+ { \pgfpoint { - 0.5 \arrayrulewidth } \c_zero_dim }
}
\str_if_empty:NF \l_@@_name_str
{
@@ -10890,10 +11143,10 @@ version 2005/12/01 or later.
{
% \end{macrocode}
% At the beginning of the cell, we link |\CodeAfter| to a command which do
-% \emph{not} begin with |\omit| (whereas the standard version of |\CodeAfter|
-% begins with |\omit|).
+% begins with |\\| (whereas the standard version of |\CodeAfter| begins does
+% not).
% \begin{macrocode}
- \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i:n
+ \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i:
\bool_gset_true:N \g_@@_after_col_zero_bool
\@@_begin_of_row:
% \end{macrocode}
@@ -10966,10 +11219,10 @@ version 2005/12/01 or later.
{
% \end{macrocode}
% At the beginning of the cell, we link |\CodeAfter| to a command which do
-% \emph{not} begin with |\omit| (whereas the standard version of |\CodeAfter|
-% begins with |\omit|).
+% begins with |\\| (whereas the standard version of |\CodeAfter| begins does
+% not).
% \begin{macrocode}
- \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i:n
+ \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i:
% \end{macrocode}
% With the flag |\g_@@_last_col_found_bool|, we will know that the ``last
% column'' is really used.
@@ -11132,12 +11385,11 @@ version 2005/12/01 or later.
\NewDocumentEnvironment { NiceTabular } { O { } m ! O { } }
{
% \end{macrocode}
-% The dimension |\l_@@_width_dim| will be used if at least one column of type
-% |X| is used.
-%
+% If the dimension |\l_@@_width_dim| is equal to $0$~pt, that means that it has
+% not be set by a previous use of |\NiceMatrixOptions|.
% \begin{macrocode}
- \dim_zero_new:N \l_@@_width_dim
- \dim_set_eq:NN \l_@@_width_dim \linewidth
+ \dim_compare:nNnT \l_@@_width_dim = \c_zero_dim
+ { \dim_set_eq:NN \l_@@_width_dim \linewidth }
\str_gset:Nn \g_@@_name_env_str { NiceTabular }
\keys_set:nn { NiceMatrix / NiceTabular } { #1 , #3 }
\bool_set_true:N \l_@@_NiceTabular_bool
@@ -11245,8 +11497,9 @@ version 2005/12/01 or later.
}
}
% \end{macrocode}
-% We write also the potential content of |\g_@@_pos_of_blocks_seq| (it will be
-% useful if the command |\rowcolors| is used with the key |respect-blocks|).
+% We write also the potential content of |\g_@@_pos_of_blocks_seq|. It will be
+% used to recreate the blocks with a name in the |\CodeBefore| and also if the
+% command |\rowcolors| is used with the key |respect-blocks|).
% \begin{macrocode}
\seq_if_empty:NF \g_@@_pos_of_blocks_seq
{
@@ -11274,6 +11527,41 @@ version 2005/12/01 or later.
% \begin{macrocode}
\@@_create_diag_nodes:
% \end{macrocode}
+%
+% \medskip
+% We create the aliases using |last| for the nodes of the cells in the last row
+% and the last column.
+% \begin{macrocode}
+ \pgfpicture
+ \int_step_inline:nn \c@iRow
+ {
+ \pgfnodealias
+ { \@@_env: - ##1 - last }
+ { \@@_env: - ##1 - \int_use:N \c@jCol }
+ }
+ \int_step_inline:nn \c@jCol
+ {
+ \pgfnodealias
+ { \@@_env: - last - ##1 }
+ { \@@_env: - \int_use:N \c@iRow - ##1 }
+ }
+ \str_if_empty:NF \l_@@_name_str
+ {
+ \int_step_inline:nn \c@iRow
+ {
+ \pgfnodealias
+ { \l_@@_name_str - ##1 - last }
+ { \@@_env: - ##1 - \int_use:N \c@jCol }
+ }
+ \int_step_inline:nn \c@jCol
+ {
+ \pgfnodealias
+ { \l_@@_name_str - last - ##1 }
+ { \@@_env: - \int_use:N \c@iRow - ##1 }
+ }
+ }
+ \endpgfpicture
+% \end{macrocode}
%
% By default, the diagonal lines will be parallelized\footnote{It's possible to
% use the option |parallelize-diags| to disable this parallelization.}. There
@@ -11435,11 +11723,6 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-%
-% \begin{macrocode}
- % \bool_if:NT \l_@@_code_before_bool \@@_write_aux_for_cell_nodes:
-% \end{macrocode}
-%
% \medskip
% \begin{macrocode}
\str_gclear:N \g_@@_name_env_str
@@ -11483,13 +11766,13 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_adjust_pos_of_blocks_seq:
{
\seq_gset_map_x:NNn \g_@@_pos_of_blocks_seq \g_@@_pos_of_blocks_seq
- { \@@_adjust_pos_of_blocks_seq_i:nnnn ##1 }
+ { \@@_adjust_pos_of_blocks_seq_i:nnnnn ##1 }
}
% \end{macrocode}
%
% The following command must \emph{not} be protected.
% \begin{macrocode}
-\cs_new:Npn \@@_adjust_pos_of_blocks_seq_i:nnnn #1 #2 #3 #4
+\cs_new:Npn \@@_adjust_pos_of_blocks_seq_i:nnnnn #1 #2 #3 #4 #5
{
{ #1 }
{ #2 }
@@ -11503,6 +11786,7 @@ version 2005/12/01 or later.
{ \int_use:N \c@jCol }
{ #4 }
}
+ { #5 }
}
% \end{macrocode}
%
@@ -11566,52 +11850,6 @@ version 2005/12/01 or later.
% \end{macrocode}
%
%
-% \bigskip
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_write_aux_for_cell_nodes:
- {
- \pgfpicture
- \pgfrememberpicturepositiononpagetrue
- \pgf@relevantforpicturesizefalse
- \int_step_inline:nnn \l_@@_first_row_int \g_@@_row_total_int
- {
- \int_step_inline:nnn \l_@@_first_col_int \g_@@_col_total_int
- {
- \cs_if_exist:cT { pgf @ sh @ ns @ \@@_env: - ##1 - ####1 }
- {
- \pgfscope
- \pgftransformshift
- { \pgfpointanchor { \@@_env: - ##1 - ####1 } { north~west } }
- \pgfnode
- { rectangle }
- { center }
- {
- \hbox
- { \pgfsys@markposition { \@@_env: - ##1 - ####1 - NW } }
- }
- { }
- { }
- \endpgfscope
- \pgfscope
- \pgftransformshift
- { \pgfpointanchor { \@@_env: - ##1 - ####1 } { south~east } }
- \pgfnode
- { rectangle }
- { center }
- {
- \hbox
- { \pgfsys@markposition { \@@_env: - ##1 - ####1 - SE } }
- }
- { }
- { }
- \endpgfscope
- }
- }
- }
- \endpgfpicture
- \@@_create_extra_nodes:
- }
-% \end{macrocode}
%
% \bigskip
% The following command creates the diagonal nodes (in fact, if the matrix is
@@ -11908,6 +12146,7 @@ version 2005/12/01 or later.
{ \int_min:nn \l_@@_initial_j_int \l_@@_final_j_int }
{ \int_use:N \l_@@_final_i_int }
{ \int_max:nn \l_@@_initial_j_int \l_@@_final_j_int }
+ { } % for the name of the block
}
}
% \end{macrocode}
@@ -12415,15 +12654,11 @@ version 2005/12/01 or later.
\bool_if:NTF \l_@@_initial_open_bool
{
\@@_open_y_initial_dim:
- % \@@_qpoint:n { col - \int_use:N \l_@@_initial_j_int }
- % \dim_set_eq:NN \l_@@_x_initial_dim \pgf@x
\@@_open_x_initial_dim:
}
{ \@@_set_initial_coords_from_anchor:n { south~east } }
\bool_if:NTF \l_@@_final_open_bool
{
- % \@@_open_y_final_dim:
- % \@@_qpoint:n { col - \@@_succ:n \l_@@_final_j_int }
\@@_open_x_final_dim:
\dim_set_eq:NN \l_@@_x_final_dim \pgf@x
}
@@ -12849,8 +13084,8 @@ version 2005/12/01 or later.
\int_compare:nNnTF \c@jCol = \l_@@_last_col_int
{ \@@_error:nn { in~last~col } \Ldots }
{
- \@@_instruction_of_type:nnn \c_false_bool { Ldots }
- { #1 , down = #2 , up = #3 }
+ \@@_instruction_of_type:nnn \c_false_bool { Ldots }
+ { #1 , down = #2 , up = #3 }
}
}
\bool_if:NF \l_@@_nullify_dots_bool
@@ -12869,8 +13104,8 @@ version 2005/12/01 or later.
\int_compare:nNnTF \c@jCol = \l_@@_last_col_int
{ \@@_error:nn { in~last~col } \Cdots }
{
- \@@_instruction_of_type:nnn \c_false_bool { Cdots }
- { #1 , down = #2 , up = #3 }
+ \@@_instruction_of_type:nnn \c_false_bool { Cdots }
+ { #1 , down = #2 , up = #3 }
}
}
\bool_if:NF \l_@@_nullify_dots_bool
@@ -12889,8 +13124,8 @@ version 2005/12/01 or later.
\int_compare:nNnTF \c@iRow = \l_@@_last_row_int
{ \@@_error:nn { in~last~row } \Vdots }
{
- \@@_instruction_of_type:nnn \c_false_bool { Vdots }
- { #1 , down = #2 , up = #3 }
+ \@@_instruction_of_type:nnn \c_false_bool { Vdots }
+ { #1 , down = #2 , up = #3 }
}
}
\bool_if:NF \l_@@_nullify_dots_bool
@@ -13340,6 +13575,140 @@ version 2005/12/01 or later.
% this command because they have to do other settings (for example, the diagonal
% lines must be parallelized).
%
+%
+%
+% \bigskip
+% \subsection*{The command \textbackslash RowStyle}
+%
+% \medskip
+% \begin{macrocode}
+\keys_define:nn { NiceMatrix / RowStyle }
+ {
+ cell-space-top-limit .dim_set:N = \l_tmpa_dim ,
+ cell-space-top-limit .initial:n = \c_zero_dim ,
+ cell-space-top-limit .value_required:n = true ,
+ cell-space-bottom-limit .dim_set:N = \l_tmpb_dim ,
+ cell-space-bottom-limit .initial:n = \c_zero_dim ,
+ cell-space-bottom-limit .value_required:n = true ,
+ cell-space-limits .meta:n =
+ {
+ cell-space-top-limit = #1 ,
+ cell-space-bottom-limit = #1 ,
+ } ,
+ color .tl_set:N = \l_tmpa_tl ,
+ color .value_required:n = true ,
+ bold .bool_set:N = \l_tmpa_bool ,
+ bold .default:n = true ,
+ bold .initial:n = false ,
+ nb-rows .int_set:N = \l_@@_key_nb_rows_int ,
+ nb-rows .value_required:n = true ,
+ nb-rows .initial:n = 1 ,
+ rowcolor .tl_set:N = \l_tmpc_tl ,
+ rowcolor .value_required:n = true ,
+ rowcolor .initial:n = \c_empty_tl ,
+ unknown .code:n = \@@_error:n { Unknown~key~for~RowStyle }
+ }
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\NewDocumentCommand \@@_RowStyle:n { O { } m }
+ {
+ \keys_set:nn { NiceMatrix / RowStyle } { #1 }
+% \end{macrocode}
+% If the key |rowcolor| has been used.
+% \begin{macrocode}
+ \tl_if_empty:NF \l_tmpc_tl
+ {
+% \end{macrocode}
+% First, the end of the current row (we remind that |\RowStyle| applies to the
+% \emph{end} of the current row).
+% \begin{macrocode}
+ \tl_gput_right:Nx \g_nicematrix_code_before_tl
+ {
+ \@@_rectanglecolor
+ { \l_tmpc_tl }
+ { \int_use:N \c@iRow - \int_use:N \c@jCol }
+ { \int_use:N \c@iRow - * }
+ }
+% \end{macrocode}
+% Then, the other rows (if there is several rows).
+% \begin{macrocode}
+ \int_compare:nNnT \l_@@_key_nb_rows_int > 1
+ {
+ \tl_gput_right:Nx \g_nicematrix_code_before_tl
+ {
+ \@@_rowcolor
+ { \l_tmpc_tl }
+ {
+ \int_eval:n { \c@iRow + 1 }
+ - \int_eval:n { \c@iRow + \l_@@_key_nb_rows_int - 1 }
+ }
+ }
+ }
+ }
+ \tl_gput_right:Nn \g_@@_row_style_tl { \ifnum \c@iRow < }
+ \tl_gput_right:Nx \g_@@_row_style_tl
+ { \int_eval:n { \c@iRow + \l_@@_key_nb_rows_int } }
+ \tl_gput_right:Nn \g_@@_row_style_tl { #2 }
+% \end{macrocode}
+% |\l_tmpa_dim| is the value of the key |cell-space-top-limit| of |\RowStyle|.
+% \begin{macrocode}
+ \dim_compare:nNnT \l_tmpa_dim > \c_zero_dim
+ {
+ \tl_gput_right:Nx \g_@@_row_style_tl
+ {
+ \tl_gput_right:Nn \exp_not:N \g_@@_post_action_cell_tl
+ {
+ \dim_set:Nn \l_@@_cell_space_top_limit_dim
+ { \dim_use:N \l_tmpa_dim }
+ }
+ }
+ }
+% \end{macrocode}
+% |\l_tmpb_dim| is the value of the key |cell-space-bottom-limit| of |\RowStyle|.
+% \begin{macrocode}
+ \dim_compare:nNnT \l_tmpb_dim > \c_zero_dim
+ {
+ \tl_gput_right:Nx \g_@@_row_style_tl
+ {
+ \tl_gput_right:Nn \exp_not:N \g_@@_post_action_cell_tl
+ {
+ \dim_set:Nn \l_@@_cell_space_bottom_limit_dim
+ { \dim_use:N \l_tmpb_dim }
+ }
+ }
+ }
+% \end{macrocode}
+% |\l_tmpa_tl| is the value of the key |color| of |\RowStyle|.
+% \begin{macrocode}
+ \tl_if_empty:NF \l_tmpa_tl
+ {
+ \tl_gput_right:Nx \g_@@_row_style_tl
+ { \mode_leave_vertical: \exp_not:N \color { \l_tmpa_tl } }
+ }
+% \end{macrocode}
+% |\l_tmpa_bool| is the value of the key |bold|.
+% \begin{macrocode}
+ \bool_if:NT \l_tmpa_bool
+ {
+ \tl_gput_right:Nn \g_@@_row_style_tl
+ {
+ \if_mode_math:
+ \c_math_toggle_token
+ \bfseries \boldmath
+ \c_math_toggle_token
+ \else:
+ \bfseries \boldmath
+ \fi:
+ }
+ }
+ \tl_gput_right:Nn \g_@@_row_style_tl { \fi }
+ \g_@@_row_style_tl
+ \ignorespaces
+ }
+% \end{macrocode}
+%
% \bigskip
% \subsection*{Colors of cells, rows and columns}
%
@@ -13423,13 +13792,6 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-% \begin{macrocode}
-\cs_set_protected:Npn \@@_cut_on_hyphen:w #1-#2\q_stop
- {
- \tl_set:Nn \l_tmpa_tl { #1 }
- \tl_set:Nn \l_tmpb_tl { #2 }
- }
-% \end{macrocode}
%
% \begin{macrocode}
\cs_new_protected:Npn \@@_cartesian_color:nn #1 #2
@@ -13548,7 +13910,7 @@ version 2005/12/01 or later.
% \bigskip
% \begin{macrocode}
\keys_define:nn { NiceMatrix / arraycolor }
- { except-corners .code:n = \@@_error:n { key except-corners } }
+ { except-corners .code:n = \@@_error:n { key~except-corners } }
% \end{macrocode}
%
% \bigskip
@@ -13617,7 +13979,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\seq_set_eq:NN \l_tmpb_seq \g_@@_pos_of_blocks_seq
\seq_set_filter:NNn \l_tmpa_seq \l_tmpb_seq
- { \@@_not_in_exterior_p:nnnn ##1 }
+ { \@@_not_in_exterior_p:nnnnn ##1 }
}
\pgfpicture
\pgf@relevantforpicturesizefalse
@@ -13654,8 +14016,8 @@ version 2005/12/01 or later.
\bool_if:NT \l_@@_respect_blocks_bool
{
\seq_set_filter:NNn \l_tmpb_seq \l_tmpa_seq
- { \@@_intersect_our_row_p:nnnn ####1 }
- \seq_map_inline:Nn \l_tmpb_seq { \@@_rowcolors_i:nnnn ####1 }
+ { \@@_intersect_our_row_p:nnnnn ####1 }
+ \seq_map_inline:Nn \l_tmpb_seq { \@@_rowcolors_i:nnnnn ####1 }
% \end{macrocode}
% Now, the last row of the block is computed in |\l_tmpb_int|.
% \begin{macrocode}
@@ -13714,7 +14076,7 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
-\cs_new_protected:Npn \@@_rowcolors_i:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_rowcolors_i:nnnnn #1 #2 #3 #4 #5
{
\int_compare:nNnT { #3 } > \l_tmpb_int
{ \int_set:Nn \l_tmpb_int { #3 } }
@@ -13724,7 +14086,7 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
-\prg_new_conditional:Nnn \@@_not_in_exterior:nnnn p
+\prg_new_conditional:Nnn \@@_not_in_exterior:nnnnn p
{
\bool_lazy_or:nnTF
{ \int_compare_p:nNn { #4 } = \c_zero_int }
@@ -13738,7 +14100,7 @@ version 2005/12/01 or later.
% The following command return |true| when the block intersects the row
% |\l_tmpa_int|.
% \begin{macrocode}
-\prg_new_conditional:Nnn \@@_intersect_our_row:nnnn p
+\prg_new_conditional:Nnn \@@_intersect_our_row:nnnnn p
{
\bool_if:nTF
{
@@ -13896,7 +14258,7 @@ version 2005/12/01 or later.
% |!| which may be activated by some packages (ex.: \pkg{babel} with the option
% |french| on latex and pdflatex).
% \begin{macrocode}
- \cellcolor [ #1 ] { \exp_not:n { #2 } }
+ \@@_cellcolor [ #1 ] { \exp_not:n { #2 } }
{ \int_use:N \c@iRow - \int_use:N \c@jCol }
}
}
@@ -13913,7 +14275,7 @@ version 2005/12/01 or later.
{
\tl_gput_right:Nx \g_nicematrix_code_before_tl
{
- \exp_not:N \rectanglecolor [ #1 ] { \exp_not:n { #2 } }
+ \@@_rectanglecolor [ #1 ] { \exp_not:n { #2 } }
{ \int_use:N \c@iRow - \int_use:N \c@jCol }
{ \int_use:N \c@iRow - \exp_not:n { \int_use:N \c@jCol } }
}
@@ -14054,33 +14416,33 @@ version 2005/12/01 or later.
% etc.), we will set |\g_tmpa_bool| to |false| and the small vertical rule won't
% be drawn.
% \begin{macrocode}
- \bool_gset_true:N \g_tmpa_bool
- \seq_map_inline:Nn \g_@@_pos_of_blocks_seq
- { \@@_test_vline_in_block:nnnn ##1 }
- \seq_map_inline:Nn \g_@@_pos_of_xdots_seq
- { \@@_test_vline_in_block:nnnn ##1 }
- \seq_map_inline:Nn \g_@@_pos_of_stroken_blocks_seq
- { \@@_test_vline_in_stroken_block:nnnn ##1 }
- \clist_if_empty:NF \l_@@_corners_clist \@@_test_in_corner_v:
- \bool_if:NTF \g_tmpa_bool
- {
- \tl_if_empty:NT \l_tmpc_tl
+ \bool_gset_true:N \g_tmpa_bool
+ \seq_map_inline:Nn \g_@@_pos_of_blocks_seq
+ { \@@_test_vline_in_block:nnnnn ##1 }
+ \seq_map_inline:Nn \g_@@_pos_of_xdots_seq
+ { \@@_test_vline_in_block:nnnnn ##1 }
+ \seq_map_inline:Nn \g_@@_pos_of_stroken_blocks_seq
+ { \@@_test_vline_in_stroken_block:nnnn ##1 }
+ \clist_if_empty:NF \l_@@_corners_clist \@@_test_in_corner_v:
+ \bool_if:NTF \g_tmpa_bool
+ {
+ \tl_if_empty:NT \l_tmpc_tl
% \end{macrocode}
% We keep in memory that we have a rule to draw.
% \begin{macrocode}
- { \tl_set_eq:NN \l_tmpc_tl \l_tmpa_tl }
- }
- {
- \tl_if_empty:NF \l_tmpc_tl
- {
- \@@_vline_ii:nnnn
- { #1 }
- { #2 }
- \l_tmpc_tl
- { \int_eval:n { \l_tmpa_tl - 1 } }
- \tl_clear:N \l_tmpc_tl
- }
- }
+ { \tl_set_eq:NN \l_tmpc_tl \l_tmpa_tl }
+ }
+ {
+ \tl_if_empty:NF \l_tmpc_tl
+ {
+ \@@_vline_ii:nnnn
+ { #1 }
+ { #2 }
+ \l_tmpc_tl
+ { \int_eval:n { \l_tmpa_tl - 1 } }
+ \tl_clear:N \l_tmpc_tl
+ }
+ }
}
\tl_if_empty:NF \l_tmpc_tl
{
@@ -14280,9 +14642,9 @@ version 2005/12/01 or later.
% \begin{macrocode}
\bool_gset_true:N \g_tmpa_bool
\seq_map_inline:Nn \g_@@_pos_of_blocks_seq
- { \@@_test_hline_in_block:nnnn ##1 }
+ { \@@_test_hline_in_block:nnnnn ##1 }
\seq_map_inline:Nn \g_@@_pos_of_xdots_seq
- { \@@_test_hline_in_block:nnnn ##1 }
+ { \@@_test_hline_in_block:nnnnn ##1 }
\seq_map_inline:Nn \g_@@_pos_of_stroken_blocks_seq
{ \@@_test_hline_in_stroken_block:nnnn ##1 }
\clist_if_empty:NF \l_@@_corners_clist \@@_test_in_corner_h:
@@ -14559,7 +14921,7 @@ version 2005/12/01 or later.
% |#1|, |#2|, |#3| and |#4|. If this rule would be in the block (it must not be
% drawn), the boolean |\l_tmpa_bool| is set to |false|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_test_hline_in_block:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_hline_in_block:nnnnn #1 #2 #3 #4
{
\bool_lazy_all:nT
{
@@ -14574,7 +14936,7 @@ version 2005/12/01 or later.
%
% The same for vertical rules.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_test_vline_in_block:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_vline_in_block:nnnnn #1 #2 #3 #4
{
\bool_lazy_all:nT
{
@@ -14703,8 +15065,8 @@ version 2005/12/01 or later.
\@@_test_if_cell_in_a_block:nn { ##1 } { \int_eval:n { #2 } }
\bool_lazy_or:nnTF
{
- \cs_if_exist_p:c
- { pgf @ sh @ ns @ \@@_env: - ##1 - \int_eval:n { #2 } }
+ \cs_if_exist_p:c
+ { pgf @ sh @ ns @ \@@_env: - ##1 - \int_eval:n { #2 } }
}
\l_tmpb_bool
{ \bool_set_true:N \l_tmpa_bool }
@@ -14786,7 +15148,7 @@ version 2005/12/01 or later.
%
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_test_if_cell_in_block:nnnnnnn #1 #2 #3 #4 #5 #6
+\cs_new_protected:Npn \@@_test_if_cell_in_block:nnnnnnn #1 #2 #3 #4 #5 #6 #7
{
\int_compare:nNnT { #3 } < { \@@_succ:n { #1 } }
{
@@ -15500,7 +15862,7 @@ version 2005/12/01 or later.
% If the box is rotated (the key |\rotate| may be in the previous |#4|), the
% tabular used for the content of the cell will be constructed with a format
% |c|. In the other cases, the tabular will be constructed with a format equal
-% to the key of position of the box. In other words: the alignement internal to
+% to the key of position of the box. In other words: the alignment internal to
% the tabular is the same as the external alignment of the tabular (that is to
% say the position of the block in its zone of merged cells).
% \begin{macrocode}
@@ -15603,7 +15965,7 @@ version 2005/12/01 or later.
% In the list of options |#3|, maybe there is a key for the horizontal alignment
% (|l|, |r| or |c|). In that case, that key has been read and stored in
% |\l_@@_hpos_block_str|. However, maybe there were no key of the horizontal
-% alignement and that's why we put a key corresponding to the value of
+% alignment and that's why we put a key corresponding to the value of
% |\l_@@_hpos_block_str|, which is fixed by the type of current column.
% \begin{macrocode}
{ \exp_not:n { #3 } , \l_@@_hpos_block_str }
@@ -15640,7 +16002,7 @@ version 2005/12/01 or later.
% If the box is rotated (the key |\rotate| may be in the previous |#4|), the
% tabular used for the content of the cell will be constructed with a format
% |c|. In the other cases, the tabular will be constructed with a format equal
-% to the key of position of the box. In other words: the alignement internal to
+% to the key of position of the box. In other words: the alignment internal to
% the tabular is the same as the external alignment of the tabular (that is to
% say the position of the block in its zone of merged cells).
% \begin{macrocode}
@@ -15726,6 +16088,9 @@ version 2005/12/01 or later.
t .value_forbidden:n = true ,
b .code:n = \str_set:Nn \l_@@_vpos_of_block_tl b ,
b .value_forbidden:n = true ,
+ name .tl_set:N = \l_@@_block_name_str ,
+ name .value_required:n = true ,
+ name .initial:n = \c_empty_tl ,
unknown .code:n = \@@_error:n { Unknown~key~for~Block }
}
% \end{macrocode}
@@ -15817,8 +16182,8 @@ version 2005/12/01 or later.
% |hvlines|) will be used when drawing the rules (in fact, there is also the
% |\multicolumn| and the |\diagbox| in that sequence).
% \begin{macrocode}
- \seq_gput_left:Nn \g_@@_pos_of_blocks_seq
- { { #1 } { #2 } { #3 } { #4 } }
+ \seq_gput_left:Nx \g_@@_pos_of_blocks_seq
+ { { #1 } { #2 } { #3 } { #4 } { \l_@@_block_name_str } }
}
% \end{macrocode}
%
@@ -15975,11 +16340,21 @@ version 2005/12/01 or later.
% The function |\@@_pgf_rect_node:nnnnn| takes in as arguments the name of the node
% and the four coordinates of two opposite corner points of the rectangle.
% \begin{macrocode}
- \begin { pgfscope }
\@@_pgf_rect_node:nnnnn
{ \@@_env: - #1 - #2 - block }
\l_tmpb_dim \l_tmpa_dim \l_tmpd_dim \l_tmpc_dim
- \end { pgfscope }
+ \str_if_empty:NF \l_@@_block_name_str
+ {
+ \pgfnodealias
+ { \@@_env: - \l_@@_block_name_str }
+ { \@@_env: - #1 - #2 - block }
+ \str_if_empty:NF \l_@@_name_str
+ {
+ \pgfnodealias
+ { \l_@@_name_str - \l_@@_block_name_str }
+ { \@@_env: - #1 - #2 - block }
+ }
+ }
% \end{macrocode}
%
% \medskip
@@ -16590,6 +16965,10 @@ version 2005/12/01 or later.
{ \int_use:N \c@jCol }
{ \int_use:N \c@iRow }
{ \int_use:N \c@jCol }
+% \end{macrocode}
+% The last argument is for the name of the block.
+% \begin{macrocode}
+ { }
}
}
% \end{macrocode}
@@ -16600,7 +16979,7 @@ version 2005/12/01 or later.
% \medskip
% The first four arguments of |\@@_actually_diagbox:nnnnnn| correspond to the
% rectangle (=block) to slash (we recall that it's possible to use |\diagbox| in
-% a |\Block|). The two other are the elements to draw below and above the
+% a |\Block|). The other two are the elements to draw below and above the
% diagonal line.
% \begin{macrocode}
\cs_new_protected:Npn \@@_actually_diagbox:nnnnnn #1 #2 #3 #4 #5 #6
@@ -16632,11 +17011,24 @@ version 2005/12/01 or later.
\pgfscope
\pgftransformshift { \pgfpoint \l_tmpb_dim \l_tmpc_dim }
\pgfnode { rectangle } { south~west }
- { \@@_math_toggle_token: #5 \@@_math_toggle_token: } { } { }
+ {
+ \begin { minipage } { 20 cm }
+ \@@_math_toggle_token: #5 \@@_math_toggle_token:
+ \end { minipage }
+ }
+ { }
+ { }
\endpgfscope
\pgftransformshift { \pgfpoint \l_tmpd_dim \l_tmpa_dim }
\pgfnode { rectangle } { north~east }
- { \@@_math_toggle_token: #6 \@@_math_toggle_token: } { } { }
+ {
+ \begin { minipage } { 20 cm }
+ \raggedleft
+ \@@_math_toggle_token: #6 \@@_math_toggle_token:
+ \end { minipage }
+ }
+ { }
+ { }
\endpgfpicture
}
% \end{macrocode}
@@ -16681,29 +17073,32 @@ version 2005/12/01 or later.
% |\@@_CodeAfter:|. That macro must \emph{not} be protected since it begins with
% |\omit|.
% \begin{macrocode}
-\cs_new:Npn \@@_CodeAfter: { \omit \@@_CodeAfter_i:n }
+\cs_new:Npn \@@_CodeAfter: { \omit \@@_CodeAfter_ii:n }
% \end{macrocode}
%
% \medskip
% However, in each cell of the environment, the command |\CodeAfter| will be
-% linked to the following command |\@@_CodeAfter_i:n| which do \emph{not} begin
-% with |\omit| (and thus, the user will be able to use |\CodeAfter| without
-% error and without the need to prefix by |\omit|.
+% linked to the following command |\@@_CodeAfter_ii:n| which begins
+% with |\\|.
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_CodeAfter_i: { \\ \omit \@@_CodeAfter_ii:n }
+% \end{macrocode}
%
% \smallskip
% We have to catch everything until the end of the current environment (of
% \pkg{nicematrix}). First, we go until the next command |\end|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_CodeAfter_i:n #1 \end
+\cs_new_protected:Npn \@@_CodeAfter_ii:n #1 \end
{
- \tl_gput_right:Nn \g_nicematrix_code_after_tl { #1 }
- \@@_CodeAfter_ii:n
+ \tl_gput_right:Nn \g_nicematrix_code_after_tl { #1 }
+ \@@_CodeAfter_iv:n
}
% \end{macrocode}
%
% We catch the argument of the command |\end| (in |#1|).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_CodeAfter_ii:n #1
+\cs_new_protected:Npn \@@_CodeAfter_iv:n #1
{
% \end{macrocode}
% If this is really the end of the current environment (of \pkg{nicematrix}), we
@@ -16717,11 +17112,12 @@ version 2005/12/01 or later.
% \begin{macrocode}
{
\tl_gput_right:Nn \g_nicematrix_code_after_tl { \end { #1 } }
- \@@_CodeAfter_i:n
+ \@@_CodeAfter_ii:n
}
}
% \end{macrocode}
%
+%
%
% \subsection*{The delimiters in the preamble}
%
@@ -16935,8 +17331,10 @@ version 2005/12/01 or later.
\exp_args:NNV \NewDocumentCommand \@@_SubMatrix \l_@@_argspec_tl
{
\peek_remove_spaces:n
- { \@@_sub_matrix:nnnnnnn
- { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } { #7 } }
+ {
+ \@@_sub_matrix:nnnnnnn
+ { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } { #7 }
+ }
}
}
% \end{macrocode}
@@ -17531,7 +17929,7 @@ version 2005/12/01 or later.
% The following message will be deleted when we will delete the key
% |except-corners| for the command |\arraycolor|.
% \begin{macrocode}
-\@@_msg_new:nn { key except-corners }
+\@@_msg_new:nn { key~except-corners }
{
The~key~'except-corners'~has~been~deleted~for~the~command~\token_to_str:N
\arraycolor\ in~the~\token_to_str:N \CodeBefore.~You~should~instead~use~
@@ -17583,6 +17981,13 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+% \begin{macrocode}
+\@@_msg_new:nn { negative~weight }
+ {
+ The~weight~of~the~'X'~columns~must~be~positive~and~you~have~used~
+ the~value~'#1'.~If~you~go~on,~the~absolute~value~will~be~used.
+ }
+% \end{macrocode}
%
% \begin{macrocode}
\@@_msg_new:nn { too~much~cols~for~matrix~with~last~col }
@@ -17704,14 +18109,6 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-% \begin{macrocode}
-\@@_msg_new:nn { Unknown~key~for~RowStyle }
- {
- As~for~now,~there~is~only~four~keys~available~here:~'cell-space-top-limit',~
- 'cell-space-bottom-limit~'cell-space-limits'~and~color~(and~you~try~to~use~
- '\l_keys_key_str').~If~you~go~on,~this~key~will~be~ignored.
- }
-% \end{macrocode}
%
% \begin{macrocode}
\@@_msg_new:nn { Unknown~key~for~rowcolors }
@@ -18017,6 +18414,14 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+% \begin{macrocode}
+\@@_msg_new:nn { varwidth~not~loaded }
+ {
+ You~can't~use~the~column~type~'V'~because~'varwidth'~is~not~
+ loaded.\\
+ If~you~go~on,~your~column~will~behave~like~'p'.
+ }
+% \end{macrocode}
%
% \begin{macrocode}
\@@_msg_new:nnn { Unknown~key~for~Block }
@@ -18027,7 +18432,7 @@ version 2005/12/01 or later.
}
{
The~available~keys~are~(in~alphabetic~order):~b,~borders,~c,~draw,~fill,~
- hvlines,~l,~line-width,~rounded-corners,~r,~t~and~tikz.
+ hvlines,~l,~line-width,~name,~rounded-corners,~r,~t~and~tikz.
}
% \end{macrocode}
%
@@ -18095,6 +18500,26 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
+\@@_msg_new:nnn { Unknown~key~for~RowStyle }
+ {
+ The~key~'\l_keys_key_str'~is~unknown~for~the~command~
+ \token_to_str:N \RowStyle. \\
+ If~you~go~on,~it~will~be~ignored. \\
+ For~a~list~of~the~available~keys,~type~H~<return>.
+ }
+ {
+ The~available~keys~are~(in~alphabetic~order):~
+ 'bold',~
+ 'cell-space-top-limit',~
+ 'cell-space-bottom-limit',~
+ 'cell-space-limits',~
+ 'color',~
+ 'nb-rows'~and~
+ 'rowcolor'.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
\@@_msg_new:nnn { Unknown~key~for~NiceMatrixOptions }
{
The~key~'\l_keys_key_str'~is~unknown~for~the~command~
@@ -18857,6 +19282,20 @@ version 2005/12/01 or later.
%
% Key |\color| for the command |\RowStyle|.
%
+% \subsection*{Changes between versions 6.1 and 6.2}
+%
+% Better compatibility with the classes \cls{revtex4-1} and \cls{revtex4-2}.
+%
+% Key |vlines-in-sub-matrix|.
+%
+% \subsection*{Changes between versions 6.2 and 6.3}
+%
+% Keys |nb-rows|, |rowcolor| and |bold| for the command |\RowStyle|
+%
+% Key |name| for the command |\Block|.
+%
+% Support for the columns |V| of \pkg{varwidth}.
+%
%
% \PrintIndex
%