summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nicematrix/nicematrix.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-03-24 03:02:47 +0000
committerNorbert Preining <norbert@preining.info>2020-03-24 03:02:47 +0000
commite9af7499b89170ca5c737240b0cdb9563dcf6c5a (patch)
tree28a1345f3b2d6516864defbaa2e5bf65b15b77da /macros/latex/contrib/nicematrix/nicematrix.dtx
parent404e90e73ebdb6ecca01ae0b18e684a5f8fe83b3 (diff)
CTAN sync 202003240302
Diffstat (limited to 'macros/latex/contrib/nicematrix/nicematrix.dtx')
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.dtx735
1 files changed, 415 insertions, 320 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx
index ede600b7d7..04dd13a9dd 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix.dtx
@@ -15,8 +15,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{3.13}
-\def\myfiledate{2020/03/15}
+\def\myfileversion{3.14}
+\def\myfiledate{2020/03/23}
%
%
%<*batchfile>
@@ -248,7 +248,7 @@ version 2005/12/01 or later.
% |\Iddots| diagonal ones. It's possible to change the color of these lines
% with the option |color|.\footnote{It's also possible to change the color of
% all theses dotted lines with the option |xdots/color| (\textsl{xdots} to
-% remind that it works for |\Cdots|, |\Ldots|, |\Vdots|, etc.)}\par\nobreak
+% remind that it works for |\Cdots|, |\Ldots|, |\Vdots|, etc.): cf. p. \pageref{customization}.}\par\nobreak
%
% \bigskip
% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -552,7 +552,8 @@ version 2005/12/01 or later.
% \end{scope}
%
% \subsection{Customization of the dotted lines}
-%
+%
+% \label{customization}
% The dotted lines drawn by |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots|
% and |\Hdotsfor| (and by the command |\line| in the |code-after| which is described
% in p.~\pageref{line-in-code-after}) may be customized by three options (specified
@@ -1086,13 +1087,11 @@ version 2005/12/01 or later.
% \label{exterior}
%
% A potential ``first row'' (exterior) has the number $0$ (and not $1$). Idem
-% for the potential ``first column''. In general cases, one must specify the
-% number of the last row and the number of the last column as values of
-% |last-row| and |last-col|.
+% for the potential ``first column''.
%
% \begin{Verbatim}
-% $\begin{pNiceMatrix}[~emphase#first-row,last-row=5,first-col,last-col=5@]
-% $\begin{pNiceMatrix}[~emphase#first-row,last-row=5,first-col,last-col=5@,nullify-dots]
+% $\begin{pNiceMatrix}[~emphase#first-row,last-row,first-col,last-col@]
+% $\begin{pNiceMatrix}[~emphase#first-row,last-row,first-col,last-col@,nullify-dots]
% & C_1 & \Cdots & & C_4 & \\
% L_1 & a_{11} & a_{12} & a_{13} & a_{14} & L_1 \\
% \Vdots & a_{21} & a_{22} & a_{23} & a_{24} & \Vdots \\
@@ -1103,7 +1102,7 @@ version 2005/12/01 or later.
% \end{pNiceMatrix}$
% \end{Verbatim}
%
-% \[\begin{pNiceMatrix}[first-row,last-row=5,first-col,last-col=5,nullify-dots]
+% \[\begin{pNiceMatrix}[first-row,last-row,first-col,last-col,nullify-dots]
% & C_1 & \Cdots & & C_4 & \\
% L_1 & a_{11} & a_{12} & a_{13} & a_{14} & L_1 \\
% \Vdots & a_{21} & a_{22} & a_{23} & a_{24} & \Vdots \\
@@ -1120,14 +1119,29 @@ version 2005/12/01 or later.
% its variants), no letter must be given in that preamble for the potential
% first column and the potential last column: they will automatically (and
% necessarily) be of type |R| for the first column and |L| for the last one.
-% \item In an environment with an explicit preamble, the option |last-col| must
-% be used \emph{without} value: the number of columns will be automatically
-% computed from the preamble of the array.
-% \item For the potential last row, the option |last-row| may, in fact, be used
-% without value. In this case, \pkg{nicematrix} computes, during the first
-% compilation, the number of rows of the array and writes that information in
-% the |.aux| file for the second run. In the following example, the option
-% |last-row| will be used without value.
+% \item One may wonder how \pkg{nicematrix} determines the number of rows and
+% columns which are needed for the composition of the ``last row'' and ``last
+% column''.
+% \begin{itemize}
+% \item For the environments with explicit preamble, like |{NiceArray}| and
+% |{pNiceArray}|, the number of columns can obviously be computed from the
+% preamble.
+%
+% \item When the option |light-syntax| (cf. p. \pageref{light-syntax}) is used,
+% \pkg{nicematrix} has, in any case, to load the whole body of the environment
+% (and that's why it's not possible to put verbatim material in the array with
+% the option |light-syntax|). The analysis of this whole body gives the number
+% of rows (but not the number of columns).
+%
+% \item In the other cases, \pkg{nicematrix} compute the number of rows and
+% columns during the first compilation and write the result in the |aux| file
+% for the next run.
+%
+% \textsl{However, it's possible to provide the number of the last row and the number of
+% the last column as values of the options |last-row| and |last-col|, tending to
+% an acceleration of the whole compilation of the document.} That's what we will
+% do throughout the rest of the document.
+% \end{itemize}
% \end{itemize}
%
% \bigskip
@@ -1143,7 +1157,7 @@ version 2005/12/01 or later.
% ~emphase#code-for-first-col@ = \color{blue},
% ~emphase#code-for-last-row@ = \color{green},
% ~emphase#code-for-last-col@ = \color{magenta}}
-% $\begin{pNiceArray}{CC|CC}[first-row,last-row,first-col,last-col,nullify-dots]
+% $\begin{pNiceArray}{CC|CC}[first-row,last-row=5,first-col,last-col,nullify-dots]
% & C_1 & \Cdots & & C_4 & \\
% L_1 & a_{11} & a_{12} & a_{13} & a_{14} & L_1 \\
% \Vdots & a_{21} & a_{22} & a_{23} & a_{24} & \Vdots \\
@@ -1160,7 +1174,7 @@ version 2005/12/01 or later.
% code-for-last-row = \color{green},
% code-for-last-col = \color{magenta}}
% \begin{displaymath}
-% \begin{pNiceArray}{CC|CC}[first-row,last-row,first-col,last-col,nullify-dots]
+% \begin{pNiceArray}{CC|CC}[first-row,last-row=5,first-col,last-col,nullify-dots]
% & C_1 & \multicolumn1C{\Cdots} & & C_4 & \\
% L_1 & a_{11} & a_{12} & a_{13} & a_{14} & L_1 \\
% \Vdots & a_{21} & a_{22} & a_{23} & a_{24} & \Vdots \\
@@ -1608,7 +1622,7 @@ version 2005/12/01 or later.
% \NiceMatrixOptions%
% {code-for-last-row = \scriptstyle ~emphase#\rotate@ ,
% code-for-last-col = \scriptstyle }
-% $A = \begin{pNiceMatrix}[last-row,last-col=4]
+% $A = \begin{pNiceMatrix}[last-row=4,last-col=4]
% 1 & 2 & 3 & e_1 \\
% 4 & 5 & 6 & e_2 \\
% 7 & 8 & 9 & e_3 \\
@@ -1619,7 +1633,7 @@ version 2005/12/01 or later.
% \NiceMatrixOptions%
% {code-for-last-row = \scriptstyle\rotate ,
% code-for-last-col = \scriptstyle }%
-% $A = \begin{pNiceMatrix}[last-row,last-col=4]
+% $A = \begin{pNiceMatrix}[last-row=4,last-col=4]
% 1 & 2 & 3 & e_1 \\
% 4 & 5 & 6 & e_2 \\
% 7 & 8 & 9 & e_3 \\
@@ -1823,14 +1837,15 @@ version 2005/12/01 or later.
%
% \subsection{The option light-syntax}
%
+% \label{light-syntax}
% The option |light-syntax|\footnote{This option is inspired by the extension
-% \pkg{spalign} of Joseph Rabinoff.} allow the user to compose the arrays with a
+% \pkg{spalign} of Joseph Rabinoff.} allows the user to compose the arrays with a
% lighter syntax, which gives a more readable TeX source.
%
% When this option is used, one should use the semicolon for the end of a row
-% and a space to separate the columns. However, as usual in the TeX world, the
-% spaces after a control sequence are discarded and the elements between curly
-% braces are considered as a whole.
+% and spaces or tabulations to separate the columns. However, as usual in the
+% TeX world, the spaces after a control sequence are discarded and the elements
+% between curly braces are considered as a whole.
%
% \bigskip
% The following example has been composed with XeLaTeX with \pkg{unicode-math},
@@ -1856,6 +1871,14 @@ version 2005/12/01 or later.
% It's possible to change the character used to mark the end of rows with the
% option |end-of-row|. As said before, the initial value is a semicolon.
%
+% \medskip
+% When the option |light-syntax| is used, it is not possible to put verbatim
+% material (for example with the command |\verb|) in the cells of the
+% array.\footnote{The reason is that, when the option |light-syntax| is used,
+% the whole content of the environment is loaded as a TeX argument to be
+% analyzed. The environment doesn't behave in that case as a standard
+% environment of LaTeX which only put TeX commands before and after the content.}
+%
% \subsection{Use of the column type S of siunitx}
%
% If the package \pkg{siunitx} is loaded (before or after \pkg{nicematrix}),
@@ -1913,14 +1936,14 @@ version 2005/12/01 or later.
% \newcolumntype{?}{!{\OnlyMainNiceMatrix{\vrule width 1 pt}}}
%
% \begin{BVerbatim}[baseline = c, boxwidth = 10.5cm]
-% $\begin{pNiceArray}{CC?CC}[first-row,last-row]
+% $\begin{pNiceArray}{CC?CC}[first-row,last-row=3]
% C_1 & C_2 & C_3 & C_4 \\
% a & b & c & d \\
% e & f & g & h \\
% C_1 & C_2 & C_3 & C_4
% \end{pNiceArray}$
% \end{BVerbatim}
-% $\begin{pNiceArray}{CC?CC}[first-row,last-row]
+% $\begin{pNiceArray}{CC?CC}[first-row,last-row=3]
% C_1 & C_2 & C_3 & C_4 \\
% a & b & c & d \\
% e & f & g & h \\
@@ -2249,12 +2272,12 @@ version 2005/12/01 or later.
%
% \vspace{2cm}
%
-% An example with |\Iddots|. We have raised even more the value of
-% |xdots/shorten|.\par\nobreak
+% An example with |\Iddots| (we have raised again the value of
+% |xdots/shorten|).\par\nobreak
%
% \bigskip
% \begin{BVerbatim}[baseline=c]
-% $\begin{pNiceMatrix}[~emphase#xdots/shorten=0.9em@]
+% $\begin{pNiceMatrix}[xdots/shorten=0.9em]
% 1 & \Cdots & & 1 \\
% \Vdots & & & 0 \\
% & ~emphase#\Iddots@ & ~emphase#\Iddots@ & \Vdots \\
@@ -2262,7 +2285,7 @@ version 2005/12/01 or later.
% \end{pNiceMatrix}$
% \end{BVerbatim}
% \hspace{4cm}
-% $\begin{pNiceMatrix}[xdots/shorten=0.9em]
+% $\begin{pNiceMatrix}[xdots/shorten=0.9em]
% 1 & \Cdots & & 1 \\
% \Vdots & & & 0 \\
% & \Iddots & \Iddots & \Vdots \\
@@ -3338,14 +3361,24 @@ version 2005/12/01 or later.
\bool_new:N \l_@@_last_row_without_value_bool
% \end{macrocode}
%
+% \smallskip
+% Idem for |\l_@@_last_col_without_value_bool|
+% \begin{macrocode}
+\bool_new:N \l_@@_last_col_without_value_bool
+% \end{macrocode}
+%
% \medskip
% \item \textbf{Last column}\par\nobreak
%
-% For the eventual ``last column'', we use an integer. A value of $-1$ means
-% that there is no last column.
+% For the eventual ``last column'', we use an integer. A value of $-2$ means
+% that there is no last column. A value of $-1$ means that there is a last
+% column but we don't know its value because the user has used the option
+% |last-col| without value (it's possible in an environment without preamble
+% like |{pNiceMatrix}|). A value of $0$ means that the option |last-col| has
+% been used in an environment with preamble (like |{pNiceArray}|).
% \begin{macrocode}
\int_new:N \l_@@_last_col_int
-\int_set:Nn \l_@@_last_col_int { -1 }
+\int_set:Nn \l_@@_last_col_int { -2 }
% \end{macrocode}
%
% However, we have also a boolean. Consider the following code:
@@ -3489,9 +3522,79 @@ version 2005/12/01 or later.
% The following command is only for efficiency. It must \emph{not} be protected
% because it will be used (for instance) in names of \textsc{pgf} nodes.
% \begin{macrocode}
-\cs_new:Npn \@@_succ:N #1 { \the \numexpr #1 + 1 \relax }
+\cs_new:Npn \@@_succ:n #1 { \the \numexpr #1 + 1 \relax }
+\cs_new:Npn \@@_pred:n #1 { \the \numexpr #1 - 1 \relax }
% \end{macrocode}
%
+% \subsection*{Command for creation of rectangle nodes}
+%
+%
+% The following command should be used in a |{pgfpicture}|. It creates an
+% rectangular (empty but with a name) when the four corners are given.
+%
+% |#1| is the name of the node which will be created;
+% |#2| and |#3| are the coordinates of one of the corner of the rectangle;
+% |#4| and |#5| are the coordinates of the opposite corner.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_pgf_rect_node:nnnnn #1 #2 #3 #4 #5
+ {
+ \begin { pgfscope }
+ \pgfset
+ {
+ outer~sep = \c_zero_dim ,
+ inner~sep = \c_zero_dim ,
+ minimum~size = \c_zero_dim
+ }
+ \pgftransformshift { \pgfpoint { 0.5 * ( #2 + #4 ) } { 0.5 * ( #3 + #5 ) } }
+ \pgfnode
+ { rectangle }
+ { center }
+ {
+ \vbox_to_ht:nn
+ { \dim_abs:n { #5 - #3 } }
+ {
+ \vfill
+ \hbox_to_wd:nn { \dim_abs:n { #4 - #2 } } { }
+ }
+ }
+ { #1 }
+ { }
+ \end { pgfscope }
+ }
+% \end{macrocode}
+%
+% \medskip
+% The command |\@@_pgf_rect_node:nnn| is a variant of |\@@_pgr_rect_node:nnnn|:
+% it takes two \textsc{pgf} points as arguments instead of the four dimensions
+% which are the coordinates.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_pgf_rect_node:nnn #1 #2 #3
+ {
+ \begin { pgfscope }
+ \pgfset
+ {
+ outer~sep = \c_zero_dim ,
+ inner~sep = \c_zero_dim ,
+ minimum~size = \c_zero_dim
+ }
+ \pgftransformshift { \pgfpointscale { 0.5 } { \pgfpointadd { #2 } { #3 } } }
+ \pgfpointdiff { #3 } { #2 }
+ \pgfgetlastxy \l_tmpa_dim \l_tmpb_dim
+ \pgfnode
+ { rectangle }
+ { center }
+ {
+ \vbox_to_ht:nn
+ { \dim_abs:n \l_tmpb_dim }
+ { \vfill \hbox_to_wd:nn { \dim_abs:n \l_tmpa_dim } { } }
+ }
+ { #1 }
+ { }
+ \end { pgfscope }
+ }
+% \end{macrocode}
+%
+%
% \bigskip
% \subsection*{The options}
%
@@ -3566,7 +3669,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% The boolean |\l_@@_extra_medium_bool| will be used to indicate whether the
+% The boolean |\l_@@_medium_nodes_bool| will be used to indicate whether the
% ``medium nodes'' are created in the array. Idem for the ``large nodes''.
% \begin{macrocode}
\bool_new:N \l_@@_medium_nodes_bool
@@ -3876,7 +3979,10 @@ version 2005/12/01 or later.
\keys_define:nn { NiceMatrix / NiceMatrix }
{
last-col .code:n = \tl_if_empty:nTF {#1}
- { \@@_error:n { last-col~empty~for~NiceMatrix } }
+ {
+ \bool_set_true:N \l_@@_last_col_without_value_bool
+ \int_set:Nn \l_@@_last_col_int { -1 }
+ }
{ \int_set:Nn \l_@@_last_col_int { #1 } } ,
l .code:n = \tl_set:Nn \l_@@_type_of_col_tl L ,
r .code:n = \tl_set:Nn \l_@@_type_of_col_tl R ,
@@ -4255,7 +4361,7 @@ version 2005/12/01 or later.
{
\pgfpicture
\pgfrememberpicturepositiononpagetrue
- \pgfcoordinate { \@@_env: - row - \@@_succ:N \c@iRow }
+ \pgfcoordinate { \@@_env: - row - \@@_succ:n \c@iRow }
\pgfpointorigin
\str_if_empty:NF \l_@@_name_str
{
@@ -4681,6 +4787,35 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+%
+% A value of $-1$ for the counter |\l_@@_last_col_int| means that the user has
+% used the option |last-col| without value (it's possible in an environment
+% without preamble like |{NiceMatrix}| or |{pNiceMatrix}|), that is to say
+% without specifying the number of that last column. In this case, we try to
+% read that value from the |aux| file (if it has been written on a previous
+% run).
+% \begin{macrocode}
+ \int_compare:nNnT \l_@@_last_col_int = { -1 }
+ {
+ \str_if_empty:NTF \l_@@_name_str
+ {
+ \cs_if_exist:cT { @@_last_col_ \int_use:N \g_@@_env_int }
+ {
+ \int_set:Nn \l_@@_last_col_int
+ { \use:c { @@_last_col_ \int_use:N \g_@@_env_int } }
+ }
+ }
+ {
+ \cs_if_exist:cT { @@_last_col_ \l_@@_name_str }
+ {
+ \int_set:Nn \l_@@_last_col_int
+ { \use:c { @@_last_col_ \l_@@_name_str } }
+ }
+ }
+ }
+% \end{macrocode}
+%
+% \interitem
% The code in |\@@_pre_array:| is used only by |{NiceArrayWithDelims}|.
% \begin{macrocode}
\@@_pre_array:
@@ -5104,13 +5239,20 @@ version 2005/12/01 or later.
% because we have the whole body of the environment in |#1|.
% \begin{macrocode}
\tl_if_empty:nT { #1 } { \@@_fatal:n { empty~environment } }
+ \tl_map_inline:nn { #1 }
+ {
+ \tl_if_eq:nnT { ##1 } { & }
+ { \@@_fatal:n { ampersand~in~light-syntax } }
+ \tl_if_eq:nnT { ##1 } { \\ }
+ { \@@_fatal:n { double-backslash~in~light-syntax } }
+ }
% \end{macrocode}
% The body of the environment, which is stored in the argument |#1|, is now
% splitted into items (and \emph{not} tokens)
% \begin{macrocode}
\seq_gclear_new:N \g_@@_rows_seq
\tl_set_rescan:Nno \l_@@_end_of_row_tl { } \l_@@_end_of_row_tl
- \exp_args:NNV \seq_gset_split:Nnn \g_@@_rows_seq \l_@@_end_of_row_tl { #1 }
+ \exp_args:NNV \seq_gset_split:Nnn \g_@@_rows_seq \l_@@_end_of_row_tl { #1 }
% \end{macrocode}
% If the environment uses the option |last-row| without value (i.e. without
% saying the number of the rows), we have now the opportunity to know that
@@ -5262,13 +5404,13 @@ version 2005/12/01 or later.
% \begin{macrocode}
\pgfpicture
\pgfrememberpicturepositiononpagetrue
- \pgfcoordinate { \@@_env: - col - \@@_succ:N \g_tmpa_int }
+ \pgfcoordinate { \@@_env: - col - \@@_succ:n \g_tmpa_int }
\pgfpointorigin
\str_if_empty:NF \l_@@_name_str
{
\pgfnodealias
- { \@@_env: - col - \@@_succ:N \g_tmpa_int }
- { \l_@@_name_str - col - \@@_succ:N \g_tmpa_int }
+ { \@@_env: - col - \@@_succ:n \g_tmpa_int }
+ { \l_@@_name_str - col - \@@_succ:n \g_tmpa_int }
}
\endpgfpicture
}
@@ -5357,8 +5499,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\bool_gset_true:N \g_@@_last_col_found_bool
\int_gincr:N \c@jCol
- \int_gset:Nn \g_@@_col_total_int
- { \int_max:nn \g_@@_col_total_int \c@jCol }
+ \int_gset_eq:NN \g_@@_col_total_int \c@jCol
% \end{macrocode}
% The contents of the cell is constructed in the box |\l_tmpa_box| because we
% have to compute some dimensions of this box.
@@ -5517,9 +5658,9 @@ version 2005/12/01 or later.
{
*
{
- \int_compare:nNnTF \l_@@_last_col_int = { -1 }
+ \int_compare:nNnTF \l_@@_last_col_int < 0
\c@MaxMatrixCols
- { \int_eval:n { \l_@@_last_col_int - 1 } }
+ { \@@_pred:n \l_@@_last_col_int }
}
#2
}
@@ -5547,15 +5688,40 @@ version 2005/12/01 or later.
{
\group_begin:
% \end{macrocode}
+% When the option |last-col| is used in the environments with explicit preambles
+% (like |{NiceArray}|, |{pNiceArray}|, etc.) a special type of column is used at
+% the end of the preamble in order to compose the cells in an overlapping
+% position (with |\hbox_overlap_right:n|) but (if |last-col| has been used), we
+% don't have the number of that last column. However, we have to know that
+% number for the color of the potential |\Vdots| drawn in that last column.
+% That's why we fix the correct value of |\l_@@_last_col_int| in that case.
+% \begin{macrocode}
+ \bool_if:NT \g_@@_last_col_found_bool
+ { \int_set_eq:NN \l_@@_last_col_int \g_@@_col_total_int }
+% \end{macrocode}
%
-% If a last column is announced in the options, but without the value (because
-% we are in an environment with preamble, it's time to fix the real value of
-% |\l_@@_last_col_int|).
+% If we are in an environment without preamble (like |{NiceMatrix}| or
+% |{pNiceMatrix}|) and if the option |last-col| has been used without value
+% we fix the real value of |\l_@@_last_col_int|.
% \begin{macrocode}
- \int_compare:nNnT \l_@@_last_col_int = 0
+ \bool_if:NT \l_@@_last_col_without_value_bool
{
- \bool_if:NT \g_@@_last_col_found_bool
- { \dim_set_eq:NN \l_@@_last_col_int \g_@@_col_total_int }
+ \dim_set_eq:NN \l_@@_last_col_int \g_@@_col_total_int
+ \iow_shipout:Nn \@mainaux \ExplSyntaxOn
+ \iow_shipout:Nx \@mainaux
+ {
+ \cs_gset:cpn { @@_last_col_ \int_use:N \g_@@_env_int }
+ { \int_use:N \g_@@_col_total_int }
+ }
+ \str_if_empty:NF \l_@@_name_str
+ {
+ \iow_shipout:Nx \@mainaux
+ {
+ \cs_gset:cpn { @@_last_col_ \l_@@_name_str }
+ { \int_use:N \g_@@_col_total_int }
+ }
+ }
+ \iow_shipout:Nn \@mainaux \ExplSyntaxOff
}
% \end{macrocode}
%
@@ -5566,26 +5732,33 @@ version 2005/12/01 or later.
\bool_if:NT \l_@@_last_row_without_value_bool
{
\dim_set_eq:NN \l_@@_last_row_int \g_@@_row_total_int
- \iow_now:Nn \@mainaux \ExplSyntaxOn
- \iow_now:Nx \@mainaux
- {
- \cs_gset:cpn { @@_last_row_ \int_use:N \g_@@_env_int }
- { \int_use:N \g_@@_row_total_int }
- }
+% \end{macrocode}
+% If the option |light-syntax| is used, we have nothing to write since, in this
+% case, the number of rows is directly determined.
+% \begin{macrocode}
+ \bool_if:NF \l_@@_light_syntax_bool
+ {
+ \iow_shipout:Nn \@mainaux \ExplSyntaxOn
+ \iow_shipout:Nx \@mainaux
+ {
+ \cs_gset:cpn { @@_last_row_ \int_use:N \g_@@_env_int }
+ { \int_use:N \g_@@_row_total_int }
+ }
% \end{macrocode}
% If the environment has a name, we also write a value based on the name
% because it's more reliable than a value based on the number of the
% environment.
% \begin{macrocode}
- \str_if_empty:NF \l_@@_name_str
- {
- \iow_now:Nx \@mainaux
+ \str_if_empty:NF \l_@@_name_str
{
- \cs_gset:cpn { @@_last_row_ \l_@@_name_str }
- { \int_use:N \g_@@_row_total_int }
- }
+ \iow_shipout:Nx \@mainaux
+ {
+ \cs_gset:cpn { @@_last_row_ \l_@@_name_str }
+ { \int_use:N \g_@@_row_total_int }
+ }
+ }
+ \iow_shipout:Nn \@mainaux \ExplSyntaxOff
}
- \iow_now:Nn \@mainaux \ExplSyntaxOff
}
% \end{macrocode}
%
@@ -5644,7 +5817,7 @@ version 2005/12/01 or later.
% \end{macrocode}
% The dimension |\l_@@_xdots_shorten_dim| corresponds to the option
% |xdots/shorten| available to the user. That's why we give a new value
-% according to the current value, and not a absolute value.
+% according to the current value, and not an absolute value.
% \begin{macrocode}
\dim_set:Nn \l_@@_xdots_shorten_dim { 0.6 \l_@@_xdots_shorten_dim }
}
@@ -6033,7 +6206,7 @@ version 2005/12/01 or later.
{ \@@_set_initial_coords_from_anchor:n { base~east } }
\bool_if:NTF \l_@@_final_open_bool
{
- \@@_qpoint: { col - \@@_succ:N \l_@@_final_j_int }
+ \@@_qpoint: { col - \@@_succ:n \l_@@_final_j_int }
\dim_set_eq:NN \l_@@_x_final_dim \pgf@x
\dim_sub:Nn \l_@@_x_final_dim \arraycolsep
\@@_qpoint: { row - \int_use:N \l_@@_final_i_int - base }
@@ -6114,7 +6287,7 @@ version 2005/12/01 or later.
{ \@@_set_initial_coords_from_anchor:n { mid~east } }
\bool_if:NTF \l_@@_final_open_bool
{
- \@@_qpoint: { col - \@@_succ:N \l_@@_final_j_int }
+ \@@_qpoint: { col - \@@_succ:n \l_@@_final_j_int }
\dim_set_eq:NN \l_@@_x_final_dim \pgf@x
\dim_sub:Nn \l_@@_x_final_dim \arraycolsep
}
@@ -6125,7 +6298,7 @@ version 2005/12/01 or later.
{
\@@_qpoint: { row - \int_use:N \l_@@_initial_i_int }
\dim_set_eq:NN \l_tmpa_dim \pgf@y
- \@@_qpoint: { row - \@@_succ:N \l_@@_initial_i_int }
+ \@@_qpoint: { row - \@@_succ:n \l_@@_initial_i_int }
\dim_set:Nn \l_@@_y_initial_dim { ( \l_tmpa_dim + \pgf@y ) / 2 }
\dim_set_eq:NN \l_@@_y_final_dim \l_@@_y_initial_dim
}
@@ -6212,7 +6385,7 @@ version 2005/12/01 or later.
{ \@@_set_initial_coords_from_anchor:n { south } }
\bool_if:NTF \l_@@_final_open_bool
{
- \@@_qpoint: { row - \@@_succ:N \c@iRow }
+ \@@_qpoint: { row - \@@_succ:n \c@iRow }
\dim_set_eq:NN \l_@@_y_final_dim \pgf@y
}
{ \@@_set_final_coords_from_anchor:n { north } }
@@ -6222,7 +6395,7 @@ version 2005/12/01 or later.
{
\@@_qpoint: { col - \int_use:N \l_@@_initial_j_int }
\dim_set_eq:NN \l_tmpa_dim \pgf@x
- \@@_qpoint: { col - \@@_succ:N \l_@@_initial_j_int }
+ \@@_qpoint: { col - \@@_succ:n \l_@@_initial_j_int }
\dim_set:Nn \l_@@_x_initial_dim { ( \pgf@x + \l_tmpa_dim ) / 2 }
\dim_set_eq:NN \l_@@_x_final_dim \l_@@_x_initial_dim
}
@@ -6310,9 +6483,9 @@ version 2005/12/01 or later.
{ \@@_set_initial_coords_from_anchor:n { south~east } }
\bool_if:NTF \l_@@_final_open_bool
{
- \@@_qpoint: { row - \@@_succ:N \l_@@_final_i_int }
+ \@@_qpoint: { row - \@@_succ:n \l_@@_final_i_int }
\dim_set_eq:NN \l_@@_y_final_dim \pgf@y
- \@@_qpoint: { col - \@@_succ:N \l_@@_final_j_int }
+ \@@_qpoint: { col - \@@_succ:n \l_@@_final_j_int }
\dim_set_eq:NN \l_@@_x_final_dim \pgf@x
}
{ \@@_set_final_coords_from_anchor:n { north~west } }
@@ -6408,13 +6581,13 @@ version 2005/12/01 or later.
{
\@@_qpoint: { row - \int_use:N \l_@@_initial_i_int }
\dim_set_eq:NN \l_@@_y_initial_dim \pgf@y
- \@@_qpoint: { col - \@@_succ:N \l_@@_initial_j_int }
+ \@@_qpoint: { col - \@@_succ:n \l_@@_initial_j_int }
\dim_set_eq:NN \l_@@_x_initial_dim \pgf@x
}
{ \@@_set_initial_coords_from_anchor:n { south~west } }
\bool_if:NTF \l_@@_final_open_bool
{
- \@@_qpoint: { row - \@@_succ:N \l_@@_final_i_int }
+ \@@_qpoint: { row - \@@_succ:n \l_@@_final_i_int }
\dim_set_eq:NN \l_@@_y_final_dim \pgf@y
\@@_qpoint: { col - \int_use:N \l_@@_final_j_int }
\dim_set_eq:NN \l_@@_x_final_dim \pgf@x
@@ -6548,15 +6721,24 @@ version 2005/12/01 or later.
}
}
% \end{macrocode}
-% We draw only if the length is not equal to zero (in fact, in the first
-% compilation, the length may be equal to zero when the command |\line| is used).
+% It seems that, during the first compilations, the value of |\l_@@_l_dim| may
+% be erroneous (equal to zero or very large). We must detect these cases
+% because they would cause errors during the drawing of the dotted line. Maybe
+% we should also write something in the |aux| file to say that one more
+% compilation should be done.
% \begin{macrocode}
- \dim_compare:nNnF \l_@@_l_dim = \c_zero_dim \@@_actually_draw_line:
+ \bool_lazy_or:nnF
+ { \dim_compare_p:nNn { \dim_abs:n \l_@@_l_dim } > \c_@@_max_l_dim }
+ { \dim_compare_p:nNn \l_@@_l_dim = \c_zero_dim }
+ \@@_actually_draw_line:
\group_end:
}
% \end{macrocode}
%
-%
+% \begin{macrocode}
+\dim_const:Nn \c_@@_max_l_dim { 50 cm }
+% \end{macrocode}
+%
% \begin{macrocode}
\cs_new_protected:Npn \@@_actually_draw_line:
{
@@ -6593,7 +6775,7 @@ version 2005/12/01 or later.
\int_set:Nn \l_tmpa_int
{
\dim_ratio:nn
- { \l_@@_l_dim - ( 2 \l_@@_xdots_shorten_dim ) }
+ { \l_@@_l_dim - 2 \l_@@_xdots_shorten_dim }
\l_@@_inter_dots_dim
}
}
@@ -6768,8 +6950,8 @@ version 2005/12/01 or later.
% |{NiceArrayWithDelims}|. This command uses an optional argument (as does
% |\hdotsfor|) but this argument is discarded (in |\hdotsfor|, this argument is
% used for fine tuning of the space between two consecutive dots). Tikz nodes
-% are created for all the cells of the array, even the implicit cells of the
-% |\Hdotsfor|.
+% are created also the implicit cells of the |\Hdotsfor| (maybe we should modify
+% that point).
%
% \medskip
% This command must \emph{not} be protected since it begins with |\multicolumn|.
@@ -7142,7 +7324,7 @@ version 2005/12/01 or later.
\@@_qpoint: {row - 1 }
\dim_set_eq:NN \l_tmpa_dim \pgf@y
\pgfusepathqfill
- \@@_qpoint: { row - \@@_succ:N \c@iRow }
+ \@@_qpoint: { row - \@@_succ:n \c@iRow }
\dim_sub:Nn \l_tmpa_dim \pgf@y
\pgfusepathqfill
% \end{macrocode}
@@ -7157,9 +7339,9 @@ version 2005/12/01 or later.
% We adjust the value of |\l_tmpa_dim| by the width of the horizontal rule just
% before the ``last row''.
% \begin{macrocode}
- \@@_qpoint: { row - \@@_succ:N\c@iRow }
+ \@@_qpoint: { row - \@@_succ:n\c@iRow }
\dim_add:Nn \l_tmpa_dim \pgf@y
- \@@_qpoint: { row - \@@_succ:N \g_@@_row_total_int }
+ \@@_qpoint: { row - \@@_succ:n \g_@@_row_total_int }
\dim_sub:Nn \l_tmpa_dim \pgf@y
\dim_sub:Nn \l_tmpa_dim \l_tmpb_dim
}
@@ -7169,7 +7351,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\int_step_inline:nnn
{ \bool_if:NTF \l_@@_NiceArray_bool 1 2 }
- { \bool_if:NTF \l_@@_NiceArray_bool { \@@_succ:N \c@jCol } \c@jCol }
+ { \bool_if:NTF \l_@@_NiceArray_bool { \@@_succ:n \c@jCol } \c@jCol }
{
\pgfpathmoveto
{
@@ -7345,7 +7527,7 @@ version 2005/12/01 or later.
\@@_qpoint: { col - 1 }
\dim_set:Nn \l_@@_x_initial_dim
{ \pgf@x + \arraycolsep - \l_@@_left_margin_dim }
- \@@_qpoint: { col - \@@_succ:N \c@jCol }
+ \@@_qpoint: { col - \@@_succ:n \c@jCol }
\dim_set:Nn \l_@@_x_final_dim
{ \pgf@x - \arraycolsep + \l_@@_right_margin_dim }
% \end{macrocode}
@@ -7429,7 +7611,7 @@ version 2005/12/01 or later.
% |\l_@@_inter_dots_dim| in order to improve the visual impact.
% \begin{macrocode}
\dim_set:Nn \l_@@_y_initial_dim { \pgf@y - 0.5 \l_@@_inter_dots_dim }
- \@@_qpoint: { row - \@@_succ:N \c@iRow }
+ \@@_qpoint: { row - \@@_succ:n \c@iRow }
\dim_set:Nn \l_@@_y_final_dim { \pgf@y + 0.5 \l_@@_inter_dots_dim }
% \end{macrocode}
% As for now, we have no option to control the style of the lines drawn by
@@ -7494,8 +7676,8 @@ version 2005/12/01 or later.
{
\bool_if:NT \l_@@_block_auto_columns_width_bool
{
- \iow_now:Nn \@mainaux \ExplSyntaxOn
- \iow_now:Nx \@mainaux
+ \iow_shipout:Nn \@mainaux \ExplSyntaxOn
+ \iow_shipout:Nx \@mainaux
{
\cs_gset:cpn
{ @@ _ max _ cell _ width _ \int_use:N \g_@@_NiceMatrixBlock_int }
@@ -7505,7 +7687,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
{ \dim_eval:n { \g_@@_max_cell_width_dim + \arrayrulewidth } }
}
- \iow_now:Nn \@mainaux \ExplSyntaxOff
+ \iow_shipout:Nn \@mainaux \ExplSyntaxOff
}
}
% \end{macrocode}
@@ -7576,9 +7758,9 @@ version 2005/12/01 or later.
\int_step_variable:nnNn
\l_@@_first_col_int \g_@@_col_total_int \@@_j:
% \end{macrocode}
-% Maybe the cell ($i$-$j$) is an implicit cell (that is to say a cell after
-% implicit ampersands |&|). In this case, of course, we don't update the
-% dimensions we want to compute.
+% If the cell ($i$-$j$) is empty or an implicit cell (that is to say a cell
+% after implicit ampersands |&|) we don't update the dimensions we want to
+% compute.
% \begin{macrocode}
{
\cs_if_exist:cT
@@ -7588,9 +7770,7 @@ version 2005/12/01 or later.
% the cell ($i$-$j$). They will be stored in |\pgf@x| and |\pgf@y|.
% \begin{macrocode}
{
- \pgfpointanchor
- { \@@_env: - \@@_i: - \@@_j: }
- { south~west }
+ \pgfpointanchor { \@@_env: - \@@_i: - \@@_j: } { south~west }
\dim_set:cn { l_@@_row_\@@_i: _min_dim}
{ \dim_min:vn { l_@@_row _ \@@_i: _min_dim } \pgf@y }
\seq_if_in:NxF \g_@@_multicolumn_cells_seq { \@@_i: - \@@_j: }
@@ -7602,9 +7782,7 @@ version 2005/12/01 or later.
% We retrieve the coordinates of the anchor |north east| of the (normal) node of
% the cell ($i$-$j$). They will be stored in |\pgf@x| and |\pgf@y|.
% \begin{macrocode}
- \pgfpointanchor
- { \@@_env: - \@@_i: - \@@_j: }
- { north~east }
+ \pgfpointanchor { \@@_env: - \@@_i: - \@@_j: } { north~east }
\dim_set:cn { l_@@_row _ \@@_i: _ max_dim }
{ \dim_max:vn { l_@@_row _ \@@_i: _ max_dim } \pgf@y }
\seq_if_in:NxF \g_@@_multicolumn_cells_seq { \@@_i: - \@@_j: }
@@ -7615,6 +7793,30 @@ version 2005/12/01 or later.
}
}
}
+% \end{macrocode}
+% Now, we have to deal with empty rows or empty columns since we don't have
+% created nodes in such rows and columns.
+% \begin{macrocode}
+ \int_step_variable:nnNn \l_@@_first_row_int \g_@@_row_total_int \@@_i:
+ {
+ \dim_compare:nNnT
+ { \dim_use:c { l_@@_row _ \@@_i: _ min _ dim } } = \c_max_dim
+ {
+ \@@_qpoint: { row - \@@_i: - base }
+ \dim_set:cn { l_@@_row _ \@@_i: _ max _ dim } \pgf@y
+ \dim_set:cn { l_@@_row _ \@@_i: _ min _ dim } \pgf@y
+ }
+ }
+ \int_step_variable:nnNn \l_@@_first_col_int \g_@@_col_total_int \@@_j:
+ {
+ \dim_compare:nNnT
+ { \dim_use:c { l_@@_column _ \@@_j: _ min _ dim } } = \c_max_dim
+ {
+ \@@_qpoint: { col - \@@_j: }
+ \dim_set:cn { l_@@_column _ \@@_j: _ max _ dim } \pgf@y
+ \dim_set:cn { l_@@_column _ \@@_j: _ min _ dim } \pgf@y
+ }
+ }
}
% \end{macrocode}
%
@@ -7705,11 +7907,11 @@ version 2005/12/01 or later.
{
(
\dim_use:c { l_@@_row _ \@@_i: _ min _ dim } +
- \dim_use:c { l_@@_row _ \int_eval:n { \@@_i: + 1 } _ max _ dim }
+ \dim_use:c { l_@@_row _ \@@_succ:n \@@_i: _ max _ dim }
)
/ 2
}
- \dim_set_eq:cc { l_@@_row _ \int_eval:n { \@@_i: + 1 } _ max _ dim }
+ \dim_set_eq:cc { l_@@_row _ \@@_succ:n \@@_i: _ max _ dim }
{ l_@@_row_\@@_i: _min_dim }
}
\int_step_variable:nNn { \c@jCol - 1 } \@@_j:
@@ -7717,14 +7919,13 @@ version 2005/12/01 or later.
\dim_set:cn { l_@@_column _ \@@_j: _ max _ dim }
{
(
+ \dim_use:c { l_@@_column _ \@@_j: _ max _ dim } +
\dim_use:c
- { l_@@_column _ \@@_j: _ max _ dim } +
- \dim_use:c
- { l_@@_column _ \int_eval:n { \@@_j: + 1 } _ min _ dim }
+ { l_@@_column _ \@@_succ:n \@@_j: _ min _ dim }
)
/ 2
}
- \dim_set_eq:cc { l_@@_column _ \int_eval:n { \@@_j: + 1 } _ min _ dim }
+ \dim_set_eq:cc { l_@@_column _ \@@_succ:n \@@_j: _ min _ dim }
{ l_@@_column _ \@@_j: _ max _ dim }
}
% \end{macrocode}
@@ -7939,9 +8140,9 @@ version 2005/12/01 or later.
\dim_set_eq:NN \l_tmpa_dim \pgf@y
\@@_qpoint: { col - #2 }
\dim_set_eq:NN \l_tmpb_dim \pgf@x
- \@@_qpoint: { row - \@@_succ:N #3 }
+ \@@_qpoint: { row - \@@_succ:n { #3 } }
\dim_set_eq:NN \l_tmpc_dim \pgf@y
- \@@_qpoint: { col - \@@_succ:N #4 }
+ \@@_qpoint: { col - \@@_succ:n { #4 } }
\dim_set_eq:NN \l_tmpd_dim \pgf@x
% \end{macrocode}
%
@@ -8149,6 +8350,7 @@ version 2005/12/01 or later.
% Of course, the command |\NiceMatrix| must be defined before such an
% instruction is executed.
% \begin{macrocode}
+\bool_new:N \c_@@_obsolete_environments_bool
\keys_define:nn { NiceMatrix / Package }
{
renew-dots .bool_set:N = \l_@@_renew_dots_bool ,
@@ -8157,9 +8359,9 @@ version 2005/12/01 or later.
renew-matrix .value_forbidden:n = true ,
transparent .meta:n = { renew-dots , renew-matrix } ,
transparent .value_forbidden:n = true,
- obsolete-environments .code:n =
- \@@_msg_redirect_name:nn { Obsolete~environment } { none } ,
- obsolete-environments .value_forbidden:n = true,
+ obsolete-environments .bool_set:N = \c_@@_obsolete_environments_bool ,
+ obsolete-environments .value_forbidden:n = true ,
+ obsolete-environments .default:n = true ,
starred-commands .code:n =
\@@_msg_redirect_name:nn { starred~commands } { none } ,
starred-commands .value_forbidden:n = true ,
@@ -8286,6 +8488,23 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
+\@@_msg_new:nn { ampersand~in~light-syntax }
+ {
+ You~can't~use~an~ampersand~(\token_to_str &)~to~separate~columns~because
+ ~you~have~used~the~option~'light-syntax'.~This~error~is~fatal.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@@_msg_new:nn { double-backslash~in~light-syntax }
+ {
+ You~can't~use~\token_to_str:N \\~to~separate~rows~because~you~have~used~
+ the~option~'light-syntax'.~You~must~use~the~character~'\l_@@_end_of_row_tl'~
+ (set~by~the~option~'end-of-row').~This~error~is~fatal.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
\@@_msg_new:nn { starred~commands }
{
The~starred~versions~of~\token_to_str:N \Cdots,~\token_to_str:N \Ldots,~
@@ -8340,14 +8559,6 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-% \begin{macrocode}
-\@@_msg_new:nn { last-col~empty~for~NiceMatrix }
- {
- In~the~\@@_full_name_env:, you~can't~use~the~option~
- 'last-col'~without~value.~You~must~give~the~number~of~that~last~column.\\
- If~you~go~on~this~option~will~be~ignored.
- }
-% \end{macrocode}
%
% \begin{macrocode}
\@@_msg_new:nn { Block~too~large }
@@ -8570,218 +8781,95 @@ version 2005/12/01 or later.
% \bigskip
% \subsection*{Obsolete environments}
%
-% \begin{macrocode}
-\@@_msg_new:nn { Obsolete~environment }
- {
- The~environment~\{\@currenvir\}~is~obsolete.~You~should~use~#1~instead.~
- However,~it's~still~possible~to~use~the~environment~\{\@currenvir\}~(for~
- a~few~months)~by~loading~'nicematrix'~with~the~option~
- 'obsolete-environments'.
- }
-% \end{macrocode}
+% The following environments are loaded only when the package \pkg{nicematrix}
+% has been loaded with the option |obsolete-environments|. However, they will be
+% completly deleted in a future version.
%
% \begin{macrocode}
-\NewDocumentEnvironment { pNiceArrayC } { }
- {
- \@@_fatal:nn { Obsolete~environment } { the~option~'last-col' }
- \int_zero:N \l_@@_last_col_int
- \pNiceArray
- }
- { \endpNiceArray }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { bNiceArrayC } { }
- {
- \@@_fatal:nn { Obsolete~environment } { the~option~'last-col' }
- \int_zero:N \l_@@_last_col_int
- \bNiceArray
- }
- { \endbNiceArray }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { BNiceArrayC } { }
- {
- \@@_fatal:nn { Obsolete~environment } { the~option~'last-col' }
- \int_zero:N \l_@@_last_col_int
- \BNiceArray
- }
- { \endBNiceArray }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { vNiceArrayC } { }
- {
- \@@_fatal:nn { Obsolete~environment } { the~option~'last-col' }
- \int_zero:N \l_@@_last_col_int
- \vNiceArray
- }
- { \endvNiceArray }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { VNiceArrayC } { }
- {
- \@@_fatal:nn { Obsolete~environment } { the~option~'last-col' }
- \int_zero:N \l_@@_last_col_int
- \VNiceArray
- }
- { \endVNiceArray }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { pNiceArrayRC } { }
- {
- \@@_fatal:nn { Obsolete~environment }
- { the~options~'last-col'~and~'first-row' }
- \int_zero:N \l_@@_last_col_int
- \int_zero:N \l_@@_first_row_int
- \pNiceArray
- }
- { \endpNiceArray }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { bNiceArrayRC } { }
- {
- \@@_fatal:nn { Obsolete~environment }
- { the~options~'last-col'~and~'first-row' }
- \int_zero:N \l_@@_last_col_int
- \int_zero:N \l_@@_first_row_int
- \bNiceArray
- }
- { \endbNiceArray }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { BNiceArrayRC } { }
- {
- \@@_fatal:nn { Obsolete~environment }
- { the~options~'last-col'~and~'first-row' }
- \int_zero:N \l_@@_last_col_int
- \int_zero:N \l_@@_first_row_int
- \BNiceArray
- }
- { \endBNiceArray }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { vNiceArrayRC } { }
- {
- \@@_fatal:nn { Obsolete~environment }
- { the~options~'last-col'~and~'first-row' }
- \int_zero:N \l_@@_last_col_int
- \int_zero:N \l_@@_first_row_int
- \vNiceArray
- }
- { \endvNiceArray }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { VNiceArrayRC } { }
- {
- \@@_fatal:nn { Obsolete~environment }
- { the~options~'last-col'~and~'first-row' }
- \int_zero:N \l_@@_last_col_int
- \int_zero:N \l_@@_first_row_int
- \VNiceArray
- }
- { \endVNiceArray }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { NiceArrayCwithDelims } { }
- {
- \@@_fatal:nn { Obsolete~environment }
- { the~option~'last-col' }
- \int_zero:N \l_@@_last_col_int
- \NiceArrayWithDelims
- }
- { \endNiceArrayWithDelims }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { NiceArrayRCwithDelims } { }
- {
- \@@_fatal:nn { Obsolete~environment }
- { the~options~'last-col'~and~'first-row' }
- \int_zero:N \l_@@_last_col_int
- \int_zero:N \l_@@_first_row_int
- \NiceArrayWithDelims
- }
- { \endNiceArrayWithDelims }
-% \end{macrocode}
-%
-%
-% \subsection*{Command for creation of rectangle nodes}
-%
-%
-% The following command should be used in a |{pgfpicture}|. It creates an
-% rectangular (empty but with a name) when the four corners are given.
-%
-% |#1| is the name of the node which will be created;
-% |#2| and |#3| are the coordinates of one of the corner of the rectangle;
-% |#4| and |#5| are the coordinates of the opposite corner.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_pgf_rect_node:nnnnn #1 #2 #3 #4 #5
+\bool_if:NT \c_@@_obsolete_environments_bool
{
- \begin { pgfscope }
- \pgfset
+ \NewDocumentEnvironment { pNiceArrayC } { }
{
- outer~sep = \c_zero_dim ,
- inner~sep = \c_zero_dim ,
- minimum~size = \c_zero_dim
+ \int_zero:N \l_@@_last_col_int
+ \pNiceArray
}
- \pgftransformshift { \pgfpoint { 0.5 * ( #2 + #4 ) } { 0.5 * ( #3 + #5 ) } }
- \pgfnode
- { rectangle }
- { center }
- {
- \vbox_to_ht:nn
- { \dim_abs:n { #5 - #3 } }
- {
- \vfill
- \hbox_to_wd:nn { \dim_abs:n { #4 - #2 } } { }
- }
+ { \endpNiceArray }
+ \NewDocumentEnvironment { bNiceArrayC } { }
+ {
+ \int_zero:N \l_@@_last_col_int
+ \bNiceArray
+ }
+ { \endbNiceArray }
+ \NewDocumentEnvironment { BNiceArrayC } { }
+ {
+ \int_zero:N \l_@@_last_col_int
+ \BNiceArray
}
- { #1 }
- { }
- \end { pgfscope }
- }
-% \end{macrocode}
-%
-% \medskip
-% The command |\@@_pgf_rect_node:nnn| is a variant of |\@@_pgr_rect_node:nnnn|:
-% it takes two \textsc{pgf} points as arguments instead of the four dimensions
-% which are the coordinates.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_pgf_rect_node:nnn #1 #2 #3
- {
- \begin { pgfscope }
- \pgfset
+ { \endBNiceArray }
+ \NewDocumentEnvironment { vNiceArrayC } { }
{
- outer~sep = \c_zero_dim ,
- inner~sep = \c_zero_dim ,
- minimum~size = \c_zero_dim
+ \int_zero:N \l_@@_last_col_int
+ \vNiceArray
}
- \pgftransformshift { \pgfpointscale { 0.5 } { \pgfpointadd { #2 } { #3 } } }
- \pgfpointdiff { #3 } { #2 }
- \pgfgetlastxy \l_tmpa_dim \l_tmpb_dim
- \pgfnode
- { rectangle }
- { center }
- {
- \vbox_to_ht:nn
- { \dim_abs:n { \l_tmpb_dim } }
- { \vfill \hbox_to_wd:nn { \dim_abs:n { \l_tmpa_dim } } { } }
+ { \endvNiceArray }
+ \NewDocumentEnvironment { VNiceArrayC } { }
+ {
+ \int_zero:N \l_@@_last_col_int
+ \VNiceArray
}
- { #1 }
- { }
- \end { pgfscope }
+ { \endVNiceArray }
+ \NewDocumentEnvironment { pNiceArrayRC } { }
+ {
+ \int_zero:N \l_@@_last_col_int
+ \int_zero:N \l_@@_first_row_int
+ \pNiceArray
+ }
+ { \endpNiceArray }
+ \NewDocumentEnvironment { bNiceArrayRC } { }
+ {
+ \int_zero:N \l_@@_last_col_int
+ \int_zero:N \l_@@_first_row_int
+ \bNiceArray
+ }
+ { \endbNiceArray }
+ \NewDocumentEnvironment { BNiceArrayRC } { }
+ {
+ \int_zero:N \l_@@_last_col_int
+ \int_zero:N \l_@@_first_row_int
+ \BNiceArray
+ }
+ { \endBNiceArray }
+ \NewDocumentEnvironment { vNiceArrayRC } { }
+ {
+ \int_zero:N \l_@@_last_col_int
+ \int_zero:N \l_@@_first_row_int
+ \vNiceArray
+ }
+ { \endvNiceArray }
+ \NewDocumentEnvironment { VNiceArrayRC } { }
+ {
+ \int_zero:N \l_@@_last_col_int
+ \int_zero:N \l_@@_first_row_int
+ \VNiceArray
+ }
+ { \endVNiceArray }
+ \NewDocumentEnvironment { NiceArrayCwithDelims } { }
+ {
+ \int_zero:N \l_@@_last_col_int
+ \NiceArrayWithDelims
+ }
+ { \endNiceArrayWithDelims }
+ \NewDocumentEnvironment { NiceArrayRCwithDelims } { }
+ {
+ \int_zero:N \l_@@_last_col_int
+ \int_zero:N \l_@@_first_row_int
+ \NiceArrayWithDelims
+ }
+ { \endNiceArrayWithDelims }
}
% \end{macrocode}
%
+%
%
% \vspace{1cm}
% \section{History}
@@ -9060,6 +9148,13 @@ version 2005/12/01 or later.
% The code of \pkg{nicematrix} no longer uses Tikz but only \textsc{pgf}. By
% default, Tikz is \emph{not} loaded by \pkg{nicematrix}.
%
+% \subsection*{Changes between versions 3.12 and 3.13}
+%
+% Correction of a bug (question 60761504 on |stakoverflow|).
+%
+% Best error messages when the user uses |&| or |\\| when |light-syntax| is in
+% force.
+%
% \PrintIndex
%
% \tableofcontents