From 525515c8d9df4f6ece9b285a88e58f01bee94de8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 13 Jun 2020 20:58:46 +0000 Subject: nicematrix (13jun20) git-svn-id: svn://tug.org/texlive/trunk@55539 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/nicematrix/nicematrix.sty | 67 +++++++++++++++++----- 1 file changed, 53 insertions(+), 14 deletions(-) (limited to 'Master/texmf-dist/tex/latex/nicematrix') diff --git a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty index b4a7ec1366c..d286a1bb15c 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.2} -\def\myfiledate{2020/06/07} +\def\myfileversion{4.3} +\def\myfiledate{2020/06/12} \RequirePackage{pgfcore} \usepgfmodule{shapes} \RequirePackage{l3keys2e} @@ -2297,9 +2297,9 @@ } \cs_new_protected:Npn \__nicematrix_draw_non_standard_dotted_line: { - \begin { scope } - \exp_args:No \__nicematrix_draw_non_standard_dotted_line:n - { \l__nicematrix_xdots_line_style_tl , \l__nicematrix_xdots_color_tl } + \begin { scope } + \exp_args:No \__nicematrix_draw_non_standard_dotted_line:n + { \l__nicematrix_xdots_line_style_tl , \l__nicematrix_xdots_color_tl } } \cs_new_protected:Npn \__nicematrix_draw_non_standard_dotted_line:n #1 { @@ -3165,7 +3165,7 @@ { \int_compare:nNnT \l_tmpb_tl > { #2 - 1 } { - \int_compare:nNnT \l_tmpb_tl < { #4 + 1 } + \int_compare:nNnT \l_tmpb_tl < { #4 + 1 } { \bool_gset_false:N \g_tmpa_bool } } } @@ -3487,17 +3487,17 @@ { \int_use:N \g__nicematrix_env_int - \__nicematrix_i: - \__nicematrix_j: \l__nicematrix_suffix_tl} } } -\NewDocumentCommand \__nicematrix_Block: { O { } m D < > { } m } +\NewExpandableDocumentCommand \__nicematrix_Block: { O { } m D < > { } m } { \__nicematrix_Block_i #2 \q_stop { #1 } { #3 } { #4 } } \cs_new:Npn \__nicematrix_Block_i #1-#2 \q_stop { \__nicematrix_Block_ii:nnnnn { #1 } { #2 } } \cs_new_protected:Npn \__nicematrix_Block_ii:nnnnn #1 #2 #3 #4 #5 { \tl_set:Nx \l_tmpa_tl { - { \int_use:N \c@iRow } - { \int_use:N \c@jCol } - { \int_eval:n { \c@iRow + #1 - 1 } } - { \int_eval:n { \c@jCol + #2 - 1 } } + { \int_use:N \c@iRow } + { \int_use:N \c@jCol } + { \int_eval:n { \c@iRow + #1 - 1 } } + { \int_eval:n { \c@jCol + #2 - 1 } } } \seq_gput_left:NV \g__nicematrix_pos_of_blocks_seq \l_tmpa_tl \seq_gput_left:Nx \g__nicematrix_blocks_seq @@ -3519,7 +3519,7 @@ \group_begin: \keys_set:nn { NiceMatrix / Block } { #5 } \bool_lazy_or:nnTF - { \int_compare_p:nNn { #3 } > \c@iRow } + { \int_compare_p:nNn { #3 } > \g__nicematrix_row_total_int } { \int_compare_p:nNn { #4 } > \c@jCol } { \msg_error:nnnn { nicematrix } { Block~too~large } { #1 } { #2 } } { @@ -3541,6 +3541,39 @@ { \__nicematrix_env: - #1 - #2 - block } \l_tmpb_dim \l_tmpa_dim \l_tmpd_dim \l_tmpc_dim \end { pgfscope } + \dim_set_eq:NN \l_tmpb_dim \c_max_dim + \int_step_inline:nnn \l__nicematrix_first_row_int \g__nicematrix_row_total_int + { + \cs_if_exist:cT + { pgf @ sh @ ns @ \__nicematrix_env: - ##1 - #2 } + { + \pgfpointanchor { \__nicematrix_env: - ##1 - #2 } { west } + \dim_set:Nn \l_tmpb_dim { \dim_min:nn \l_tmpb_dim \pgf@x } + } + } + \dim_compare:nNnT \l_tmpb_dim = \c_max_dim + { + \__nicematrix_qpoint:n { col - #2 } + \dim_set_eq:NN \l_tmpb_dim \pgf@x + } + \dim_set:Nn \l_tmpd_dim { - \c_max_dim } + \int_step_inline:nnn \l__nicematrix_first_row_int \g__nicematrix_row_total_int + { + \cs_if_exist:cT + { pgf @ sh @ ns @ \__nicematrix_env: - ##1 - #4 } + { + \pgfpointanchor { \__nicematrix_env: - ##1 - #4 } { east } + \dim_set:Nn \l_tmpd_dim { \dim_max:nn \l_tmpd_dim \pgf@x } + } + } + \dim_compare:nNnT \l_tmpd_dim = { - \c_max_dim } + { + \__nicematrix_qpoint:n { col - \__nicematrix_succ:n { #4 } } + \dim_set_eq:NN \l_tmpd_dim \pgf@x + } + \__nicematrix_pgf_rect_node:nnnnn + { \__nicematrix_env: - #1 - #2 - block - short } + \l_tmpb_dim \l_tmpa_dim \l_tmpd_dim \l_tmpc_dim \bool_if:NT \l__nicematrix_medium_nodes_bool { \__nicematrix_pgf_rect_node:nnn @@ -3550,14 +3583,20 @@ } \int_compare:nNnTF { #1 } = { #3 } { + \int_compare:nNnTF { #1 } = 0 + { \l__nicematrix_code_for_first_row_tl } + { + \int_compare:nNnT { #1 } = \l__nicematrix_last_row_int + \l__nicematrix_code_for_last_row_tl + } \pgfextracty \l_tmpa_dim { \__nicematrix_qpoint:n { row - #1 - base } } - \__nicematrix_qpoint:n { #1 - #2 - block } + \__nicematrix_qpoint:n { #1 - #2 - block - short } \pgftransformshift { \pgfpoint \pgf@x \l_tmpa_dim } \pgfnode { rectangle } { base } { \box_use_drop:N \l__nicematrix_cell_box } { } { } } { - \pgftransformshift { \__nicematrix_qpoint:n { #1 - #2 - block } } + \pgftransformshift { \__nicematrix_qpoint:n { #1 - #2 - block - short } } \pgfnode { rectangle } { center } { \box_use_drop:N \l__nicematrix_cell_box } { } { } } -- cgit v1.2.3