summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nicematrix
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-08-22 20:06:55 +0000
committerKarl Berry <karl@freefriends.org>2021-08-22 20:06:55 +0000
commit6e18fe0f01e9a301f7fc4a40ee702864cec07a26 (patch)
tree959468afc28a89244d9fac52608a5fe0aca74958 /Master/texmf-dist/tex/latex/nicematrix
parent09a3454f70a6557c432286bf16645b081821a8cf (diff)
nicematrix
git-svn-id: svn://tug.org/texlive/trunk@60304 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/nicematrix')
-rw-r--r--Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty278
1 files changed, 151 insertions, 127 deletions
diff --git a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
index b0fa2412209..c50867a21dd 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.0}
-\def\myfiledate{2021/08/10}
+\def\myfileversion{6.1}
+\def\myfiledate{2021/08/20}
\RequirePackage{pgfcore}
\usepgfmodule{shapes}
\RequirePackage{l3keys2e}
@@ -207,41 +207,13 @@
\bool_if:nTF { ! \c__nicematrix_siunitx_loaded_bool }
{ \cs_set_eq:NN \__nicematrix_renew_NC@rewrite@S: \prg_do_nothing: }
{
- \cs_if_exist:NTF \siunitx_cell_begin:w
+ \cs_new_protected:Npn \__nicematrix_renew_NC@rewrite@S:
{
- \cs_new_protected:Npn \__nicematrix_renew_NC@rewrite@S:
+ \renewcommand*{\NC@rewrite@S}[1][]
{
- \renewcommand*{\NC@rewrite@S}[1][]
- {
- \@temptokena \exp_after:wN
- {
- \tex_the:D \@temptokena
- > {
- \__nicematrix_Cell:
- \keys_set:nn { siunitx } { ##1 }
- \siunitx_cell_begin:w
- }
- \__nicematrix_true_c:
- < { \siunitx_cell_end: \__nicematrix_end_Cell: }
- }
- \NC@find
- }
- }
- }
- {
- \cs_new_protected:Npn \__nicematrix_renew_NC@rewrite@S:
- {
- \renewcommand*{\NC@rewrite@S}[1][]
- {
- \@temptokena \exp_after:wN
- {
- \tex_the:D \@temptokena
- > { \__nicematrix_Cell: \c__nicematrix_table_collect_begin_tl S {##1} }
- \__nicematrix_true_c:
- < { \c__nicematrix_table_print_tl \__nicematrix_end_Cell: }
- }
- \NC@find
- }
+ \@temptokena \exp_after:wN
+ { \tex_the:D \@temptokena \__nicematrix_S: [ ##1 ] }
+ \NC@find
}
}
}
@@ -899,7 +871,7 @@
l .code:n = \__nicematrix_error:n { r~or~l~with~preamble } ,
unknown .code:n = \__nicematrix_error:n { Unknown~key~for~NiceTabular }
}
-\cs_new_protected:Npn \__nicematrix_Cell:
+\cs_new_protected:Npn \__nicematrix_cell_begin:w
{
\tl_gclear:N \g__nicematrix_post_action_cell_tl
\cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter_i:n
@@ -1001,7 +973,7 @@
\dim_gzero:N \g__nicematrix_blocks_ht_dim
}
}
-\cs_new_protected:Npn \__nicematrix_end_Cell:
+\cs_new_protected:Npn \__nicematrix_cell_end:
{
\__nicematrix_math_toggle_token:
\hbox_set_end:
@@ -1195,6 +1167,7 @@
}
\cs_new_protected:Npn \__nicematrix_pre_array_ii:
{
+ \int_gzero:N \g__nicematrix_total_X_weight_int
\bool_if:NT \c__nicematrix_booktabs_loaded_bool
{ \tl_put_left:Nn \@BTnormal \__nicematrix_create_row_node: }
\box_clear_new:N \l__nicematrix_cell_box
@@ -1372,6 +1345,13 @@
cell-space-top-limit = #1 ,
cell-space-bottom-limit = #1 ,
} ,
+ color .code:n =
+ {
+ \leavevmode \color { #1 }
+ \tl_gput_right:Nn \g__nicematrix_row_style_tl
+ { \leavevmode \color { #1 } }
+ } ,
+ color .value_required:n = true ,
unknown .code:n = \__nicematrix_error:n { Unknown~key~for~RowStyle }
}
\NewDocumentCommand \__nicematrix_RowStyle:n { O { } m }
@@ -1560,19 +1540,28 @@
}
\int_compare:nNnT \g__nicematrix_total_X_weight_int > 0
{
- \bool_if:NTF \l__nicematrix_X_columns_aux_bool
- { \dim_set_eq:NN \l_tmpa_dim \l__nicematrix_X_columns_dim }
- {
- \dim_set:Nn \l_tmpa_dim
- {
- ( \l__nicematrix_width_dim - \box_wd:N \l__nicematrix_the_array_box )
- / \int_use:N \g__nicematrix_total_X_weight_int
- }
- }
\tl_gput_right:Nx \g__nicematrix_aux_tl
{
\bool_set_true:N \l__nicematrix_X_columns_aux_bool
- \dim_set:Nn \l__nicematrix_X_columns_dim { \dim_use:N \l_tmpa_dim }
+ \dim_set:Nn \l__nicematrix_X_columns_dim
+ {
+ \dim_compare:nNnTF
+ {
+ \dim_abs:n
+ { \l__nicematrix_width_dim - \box_wd:N \l__nicematrix_the_array_box }
+ }
+ <
+ { 0.001 pt }
+ { \dim_use:N \l__nicematrix_X_columns_dim }
+ {
+ \dim_eval:n
+ {
+ ( \l__nicematrix_width_dim - \box_wd:N \l__nicematrix_the_array_box )
+ / \int_use:N \g__nicematrix_total_X_weight_int
+ + \l__nicematrix_X_columns_dim
+ }
+ }
+ }
}
}
\int_compare:nNnT \l__nicematrix_last_row_int > { -2 }
@@ -1706,7 +1695,6 @@
{ ! { \skip_horizontal:N \arrayrulewidth } }
}
}
- \int_gzero:N \g__nicematrix_total_X_weight_int
\seq_clear:N \g__nicematrix_cols_vlism_seq
\int_zero:N \l_tmpa_int
\exp_after:wN \__nicematrix_patch_preamble:n \the \@temptokena \q_stop
@@ -1771,7 +1759,7 @@
m { \__nicematrix_patch_preamble_iv:n #1 }
\__nicematrix_w: { \__nicematrix_patch_preamble_v:nnnn { } #1 }
\__nicematrix_W: { \__nicematrix_patch_preamble_v:nnnn { \cs_set_eq:NN \hss \hfil } #1 }
- \__nicematrix_true_c: { \__nicematrix_patch_preamble_vi:n #1 }
+ \__nicematrix_S: { \__nicematrix_patch_preamble_vi:n }
( { \__nicematrix_patch_preamble_vii:nn #1 }
[ { \__nicematrix_patch_preamble_vii:nn #1 }
\{ { \__nicematrix_patch_preamble_vii:nn #1 }
@@ -1810,9 +1798,9 @@
{
\tl_gput_right:Nn \g__nicematrix_preamble_tl
{
- > { \__nicematrix_Cell: \str_set:Nn \l__nicematrix_hpos_cell_str { #1 } }
+ > { \__nicematrix_cell_begin:w \str_set:Nn \l__nicematrix_hpos_cell_str { #1 } }
#1
- < \__nicematrix_end_Cell:
+ < \__nicematrix_cell_end:
}
\int_gincr:N \c@jCol
\__nicematrix_patch_preamble_x:n
@@ -1847,10 +1835,12 @@
}
}
\tl_gput_right:Nx \g__nicematrix_internal_code_after_tl
- { \__nicematrix_vline:nn { \__nicematrix_succ:n \c@jCol } { \int_use:N \l_tmpa_int } }
+ {
+ \__nicematrix_vline:nnnn
+ { \__nicematrix_succ:n \c@jCol } { \int_use:N \l_tmpa_int } { 1 } { }
+ }
\int_zero:N \l_tmpa_int
- \str_if_eq:nnT { #1 } { \q_stop }
- { \bool_gset_true:N \g_tmpb_bool }
+ \str_if_eq:nnT { #1 } { \q_stop } { \bool_gset_true:N \g_tmpb_bool }
\__nicematrix_patch_preamble:n #1
}
}
@@ -1863,13 +1853,15 @@
c .value_forbidden:n = true ,
l .code:n = \str_set:Nn \l__nicematrix_hpos_col_str { l } ,
l .value_forbidden:n = true ,
+ si .code:n = \str_set:Nn \l__nicematrix_hpos_col_str { si } ,
+ si .value_forbidden:n = true ,
p .code:n = \str_set:Nn \l__nicematrix_vpos_col_str { p } ,
p .value_forbidden:n = true ,
t .meta:n = p ,
m .code:n = \str_set:Nn \l__nicematrix_vpos_col_str { m } ,
m .value_forbidden:n = true ,
b .code:n = \str_set:Nn \l__nicematrix_vpos_col_str { b } ,
- b .value_forbidden:n = true
+ b .value_forbidden:n = true ,
}
\cs_new_protected:Npn \__nicematrix_patch_preamble_iv:n #1
{
@@ -1894,13 +1886,16 @@
{
\use:x
{
- \__nicematrix_patch_preamble_iv_v:nnnn
+ \__nicematrix_patch_preamble_iv_v:nnnnnn
{ \str_if_eq:VnTF \l__nicematrix_vpos_col_str { p } { t } { b } }
{ \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 \l__nicematrix_hpos_col_str }
+ {
+ \str_set:Nn \exp_not:N \l__nicematrix_hpos_cell_str
+ { \l__nicematrix_hpos_col_str }
+ }
\str_case:Vn \l__nicematrix_hpos_col_str
{
c { \exp_not:N \centering }
@@ -1909,17 +1904,19 @@
}
}
{ \str_if_eq:VnT \l__nicematrix_vpos_col_str { m } \__nicematrix_center_cell_box: }
+ { \str_if_eq:VnT \l__nicematrix_hpos_col_str { si } \siunitx_cell_begin:w }
+ { \str_if_eq:VnT \l__nicematrix_hpos_col_str { si } \siunitx_cell_end: }
}
\int_gincr:N \c@jCol
\__nicematrix_patch_preamble_x:n
}
-\cs_new_protected:Npn \__nicematrix_patch_preamble_iv_v:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \__nicematrix_patch_preamble_iv_v:nnnnnn #1 #2 #3 #4 #5 #6
{
\tl_gput_right:Nn \g__nicematrix_preamble_tl
{
> {
\dim_set:Nn \l__nicematrix_col_width_dim { #2 }
- \__nicematrix_Cell:
+ \__nicematrix_cell_begin:w
\begin { minipage } [ #1 ] { #2 }
\everypar
{
@@ -1929,13 +1926,15 @@
#3
\g__nicematrix_row_style_tl
\arraybackslash
+ #5
}
c
< {
+ #6
\@finalstrut \@arstrutbox
\end { minipage }
#4
- \__nicematrix_end_Cell:
+ \__nicematrix_cell_end:
}
}
}
@@ -1967,12 +1966,12 @@
> {
\dim_set:Nn \l__nicematrix_col_width_dim { #4 }
\hbox_set:Nw \l__nicematrix_cell_box
- \__nicematrix_Cell:
+ \__nicematrix_cell_begin:w
\str_set:Nn \l__nicematrix_hpos_cell_str { #3 }
}
c
< {
- \__nicematrix_end_Cell:
+ \__nicematrix_cell_end:
#1
\hbox_set_end:
\bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
@@ -1985,9 +1984,45 @@
}
\cs_new_protected:Npn \__nicematrix_patch_preamble_vi:n #1
{
- \tl_gput_right:Nn \g__nicematrix_preamble_tl { c }
- \int_gincr:N \c@jCol
- \__nicematrix_patch_preamble_x:n
+ \str_if_eq:nnTF { #1 } { [ }
+ { \__nicematrix_patch_preamble_vi_i:w [ }
+ { \__nicematrix_patch_preamble_vi_i:w [ ] { #1 } }
+ }
+\cs_new_protected:Npn \__nicematrix_patch_preamble_vi_i:w [ #1 ]
+ { \__nicematrix_patch_preamble_vi_ii:n { #1 } }
+\AtBeginDocument
+ {
+ \cs_if_exist:NTF \siunitx_cell_begin:w
+ {
+ \cs_new_protected:Npn \__nicematrix_patch_preamble_vi_ii:n #1
+ {
+ \tl_gput_right:Nn \g__nicematrix_preamble_tl
+ {
+ > {
+ \__nicematrix_cell_begin:w
+ \keys_set:nn { siunitx } { #1 }
+ \siunitx_cell_begin:w
+ }
+ c
+ < { \siunitx_cell_end: \__nicematrix_cell_end: }
+ }
+ \int_gincr:N \c@jCol
+ \__nicematrix_patch_preamble_x:n
+ }
+ }
+ {
+ \cs_new_protected:Npn \__nicematrix_patch_preamble_vi_ii:n #1
+ {
+ \tl_gput_right:Nn \g__nicematrix_preamble_tl
+ {
+ > { \__nicematrix_cell_begin:w \c__nicematrix_table_collect_begin_tl S { #1 } }
+ c
+ < { \c__nicematrix_table_print_tl \__nicematrix_cell_end: }
+ }
+ \int_gincr:N \c@jCol
+ \__nicematrix_patch_preamble_x:n
+ }
+ }
}
\cs_new_protected:Npn \__nicematrix_patch_preamble_vii:nn #1 #2
{
@@ -2094,7 +2129,7 @@
\tl_gput_right:Nn \g__nicematrix_preamble_tl
{
> {
- \__nicematrix_Cell:
+ \__nicematrix_cell_begin:w
\bool_set_true:N \l__nicematrix_X_column_bool
\tl_gput_right:Nn \g__nicematrix_post_action_cell_tl
{ \hbox_set:Nn \l__nicematrix_cell_box { } }
@@ -2103,7 +2138,7 @@
c
< {
\end { minipage }
- \__nicematrix_end_Cell:
+ \__nicematrix_cell_end:
}
}
\int_gincr:N \c@jCol
@@ -2204,9 +2239,9 @@
{
\tl_gput_right:Nn \g__nicematrix_preamble_tl
{
- > { \__nicematrix_Cell: \str_set:Nn \l__nicematrix_hpos_cell_str { #1 } }
+ > { \__nicematrix_cell_begin:w \str_set:Nn \l__nicematrix_hpos_cell_str { #1 } }
#1
- < \__nicematrix_end_Cell:
+ < \__nicematrix_cell_end:
}
\__nicematrix_patch_m_preamble_x:n
}
@@ -2225,7 +2260,7 @@
\tl_gput_right:Nn \g__nicematrix_preamble_tl
{
> {
- \__nicematrix_Cell:
+ \__nicematrix_cell_begin:w
\begin { minipage } [ #1 ] { \dim_eval:n { #3 } }
\mode_leave_vertical:
\arraybackslash
@@ -2235,7 +2270,7 @@
< {
\vrule height 0 pt depth \box_dp:N \@arstrutbox width 0 pt
\end { minipage }
- \__nicematrix_end_Cell:
+ \__nicematrix_cell_end:
}
}
\__nicematrix_patch_m_preamble_x:n
@@ -2246,12 +2281,12 @@
{
> {
\hbox_set:Nw \l__nicematrix_cell_box
- \__nicematrix_Cell:
+ \__nicematrix_cell_begin:w
\str_set:Nn \l__nicematrix_hpos_cell_str { #3 }
}
c
< {
- \__nicematrix_end_Cell:
+ \__nicematrix_cell_end:
#1
\hbox_set_end:
\bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box:
@@ -2859,7 +2894,7 @@
\c@MaxMatrixCols
{ \__nicematrix_pred:n \l__nicematrix_last_col_int }
}
- { > \__nicematrix_Cell: #2 < \__nicematrix_end_Cell: }
+ { > \__nicematrix_cell_begin:w #2 < \__nicematrix_cell_end: }
}
}
\clist_map_inline:nn { { } , p , b , B , v , V }
@@ -2968,16 +3003,16 @@
\__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 }
- { \seq_if_empty_p:N \g__nicematrix_pos_of_xdots_seq }
- { \seq_if_empty_p:N \l__nicematrix_corners_cells_seq }
- }
- {
- \cs_set_eq:NN \__nicematrix_vline_i:nn \__nicematrix_vline_i_complete:nn
- \cs_set_eq:NN \__nicematrix_hline_i:nn \__nicematrix_hline_i_complete:nn
- }
+ % \bool_lazy_all:nT
+ % {
+ % { \seq_if_empty_p:N \g__nicematrix_pos_of_blocks_seq }
+ % { \seq_if_empty_p:N \g__nicematrix_pos_of_xdots_seq }
+ % { \seq_if_empty_p:N \l__nicematrix_corners_cells_seq }
+ % }
+ % {
+ % \cs_set_eq:NN \__nicematrix_vline_i:nn \__nicematrix_vline_i_complete:nn
+ % \cs_set_eq:NN \__nicematrix_hline_i:nn \__nicematrix_hline_i_complete:nn
+ % }
\tl_if_empty:NF \l__nicematrix_hlines_clist \__nicematrix_draw_hlines:
\tl_if_empty:NF \l__nicematrix_vlines_clist \__nicematrix_draw_vlines:
\cs_set_eq:NN \SubMatrix \__nicematrix_SubMatrix
@@ -4584,20 +4619,23 @@
\int_compare:nNnF \c@iRow = 0
{ \int_compare:nNnF \c@iRow = \l__nicematrix_last_row_int { #1 } }
}
-\cs_new_protected:Npn \__nicematrix_vline:nn #1 #2
+\cs_new_protected:Npn \__nicematrix_vline:nnnn #1 #2 #3 #4
{
\int_compare:nNnT { #1 } < { \c@jCol + 2 }
{
\pgfpicture
- \__nicematrix_vline_i:nn { #1 } { #2 }
+ \__nicematrix_vline_i:nnnn { #1 } { #2 } { #3 } { #4 }
\endpgfpicture
}
}
-\cs_new_protected:Npn \__nicematrix_vline_i:nn #1 #2
+\cs_new_protected:Npn \__nicematrix_vline_i:nnnn #1 #2 #3 #4
{
\tl_set:Nx \l_tmpb_tl { #1 }
\tl_clear_new:N \l_tmpc_tl
- \int_step_variable:nNn \c@iRow \l_tmpa_tl
+ \int_step_variable:nnNn
+ { #3 }
+ { \tl_if_blank:nTF { #4 } { \int_use:N \c@iRow } { #4 } }
+ \l_tmpa_tl
{
\bool_gset_true:N \g_tmpa_bool
\seq_map_inline:Nn \g__nicematrix_pos_of_blocks_seq
@@ -4606,8 +4644,7 @@
{ \__nicematrix_test_vline_in_block:nnnn ##1 }
\seq_map_inline:Nn \g__nicematrix_pos_of_stroken_blocks_seq
{ \__nicematrix_test_vline_in_stroken_block:nnnn ##1 }
- \clist_if_empty:NF \l__nicematrix_corners_clist
- \__nicematrix_test_in_corner_v:
+ \clist_if_empty:NF \l__nicematrix_corners_clist \__nicematrix_test_in_corner_v:
\bool_if:NTF \g_tmpa_bool
{
\tl_if_empty:NT \l_tmpc_tl
@@ -4631,7 +4668,7 @@
{ #1 }
{ #2 }
\l_tmpc_tl
- { \int_use:N \c@iRow }
+ { \tl_if_blank:nTF { #4 } { \int_use:N \c@iRow } { #4 } }
\tl_clear:N \l_tmpc_tl
}
}
@@ -4720,20 +4757,23 @@
{
\tl_if_eq:NnF \l__nicematrix_vlines_clist { all }
{ \clist_if_in:NnT \l__nicematrix_vlines_clist { ##1 } }
- { \__nicematrix_vline:nn { ##1 } 1 }
+ { \__nicematrix_vline:nnnn { ##1 } 1 1 { } }
}
}
-\cs_new_protected:Npn \__nicematrix_hline:nn #1 #2
+\cs_new_protected:Npn \__nicematrix_hline:nnnn #1 #2 #3 #4
{
\pgfpicture
- \__nicematrix_hline_i:nn { #1 } { #2 }
+ \__nicematrix_hline_i:nnnn { #1 } { #2 } { #3 } { #4 }
\endpgfpicture
}
-\cs_new_protected:Npn \__nicematrix_hline_i:nn #1 #2
+\cs_new_protected:Npn \__nicematrix_hline_i:nnnn #1 #2 #3 #4
{
\tl_set:Nn \l_tmpa_tl { #1 }
\tl_clear_new:N \l_tmpc_tl
- \int_step_variable:nNn \c@jCol \l_tmpb_tl
+ \int_step_variable:nnNn
+ { #3 }
+ { \tl_if_blank:nTF { #4 } { \int_use:N \c@jCol } { #4 } }
+ \l_tmpb_tl
{
\bool_gset_true:N \g_tmpa_bool
\seq_map_inline:Nn \g__nicematrix_pos_of_blocks_seq
@@ -4766,7 +4806,7 @@
{ #1 }
{ #2 }
\l_tmpc_tl
- { \int_use:N \c@jCol }
+ { \tl_if_blank:nTF { #4 } { \int_use:N \c@jCol } { #4 } }
\tl_clear:N \l_tmpc_tl
}
}
@@ -4853,7 +4893,7 @@
{
\tl_if_eq:NnF \l__nicematrix_hlines_clist { all }
{ \clist_if_in:NnT \l__nicematrix_hlines_clist { ##1 } }
- { \__nicematrix_hline:nn { ##1 } 1 }
+ { \__nicematrix_hline:nnnn { ##1 } 1 1 { } }
}
}
\cs_set:Npn \__nicematrix_Hline: { \noalign { \ifnum 0 = `} \fi \__nicematrix_Hline_i:n { 1 } }
@@ -4872,7 +4912,7 @@
+ \doublerulesep * ( \int_max:nn 0 { #1 - 1 } )
}
\tl_gput_right:Nx \g__nicematrix_internal_code_after_tl
- { \__nicematrix_hline:nn { \__nicematrix_succ:n { \c@iRow } } { #1 } }
+ { \__nicematrix_hline:nnnn { \__nicematrix_succ:n { \c@iRow } } { #1 } 1 { } }
\ifnum 0 = `{ \fi }
}
\cs_new_protected:Npn \__nicematrix_test_hline_in_block:nnnn #1 #2 #3 #4
@@ -5360,7 +5400,7 @@
b .code:n = \str_set:Nn \l__nicematrix_vpos_of_block_tl b ,
b .value_forbidden:n = true ,
color .tl_set:N = \l__nicematrix_color_tl ,
- color .value_required:n = true ,
+ color .value_required:n = true
}
\NewExpandableDocumentCommand \__nicematrix_Block: { O { } m D < > { } m }
{
@@ -5660,10 +5700,9 @@
}
\cs_new_protected:Npn \__nicematrix_Block_v:nnnnnn #1 #2 #3 #4 #5 #6
{
- \seq_gput_left:Nn \g__nicematrix_pos_of_blocks_seq { { #1 } { #2 } { #3 } { #4 } }
\group_begin:
\keys_set:nn { NiceMatrix / Block / SecondPass } { #5 }
- \bool_if:NT \l__nicematrix_hvlines_block_bool
+ \bool_if:NTF \l__nicematrix_hvlines_block_bool
{
\tl_gput_right:Nx \g_nicematrix_code_after_tl
{
@@ -5673,6 +5712,10 @@
{ \int_use:N \l__nicematrix_last_row_int - \int_use:N \l__nicematrix_last_col_int }
}
}
+ {
+ \seq_gput_left:Nn \g__nicematrix_pos_of_blocks_seq
+ { { #1 } { #2 } { #3 } { #4 } }
+ }
\tl_if_empty:NF \l__nicematrix_draw_tl
{
\tl_gput_right:Nx \g_nicematrix_code_after_tl
@@ -5948,7 +5991,6 @@
rounded-corners .dim_set:N = \l__nicematrix_rounded_corners_dim ,
rounded-corners .default:n = 4 pt
}
-
\cs_new_protected:Npn \__nicematrix_hvlines_block:nnn #1 #2 #3
{
\dim_set_eq:NN \l__nicematrix_line_width_dim \arrayrulewidth
@@ -5959,34 +6001,16 @@
\__nicematrix_cut_on_hyphen:w #3 \q_stop
\tl_set:Nx \l_tmpa_tl { \int_eval:n { \l_tmpa_tl + 1 } }
\tl_set:Nx \l_tmpb_tl { \int_eval:n { \l_tmpb_tl + 1 } }
- \pgfpicture
- \pgfrememberpicturepositiononpagetrue
- \pgf@relevantforpicturesizefalse
- \CT@arc@
- \pgfsetlinewidth { 1.1 \l__nicematrix_line_width_dim }
- \__nicematrix_qpoint:n { row - \l_tmpa_tl }
- \dim_set_eq:NN \l_tmpa_dim \pgf@y
- \__nicematrix_qpoint:n { row - \l_tmpc_tl }
- \dim_set_eq:NN \l_tmpb_dim \pgf@y
\int_step_inline:nnn \l_tmpd_tl \l_tmpb_tl
{
- \__nicematrix_qpoint:n { col - ##1 }
- \pgfpathmoveto { \pgfpoint \pgf@x \l_tmpa_dim }
- \pgfpathlineto { \pgfpoint \pgf@x \l_tmpb_dim }
- \pgfusepathqstroke
+ \use:x
+ { \__nicematrix_vline:nnnn { ##1 } 1 { \l_tmpc_tl } { \__nicematrix_pred:n \l_tmpa_tl } }
}
- \__nicematrix_qpoint:n { col - \l_tmpb_tl }
- \dim_set:Nn \l_tmpa_dim { \pgf@x + 0.5 \arrayrulewidth }
- \__nicematrix_qpoint:n { col - \l_tmpd_tl }
- \dim_set:Nn \l_tmpb_dim { \pgf@x - 0.5 \arrayrulewidth }
\int_step_inline:nnn \l_tmpc_tl \l_tmpa_tl
{
- \__nicematrix_qpoint:n { row - ##1 }
- \pgfpathmoveto { \pgfpoint \l_tmpa_dim \pgf@y }
- \pgfpathlineto { \pgfpoint \l_tmpb_dim \pgf@y }
- \pgfusepathqstroke
+ \use:x
+ { \__nicematrix_hline:nnnn { ##1 } 1 { \l_tmpd_tl } { \__nicematrix_pred:n \l_tmpb_tl } }
}
- \endpgfpicture
}
\cs_new_protected:Npn \__nicematrix_stroke_borders_block:nnn #1 #2 #3
{
@@ -6854,8 +6878,8 @@
}
\__nicematrix_msg_new:nn { Unknown~key~for~RowStyle }
{
- As~for~now,~there~is~only~three~keys~available~here:~'cell-space-top-limit',~
- 'cell-space-bottom-limit~and~'cell-space-limits'~(and~you~try~to~use~
+ As~for~now,~there~is~only~four~keys~available~here:~'cell-space-top-limit',~
+ 'cell-space-bottom-limit~'cell-space-limits'~and~color~(and~you~try~to~use~
'\l_keys_key_str').~If~you~go~on,~this~key~will~be~ignored.
}
\__nicematrix_msg_new:nn { Unknown~key~for~rowcolors }