From 1826cb7a886c82a06bcc09d387800419855f672d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 5 Feb 2023 21:15:42 +0000 Subject: nicematrix (5feb23) git-svn-id: svn://tug.org/texlive/trunk@65739 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/nicematrix/nicematrix-french.pdf | Bin 510920 -> 511895 bytes .../doc/latex/nicematrix/nicematrix-french.tex | 19 ++++- .../texmf-dist/doc/latex/nicematrix/nicematrix.pdf | Bin 1326867 -> 1331647 bytes .../source/latex/nicematrix/nicematrix.dtx | 79 ++++++++++++++++----- .../source/latex/nicematrix/nicematrix.ins | 2 +- .../texmf-dist/tex/latex/nicematrix/nicematrix.sty | 47 ++++++++---- 6 files changed, 113 insertions(+), 34 deletions(-) diff --git a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf index 4c02bff4e4f..54cdad46464 100644 Binary files a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf and b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf differ diff --git a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex index 7ada2b36dbf..1adb3a823d2 100644 --- a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex +++ b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex @@ -2273,8 +2273,9 @@ clé |width| (dans |{NiceTabular}| ou dans |\NiceMatrixOptions|). La valeur initiale de ce paramètre est |\linewidth| (et non |\textwidth|). Pour se rapprocher davantage de l'environnement |{tabularx}|, \pkg{nicematrix} -propose aussi un environnement |{NiceTabularX}| qui prend en premier argument -(obligatoire) la largeur voulue pour le tableau.\footnote{Si \pkg{tabularx} est +propose aussi un environnement |{NiceTabularX}| avec une syntaxe similaire à +celle de |{tabularx}|, c'est-à-dire que la largeur voulue pour le tableau est +spécifiée en premier argument (obligatoire).\footnote{Si \pkg{tabularx} est chargé, on doit obligatoirement utiliser |{NiceTabularX}| pour utiliser les colonnes |X| (cela est dû à un problème de conflit de définition des spécificateurs de colonne |X|).} @@ -3295,6 +3296,15 @@ a_{21} & \displaystyle \int_0^1\dfrac{1}{x^2+1}\,dx & a_{23} \\ a_{31} & a_{32} & a_{33} \end{pNiceArray}\] +\bigskip +La commande |\SubMatrix| est en fait aussi disponible dans le |\CodeBefore|. +L'intérêt d'utiliser |\SubMatrix| dans le |\CodeBefore| est que les délimiteurs +tracés par ces commandes |\SubMatrix| sont alors prises en compte pour limiter les +lignes en pointillés continues (créées par |\Cdots|, |\Vdots|, etc.) qui ont +une extrémité ouverte. + +Pour un exemple, voir \ref{submatrix-in-codebefore} +p.~\pageref{submatrix-in-codebefore}. \subsection{Les commandes \textbackslash OverBrace et \textbackslash @@ -3820,7 +3830,7 @@ charge par \pkg{nicematrix}. -\subsection{Colonne par défaut dans \{NiceMatrix\}} +\subsection{Type de colonne par défaut dans \{NiceMatrix\}} \label{columns-type} @@ -5816,6 +5826,9 @@ a & a & a & L_3 \subsection{Utilisation de \textbackslash SubMatrix dans le \textbackslash CodeBefore} + +\label{submatrix-in-codebefore} + Dans l'exemple suivant, on illustre le produit mathématique de deux matrices. L'ensemble de la figure est un environnement |{NiceArray}| et les trois paires diff --git a/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf b/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf index 94269ea86d2..76fa5d3fe82 100644 Binary files a/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf and b/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf differ diff --git a/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx b/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx index 71f6ee632c6..02d0f8e8b8c 100644 --- a/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx +++ b/Master/texmf-dist/source/latex/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 diff --git a/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins b/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins index 2bfd59f5679..814600f7c2b 100644 --- a/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins +++ b/Master/texmf-dist/source/latex/nicematrix/nicematrix.ins @@ -17,7 +17,7 @@ \usedir{tex/latex/nicematrix} \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 conditions of the LaTeX Project Public License, either diff --git a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty index ef9357348a4..f9cb813cd99 100644 --- a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty +++ b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty @@ -6,7 +6,7 @@ %% %% nicematrix.dtx (with options: `package') %% -%% Copyright (C) 2018-2022 by F. Pantigny +%% Copyright (C) 2018-2023 by F. Pantigny %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -18,8 +18,8 @@ %% and version 1.3 or later is part of all distributions of %% LaTeX version 2005/12/01 or later. %% -\def\myfileversion{6.13e} -\def\myfiledate{2022/12/12} +\def\myfileversion{6.13f} +\def\myfiledate{2023/02/05} \RequirePackage{pgfcore} \usepgfmodule{shapes} @@ -2299,7 +2299,7 @@ \int_compare:nNnT { \box_ht:N \l__nicematrix_cell_box } > - { \box_ht:N \@arstrutbox } + { \box_ht:N \strutbox } { \hbox_set:Nn \l__nicematrix_cell_box { @@ -2535,20 +2535,24 @@ \str_if_eq:nnTF { #1 } { < } \__nicematrix_patch_preamble_xiii:n { - \tl_if_eq:NnTF \l__nicematrix_vlines_clist { all } - { - \tl_gput_right:Nn \g__nicematrix_preamble_tl - { ! { \skip_horizontal:N \arrayrulewidth } } - } + \str_if_eq:nnTF { #1 } { @ } + \__nicematrix_patch_preamble_xv:n { - \exp_args:NNx - \clist_if_in:NnT \l__nicematrix_vlines_clist { \int_eval:n { \c@jCol + 1 } } + \tl_if_eq:NnTF \l__nicematrix_vlines_clist { all } { \tl_gput_right:Nn \g__nicematrix_preamble_tl { ! { \skip_horizontal:N \arrayrulewidth } } } - } - \__nicematrix_patch_preamble:n { #1 } + { + \exp_args:NNx + \clist_if_in:NnT \l__nicematrix_vlines_clist { \int_eval:n { \c@jCol + 1 } } + { + \tl_gput_right:Nn \g__nicematrix_preamble_tl + { ! { \skip_horizontal:N \arrayrulewidth } } + } + } + \__nicematrix_patch_preamble:n { #1 } + } } } \cs_new_protected:Npn \__nicematrix_patch_preamble_xiii:n #1 @@ -2556,6 +2560,23 @@ \tl_gput_right:Nn \g__nicematrix_preamble_tl { < { #1 } } \__nicematrix_patch_preamble_xi:n } +\cs_new_protected:Npn \__nicematrix_patch_preamble_xv:n #1 + { + \tl_if_eq:NnTF \l__nicematrix_vlines_clist { all } + { + \tl_gput_right:Nn \g__nicematrix_preamble_tl + { @ { #1 \skip_horizontal:N \arrayrulewidth } } + } + { + \exp_args:NNx + \clist_if_in:NnT \l__nicematrix_vlines_clist { \int_eval:n { \c@jCol + 1 } } + { + \tl_gput_right:Nn \g__nicematrix_preamble_tl + { @ { #1 \skip_horizontal:N \arrayrulewidth } } + } + } + \__nicematrix_patch_preamble:n + } \cs_new_protected:Npn \__nicematrix_set_preamble:Nn #1 #2 { \group_begin: -- cgit v1.2.3