diff options
author | Norbert Preining <norbert@preining.info> | 2021-06-06 03:02:43 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-06-06 03:02:43 +0000 |
commit | 4338972cc175be565a3441c4ae8a6aa0dfcbe9f9 (patch) | |
tree | 9ec52a5d0d9c8a00b1a6801cc82248c0c008465d /macros/latex/contrib/nicematrix | |
parent | 4e703bdd2f304028698cd4ab92b0dda0b95a95a8 (diff) |
CTAN sync 202106060302
Diffstat (limited to 'macros/latex/contrib/nicematrix')
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix-french.pdf | bin | 462481 -> 462567 bytes | |||
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix-french.tex | 2 | ||||
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix.dtx | 229 | ||||
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix.pdf | bin | 1248363 -> 1305091 bytes |
4 files changed, 110 insertions, 121 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf Binary files differindex 972985be67..646ec7e301 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf +++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex index b9f2c80453..c80c13f352 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.tex +++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex @@ -4348,7 +4348,7 @@ a_p & &&a_0 & & &b_1 \\ \end{scope} \vspace{2cm} -Un exemple avec un système linéaire:\par\nobreak +Un exemple avec un système linéaire: \begin{Verbatim} $\begin{pNiceArray}{*6c|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle] diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx index 0718d3cae5..32206348c0 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.dtx +++ b/macros/latex/contrib/nicematrix/nicematrix.dtx @@ -15,8 +15,8 @@ % % \fi % \iffalse -\def\myfileversion{5.15a} -\def\myfiledate{2021/05/06} +\def\myfileversion{5.15b} +\def\myfiledate{2021/06/05} % % %<*batchfile> @@ -1665,7 +1665,7 @@ version 2005/12/01 or later. % % It's possible to access the preceding tools with a syntax close to the syntax % of \pkg{colortbl}. For that, one must use the key |colortbl-like| in the -% current environment.\footnote{As for now, this key is \emph{not} available in |\NiceMatrixOptions|.} +% current environment.\footnote{Up to now, this key is \emph{not} available in |\NiceMatrixOptions|.} % % There are three commands available (they are inspired by \pkg{colortbl} but % are \emph{independent} of \pkg{colortbl}): @@ -4134,7 +4134,7 @@ version 2005/12/01 or later. % \end{Verbatim} % % \bigskip -% As for now, the package \pkg{nicematrix} is not compatible with +% Up to now, the package \pkg{nicematrix} is not compatible with % \cls{aastex63}. If you want to use \pkg{nicematrix} with \cls{aastex63}, send % me an email and I will try to solve the incompatibilies. % @@ -5276,87 +5276,7 @@ version 2005/12/01 or later. } % \end{macrocode} % -% \medskip -% The command |\NC@rewrite@S| is a LaTeX command created by \pkg{siunitx} in -% connection with the |S| column. In the code of \pkg{siunitx}, this command is -% defined by: -% \begin{Verbatim}[commandchars=\~\!\+, formatcom = \small] -% \renewcommand*{\NC@rewrite@S}[1][] -% { -% \@temptokena \exp_after:wN -% { -% \tex_the:D \@temptokena -% > { \__siunitx_table_collect_begin: S {#1} } -% c -% < { \__siunitx_table_print: } -% } -% \NC@find -% } -% \end{Verbatim} -% We want to patch this command (in the environments of \pkg{nicematrix}) in -% order to have: -% \begin{Verbatim}[commandchars=\~\!\+, formatcom = \small] -% \renewcommand*{\NC@rewrite@S}[1][] -% { -% \@temptokena \exp_after:wN -% { -% \tex_the:D \@temptokena -% > { ~emphase!\@@_Cell:+ \__siunitx_table_collect_begin: S {#1} } -% ~emphase!\@@_true_c:+ -% < { \__siunitx_table_print: ~emphase!\@@_end_Cell:+ } -% } -% \NC@find -% } -% \end{Verbatim} -% However, we don't want do use explicitly any private command of \pkg{siunitx}. -% That's why we will extract the name of the two |\__siunitx...| commands by -% their position in the code of |\NC@rewrite@S|. -% -% Since the command |\NC@rewrite@S| appends some tokens to the \emph{toks} list -% |\@temptokena|, we use the LaTeX command |\NC@rewrite@S| in a group -% (|\group_begin:|--|\group_end:|) and we extract the two command names which -% are in the toks |\@temptokena|. However, this extraction can be done only -% when \pkg{siunitx} is loaded (and it may be loaded after \pkg{nicematrix}) -% and, in fact, after the beginning of the document --- because some -% instructions of \pkg{siunitx} are executed in a |\AtBeginDocument|). That's -% why this extraction will be done only at the first use of an -% environment of \pkg{nicematrix} with the command |\@@_adapt_S_column:|. -% \begin{macrocode} -\cs_set_protected:Npn \@@_adapt_S_column: - { - \bool_if:NT \c_@@_siunitx_loaded_bool - { - \group_begin: - \@temptokena = { } -% \end{macrocode} -% We protect |\NC@find| which is at the end of |\NC@rewrite@S|. -% \begin{macrocode} - \cs_set_eq:NN \NC@find \prg_do_nothing: - \NC@rewrite@S { } -% \end{macrocode} -% Conversion of the \emph{toks} |\@temptokena| in a token list of \pkg{expl3} -% (the toks are not supported by \pkg{expl3} but we can, nevertheless, use the -% option |V| for |\tl_gset:NV|). -% \begin{macrocode} - \tl_gset:NV \g_tmpa_tl \@temptokena - \group_end: - \tl_new:N \c_@@_table_collect_begin_tl - \tl_set:Nx \l_tmpa_tl { \tl_item:Nn \g_tmpa_tl 2 } - \tl_gset:Nx \c_@@_table_collect_begin_tl { \tl_item:Nn \l_tmpa_tl 1 } - \tl_new:N \c_@@_table_print_tl - \tl_gset:Nx \c_@@_table_print_tl { \tl_item:Nn \g_tmpa_tl { -1 } } -% \end{macrocode} -% The token lists |\c_@@_table_collect_begin_tl| and |\c_@@_table_print_tl| -% contain now the two commands of \pkg{siunitx}. -% -% \smallskip -% If the adaptation has been done, the command |\@@_adapt_S_column:| becomes -% no-op (globally). -% \begin{macrocode} - \cs_gset_eq:NN \@@_adapt_S_column: \prg_do_nothing: - } - } -% \end{macrocode} +% % % \bigskip % The command |\@@_renew_NC@rewrite@S:| will be used in each environment of @@ -5367,28 +5287,82 @@ version 2005/12/01 or later. \bool_if:nTF { ! \c_@@_siunitx_loaded_bool } { \cs_set_eq:NN \@@_renew_NC@rewrite@S: \prg_do_nothing: } { - \cs_new_protected:Npn \@@_renew_NC@rewrite@S: +% \end{macrocode} +% For version of \pkg{siunitx} at least equal to 3.0, the adaptation is different +% from previous ones. We test the version of \pkg{siunitx} by the existence of the +% control sequence |\siunitx_cell_begin:w|. +% \begin{macrocode} + \cs_if_exist:NTF \siunitx_cell_begin:w { - \renewcommand*{\NC@rewrite@S}[1][] + \cs_new_protected:Npn \@@_renew_NC@rewrite@S: { - \@temptokena \exp_after:wN + \renewcommand*{\NC@rewrite@S}[1][] { - \tex_the:D \@temptokena - > { \@@_Cell: \c_@@_table_collect_begin_tl S {##1} } + \@temptokena \exp_after:wN + { + \tex_the:D \@temptokena + > { + \@@_Cell: + \keys_set:nn { siunitx } { ##1 } + \siunitx_cell_begin:w + } % \end{macrocode} % |\@@_true_c:| will be replaced statically by |c| at the end of the construction % of the preamble. % \begin{macrocode} - \@@_true_c: - < { \c_@@_table_print_tl \@@_end_Cell: } + \@@_true_c: + < { \siunitx_cell_end: \@@_end_Cell: } + } + \NC@find } - \NC@find } } + { + \cs_new_protected:Npn \@@_renew_NC@rewrite@S: + { + \renewcommand*{\NC@rewrite@S}[1][] + { + \@temptokena \exp_after:wN + { + \tex_the:D \@temptokena + > { \@@_Cell: \c_@@_table_collect_begin_tl S {##1} } + \@@_true_c: + < { \c_@@_table_print_tl \@@_end_Cell: } + } + \NC@find + } + } + } + } + } +% \end{macrocode} +% +% \medskip +% The following code is used to define |\c_@@_table_collect_begin_tl| and +% |\c_@@_table_print_tl| when the version of \pkg{siunitx} is prior to 3.0. The +% command |\@@_adapt_S_column| is used in the environment |{NiceArrayWithDelims}|. +% \begin{macrocode} +\cs_set_protected:Npn \@@_adapt_S_column: + { + \bool_if:NT \c_@@_siunitx_loaded_bool + { + \group_begin: + \@temptokena = { } + \cs_set_eq:NN \NC@find \prg_do_nothing: + \NC@rewrite@S { } + \tl_gset:NV \g_tmpa_tl \@temptokena + \group_end: + \tl_new:N \c_@@_table_collect_begin_tl + \tl_set:Nx \l_tmpa_tl { \tl_item:Nn \g_tmpa_tl 2 } + \tl_gset:Nx \c_@@_table_collect_begin_tl { \tl_item:Nn \l_tmpa_tl 1 } + \tl_new:N \c_@@_table_print_tl + \tl_gset:Nx \c_@@_table_print_tl { \tl_item:Nn \g_tmpa_tl { -1 } } + \cs_gset_eq:NN \@@_adapt_S_column: \prg_do_nothing: } } % \end{macrocode} % +% % \bigskip % The following regex will be used to modify the preamble of the array when the % key |colortbl-like| is used. @@ -5416,6 +5390,7 @@ version 2005/12/01 or later. } % \end{macrocode} % +% \bigskip % \subsection*{Parameters} % % \bigskip @@ -5864,11 +5839,7 @@ version 2005/12/01 or later. % % \medskip % The following token list correspond to the key |color| of the command -% |\Block|. However, as of now (v. 5.7 of \pkg{nicematrix}), the key |color| -% linked to |fill| with an error. We will give to the key |color| of |\Block| -% its new meaning in a few months (with its new definition, the key |color| will -% draw the frame with the given color but also color the content of the block -% (that is to say the text) as does the key |color| of a Tikz node). +% |\Block|. % \begin{macrocode} \tl_new:N \l_@@_color_tl % \end{macrocode} @@ -7209,7 +7180,7 @@ version 2005/12/01 or later. % \item we test the existence of these nodes in order to determine whether a % cell is empty when we search the extremities of a dotted line. % \end{itemize} -% However, it's very difficult to determine whether a cell is empty. As for now, +% However, it's very difficult to determine whether a cell is empty. Up to now % we use the following technic: % \begin{itemize} % \item if the width of the box |\l_@@_cell_box| (created with the content of @@ -8169,6 +8140,10 @@ version 2005/12/01 or later. \bool_gset_false:N \g_@@_row_of_col_done_bool \str_if_empty:NT \g_@@_name_env_str { \str_gset:Nn \g_@@_name_env_str { NiceArrayWithDelims } } +% \end{macrocode} +% The following line will be deleted when we will consider that only versions of +% \pkg{siunitx} after v3.0 are compatible with \pkg{nicematrix}. +% \begin{macrocode} \@@_adapt_S_column: \bool_if:NTF \l_@@_NiceTabular_bool \mode_leave_vertical: @@ -10157,12 +10132,19 @@ version 2005/12/01 or later. % \begin{macrocode} \seq_gclear:N \g_@@_submatrix_names_seq % \end{macrocode} +% \medskip +% We compose the |code-after| in math mode in order to nullify the spaces put +% by the user between instructions in the |code-after|. +% \begin{macrocode} + % \bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token +% \end{macrocode} % And here's the |\CodeAfter|. Since the |\CodeAfter| may begin with an % ``argument'' between square brackets of the options, we extract and treat that % potential ``argument'' with the command |\@@_CodeAfter_keys:|. % \begin{macrocode} \exp_last_unbraced:NV \@@_CodeAfter_keys: \g_nicematrix_code_after_tl \scan_stop: + % \bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token \tl_gclear:N \g_nicematrix_code_after_tl \group_end: % \end{macrocode} @@ -10661,8 +10643,8 @@ version 2005/12/01 or later. % The following commmand (\emph{when it will be written}) will set the four % counters |\l_@@_row_min_int|, |\l_@@_row_max_int|, |\l_@@_col_min_int| and % |\l_@@_col_max_int| to the intersections of the sub-matrices which contains -% the cell of row |#1| and column |#2|. -% As of now, it's only the whole array (excepted exterior row and columns). +% the cell of row |#1| and column |#2|. As of now, it's only the whole array +% (excepted exterior rows and columns). % \begin{macrocode} \cs_new_protected:Npn \@@_adjust_to_submatrix:nn #1 #2 { @@ -11571,9 +11553,6 @@ version 2005/12/01 or later. % |\Iddots| in the environments |{NiceArray}| (the other environments of % \pkg{nicematrix} rely upon |{NiceArray}|). % -% The starred versions of these commands are deprecated since version~3.1 but, -% as of now, they are still available with an error. -% % % \medskip % The syntax of these commands uses the character |_| as embellishment and @@ -12370,8 +12349,7 @@ version 2005/12/01 or later. % The command |\@@_arraycolor| (linked to |\arraycolor| at the beginning of % the |\CodeBefore|) will color the whole tabular (excepted the potential % exterior rows and columns). The third argument is a optional argument which a -% list of pairs key-value. As for now, there is only one key: |except-corners|. -% When that key is used, the cells in the corners are not colored. +% list of pairs key-value. % \begin{macrocode} \NewDocumentCommand \@@_arraycolor { O { } m O { } } { @@ -13627,7 +13605,7 @@ version 2005/12/01 or later. % \end{macrocode} % % \medskip -% As for now, we have no option to control the style of the lines drawn by +% Up to now, we have no option to control the style of the lines drawn by % |\hdottedline| and the specifier ``|:|'' in the preamble. That's why we impose % the style |standard|. % \begin{macrocode} @@ -13695,7 +13673,7 @@ version 2005/12/01 or later. \@@_qpoint:n { 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 +% Up to now, we have no option to control the style of the lines drawn by % |\hdottedline| and the specifier ``|:|'' in the preamble. That's why we impose % the style |standard|. % \begin{macrocode} @@ -13716,7 +13694,7 @@ version 2005/12/01 or later. % \end{macrocode} % % \bigskip -% As for now, there is only one option available for the environment +% Up to now, there is only one option available for the environment % |{NiceMatrixBlock}|. % \begin{macrocode} \keys_define:nn { NiceMatrix / NiceMatrixBlock } @@ -15618,16 +15596,19 @@ version 2005/12/01 or later. % \begin{macrocode} \NewDocumentCommand \@@_SubMatrix_in_code_before { m m m m ! O { } } { - \@@_cut_on_hyphen:w #3 \q_stop - \tl_clear_new:N \l_tmpc_tl - \tl_clear_new:N \l_tmpd_tl - \tl_set_eq:NN \l_tmpc_tl \l_tmpa_tl - \tl_set_eq:NN \l_tmpd_tl \l_tmpb_tl - \@@_cut_on_hyphen:w #2 \q_stop - \seq_gput_right:Nx \g_@@_submatrix_seq - { { \l_tmpa_tl } { \l_tmpb_tl } { \l_tmpc_tl } { \l_tmpd_tl } } - \tl_gput_right:Nn \g_@@_internal_code_after_tl - { \SubMatrix { #1 } { #2 } { #3 } { #4 } [ #5 ] } + \peek_remove_spaces:n + { + \@@_cut_on_hyphen:w #3 \q_stop + \tl_clear_new:N \l_tmpc_tl + \tl_clear_new:N \l_tmpd_tl + \tl_set_eq:NN \l_tmpc_tl \l_tmpa_tl + \tl_set_eq:NN \l_tmpd_tl \l_tmpb_tl + \@@_cut_on_hyphen:w #2 \q_stop + \seq_gput_right:Nx \g_@@_submatrix_seq + { { \l_tmpa_tl } { \l_tmpb_tl } { \l_tmpc_tl } { \l_tmpd_tl } } + \tl_gput_right:Nn \g_@@_internal_code_after_tl + { \SubMatrix { #1 } { #2 } { #3 } { #4 } [ #5 ] } + } } % \end{macrocode} % @@ -15644,6 +15625,13 @@ version 2005/12/01 or later. % \begin{macrocode} \NewDocumentCommand \@@_SubMatrix { m m m m O { } } { + \peek_remove_spaces:n + { \@@_sub_matrix:nnnnn { #1 } { #2 } { #3 } { #4 } { #5 } } + } +% \end{macrocode} +% \begin{macrocode} +\cs_new_protected:Npn \@@_sub_matrix:nnnnn #1 #2 #3 #4 #5 + { \group_begin: % \end{macrocode} % The four following token lists correspond to the position of the |\SubMatrix|. @@ -17490,8 +17478,9 @@ version 2005/12/01 or later. % It's now possible to specify delimiters for submatrices in the preamble of an % environment. % +% The version 5.15b is compatible with the version 3.0+ of \pkg{siunitx} +% (previous versions were not). % -% \subsection*{Changes between versions 5.15 and 5.16} % % \PrintIndex % diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf Binary files differindex 9bae2b15ba..b096ea1e0f 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.pdf +++ b/macros/latex/contrib/nicematrix/nicematrix.pdf |