summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty')
-rw-r--r--Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty338
1 files changed, 219 insertions, 119 deletions
diff --git a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
index a0d9e5a3c4e..595260e2658 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{5.5}
-\def\myfiledate{2020/10/20}
+\def\myfileversion{5.6}
+\def\myfiledate{2020/11/08}
\RequirePackage{pgfcore}
\usepgfmodule{shapes}
@@ -252,7 +252,9 @@
\dim_new:N \l__nicematrix_columns_width_dim
\tl_new:N \l__nicematrix_cell_type_tl
\tl_set:Nn \l__nicematrix_cell_type_tl { c }
-\dim_new:N \g__nicematrix_blocks_width_dim
+\dim_new:N \g__nicematrix_blocks_wd_dim
+\dim_new:N \g__nicematrix_blocks_ht_dim
+\dim_new:N \g__nicematrix_blocks_dp_dim
\seq_new:N \g__nicematrix_names_seq
\bool_new:N \l__nicematrix_in_env_bool
\bool_new:N \l__nicematrix_NiceArray_bool
@@ -282,6 +284,7 @@
\int_new:N \l__nicematrix_old_jCol_int
\tl_new:N \l__nicematrix_rules_color_tl
\bool_new:N \g__nicematrix_row_of_col_done_bool
+\bool_new:N \g__nicematrix_not_empty_cell_bool
\tl_new:N \l__nicematrix_code_before_tl
\bool_new:N \l__nicematrix_code_before_bool
\dim_new:N \l__nicematrix_x_initial_dim
@@ -848,13 +851,25 @@
}
\bool_gset_false:N \g__nicematrix_rotate_bool
}
-\cs_new_protected:Npn \__nicematrix_adjust_width_box:
+\cs_new_protected:Npn \__nicematrix_adjust_size_box:
{
- \dim_compare:nNnT \g__nicematrix_blocks_width_dim > \c_zero_dim
+ \dim_compare:nNnT \g__nicematrix_blocks_wd_dim > \c_zero_dim
{
\box_set_wd:Nn \l__nicematrix_cell_box
- { \dim_max:nn { \box_wd:N \l__nicematrix_cell_box } \g__nicematrix_blocks_width_dim }
- \dim_gzero:N \g__nicematrix_blocks_width_dim
+ { \dim_max:nn { \box_wd:N \l__nicematrix_cell_box } \g__nicematrix_blocks_wd_dim }
+ \dim_gzero:N \g__nicematrix_blocks_wd_dim
+ }
+ \dim_compare:nNnT \g__nicematrix_blocks_dp_dim > \c_zero_dim
+ {
+ \box_set_dp:Nn \l__nicematrix_cell_box
+ { \dim_max:nn { \box_dp:N \l__nicematrix_cell_box } \g__nicematrix_blocks_dp_dim }
+ \dim_gzero:N \g__nicematrix_blocks_dp_dim
+ }
+ \dim_compare:nNnT \g__nicematrix_blocks_ht_dim > \c_zero_dim
+ {
+ \box_set_ht:Nn \l__nicematrix_cell_box
+ { \dim_max:nn { \box_ht:N \l__nicematrix_cell_box } \g__nicematrix_blocks_ht_dim }
+ \dim_gzero:N \g__nicematrix_blocks_ht_dim
}
}
\cs_new_protected:Npn \__nicematrix_end_Cell:
@@ -862,7 +877,7 @@
\__nicematrix_math_toggle_token:
\hbox_set_end:
\bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
- \__nicematrix_adjust_width_box:
+ \__nicematrix_adjust_size_box:
\box_set_ht:Nn \l__nicematrix_cell_box
{ \box_ht:N \l__nicematrix_cell_box + \l__nicematrix_cell_space_top_limit_dim }
\box_set_dp:Nn \l__nicematrix_cell_box
@@ -873,11 +888,14 @@
\bool_if:NTF \g__nicematrix_empty_cell_bool
{ \box_use_drop:N \l__nicematrix_cell_box }
{
- \dim_compare:nNnTF { \box_wd:N \l__nicematrix_cell_box } > \c_zero_dim
+ \bool_lazy_or:nnTF
+ \g__nicematrix_not_empty_cell_bool
+ { \dim_compare_p:nNn { \box_wd:N \l__nicematrix_cell_box } > \c_zero_dim }
\__nicematrix_node_for_the_cell:
{ \box_use_drop:N \l__nicematrix_cell_box }
}
\bool_gset_false:N \g__nicematrix_empty_cell_bool
+ \bool_gset_false:N \g__nicematrix_not_empty_cell_bool
}
\cs_new_protected:Npn \__nicematrix_node_for_the_cell:
{
@@ -1072,6 +1090,7 @@
\cs_set_eq:NN \dotfill \__nicematrix_old_dotfill:
\cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter:
\cs_set_eq:NN \diagbox \__nicematrix_diagbox:nn
+ \cs_set_eq:NN \NotEmpty \__nicematrix_NotEmpty:
\bool_if:NT \l__nicematrix_colortbl_like_bool \__nicematrix_colortbl_like:
\bool_if:NT \l__nicematrix_renew_dots_bool \__nicematrix_renew_dots:
\seq_gclear_new:N \g__nicematrix_multicolumn_cells_seq
@@ -1513,7 +1532,7 @@
> {
\hbox_set:Nw \l__nicematrix_cell_box
\__nicematrix_Cell:
- \tl_set:Nn \l__nicematrix_cell_type_tl { #1 }
+ \tl_set:Nn \l__nicematrix_cell_type_tl { #3 }
}
c
< {
@@ -1521,7 +1540,7 @@
#1
\hbox_set_end:
\bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
- \__nicematrix_adjust_width_box:
+ \__nicematrix_adjust_size_box:
\makebox [ #4 ] [ #3 ] { \box_use_drop:N \l__nicematrix_cell_box }
}
}
@@ -1975,7 +1994,7 @@
\__nicematrix_math_toggle_token:
\hbox_set_end:
\bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
- \__nicematrix_adjust_width_box:
+ \__nicematrix_adjust_size_box:
\__nicematrix_update_for_first_and_last_row:
\dim_gset:Nn \g__nicematrix_width_first_col_dim
{ \dim_max:nn \g__nicematrix_width_first_col_dim { \box_wd:N \l__nicematrix_cell_box } }
@@ -2019,7 +2038,7 @@
\__nicematrix_math_toggle_token:
\hbox_set_end:
\bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
- \__nicematrix_adjust_width_box:
+ \__nicematrix_adjust_size_box:
\__nicematrix_update_for_first_and_last_row:
\dim_gset:Nn \g__nicematrix_width_last_col_dim
{ \dim_max:nn \g__nicematrix_width_last_col_dim { \box_wd:N \l__nicematrix_cell_box } }
@@ -2086,6 +2105,8 @@
}
{ \use:c { end #1 NiceArray } }
}
+\cs_new_protected:Npn \__nicematrix_NotEmpty:
+ { \bool_gset_true:N \g__nicematrix_not_empty_cell_bool }
\NewDocumentEnvironment { NiceTabular } { O { } m ! O { } }
{
\str_gset:Nn \g__nicematrix_name_env_str { NiceTabular }
@@ -2197,6 +2218,7 @@
}
\__nicematrix_draw_dotted_lines:
\__nicematrix_compute_corners:
+ \__nicematrix_adjust_pos_of_blocks_seq:
\bool_lazy_all:nT
{
{ \seq_if_empty_p:N \g__nicematrix_pos_of_blocks_seq }
@@ -2246,6 +2268,24 @@
\__nicematrix_restore_iRow_jCol:
\cs_gset_eq:NN \CT@arc@ \__nicematrix_old_CT@arc@
}
+\cs_new_protected:Npn \__nicematrix_adjust_pos_of_blocks_seq:
+ {
+ \seq_gclear:N \g_tmpa_seq
+ \seq_map_inline:Nn \g__nicematrix_pos_of_blocks_seq
+ { \__nicematrix_adjust_pos_of_blocks_seq_i:nnnn ##1 }
+ \seq_gset_eq:NN \g__nicematrix_pos_of_blocks_seq \g_tmpa_seq
+ }
+\cs_new_protected:Npn \__nicematrix_adjust_pos_of_blocks_seq_i:nnnn #1 #2 #3 #4
+ {
+ \int_compare:nNnTF { #3 } > { 99 }
+ { \int_set_eq:NN \l_tmpa_int \c@iRow }
+ { \int_set:Nn \l_tmpa_int { #3 } }
+ \int_compare:nNnTF { #4 } > { 99 }
+ { \int_set_eq:NN \l_tmpb_int \c@jCol }
+ { \int_set:Nn \l_tmpb_int { #4 } }
+ \seq_gput_right:Nx \g_tmpa_seq
+ { { #1 } { #2 } { \int_use:N \l_tmpa_int } { \int_use:N \l_tmpb_int } }
+ }
\AtBeginDocument
{
\cs_new_protected:Npx \__nicematrix_draw_dotted_lines:
@@ -4261,7 +4301,10 @@
c .value_forbidden:n = true ,
}
\NewExpandableDocumentCommand \__nicematrix_Block: { O { } m D < > { } m }
- { \__nicematrix_Block_i #2 \q_stop { #1 } { #3 } { #4 } }
+ {
+ \tl_if_blank:nTF { #2 } { \__nicematrix_Block_i 1-1 \q_stop } { \__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
{
@@ -4269,128 +4312,165 @@
{ \tl_set:Nn \l__nicematrix_pos_of_block_tl c }
{ \tl_set_eq:NN \l__nicematrix_pos_of_block_tl \l__nicematrix_cell_type_tl }
\keys_set_known:nn { NiceMatrix / Block / FirstPass } { #3 }
+ \tl_if_empty:nTF { #1 }
+ { \int_set:Nn \l_tmpa_int { 100 } }
+ { \int_set:Nn \l_tmpa_int { #1 } }
+ \tl_if_empty:nTF { #2 }
+ { \int_set:Nn \l_tmpb_int { 100 } }
+ { \int_set:Nn \l_tmpb_int { #2 } }
\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_eval:n { \c@iRow + \l_tmpa_int - 1 } }
+ { \int_eval:n { \c@jCol + \l_tmpb_int - 1 } }
}
\seq_gput_left:NV \g__nicematrix_pos_of_blocks_seq \l_tmpa_tl
- \int_compare:nNnTF { #2 } = 1
+ \bool_lazy_or:nnTF
+ { \int_compare_p:nNn { \l_tmpa_int } = 1 }
+ { \int_compare_p:nNn { \l_tmpb_int } = 1 }
+ { \exp_args:Nxx \__nicematrix_Block_iii:nnnnn }
+ { \exp_args:Nxx \__nicematrix_Block_iv:nnnnn }
+ { \l_tmpa_int } { \l_tmpb_int } { #3 } { #4 } { #5 }
+ }
+\cs_new_protected:Npn \__nicematrix_Block_iii:nnnnn #1 #2 #3 #4 #5
+ {
+ \int_gincr:N \g__nicematrix_block_box_int
+ \cs_set_protected_nopar:Npn \diagbox ##1 ##2
{
- \int_gincr:N \g__nicematrix_block_box_int
- \cs_set_protected_nopar:Npn \diagbox ##1 ##2
+ \tl_gput_right:Nx \g__nicematrix_internal_code_after_tl
{
- \tl_gput_right:Nx \g__nicematrix_internal_code_after_tl
- {
- \__nicematrix_actually_diagbox:nnnnnn
- { \int_use:N \c@iRow }
- { \int_use:N \c@jCol }
- { \int_eval:n { \c@iRow + #1 - 1 } }
- { \int_eval:n { \c@jCol + #2 - 1 } }
- { \exp_not:n { ##1 } } { \exp_not:n { ##2 } }
- }
+ \__nicematrix_actually_diagbox:nnnnnn
+ { \int_use:N \c@iRow }
+ { \int_use:N \c@jCol }
+ { \int_eval:n { \c@iRow + #1 - 1 } }
+ { \int_eval:n { \c@jCol + #2 - 1 } }
+ { \exp_not:n { ##1 } } { \exp_not:n { ##2 } }
}
- \box_gclear_new:c
- { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
- \hbox_gset:cn
- { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
+ }
+ \box_gclear_new:c
+ { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
+ \hbox_gset:cn
+ { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
+ {
+ \int_compare:nNnT { #2 } = 1 \set@color
+ \bool_if:NTF \l__nicematrix_NiceTabular_bool
{
- \set@color
- \bool_if:NTF \l__nicematrix_NiceTabular_bool
- {
- \group_begin:
- \cs_set:Npn \arraystretch { 1 }
- \dim_set_eq:NN \extrarowheight \c_zero_dim
- #4
- \bool_if:NT \g__nicematrix_rotate_bool
- { \tl_set:Nn \l__nicematrix_pos_of_block_tl c }
- \exp_args:Nnx \begin { tabular }
- { @ { } \l__nicematrix_pos_of_block_tl @ { } }
- #5
- \end { tabular }
- \group_end:
- }
- {
- \group_begin:
- \cs_set:Npn \arraystretch { 1 }
- \dim_set_eq:NN \extrarowheight \c_zero_dim
- #4
- \bool_if:NT \g__nicematrix_rotate_bool
- { \tl_set:Nn \l__nicematrix_pos_of_block_tl c }
- \c_math_toggle_token
- \exp_args:Nnx \begin { array }
- { @ { } \l__nicematrix_pos_of_block_tl @ { } }
- #5
- \end { array }
- \c_math_toggle_token
- \group_end:
- }
+ \group_begin:
+ \cs_set:Npn \arraystretch { 1 }
+ \dim_set_eq:NN \extrarowheight \c_zero_dim
+ #4
+ \bool_if:NT \g__nicematrix_rotate_bool
+ { \tl_set:Nn \l__nicematrix_pos_of_block_tl c }
+ \exp_args:Nnx \begin { tabular }
+ { @ { } \l__nicematrix_pos_of_block_tl @ { } }
+ #5
+ \end { tabular }
+ \group_end:
}
- \bool_if:NT \g__nicematrix_rotate_bool
{
- \box_grotate:cn
- { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
- { 90 }
- \bool_gset_false:N \g__nicematrix_rotate_bool
+ \group_begin:
+ \cs_set:Npn \arraystretch { 1 }
+ \dim_set_eq:NN \extrarowheight \c_zero_dim
+ #4
+ \bool_if:NT \g__nicematrix_rotate_bool
+ { \tl_set:Nn \l__nicematrix_pos_of_block_tl c }
+ \c_math_toggle_token
+ \exp_args:Nnx \begin { array }
+ { @ { } \l__nicematrix_pos_of_block_tl @ { } }
+ #5
+ \end { array }
+ \c_math_toggle_token
+ \group_end:
}
- \dim_gset:Nn \g__nicematrix_blocks_width_dim
+ }
+ \bool_if:NT \g__nicematrix_rotate_bool
+ {
+ \box_grotate:cn
+ { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
+ { 90 }
+ \bool_gset_false:N \g__nicematrix_rotate_bool
+ }
+ \int_compare:nNnT { #2 } = 1
+ {
+ \dim_gset:Nn \g__nicematrix_blocks_wd_dim
{
\dim_max:nn
- \g__nicematrix_blocks_width_dim
+ \g__nicematrix_blocks_wd_dim
{
\box_wd:c
{ g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
}
}
- \seq_gput_right:Nx \g__nicematrix_blocks_seq
+ }
+ \int_compare:nNnT { #1 } = 1
+ {
+ \dim_gset:Nn \g__nicematrix_blocks_ht_dim
{
- \l_tmpa_tl
- { #3 , \l__nicematrix_pos_of_block_tl }
- {
- \box_use_drop:c
- { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
- }
+ \dim_max:nn
+ \g__nicematrix_blocks_ht_dim
+ {
+ \box_ht:c
+ { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
+ }
+ }
+ \dim_gset:Nn \g__nicematrix_blocks_dp_dim
+ {
+ \dim_max:nn
+ \g__nicematrix_blocks_dp_dim
+ {
+ \box_dp:c
+ { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
+ }
}
}
+ \seq_gput_right:Nx \g__nicematrix_blocks_seq
{
- \seq_gput_right:Nx \g__nicematrix_blocks_seq
+ \l_tmpa_tl
+ { #3 , \l__nicematrix_pos_of_block_tl }
+ {
+ \box_use_drop:c
+ { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box }
+ }
+ }
+ }
+\cs_new_protected:Npn \__nicematrix_Block_iv:nnnnn #1 #2 #3 #4 #5
+ {
+ \seq_gput_right:Nx \g__nicematrix_blocks_seq
+ {
+ \l_tmpa_tl
+ { #3 }
+ \exp_not:n
{
- \l_tmpa_tl
- { #3 }
- \exp_not:n
- {
+ {
+ \bool_if:NTF \l__nicematrix_NiceTabular_bool
{
- \bool_if:NTF \l__nicematrix_NiceTabular_bool
- {
- \group_begin:
- \cs_set:Npn \arraystretch { 1 }
- \dim_set_eq:NN \extrarowheight \c_zero_dim
- #4
- \bool_if:NT \g__nicematrix_rotate_bool
- { \tl_set:Nn \l__nicematrix_pos_of_block_tl c }
- \exp_args:Nnx \begin { tabular }
- { @ { } \l__nicematrix_pos_of_block_tl @ { } }
- #5
- \end { tabular }
- \group_end:
- }
- {
- \group_begin:
- \cs_set:Npn \arraystretch { 1 }
- \dim_set_eq:NN \extrarowheight \c_zero_dim
- #4
- \bool_if:NT \g__nicematrix_rotate_bool
- { \tl_set:Nn \l__nicematrix_pos_of_block_tl c }
- \c_math_toggle_token
- \exp_args:Nnx \begin { array }
- { @ { } \l__nicematrix_pos_of_block_tl @ { } } #5 \end { array }
- \c_math_toggle_token
- \group_end:
- }
+ \group_begin:
+ \cs_set:Npn \arraystretch { 1 }
+ \dim_set_eq:NN \extrarowheight \c_zero_dim
+ #4
+ \bool_if:NT \g__nicematrix_rotate_bool
+ { \tl_set:Nn \l__nicematrix_pos_of_block_tl c }
+ \exp_args:Nnx \begin { tabular }
+ { @ { } \l__nicematrix_pos_of_block_tl @ { } }
+ #5
+ \end { tabular }
+ \group_end:
}
- }
+ {
+ \group_begin:
+ \cs_set:Npn \arraystretch { 1 }
+ \dim_set_eq:NN \extrarowheight \c_zero_dim
+ #4
+ \bool_if:NT \g__nicematrix_rotate_bool
+ { \tl_set:Nn \l__nicematrix_pos_of_block_tl c }
+ \c_math_toggle_token
+ \exp_args:Nnx \begin { array }
+ { @ { } \l__nicematrix_pos_of_block_tl @ { } } #5 \end { array }
+ \c_math_toggle_token
+ \group_end:
+ }
+ }
}
}
}
@@ -4417,6 +4497,14 @@
{
\group_begin:
\keys_set:nn { NiceMatrix / Block / SecondPass} { #5 }
+ \int_zero_new:N \l__nicematrix_last_row_int
+ \int_zero_new:N \l__nicematrix_last_col_int
+ \int_compare:nNnTF { #3 } > { 99 }
+ { \int_set_eq:NN \l__nicematrix_last_row_int \c@iRow }
+ { \int_set:Nn \l__nicematrix_last_row_int { #3 } }
+ \int_compare:nNnTF { #4 } > { 99 }
+ { \int_set_eq:NN \l__nicematrix_last_col_int \c@jCol }
+ { \int_set:Nn \l__nicematrix_last_col_int { #4 } }
\tl_if_empty:NF \l__nicematrix_color_tl
{
\tl_gput_right:Nx \g_nicematrix_code_before_tl
@@ -4424,7 +4512,7 @@
\exp_not:N \rectanglecolor
{ \l__nicematrix_color_tl }
{ #1 - #2 }
- { #3 - #4 }
+ { \int_use:N \l__nicematrix_last_row_int - \int_use:N \l__nicematrix_last_col_int }
}
}
\cs_set_protected_nopar:Npn \diagbox ##1 ##2
@@ -4432,13 +4520,16 @@
\tl_gput_right:Nx \g__nicematrix_internal_code_after_tl
{
\__nicematrix_actually_diagbox:nnnnnn
- { #1 } { #2 } { #3 } { #4 }
+ { #1 }
+ { #2 }
+ { \int_use:N \l__nicematrix_last_row_int }
+ { \int_use:N \l__nicematrix_last_col_int }
{ \exp_not:n { ##1 } } { \exp_not:n { ##2 } }
}
}
\bool_lazy_or:nnTF
- { \int_compare_p:nNn { #3 } > \g__nicematrix_row_total_int }
- { \int_compare_p:nNn { #4 } > \g__nicematrix_col_total_int }
+ { \int_compare_p:nNn \l__nicematrix_last_row_int > \g__nicematrix_row_total_int }
+ { \int_compare_p:nNn \l__nicematrix_last_col_int > \g__nicematrix_col_total_int }
{ \msg_error:nnnn { nicematrix } { Block~too~large } { #1 } { #2 } }
{
\hbox_set:Nn \l__nicematrix_cell_box { #6 }
@@ -4450,9 +4541,9 @@
\dim_set_eq:NN \l_tmpa_dim \pgf@y
\__nicematrix_qpoint:n { col - #2 }
\dim_set_eq:NN \l_tmpb_dim \pgf@x
- \__nicematrix_qpoint:n { row - \__nicematrix_succ:n { #3 } }
+ \__nicematrix_qpoint:n { row - \__nicematrix_succ:n { \l__nicematrix_last_row_int } }
\dim_set_eq:NN \l_tmpc_dim \pgf@y
- \__nicematrix_qpoint:n { col - \__nicematrix_succ:n { #4 } }
+ \__nicematrix_qpoint:n { col - \__nicematrix_succ:n { \l__nicematrix_last_col_int } }
\dim_set_eq:NN \l_tmpd_dim \pgf@x
\begin { pgfscope }
\exp_args:Nx \pgfset { \l__nicematrix_tikz_tl }
@@ -4482,18 +4573,20 @@
\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 }
+ { pgf @ sh @ ns @ \__nicematrix_env: - ##1 - \int_use:N \l__nicematrix_last_col_int }
{
\seq_if_in:NnF \g__nicematrix_multicolumn_cells_seq { ##1 - #2 }
{
- \pgfpointanchor { \__nicematrix_env: - ##1 - #4 } { east }
+ \pgfpointanchor
+ { \__nicematrix_env: - ##1 - \int_use:N \l__nicematrix_last_col_int }
+ { 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 } }
+ \__nicematrix_qpoint:n { col - \__nicematrix_succ:n { \l__nicematrix_last_col_int } }
\dim_set_eq:NN \l_tmpd_dim \pgf@x
}
\__nicematrix_pgf_rect_node:nnnnn
@@ -4504,7 +4597,14 @@
\__nicematrix_pgf_rect_node:nnn
{ \__nicematrix_env: - #1 - #2 - block - medium }
{ \pgfpointanchor { \__nicematrix_env: - #1 - #2 - medium } { north~west } }
- { \pgfpointanchor { \__nicematrix_env: - #3 - #4 - medium } { south~east } }
+ {
+ \pgfpointanchor
+ { \__nicematrix_env:
+ - \int_use:N \l__nicematrix_last_row_int
+ - \int_use:N \l__nicematrix_last_col_int - medium
+ }
+ { south~east }
+ }
}
\int_compare:nNnTF { #1 } = { #3 }
{