summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nicematrix/nicematrix.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-02-06 03:05:49 +0000
committerNorbert Preining <norbert@preining.info>2023-02-06 03:05:49 +0000
commit30803eebab6e94772482c1690e47cd17917875f5 (patch)
tree407a3a70ee3a368558ec7335a160314b55b509cc /macros/latex/contrib/nicematrix/nicematrix.dtx
parent478726121e4185461616cf790eb4da8604ae2e2c (diff)
CTAN sync 202302060305
Diffstat (limited to 'macros/latex/contrib/nicematrix/nicematrix.dtx')
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.dtx79
1 files changed, 62 insertions, 17 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx
index 71f6ee632c..02d0f8e8b8 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix.dtx
@@ -2,7 +2,7 @@
%
% This file should be compiled with $xelatex$.
%
-% Copyright (C) 2018-2022 by F. Pantigny
+% Copyright (C) 2018-2023 by F. Pantigny
% -----------------------------------
%
% This file may be distributed and/or modified under the
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.13e}
-\def\myfiledate{2022/12/12}
+\def\myfileversion{6.13f}
+\def\myfiledate{2023/02/05}
%
%
%<*batchfile>
@@ -29,7 +29,7 @@
\preamble
-Copyright (C) 2018-2022 by F. Pantigny
+Copyright (C) 2018-2023 by F. Pantigny
-----------------------------------
This file may be distributed and/or modified under the
@@ -2258,7 +2258,8 @@ version 2005/12/01 or later.
% 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
+% also provides an environment |{NiceTabularX}| with a syntax similar to the
+% syntax of |{tabularx}|, that is to say with a first mandatory argument
% which is the width of the tabular.\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
@@ -3262,6 +3263,15 @@ version 2005/12/01 or later.
% \end{pNiceArray}\]
%
%
+% \bigskip
+% The command |\SubMatrix| is, in fact, also available in the |\CodeBefore|. By
+% using |\SubMatrix| in the |\CodeBefore|, the delimiters drawn by those
+% commands |\SubMatrix| are taken into account to limit the continuous dotted
+% lines (drawn by |\Cdots|, |\Vdots|, etc.) which have an open extremity.
+%
+% For an example, see voir \ref{submatrix-in-codebefore}
+% p.~\pageref{submatrix-in-codebefore}.
+%
% \subsection{The commands \textbackslash OverBrace and \textbackslash
% UnderBrace in the \textbackslash CodeAfter}
%
@@ -5733,6 +5743,8 @@ version 2005/12/01 or later.
%
% \subsection{Utilisation of \textbackslash SubMatrix in the \textbackslash CodeBefore}
%
+% \label{submatrix-in-codebefore}
+%
% In the following example, we illustrate the mathematical product of two
% matrices.
%
@@ -10753,7 +10765,12 @@ version 2005/12/01 or later.
\int_compare:nNnT
{ \box_ht:N \l_@@_cell_box }
>
- { \box_ht:N \@arstrutbox }
+% \end{macrocode}
+% Previously, we had |\@arstrutbox| and not |\strutbox| in the following line
+% but the code in \pkg{array} has changed in v 2.5g and we follow the change
+% (see \emph{array: Correctly identify single-line m-cells} in LaTeX~News~36).
+% \begin{macrocode}
+ { \box_ht:N \strutbox }
{
\hbox_set:Nn \l_@@_cell_box
{
@@ -11120,27 +11137,32 @@ version 2005/12/01 or later.
% \bigskip
% After a specifier of column, we have to test whether there is one or several
% |<{..}| because, after those potential |<{...}|, we have to insert
-% |!{\skip_horizontal:N ...}| when the key |vlines| is used.
+% |!{\skip_horizontal:N ...}| when the key |vlines| is used. In fact, we have
+% also to test wheter there is, after the |<{...}|, a |@{...}|.
% \begin{macrocode}
\cs_new_protected:Npn \@@_patch_preamble_xi:n #1
{
\str_if_eq:nnTF { #1 } { < }
\@@_patch_preamble_xiii:n
{
- \tl_if_eq:NnTF \l_@@_vlines_clist { all }
- {
- \tl_gput_right:Nn \g_@@_preamble_tl
- { ! { \skip_horizontal:N \arrayrulewidth } }
- }
- {
- \exp_args:NNx
- \clist_if_in:NnT \l_@@_vlines_clist { \int_eval:n { \c@jCol + 1 } }
+ \str_if_eq:nnTF { #1 } { @ }
+ \@@_patch_preamble_xv:n
+ {
+ \tl_if_eq:NnTF \l_@@_vlines_clist { all }
{
\tl_gput_right:Nn \g_@@_preamble_tl
{ ! { \skip_horizontal:N \arrayrulewidth } }
}
- }
- \@@_patch_preamble:n { #1 }
+ {
+ \exp_args:NNx
+ \clist_if_in:NnT \l_@@_vlines_clist { \int_eval:n { \c@jCol + 1 } }
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl
+ { ! { \skip_horizontal:N \arrayrulewidth } }
+ }
+ }
+ \@@_patch_preamble:n { #1 }
+ }
}
}
% \end{macrocode}
@@ -11153,6 +11175,29 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+% We have to catch a |@{...}| after a specifier of column because, if we have to
+% draw a vertical rule, we have to add in that |@{...}| a |\hskip| corresponding
+% to the width of the vertical rule.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_preamble_xv:n #1
+ {
+ \tl_if_eq:NnTF \l_@@_vlines_clist { all }
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl
+ { @ { #1 \skip_horizontal:N \arrayrulewidth } }
+ }
+ {
+ \exp_args:NNx
+ \clist_if_in:NnT \l_@@_vlines_clist { \int_eval:n { \c@jCol + 1 } }
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl
+ { @ { #1 \skip_horizontal:N \arrayrulewidth } }
+ }
+ }
+ \@@_patch_preamble:n
+ }
+% \end{macrocode}
+%
% \bigskip
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_preamble:Nn #1 #2