diff options
author | Karl Berry <karl@freefriends.org> | 2023-06-30 20:51:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-06-30 20:51:26 +0000 |
commit | 4f781dbd163d1420e48aa24bf2967ba2eee0af03 (patch) | |
tree | 2d0e4462a580026a5bcd7e6553a5c74f5eb9d74e /Master/texmf-dist | |
parent | 709e4fef5d5ea4962dbf30b1e4628776edd963e0 (diff) |
nicematrix (30jun23)
git-svn-id: svn://tug.org/texlive/trunk@67516 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/nicematrix/nicematrix-code.pdf | bin | 911018 -> 912191 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf | bin | 581333 -> 581086 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex | 77 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf | bin | 596415 -> 596800 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex | 75 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx | 87 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty | 48 |
7 files changed, 183 insertions, 104 deletions
diff --git a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-code.pdf b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-code.pdf Binary files differindex 384552b056a..1e27e66ce00 100644 --- a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-code.pdf +++ b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-code.pdf diff --git a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf Binary files differindex 7a0776a2bb5..de3bb303324 100644 --- a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf +++ b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.pdf diff --git a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex index 688e3b032bd..6fd43c26a63 100644 --- a/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex +++ b/Master/texmf-dist/doc/latex/nicematrix/nicematrix-french.tex @@ -3231,6 +3231,7 @@ $\begin{bNiceMatrix} \colorbox{yellow!50}{\textbf{Nouveau 6.20}}\enskip Avec la clé |xdots/horizontal-labels|, les labels restent horizontaux.\par\nobreak +\smallskip \begin{BVerbatim}[baseline=c,boxwidth=10cm] $\begin{bNiceMatrix}[xdots/horizontal-labels] 1 & \hspace*{1cm} & 0 \\[8mm] @@ -4135,7 +4136,9 @@ les notes de pied de page). \item Si une commande |\tabularnote{...}| se trouve exactement à la fin d'une case (sans aucun espace après), l'appel de note est composé en débordement vers la droite (cela peut permettre de mieux conserver l'alignement des contenus d'une -colonne). +colonne). Depuis la version 6.20a, ce comportement n'a lieu que le mode +l'alignement de la cellule est |c| ou |r| (alignement horizontal centré ou en +butée à droite). \item Si la clé |notes/para| est utilisée, les notes sont composées à la fin du tableau en un seul paragraphe. @@ -4159,8 +4162,8 @@ l'environnement |{TabularNote}| à la fin de l'environnement |{NiceTabular}| argument, une seule note est insérée en fin de tableau (mais tous les labels sont marqués). Il est possible de désactiver cette fonctionnalité avec la clé |notes/detect-duplicates|.\footnote{Pour des raisons techniques, il n'est pas - autorisé de mettre des |\tabularnote| avec exactement le même argument dans la - légende.} + autorisé de mettre plusieurs |\tabularnote| avec exactement le même argument + dans la légende.} \item Il est possible de référencer une note de tableau (avec la commande |\label| placée après le |\tabularnote|). @@ -4930,15 +4933,16 @@ environnements (pour LaTeX, il s'agit d'une commande — complètement développ \smallskip \index{name!clé pour un environnement} -Il est néanmoins recommandé de passer plutôt par la clé |name|. Celle-ci permet -de donner un nom à l'environnement. Une fois l'environnement nommé, les nœuds -sont accessibles à travers les noms «\textsl{nom}-$i$-$j$» où \textsl{nom} est -le nom donné au tableau et $i$ et $j$ les numéros de rangée et de colonne de la -case considérée. On peut les utiliser avec \textsc{pgf} mais l'utilisateur final -préférera sans doute utiliser TikZ (qui est une sur-couche de \textsc{pgf}). Il -faut néanmoins se souvenir que \pkg{nicematrix} ne charge pas TikZ par défaut. -Dans les exemples qui suivent, on suppose que TikZ a été chargé par -l'utilisateur. +Il est néanmoins recommandé de passer plutôt par la clé |name|\footnote{Depuis + la version 6.20a, la valeur passée à cette clé est \emph{développée}, au sens + de TeX.}. Celle-ci permet de donner un nom à l'environnement. Une fois +l'environnement nommé, les nœuds sont accessibles à travers les noms +«\textsl{nom}-$i$-$j$» où \textsl{nom} est le nom donné au tableau et $i$ et $j$ +les numéros de rangée et de colonne de la case considérée. On peut les utiliser +avec \textsc{pgf} mais l'utilisateur final préférera sans doute utiliser TikZ +(qui est une sur-couche de \textsc{pgf}). Il faut néanmoins se souvenir que +\pkg{nicematrix} ne charge pas TikZ par défaut. Dans les exemples qui suivent, +on suppose que TikZ a été chargé par l'utilisateur. \medskip \begin{BVerbatim}[baseline=c,boxwidth=11cm] @@ -6240,32 +6244,35 @@ On peut même tracer des lignes continues.\footnote{Dans ce document, la sur la forme des pointes de flèches.} \begin{Verbatim} -\NiceMatrixOptions - {nullify-dots,code-for-first-col = \color{blue},code-for-first-row=\color{blue}} -$\begin{pNiceMatrix}[first-row,first-col,xdots/horizontal-labels] - & & \Ldots[line-style={solid,<->},shorten=0pt]^{n \text{ colonnes}} \\ - & 1 & 1 & 1 & \Ldots & 1 \\ - & 1 & 1 & 1 & & 1 \\ -\Vdots[line-style={solid,<->}]_{n \text{ rangées}} - & 1 & 1 & 1 & & 1 \\ - & 1 & 1 & 1 & & 1 \\ - & 1 & 1 & 1 & \Ldots & 1 -\end{pNiceMatrix}$ +\tikzset{H/.style = {solid,<->,shorten > = -1mm, shorten < = -1mm}} +\tikzset{V/.style = {solid,<->}} +\NiceMatrixOptions{xdots/horizontal-labels} +$\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin] +\Hdotsfor[line-style=H]{3}^{3} & \Hdotsfor[line-style=H]{2}^{2} \\ +2 & 1 & 1 & 1 & 1 & \hspace*{4mm}\Vdotsfor[line-style=V]{3}^{3}\\ +1 & 1 & 1 & 1 & 1 \\ +1 & 1 & 1 & 1 & 1 \\ +\Hline +1 & 1 & 1 & 1 & 1 & \Vdotsfor[line-style=V]{2}^{2}\\ +1 & 1 & 1 & 1 & 1 \\ +\end{pNiceArray}$ \end{Verbatim} -\begin{scope} -\NiceMatrixOptions - {nullify-dots,code-for-first-col = \color{blue},code-for-first-row=\color{blue}} -\[\begin{pNiceMatrix}[first-row,first-col,xdots/horizontal-labels] - & & \Ldots[line-style={solid,<->},shorten=0pt]^{n \text{ colonnes}} \\ - & 1 & 1 & 1 & \Ldots & 1 \\ - & 1 & 1 & 1 & & 1 \\ -\Vdots[line-style={solid,<->}]_{n \text{ rangées}} & 1 & 1 & 1 & & 1 \\ - & 1 & 1 & 1 & & 1 \\ - & 1 & 1 & 1 & \Ldots & 1 -\end{pNiceMatrix}\] -\end{scope} +\begin{center} +\tikzset{H/.style = {solid,<->,shorten > = -1mm, shorten < = -1mm}} +\tikzset{V/.style = {solid,<->}} +\NiceMatrixOptions{xdots/horizontal-labels} +$\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin] +\Hdotsfor[line-style=H]{3}^{3} & \Hdotsfor[line-style=H]{2}^{2} \\ +2 & 1 & 1 & 1 & 1 & \hspace*{4mm}\Vdotsfor[line-style=V]{3}^{3}\\ +1 & 1 & 1 & 1 & 1 \\ +1 & 1 & 1 & 1 & 1 \\ +\Hline +1 & 1 & 1 & 1 & 1 & \Vdotsfor[line-style=V]{2}^{2}\\ +1 & 1 & 1 & 1 & 1 \\ +\end{pNiceArray}$ +\end{center} \subsection{Lignes en tiretés} diff --git a/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf b/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf Binary files differindex e754fc3aec8..ec377193568 100644 --- a/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf +++ b/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf diff --git a/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex b/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex index dc565d21602..9987ba819b3 100644 --- a/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex +++ b/Master/texmf-dist/doc/latex/nicematrix/nicematrix.tex @@ -3153,7 +3153,7 @@ $\begin{bNiceMatrix} \bigskip \colorbox{yellow!50}{\textbf{New 6.20}}\enskip -With the key |xdots/horizontal-labels|, the labels stay horizontal\par\nobreak +With the key |xdots/horizontal-labels|, the labels stay horizontal.\par\nobreak % \medskip \begin{BVerbatim}[baseline=c,boxwidth=10cm] @@ -4039,7 +4039,9 @@ together, separated by commas (this is similar to the option |multiple| of \item If a command |\tabularnote{...}| is exactly at the end of a cell (with no space at all after), the label of the note is composed in an overlapping position (towards the right). This structure may provide a better alignment of -the cells of a given column. +the cells of a given column. However, since the version 6.20a, that behaviour is +in force only when the horizontal alignment mode of the corresponding column is +|c| or |r|. \item If the key |notes/para| is used, the notes are composed at the end of the array in a single paragraph (as with the key |para| of \pkg{threeparttable}). @@ -4835,11 +4837,12 @@ counter). \smallskip \index{name!key for an environment} -However, it's advisable to use instead the key |name|. This key gives a name -to the current environment. When the environment has a name, the nodes are -accessible with the name ``\textsl{name}-$i$-$j$'' where \textsl{name} is the -name given to the array and $i$ and $j$ the numbers of row and column. It's -possible to use these nodes with \textsc{pgf} but the final user will +However, it's advisable to use instead the key |name|\footnote{Since the version + 6.20a, the value of that key is \emph{expanded} (in the TeX sens).}. This key +gives a name to the current environment. When the environment has a name, the +nodes are accessible with the name ``\textsl{name}-$i$-$j$'' where \textsl{name} +is the name given to the array and $i$ and $j$ the numbers of row and column. +It's possible to use these nodes with \textsc{pgf} but the final user will probably prefer to use Tikz (which is a convenient layer upon \textsc{pgf}). However, one should remind that \pkg{nicematrix} doesn't load Tikz by default. In the following examples, we assume that Tikz has been loaded. @@ -6147,31 +6150,36 @@ In fact, it's even possible to draw solid lines with the commands |\Cdots|, has been loaded, which impacts the shape of the arrow tips.} \begin{Verbatim} -\NiceMatrixOptions - {nullify-dots,code-for-first-col = \color{blue},code-for-first-row=\color{blue}} -$\begin{pNiceMatrix}[first-row,first-col,xdots/horizontal-labels] - & & \Ldots[line-style={solid,<->},shorten=0pt]^{n \text{ columns}} \\ - & 1 & 1 & 1 & \Ldots & 1 \\ - & 1 & 1 & 1 & & 1 \\ -\Vdots[line-style={solid,<->}]_{n \text{ rows}} & 1 & 1 & 1 & & 1 \\ - & 1 & 1 & 1 & & 1 \\ - & 1 & 1 & 1 & \Ldots & 1 -\end{pNiceMatrix}$ +\tikzset{H/.style = {solid,<->,shorten > = -1mm, shorten < = -1mm}} +\tikzset{V/.style = {solid,<->}} +\NiceMatrixOptions{xdots/horizontal-labels} +$\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin] +\Hdotsfor[line-style=H]{3}^{3} & \Hdotsfor[line-style=H]{2}^{2} \\ +2 & 1 & 1 & 1 & 1 & \hspace*{4mm}\Vdotsfor[line-style=V]{3}^{3}\\ +1 & 1 & 1 & 1 & 1 \\ +1 & 1 & 1 & 1 & 1 \\ +\Hline +1 & 1 & 1 & 1 & 1 & \Vdotsfor[line-style=V]{2}^{2}\\ +1 & 1 & 1 & 1 & 1 \\ +\end{pNiceArray}$ \end{Verbatim} -\begin{scope} -\NiceMatrixOptions - {nullify-dots,code-for-first-col = \color{blue},code-for-first-row=\color{blue}} -\[\begin{pNiceMatrix}[first-row,first-col,xdots/horizontal-labels] - & & \Ldots[line-style={solid,<->},shorten=0pt]^{n \text{ columns}} \\ - & 1 & 1 & 1 & \Ldots & 1 \\ - & 1 & 1 & 1 & & 1 \\ -\Vdots[line-style={solid,<->}]_{n \text{ rows}} & 1 & 1 & 1 & & 1 \\ - & 1 & 1 & 1 & & 1 \\ - & 1 & 1 & 1 & \Ldots & 1 -\end{pNiceMatrix}\] -\end{scope} +\begin{center} +\tikzset{H/.style = {solid,<->,shorten > = -1mm, shorten < = -1mm}} +\tikzset{V/.style = {solid,<->}} +\NiceMatrixOptions{xdots/horizontal-labels} +$\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin] +\Hdotsfor[line-style=H]{3}^{3} & \Hdotsfor[line-style=H]{2}^{2} \\ +2 & 1 & 1 & 1 & 1 & \hspace*{4mm}\Vdotsfor[line-style=V]{3}^{3}\\ +1 & 1 & 1 & 1 & 1 \\ +1 & 1 & 1 & 1 & 1 \\ +\Hline +1 & 1 & 1 & 1 & 1 & \Vdotsfor[line-style=V]{2}^{2}\\ +1 & 1 & 1 & 1 & 1 \\ +\end{pNiceArray}$ +\end{center} + \subsection{Dashed rules} \label{dashed} @@ -6877,6 +6885,15 @@ The successive versions of the file |nicematrix.sty| provided by TeXLive are ava \nolinkurl{https:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty} } +\subsection*{Changes between version 6.20 and 6.20a} + +The value of the key |name| of an environment of \pkg{nicematrix} is expanded +(in the TeX sens). + +The labels of the tabular notes (created by the command |\tabularnote|) are now +composed in an overlapping position \emph{only} when the horizontal alignment +mode of the column is |c| or |r|. + \subsection*{Changes between version 6.19 and 6.20} New key |xdots/horizontal-labels|. diff --git a/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx b/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx index 07b6fe8513e..86e54a5643d 100644 --- a/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx +++ b/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx @@ -17,8 +17,8 @@ % % \fi % \iffalse -\def\myfileversion{6.20} -\def\myfiledate{2023/06/04} +\def\myfileversion{6.20a} +\def\myfiledate{2023/06/30} % % %<*batchfile> @@ -801,11 +801,11 @@ version 2005/12/01 or later. % \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 example, a column |p[l]{3cm}| will provide the value |l| -% for all the cells of the column. +% |r|, |l|, |c| and |j|. For example, a column |p[l]{3cm}| will provide the +% value |l| for all the cells of the column. % \begin{macrocode} \str_new:N \l_@@_hpos_cell_str -\str_set:Nn \l_@@_hpos_cell_str { c } +\str_set:Nn \l_@@_hpos_cell_str { c } % \end{macrocode} % % \bigskip @@ -1779,7 +1779,8 @@ version 2005/12/01 or later. % sequence of successive commands |\tabularnote| and we have to format the % labels of these tabular notes (in the array). We compose those labels in a box % |\l_tmpa_box| because we will do a special construction in order to have this -% box in an overlapping position if we are at the end of a cell. +% box in an overlapping position if we are at the end of a cell when +% |\l_@@_hpos_cell_str| is equal to |c| or |r|. % \begin{macrocode} \hbox_set:Nn \l_tmpa_box { @@ -1802,14 +1803,20 @@ version 2005/12/01 or later. \int_compare:nNnT \l_tmpa_int = \c@tabularnote { \int_gincr:N \c@tabularnote } \seq_clear:N \l_@@_notes_labels_seq - \hbox_overlap_right:n { \box_use:N \l_tmpa_box } + \bool_lazy_or:nnTF + { \str_if_eq_p:Vn \l_@@_hpos_cell_str { c } } + { \str_if_eq_p:Vn \l_@@_hpos_cell_str { r } } + { + \hbox_overlap_right:n { \box_use:N \l_tmpa_box } % \end{macrocode} % If the command |\tabularnote| is used exactly at the end of the cell, the % |\unskip| (inserted by \pkg{array}?) will delete the skip we insert now % and the label of the footnote will be composed in an overlapping position (by % design). % \begin{macrocode} - \skip_horizontal:n { \box_wd:N \l_tmpa_box } + \skip_horizontal:n { \box_wd:N \l_tmpa_box } + } + { \box_use:N \l_tmpa_box } } } % \end{macrocode} @@ -2430,7 +2437,7 @@ version 2005/12/01 or later. % \begin{macrocode} \legacy_if:nF { measuring@ } { - \str_set:Nn \l_tmpa_str { #1 } + \str_set:Nx \l_tmpa_str { #1 } \seq_if_in:NVTF \g_@@_names_seq \l_tmpa_str { \@@_error:nn { Duplicate~name } { #1 } } { \seq_gput_left:NV \g_@@_names_seq \l_tmpa_str } @@ -3501,16 +3508,15 @@ version 2005/12/01 or later. % If there is one or several commands |\tabularnote| in the caption specified % by the key |caption| and if that caption has to be composed above the tabular, % we have now that information because it has been written in the |aux| file at -% a previous run. We use that information to start couting the tabular notes in -% the main array at the right value (that remember that the caption will be +% a previous run. We use that information to start counting the tabular notes in +% the main array at the right value (we remember that the caption will be % composed \emph{after} the array!). % \begin{macrocode} \tl_if_exist:NT \l_@@_note_in_caption_tl { \tl_if_empty:NF \l_@@_note_in_caption_tl { - \int_gset_eq:NN \g_@@_notes_caption_int - { \l_@@_note_in_caption_tl } + \int_gset_eq:NN \g_@@_notes_caption_int \l_@@_note_in_caption_tl \int_gset:Nn \c@tabularnote { \l_@@_note_in_caption_tl } } } @@ -4810,7 +4816,7 @@ version 2005/12/01 or later. { position = \int_eval:n { \c@jCol + 1 } , multiplicity = \int_use:N \l_tmpa_int , - total-width = \dim_use:N \l_tmpa_dim % added 2022-08-06 + total-width = \dim_use:N \l_tmpa_dim } % \end{macrocode} % We don't have provided value for |start| nor for |end|, which means that the @@ -4961,7 +4967,7 @@ version 2005/12/01 or later. % will provide the horizontal alignment of the column to which belongs the cell. % \begin{macrocode} \str_if_eq:VnTF \l_@@_hpos_col_str j - { \str_set:Nn \exp_not:N \l_@@_hpos_cell_str { c } } + { \str_set:Nn \exp_not:N \l_@@_hpos_cell_str { } } { \str_set:Nn \exp_not:N \l_@@_hpos_cell_str { \str_lowercase:V \l_@@_hpos_col_str } @@ -6088,6 +6094,21 @@ version 2005/12/01 or later. { \caption } { \caption [ \l_@@_short_caption_tl ] } { \l_@@_caption_tl } +% \end{macrocode} +% In some circonstancies (in particular when the package \pkg{caption} is +% loaded), the caption is composed several times. That's why, when the same +% tabular note is encountered (in the caption!), we consider that you are in the +% second compilation and you can give to |\g_@@_notes_caption_int| its final +% value, which is the number of tabular notes in the caption. But sometimes, the +% caption is composed only once. In that case, we fix the value of +% |\g_@@_caption_finished_bool| now. +% \begin{macrocode} + \bool_if:NF \g_@@_caption_finished_bool % added 2023/06/30 + { + \bool_gset_true:N \g_@@_caption_finished_bool + \int_gset_eq:NN \g_@@_notes_caption_int \c@tabularnote + \int_gzero:N \c@tabularnote + } \tl_if_empty:NF \l_@@_label_tl { \label { \l_@@_label_tl } } \group_end: } @@ -6857,7 +6878,7 @@ version 2005/12/01 or later. > { % \end{macrocode} -% At the beginning of the cell, we link |\CodeAfter| to a command which do +% At the beginning of the cell, we link |\CodeAfter| to a command which % begins with |\\| (whereas the standard version of |\CodeAfter| begins does % not). % \begin{macrocode} @@ -6956,7 +6977,7 @@ version 2005/12/01 or later. { \NewDocumentEnvironment { #1 NiceArray } { } { - \bool_gset_false:N \g_@@_NiceArray_bool + \bool_gset_false:N \g_@@_NiceArray_bool \str_if_empty:NT \g_@@_name_env_str { \str_gset:Nn \g_@@_name_env_str { #1 NiceArray } } \@@_test_if_math_mode: @@ -8308,14 +8329,17 @@ version 2005/12/01 or later. % We may think that the final user won't use a ``last column'' which contains % only a command |\Vdots|. However, if the |\Vdots| is in fact used to draw, not % a dotted line, but an arrow (to indicate the number of rows of the matrix), it -% may be really encountered. +% may be really encountered. That's why we do an adjustemnt for that case. % \begin{macrocode} \int_compare:nNnT \l_@@_last_col_int > { -2 } { \int_compare:nNnT \l_@@_initial_j_int = \g_@@_col_total_int { - \dim_set_eq:NN \l_tmpa_dim \l_@@_right_margin_dim - \dim_add:Nn \l_tmpa_dim \l_@@_extra_right_margin_dim + \dim_set:Nn \l_tmpa_dim + { + \l_@@_right_margin_dim + \l_@@_extra_right_margin_dim + + 2 mm + } \dim_add:Nn \l_@@_x_initial_dim \l_tmpa_dim \dim_add:Nn \l_@@_x_final_dim \l_tmpa_dim } @@ -8607,9 +8631,9 @@ version 2005/12/01 or later. } \draw [ - #1 , shorten~> = \l_@@_xdots_shorten_end_dim , shorten~< = \l_@@_xdots_shorten_start_dim , + #1 ] ( \l_@@_x_initial_dim , \l_@@_y_initial_dim ) % \end{macrocode} @@ -9136,6 +9160,7 @@ version 2005/12/01 or later. \tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl \exp_args:NNV \NewDocumentCommand \@@_Vdotsfor: \l_@@_argspec_tl { + \bool_gset_true:N \g_@@_empty_cell_bool % added \tl_gput_right:Nx \g_@@_HVdotsfor_lines_tl { \@@_Vdotsfor:nnnn @@ -13287,8 +13312,8 @@ version 2005/12/01 or later. % % % -% We will extract the potential keys |columns-type|, |l|, |c|, |r| and pass -% the other keys to the environment |{NiceArrayWithDelims}|. +% We will extract some keys and pass the other keys to the environment +% |{NiceArrayWithDelims}|. % \begin{macrocode} \keys_define:nn { NiceMatrix / Auto } { @@ -13321,6 +13346,11 @@ version 2005/12/01 or later. % \begin{macrocode} \group_begin: \bool_set_true:N \l_@@_Matrix_bool + \str_if_eq:nnT { #1 } { . } + { + \str_if_eq:nnT { #2 } { . } + { \bool_set_false:N \l_@@_Matrix_bool } + } \keys_set_known:nnN { NiceMatrix / Auto } { #6 } \l_tmpa_tl % \end{macrocode} % We nullify the command |\@@_transform_preamble:| because we will provide a @@ -13363,13 +13393,14 @@ version 2005/12/01 or later. \group_end: } % \end{macrocode} +% % % \begin{macrocode} \cs_set_protected:Npn \@@_define_com:nnn #1 #2 #3 { \cs_set_protected:cpn { #1 AutoNiceMatrix } { - \bool_gset_false:N \g_@@_NiceArray_bool + \bool_gset_false:N \g_@@_NiceArray_bool \str_gset:Nx \g_@@_name_env_str { #1 AutoNiceMatrix } \AutoNiceMatrixWithDelims { #2 } { #3 } } @@ -13388,9 +13419,10 @@ version 2005/12/01 or later. % We define also a command |\AutoNiceMatrix| similar to the environment |{NiceMatrix}|. % \begin{macrocode} \NewDocumentCommand \AutoNiceMatrix { O { } m O { } m ! O { } } - { + { \group_begin: - \bool_gset_true:N \g_@@_NiceArray_bool + \bool_gset_true:N \g_@@_NiceArray_bool + % \bool_set_true:N \l_@@_Matrix_bool \AutoNiceMatrixWithDelims . . { #2 } { #4 } [ #1 , #3 , #5 ] \group_end: } @@ -16061,7 +16093,8 @@ version 2005/12/01 or later. if~you~use~'columns-width=auto'.~If~you~don't~want~to~see~this~ message~again,~use~the~key~'allow-duplicate-names'~in~ '\token_to_str:N \NiceMatrixOptions'.\\ - \c_@@_available_keys_str + \bool_if:NF \c_@@_messages_for_Overleaf_bool + { For~a~list~of~the~names~already~used,~type~H~<return>. } } { The~names~already~defined~in~this~document~are:~ diff --git a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty index a04f78a423b..32575a9841a 100644 --- a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty +++ b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty @@ -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.20} -\def\myfiledate{2023/06/04} +\def\myfileversion{6.20a} +\def\myfiledate{2023/06/30} \RequirePackage{pgfcore} \usepgfmodule{shapes} \RequirePackage{l3keys2e} @@ -593,8 +593,14 @@ \int_compare:nNnT \l_tmpa_int = \c@tabularnote { \int_gincr:N \c@tabularnote } \seq_clear:N \l__nicematrix_notes_labels_seq - \hbox_overlap_right:n { \box_use:N \l_tmpa_box } - \skip_horizontal:n { \box_wd:N \l_tmpa_box } + \bool_lazy_or:nnTF + { \str_if_eq_p:Vn \l__nicematrix_hpos_cell_str { c } } + { \str_if_eq_p:Vn \l__nicematrix_hpos_cell_str { r } } + { + \hbox_overlap_right:n { \box_use:N \l_tmpa_box } + \skip_horizontal:n { \box_wd:N \l_tmpa_box } + } + { \box_use:N \l_tmpa_box } } } \cs_new_protected:Npn \__nicematrix_tabularnote_caption:nn #1 #2 @@ -892,7 +898,7 @@ name .code:n = \legacy_if:nF { measuring@ } { - \str_set:Nn \l_tmpa_str { #1 } + \str_set:Nx \l_tmpa_str { #1 } \seq_if_in:NVTF \g__nicematrix_names_seq \l_tmpa_str { \__nicematrix_error:nn { Duplicate~name } { #1 } } { \seq_gput_left:NV \g__nicematrix_names_seq \l_tmpa_str } @@ -1511,8 +1517,7 @@ { \tl_if_empty:NF \l__nicematrix_note_in_caption_tl { - \int_gset_eq:NN \g__nicematrix_notes_caption_int - { \l__nicematrix_note_in_caption_tl } + \int_gset_eq:NN \g__nicematrix_notes_caption_int \l__nicematrix_note_in_caption_tl \int_gset:Nn \c@tabularnote { \l__nicematrix_note_in_caption_tl } } } @@ -2140,7 +2145,7 @@ { position = \int_eval:n { \c@jCol + 1 } , multiplicity = \int_use:N \l_tmpa_int , - total-width = \dim_use:N \l_tmpa_dim % added 2022-08-06 + total-width = \dim_use:N \l_tmpa_dim } } \int_zero:N \l_tmpa_int @@ -2229,7 +2234,7 @@ { \dim_eval:n { #1 } } { \str_if_eq:VnTF \l__nicematrix_hpos_col_str j - { \str_set:Nn \exp_not:N \l__nicematrix_hpos_cell_str { c } } + { \str_set:Nn \exp_not:N \l__nicematrix_hpos_cell_str { } } { \str_set:Nn \exp_not:N \l__nicematrix_hpos_cell_str { \str_lowercase:V \l__nicematrix_hpos_col_str } @@ -2896,6 +2901,12 @@ { \caption } { \caption [ \l__nicematrix_short_caption_tl ] } { \l__nicematrix_caption_tl } + \bool_if:NF \g__nicematrix_caption_finished_bool % added 2023/06/30 + { + \bool_gset_true:N \g__nicematrix_caption_finished_bool + \int_gset_eq:NN \g__nicematrix_notes_caption_int \c@tabularnote + \int_gzero:N \c@tabularnote + } \tl_if_empty:NF \l__nicematrix_label_tl { \label { \l__nicematrix_label_tl } } \group_end: } @@ -4259,8 +4270,11 @@ { \int_compare:nNnT \l__nicematrix_initial_j_int = \g__nicematrix_col_total_int { - \dim_set_eq:NN \l_tmpa_dim \l__nicematrix_right_margin_dim - \dim_add:Nn \l_tmpa_dim \l__nicematrix_extra_right_margin_dim + \dim_set:Nn \l_tmpa_dim + { + \l__nicematrix_right_margin_dim + \l__nicematrix_extra_right_margin_dim + + 2 mm + } \dim_add:Nn \l__nicematrix_x_initial_dim \l_tmpa_dim \dim_add:Nn \l__nicematrix_x_final_dim \l_tmpa_dim } @@ -4429,9 +4443,9 @@ } \draw [ - #1 , shorten~> = \l__nicematrix_xdots_shorten_end_dim , shorten~< = \l__nicematrix_xdots_shorten_start_dim , + #1 ] ( \l__nicematrix_x_initial_dim , \l__nicematrix_y_initial_dim ) -- node [ __nicematrix_node_above ] { $ \scriptstyle #2 $ } @@ -4806,6 +4820,7 @@ \tl_set_rescan:Nno \l__nicematrix_argspec_tl { } \l__nicematrix_argspec_tl \exp_args:NNV \NewDocumentCommand \__nicematrix_Vdotsfor: \l__nicematrix_argspec_tl { + \bool_gset_true:N \g__nicematrix_empty_cell_bool % added \tl_gput_right:Nx \g__nicematrix_HVdotsfor_lines_tl { \__nicematrix_Vdotsfor:nnnn @@ -7423,6 +7438,11 @@ { \group_begin: \bool_set_true:N \l__nicematrix_Matrix_bool + \str_if_eq:nnT { #1 } { . } + { + \str_if_eq:nnT { #2 } { . } + { \bool_set_false:N \l__nicematrix_Matrix_bool } + } \keys_set_known:nnN { NiceMatrix / Auto } { #6 } \l_tmpa_tl \cs_set_eq:NN \__nicematrix_transform_preamble: \prg_do_nothing: \use:x @@ -7470,6 +7490,7 @@ { \group_begin: \bool_gset_true:N \g__nicematrix_NiceArray_bool + % \bool_set_true:N \l__nicematrix_Matrix_bool \AutoNiceMatrixWithDelims . . { #2 } { #4 } [ #1 , #3 , #5 ] \group_end: } @@ -9376,7 +9397,8 @@ if~you~use~'columns-width=auto'.~If~you~don't~want~to~see~this~ message~again,~use~the~key~'allow-duplicate-names'~in~ '\token_to_str:N \NiceMatrixOptions'.\\ - \c__nicematrix_available_keys_str + \bool_if:NF \c__nicematrix_messages_for_Overleaf_bool + { For~a~list~of~the~names~already~used,~type~H~<return>. } } { The~names~already~defined~in~this~document~are:~ |