From e9ed0e389f6e19960cd4940c4beed10583f4c32a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 8 Jun 2020 21:19:40 +0000 Subject: nicematrix (8jun20) git-svn-id: svn://tug.org/texlive/trunk@55484 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/nicematrix/nicematrix.sty | 65 +++++++--------------- 1 file changed, 21 insertions(+), 44 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty index dde56d6fc32..b4a7ec1366c 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{4.1} -\def\myfiledate{2020/05/27} +\def\myfileversion{4.2} +\def\myfiledate{2020/06/07} \RequirePackage{pgfcore} \usepgfmodule{shapes} \RequirePackage{l3keys2e} @@ -28,14 +28,6 @@ {\myfiledate} {\myfileversion} {Mathematical matrices with PGF/TikZ} -\msg_new:nnn { nicematrix } { expl3~too~old } - { - Your~version~of~LaTeX~(especially~expl3)~is~too~old.~ - You~can~go~on~but~you~will~probably~have~other~errors~ - if~you~use~the~functionalities~of~nicematrix. - } -\cs_if_exist:NF \l_keys_key_str - { \msg_error:nn { nicematrix } { expl3~too~old } } \RequirePackage { array } \RequirePackage { amsmath } \RequirePackage { xparse } @@ -98,8 +90,7 @@ \cs_set_eq:NN \__nicematrix_old_pgfutil@check@rerun \pgfutil@check@rerun \cs_set_protected:Npn \pgfutil@check@rerun ##1 ##2 { - \str_set:Nx \l_tmpa_str { \tl_range:nnn { ##1 } 1 3 } - \str_if_eq:VnF \l_tmpa_str { nm- } + \str_if_eq:eeF { nm- } { \tl_range:nnn { ##1 } 1 3 } { \__nicematrix_old_pgfutil@check@rerun { ##1 } { ##2 } } } } @@ -140,7 +131,7 @@ \noalign { \skip_vertical:N -\arrayrulewidth } } \cs_set:Npn \__nicematrix_cline - { \exp_args:Ne \__nicematrix_cline_i:nn \l__nicematrix_first_col_int } + { \__nicematrix_cline_i:en \l__nicematrix_first_col_int } \cs_set:Npn \__nicematrix_cline_i:nn #1 #2 { \__nicematrix_cline_i:w #1-#2 \q_stop } \cs_set:Npn \__nicematrix_cline_i:w #1-#2-#3 \q_stop { @@ -149,10 +140,10 @@ \multispan { \int_eval:n { #3 - #2 + 1 } } { \CT@arc@ \leaders \hrule \@height \arrayrulewidth \hfill } \peek_meaning_remove_ignore_spaces:NTF \cline - { & \exp_args:Ne \__nicematrix_cline_i:nn { \__nicematrix_succ:n { #3 } } } + { & \__nicematrix_cline_i:en { \__nicematrix_succ:n { #3 } } } { \everycr { } \cr } } - +\cs_generate_variant:Nn \__nicematrix_cline_i:nn { e n } \cs_new:Npn \__nicematrix_succ:n #1 { \the \numexpr #1 + 1 \relax } \cs_new:Npn \__nicematrix_pred:n #1 { \the \numexpr #1 - 1 \relax } \cs_new:Npn \__nicematrix_math_toggle_token: @@ -924,6 +915,7 @@ } \NewDocumentEnvironment { NiceArrayWithDelims } { m m O { } m ! O { } } { + \bgroup \tl_set:Nn \l__nicematrix_left_delim_tl { #1 } \tl_set:Nn \l__nicematrix_right_delim_tl { #2 } \bool_gset_false:N \g__nicematrix_row_of_col_done_bool @@ -1238,6 +1230,7 @@ \skip_horizontal:N \arraycolsep } \__nicematrix_after_array: + \egroup } \cs_new_protected:Npn \__nicematrix_put_box_in_flow: { @@ -3027,39 +3020,24 @@ \pgfrememberpicturepositiononpagetrue \pgf@relevantforpicturesizefalse \pgfsetlinewidth \arrayrulewidth + \pgfsetrectcap \__nicematrix_qpoint:n { row - 1 } \dim_set_eq:NN \l_tmpa_dim \pgf@y \__nicematrix_qpoint:n { row - \__nicematrix_succ:n \c@iRow } - \dim_sub:Nn \l_tmpa_dim \pgf@y - \dim_zero:N \l_tmpb_dim - \int_compare:nNnT \l__nicematrix_last_row_int > { -1 } - { - \dim_set_eq:NN \l_tmpb_dim \g__nicematrix_dp_last_row_dim - \dim_add:Nn \l_tmpb_dim \g__nicematrix_ht_last_row_dim - \__nicematrix_qpoint:n { row - \__nicematrix_succ:n \c@iRow } - \dim_add:Nn \l_tmpa_dim \pgf@y - \__nicematrix_qpoint:n { row - \__nicematrix_succ:n \g__nicematrix_row_total_int } - \dim_sub:Nn \l_tmpa_dim \pgf@y - \dim_sub:Nn \l_tmpa_dim \l_tmpb_dim - } - \dim_add:Nn \l_tmpa_dim \arrayrulewidth + \dim_set_eq:NN \l_tmpb_dim \pgf@y \int_step_inline:nnn { \bool_if:NTF \l__nicematrix_NiceArray_bool 1 2 } { \bool_if:NTF \l__nicematrix_NiceArray_bool { \__nicematrix_succ:n \c@jCol } \c@jCol } { - \pgfpathmoveto { \__nicematrix_qpoint:n { col - ##1 } } - \pgfpathlineto - { - \pgfpointadd - { \__nicematrix_qpoint:n { col - ##1 } } - { \pgfpoint \c_zero_dim { \l_tmpb_dim + \l_tmpa_dim } } - } + \__nicematrix_qpoint:n { col - ##1 } + \dim_set_eq:NN \l_tmpc_dim \pgf@x + \pgfpathmoveto { \pgfpoint \l_tmpc_dim \l_tmpa_dim } + \pgfpathlineto { \pgfpoint \l_tmpc_dim \l_tmpb_dim } } \pgfusepathqstroke \endpgfpicture \group_end: } -%% \cs_new_protected:Npn \__nicematrix_draw_hlines: { \pgfpicture @@ -3715,8 +3693,7 @@ } \cs_new_protected:Npn \__nicematrix_CodeAfter_i:n #1 { - \str_set:NV \l_tmpa_str \@currenvir - \bool_if:NTF { \str_if_eq_p:Vn \l_tmpa_str { #1 } } + \str_if_eq:eeTF \@currenvir { #1 } { \end { #1 } } { \tl_gput_right:Nn \g__nicematrix_code_after_tl { \end { #1 } } @@ -3826,7 +3803,7 @@ \__nicematrix_msg_new:nn { Unknown~option~for~xdots } { As~for~now~there~is~only~three~options~available~here:~'color',~'line-style'~ - and~'shorten'~(and~you~try~to~use~'\l_keys_key_str').~If~you~go~on,~ + and~'shorten'~(and~you~try~to~use~'\l_keys_key_tl').~If~you~go~on,~ this~option~will~be~ignored. } \__nicematrix_msg_new:nn { ampersand~in~light-syntax } @@ -3901,12 +3878,12 @@ } \__nicematrix_msg_new:nn { Bad~value~for~letter~for~dotted~lines } { - The~value~of~key~'\tl_use:N\l_keys_key_str'~must~be~of~length~1.\\ + The~value~of~key~'\tl_use:N\l_keys_key_tl'~must~be~of~length~1.\\ If~you~go~on,~it~will~be~ignored. } \__nicematrix_msg_new:nnn { Unknown~key~for~NiceMatrixOptions } { - The~key~'\tl_use:N\l_keys_key_str'~is~unknown~for~the~command~ + The~key~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~command~ \token_to_str:N \NiceMatrixOptions. \\ If~you~go~on,~it~will~be~ignored. \\ For~a~list~of~the~*principal*~available~keys,~type~H~. @@ -3946,7 +3923,7 @@ } \__nicematrix_msg_new:nnn { Unknown~option~for~NiceArray } { - The~option~'\tl_use:N\l_keys_key_str'~is~unknown~for~the~environment~ + The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~ \{NiceArray\}. \\ If~you~go~on,~it~will~be~ignored. \\ For~a~list~of~the~*principal*~available~options,~type~H~. @@ -3992,7 +3969,7 @@ } \__nicematrix_msg_new:nnn { Unknown~option~for~NiceMatrix } { - The~option~'\tl_use:N\l_keys_key_str'~is~unknown~for~the~ + The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~ \__nicematrix_full_name_env:. \\ If~you~go~on,~it~will~be~ignored. \\ For~a~list~of~the~*principal*~available~options,~type~H~. @@ -4041,7 +4018,7 @@ } \__nicematrix_msg_new:nnn { Unknown~option~for~NiceTabular } { - The~option~'\tl_use:N\l_keys_key_str'~is~unknown~for~the~environment~ + The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~ \{NiceTabular\}. \\ If~you~go~on,~it~will~be~ignored. \\ For~a~list~of~the~*principal*~available~options,~type~H~. -- cgit v1.2.3