From 90f483c4e9ccdcfccecda8623ed0422678206f0b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 1 Jan 2021 21:48:45 +0000 Subject: nicematrix (1jan21) git-svn-id: svn://tug.org/texlive/trunk@57288 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/nicematrix/nicematrix.sty | 729 +++++++++++---------- 1 file changed, 375 insertions(+), 354 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 a43579d0b61..e43f82a0591 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.7} -\def\myfiledate{2020/11/23} +\def\myfileversion{5.8} +\def\myfiledate{2021/01/01} \RequirePackage{pgfcore} \usepgfmodule{shapes} \RequirePackage{l3keys2e} @@ -452,8 +452,8 @@ \tl_const:Nn \c__nicematrix_standard_tl { standard } \tl_set_eq:NN \l__nicematrix_xdots_line_style_tl \c__nicematrix_standard_tl \bool_new:N \l__nicematrix_light_syntax_bool -\str_new:N \l__nicematrix_baseline_str -\tl_set:Nn \l__nicematrix_baseline_str c +\str_new:N \l__nicematrix_baseline_tl +\tl_set:Nn \l__nicematrix_baseline_tl c \bool_new:N \l__nicematrix_exterior_arraycolsep_bool \bool_new:N \l__nicematrix_parallelize_diags_bool \bool_set_true:N \l__nicematrix_parallelize_diags_bool @@ -575,10 +575,10 @@ \bool_set_true:N \l__nicematrix_code_before_bool } } , - c .code:n = \tl_set:Nn \l__nicematrix_baseline_str c , - t .code:n = \tl_set:Nn \l__nicematrix_baseline_str t , - b .code:n = \tl_set:Nn \l__nicematrix_baseline_str b , - baseline .tl_set:N = \l__nicematrix_baseline_str , + c .code:n = \tl_set:Nn \l__nicematrix_baseline_tl c , + t .code:n = \tl_set:Nn \l__nicematrix_baseline_tl t , + b .code:n = \tl_set:Nn \l__nicematrix_baseline_tl b , + baseline .tl_set:N = \l__nicematrix_baseline_tl , baseline .value_required:n = true , columns-width .code:n = \tl_if_eq:nnTF { #1 } { auto } @@ -814,7 +814,7 @@ } \cs_new_protected:Npn \__nicematrix_begin_of_row: { - \refstepcounter { iRow } + \int_gincr:N \c@iRow \dim_gset_eq:NN \g__nicematrix_dp_ante_last_row_dim \g__nicematrix_dp_last_row_dim \dim_gset:Nn \g__nicematrix_dp_last_row_dim { \box_dp:N \@arstrutbox } \dim_gset:Nn \g__nicematrix_ht_last_row_dim { \box_ht:N \@arstrutbox } @@ -964,7 +964,7 @@ { \cs_set_nopar:Npx \@halignto { to \dim_use:N \l__nicematrix_tabular_width_dim } } \@tabarray } - [ \str_if_eq:VnTF \l__nicematrix_baseline_str c c t ] + [ \str_if_eq:VnTF \l__nicematrix_baseline_tl c c t ] } \cs_set_eq:NN \__nicematrix_old_ialign: \ialign \cs_new_protected:Npn \__nicematrix_create_row_node: @@ -1029,11 +1029,11 @@ \cs_set_eq:NN \hdotsfor \__nicematrix_Hdotsfor: } \cs_new_protected:Npn \__nicematrix_colortbl_like: - { - \cs_set_eq:NN \cellcolor \__nicematrix_cellcolor_tabular - \cs_set_eq:NN \rowcolor \__nicematrix_rowcolor_tabular - \cs_set_eq:NN \columncolor \__nicematrix_columncolor_preamble - } + { + \cs_set_eq:NN \cellcolor \__nicematrix_cellcolor_tabular + \cs_set_eq:NN \rowcolor \__nicematrix_rowcolor_tabular + \cs_set_eq:NN \columncolor \__nicematrix_columncolor_preamble + } \cs_new_protected:Npn \__nicematrix_pre_array: { \bool_if:NT \c__nicematrix_booktabs_loaded_bool @@ -1319,11 +1319,6 @@ \int_compare:nNnT \l__nicematrix_last_col_int > { -1 } { \__nicematrix_error:n { last~col~not~used } } } - \bool_if:NF \l__nicematrix_Matrix_bool - { - \int_compare:nNnT \c@jCol < \g__nicematrix_static_num_of_col_int - { \__nicematrix_error:n { columns~not~used } } - } \int_gset_eq:NN \g__nicematrix_row_total_int \c@iRow \int_compare:nNnT \l__nicematrix_last_row_int > { -1 } { \int_gdecr:N \c@iRow } \int_compare:nNnT \l__nicematrix_first_col_int = 0 @@ -1333,7 +1328,7 @@ } \bool_if:NTF \l__nicematrix_NiceArray_bool { - \str_case:VnF \l__nicematrix_baseline_str + \str_case:VnF \l__nicematrix_baseline_tl { b \__nicematrix_use_arraybox_with_notes_b: c \__nicematrix_use_arraybox_with_notes_c: @@ -1388,6 +1383,15 @@ \skip_horizontal:N \g__nicematrix_width_last_col_dim \skip_horizontal:N \col@sep } + \bool_if:NF \l__nicematrix_Matrix_bool + { + \int_compare:nNnT \c@jCol < \g__nicematrix_static_num_of_col_int + { \__nicematrix_error:n { columns~not~used } } + } + \group_begin: + \globaldefs = 1 + \__nicematrix_msg_redirect_name:nn { columns~not~used } { error } + \group_end: \__nicematrix_after_array: \egroup \bool_if:NT \c__nicematrix_footnote_bool \endsavenotes @@ -1535,6 +1539,7 @@ \__nicematrix_Cell: \begin { minipage } [ #1 ] { #3 } \mode_leave_vertical: + \arraybackslash % added in the version 5.8 \box_use:N \@arstrutbox } c @@ -1601,7 +1606,7 @@ { \box_set_ht:Nn \l_tmpa_box { \box_ht:N \l_tmpa_box + \l_tmpa_dim } \box_set_dp:Nn \l_tmpa_box { \box_dp:N \l_tmpa_box + \l_tmpb_dim } - \str_if_eq:VnTF \l__nicematrix_baseline_str { c } + \tl_if_eq:NnTF \l__nicematrix_baseline_tl { c } { \box_use_drop:N \l_tmpa_box } \__nicematrix_put_box_in_flow_i: } @@ -1613,24 +1618,24 @@ \__nicematrix_qpoint:n { row - \__nicematrix_succ:n \c@iRow } \dim_gadd:Nn \g_tmpa_dim \pgf@y \dim_gset:Nn \g_tmpa_dim { 0.5 \g_tmpa_dim } - \str_if_in:NnTF \l__nicematrix_baseline_str { line- } + \str_if_in:NnTF \l__nicematrix_baseline_tl { line- } { \int_set:Nn \l_tmpa_int { \str_range:Nnn - \l__nicematrix_baseline_str + \l__nicematrix_baseline_tl 6 - { \str_count:N \l__nicematrix_baseline_str } + { \tl_count:V \l__nicematrix_baseline_tl } } \__nicematrix_qpoint:n { row - \int_use:N \l_tmpa_int } } { - \str_case:VnF \l__nicematrix_baseline_str + \str_case:VnF \l__nicematrix_baseline_tl { { t } { \int_set:Nn \l_tmpa_int 1 } { b } { \int_set_eq:NN \l_tmpa_int \c@iRow } } - { \int_set:Nn \l_tmpa_int \l__nicematrix_baseline_str } + { \int_set:Nn \l_tmpa_int \l__nicematrix_baseline_tl } \bool_lazy_or:nnT { \int_compare_p:nNn \l_tmpa_int < \l__nicematrix_first_row_int } { \int_compare_p:nNn \l_tmpa_int > \g__nicematrix_row_total_int } @@ -1712,24 +1717,24 @@ } \cs_new_protected:Npn \__nicematrix_use_arraybox_with_notes: { - \str_if_eq:VnT \l__nicematrix_baseline_str { t } - { \tl_set:Nn \l__nicematrix_baseline_str { 1 } } + \tl_if_eq:NnT \l__nicematrix_baseline_tl { t } + { \tl_set:Nn \l__nicematrix_baseline_tl { 1 } } \pgfpicture \__nicematrix_qpoint:n { row - 1 } \dim_gset_eq:NN \g_tmpa_dim \pgf@y - \str_if_in:NnTF \l__nicematrix_baseline_str { line- } + \str_if_in:NnTF \l__nicematrix_baseline_tl { line- } { \int_set:Nn \l_tmpa_int { \str_range:Nnn - \l__nicematrix_baseline_str + \l__nicematrix_baseline_tl 6 - { \str_count:N \l__nicematrix_baseline_str } + { \tl_count:V \l__nicematrix_baseline_tl } } \__nicematrix_qpoint:n { row - \int_use:N \l_tmpa_int } } { - \int_set:Nn \l_tmpa_int \l__nicematrix_baseline_str + \int_set:Nn \l_tmpa_int \l__nicematrix_baseline_tl \bool_lazy_or:nnT { \int_compare_p:nNn \l_tmpa_int < \l__nicematrix_first_row_int } { \int_compare_p:nNn \l_tmpa_int > \g__nicematrix_row_total_int } @@ -1886,7 +1891,7 @@ { \hbox { - \skip_horizontal:N 0.5 \arrayrulewidth + \skip_horizontal:N 0.5\arrayrulewidth \pgfsys@markposition { \__nicematrix_env: - col - 1 } \skip_horizontal:N -0.5\arrayrulewidth } @@ -2278,7 +2283,7 @@ { \tl_gset:cn { g__nicematrix_code_before_ \int_use:N \g__nicematrix_env_int _ tl } - { \g_nicematrix_code_before_tl } + { \exp_not:V \g_nicematrix_code_before_tl } } \iow_now:Nn \@mainaux \ExplSyntaxOff \bool_set_true:N \l__nicematrix_code_before_bool @@ -2289,21 +2294,23 @@ } \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 + \seq_gset_map_x:NNn \g__nicematrix_pos_of_blocks_seq \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 +\cs_new: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 } } + { #1 } + { #2 } + { + \int_compare:nNnTF { #3 } > { 99 } + { \int_use:N \c@iRow } + { #3 } + } + { + \int_compare:nNnTF { #4 } > { 99 } + { \int_use:N \c@jCol } + { #4 } + } } \AtBeginDocument { @@ -3086,7 +3093,7 @@ \__nicematrix_old_multicolumn { #1 } { - \exp_args:Ne \str_case:nn { \tl_lower_case:n { #2 } } + \exp_args:Ne \str_case:nn { \str_foldcase:n { #2 } } { l { > \__nicematrix_Cell: l < \__nicematrix_end_Cell: } r { > \__nicematrix_Cell: r < \__nicematrix_end_Cell: } @@ -3125,7 +3132,9 @@ } \cs_new:Npn \__nicematrix_Hdotsfor: { - \int_compare:nNnTF \c@jCol = 0 + \bool_lazy_and:nnTF + { \int_compare_p:nNn \c@jCol = 0 } + { \int_compare_p:nNn \l__nicematrix_first_col_int = 0 } { \bool_if:NTF \g__nicematrix_after_col_zero_bool { @@ -3351,25 +3360,33 @@ \tl_set:Nn \l_tmpa_tl { #1 } \tl_set:Nn \l_tmpb_tl { #2 } } -\NewDocumentCommand \__nicematrix_rowcolor { O { } m m } +\cs_new_protected:Npn \__nicematrix_cartesian_fill: { - \tl_if_blank:nF { #2 } + \clist_map_inline:Nn \l__nicematrix_cols_tl { - \pgfpicture - \pgf@relevantforpicturesizefalse - \tl_if_empty:nTF { #1 } \color { \color [ #1 ] } { #2 } - \__nicematrix_qpoint:n { col - 1} - \int_compare:nNnTF \l__nicematrix_first_col_int = 0 - { \dim_set:Nn \l_tmpc_dim { \pgf@x + 0.5 \arrayrulewidth } } + \tl_set:Nn \l_tmpa_tl { ##1 } + \tl_if_in:NnTF \l_tmpa_tl { - } + { \__nicematrix_cut_on_hyphen:w ##1 \q_stop } + { \__nicematrix_cut_on_hyphen:w ##1 - ##1 \q_stop } + \tl_if_empty:NT \l_tmpa_tl { \tl_set:Nn \l_tmpa_tl { 1 } } + \tl_if_empty:NT \l_tmpb_tl + { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } } + \int_compare:nNnT \l_tmpb_tl > \c@jCol + { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } } + \__nicematrix_qpoint:n { col - \l_tmpa_tl } + \bool_lazy_and:nnTF + { \str_if_eq_p:Vn \l_tmpa_tl 0 } + { \int_compare_p:nNn \l__nicematrix_first_col_int > 0 } { \dim_set:Nn \l_tmpc_dim { \pgf@x - 0.5 \arrayrulewidth } } - \__nicematrix_qpoint:n { col - \__nicematrix_succ:n \c@jCol } + { \dim_set:Nn \l_tmpc_dim { \pgf@x + 0.5 \arrayrulewidth } } + \__nicematrix_qpoint:n { col - \__nicematrix_succ:n \l_tmpb_tl } \dim_set:Nn \l_tmpa_dim { \pgf@x + 0.5 \arrayrulewidth } - \clist_map_inline:nn { #3 } + \clist_map_inline:Nn \l__nicematrix_rows_tl { - \tl_set:Nn \l_tmpa_tl { ##1 } + \tl_set:Nn \l_tmpa_tl { ####1 } \tl_if_in:NnTF \l_tmpa_tl { - } - { \__nicematrix_cut_on_hyphen:w ##1 \q_stop } - { \__nicematrix_cut_on_hyphen:w ##1 - ##1 \q_stop } + { \__nicematrix_cut_on_hyphen:w ####1 \q_stop } + { \__nicematrix_cut_on_hyphen:w ####1 - ####1 \q_stop } \tl_if_empty:NT \l_tmpa_tl { \tl_set:Nn \l_tmpa_tl { 1 } } \tl_if_empty:NT \l_tmpb_tl { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@iRow } } @@ -3383,7 +3400,19 @@ { \pgfpoint \l_tmpc_dim \l_tmpd_dim } { \pgfpoint \l_tmpa_dim \l_tmpb_dim } } - \pgfusepathqfill + } + \pgfusepathqfill + } +\NewDocumentCommand \__nicematrix_rowcolor { O { } m m } + { + \tl_if_blank:nF { #2 } + { + \pgfpicture + \pgf@relevantforpicturesizefalse + \tl_if_empty:nTF { #1 } \color { \color [ #1 ] } { #2 } + \tl_set:Nn \l__nicematrix_rows_tl { #3 } + \tl_set:Nn \l__nicematrix_cols_tl { - } + \__nicematrix_cartesian_fill: \endpgfpicture } } @@ -3394,100 +3423,45 @@ \pgfpicture \pgf@relevantforpicturesizefalse \tl_if_empty:nTF { #1 } \color { \color [ #1 ] } { #2 } - \__nicematrix_qpoint:n { row - 1 } - \dim_set:Nn \l_tmpa_dim {\pgf@y + 0.5 \arrayrulewidth } - \__nicematrix_qpoint:n { row - \__nicematrix_succ:n \c@iRow } - \dim_set:Nn \l_tmpb_dim { \pgf@y + 0.5 \arrayrulewidth } - \clist_map_inline:nn { #3 } - { - \tl_set:Nn \l_tmpa_tl { ##1 } - \tl_if_in:NnTF \l_tmpa_tl { - } - { \__nicematrix_cut_on_hyphen:w ##1 \q_stop } - { \__nicematrix_cut_on_hyphen:w ##1 - ##1 \q_stop } - \tl_if_empty:NT \l_tmpa_tl { \tl_set:Nn \l_tmpa_tl { 1 } } - \tl_if_empty:NT \l_tmpb_tl - { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } } - \int_compare:nNnT \l_tmpb_tl > \c@jCol - { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } } - \__nicematrix_qpoint:n { col - \l_tmpa_tl } - \int_compare:nNnTF \l__nicematrix_first_col_int = \l_tmpa_tl - { \dim_set:Nn \l_tmpc_dim { \pgf@x - 0.5 \arrayrulewidth } } - { \dim_set:Nn \l_tmpc_dim { \pgf@x + 0.5 \arrayrulewidth } } - \__nicematrix_qpoint:n { col - \__nicematrix_succ:n \l_tmpb_tl } - \dim_set:Nn \l_tmpd_dim { \pgf@x + 0.5 \arrayrulewidth } - \pgfpathrectanglecorners - { \pgfpoint \l_tmpc_dim \l_tmpa_dim } - { \pgfpoint \l_tmpd_dim \l_tmpb_dim } - } - \pgfusepathqfill + \tl_set:Nn \l__nicematrix_rows_tl { - } + \tl_set:Nn \l__nicematrix_cols_tl { #3 } + \__nicematrix_cartesian_fill: \endpgfpicture } } -\NewDocumentCommand \__nicematrix_cellcolor { O { } m m } +\NewDocumentCommand \__nicematrix_rectanglecolor { O { } m m m } { \tl_if_blank:nF { #2 } { \pgfpicture \pgf@relevantforpicturesizefalse \tl_if_empty:nTF { #1 } \color { \color [ #1 ] } { #2 } - \clist_map_inline:nn { #3 } - { - \__nicematrix_cut_on_hyphen:w ##1 \q_stop - \__nicematrix_qpoint:n { row - \l_tmpa_tl } - \bool_lazy_and:nnT - { \int_compare_p:n { \l_tmpa_tl <= \c@iRow } } - { \int_compare_p:n { \l_tmpb_tl <= \c@jCol } } - { - \dim_set:Nn \l_tmpb_dim { \pgf@y + 0.5 \arrayrulewidth } - \__nicematrix_qpoint:n { row - \__nicematrix_succ:n \l_tmpa_tl } - \dim_set:Nn \l_tmpa_dim { \pgf@y + 0.5 \arrayrulewidth } - \__nicematrix_qpoint:n { col - \l_tmpb_tl } - \int_compare:nNnTF \l__nicematrix_first_col_int = \l_tmpb_tl - { \dim_set:Nn \l_tmpc_dim { \pgf@x - 0.5 \arrayrulewidth } } - { \dim_set:Nn \l_tmpc_dim { \pgf@x + 0.5 \arrayrulewidth } } - \__nicematrix_qpoint:n { col - \__nicematrix_succ:n \l_tmpb_tl } - \dim_set:Nn \l_tmpd_dim { \pgf@x + 0.5 \arrayrulewidth } - \pgfpathrectanglecorners - { \pgfpoint \l_tmpc_dim \l_tmpb_dim } - { \pgfpoint \l_tmpd_dim \l_tmpa_dim } - } - } - \pgfusepathqfill + \__nicematrix_rectanglecolor_i:nn { #3 } { #4 } \endpgfpicture } } -\NewDocumentCommand \__nicematrix_rectanglecolor { O { } m m m } +\cs_new_protected:Npn \__nicematrix_rectanglecolor_i:nn #1 #2 + { + \__nicematrix_cut_on_hyphen:w #1 \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 + \__nicematrix_cut_on_hyphen:w #2 \q_stop + \tl_set:Nx \l__nicematrix_rows_tl { \l_tmpc_tl - \l_tmpa_tl } + \tl_set:Nx \l__nicematrix_cols_tl { \l_tmpd_tl - \l_tmpb_tl } + \__nicematrix_cartesian_fill: + } +\NewDocumentCommand \__nicematrix_cellcolor { O { } m m } { \tl_if_blank:nF { #2 } { \pgfpicture \pgf@relevantforpicturesizefalse \tl_if_empty:nTF { #1 } \color { \color [ #1 ] } { #2 } - \__nicematrix_cut_on_hyphen:w #3 \q_stop - \bool_lazy_and:nnT - { \int_compare_p:n { \l_tmpa_tl <= \c@iRow } } - { \int_compare_p:n { \l_tmpb_tl <= \c@jCol } } - { - \__nicematrix_qpoint:n { row - \l_tmpa_tl } - \dim_set:Nn \l_tmpb_dim { \pgf@y + 0.5 \arrayrulewidth } - \__nicematrix_qpoint:n { col - \l_tmpb_tl } - \int_compare:nNnTF \l__nicematrix_first_col_int = \l_tmpb_tl - { \dim_set:Nn \l_tmpc_dim { \pgf@x - 0.5 \arrayrulewidth } } - { \dim_set:Nn \l_tmpc_dim { \pgf@x + 0.5 \arrayrulewidth } } - \__nicematrix_cut_on_hyphen:w #4 \q_stop - \int_compare:nNnT \l_tmpa_tl > \c@iRow - { \tl_set:Nx \l_tmpa_tl { \int_use:N \c@iRow } } - \int_compare:nNnT \l_tmpb_tl > \c@jCol - { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } } - \__nicematrix_qpoint:n { row - \__nicematrix_succ:n \l_tmpa_tl } - \dim_set:Nn \l_tmpa_dim { \pgf@y + 0.5 \arrayrulewidth } - \__nicematrix_qpoint:n { col - \__nicematrix_succ:n \l_tmpb_tl } - \dim_set:Nn \l_tmpd_dim { \pgf@x + 0.5 \arrayrulewidth } - \pgfpathrectanglecorners - { \pgfpoint \l_tmpc_dim \l_tmpb_dim } - { \pgfpoint \l_tmpd_dim \l_tmpa_dim } - \pgfusepathqfill - } + \clist_map_inline:nn { #3 } + { \__nicematrix_rectanglecolor_i:nn { ##1 } { ##1 } } + \pgfusepathqfill \endpgfpicture } } @@ -3495,54 +3469,89 @@ { respect-blocks .bool_set:N = \l__nicematrix_respect_blocks_bool , respect-blocks .default:n = true , + cols .tl_set:N = \l__nicematrix_cols_tl , + restart .bool_set:N = \l__nicematrix_rowcolors_restart_bool , + restart .default:n = true , unknown .code:n = \__nicematrix_error:n { Unknown~option~for~rowcolors } } \NewDocumentCommand \__nicematrix_rowcolors { O { } m m m O { } } { + \group_begin: + \tl_clear_new:N \l__nicematrix_cols_tl + \tl_set:Nn \l__nicematrix_cols_tl { - } \keys_set:nn { NiceMatrix / rowcolors } { #5 } - \bool_lazy_and:nnTF + \bool_set_true:N \l_tmpa_bool + \bool_lazy_and:nnT \l__nicematrix_respect_blocks_bool - { \cs_if_exist_p:c { c__nicematrix_pos_of_blocks_ \int_use:N \g__nicematrix_env_int _ seq } } - { \__nicematrix_rowcolors_i:nnnn { #1 } { #2 } { #3 } { #4 } } { - \int_step_inline:nnn { #2 } { \int_use:N \c@iRow } - { - \int_if_odd:nTF { ##1 } - { \__nicematrix_rowcolor [ #1 ] { #3 } } - { \__nicematrix_rowcolor [ #1 ] { #4 } } - { ##1 } - } - } - } -\cs_new_protected:Npn \__nicematrix_rowcolors_i:nnnn #1 #2 #3 #4 - { - \seq_set_eq:Nc \l_tmpb_seq - { c__nicematrix_pos_of_blocks_ \int_use:N \g__nicematrix_env_int _ seq } - \seq_set_filter:NNn \l_tmpa_seq \l_tmpb_seq - { \__nicematrix_not_in_exterior_p:nnnn ##1 } - \int_set:Nn \l_tmpa_int { #2 } - \bool_set_false:N \l_tmpa_bool - \int_do_until:nNnn \l_tmpa_int > \c@iRow + \cs_if_exist_p:c + { c__nicematrix_pos_of_blocks_ \int_use:N \g__nicematrix_env_int _ seq } } { - \seq_set_filter:NNn \l_tmpb_seq \l_tmpa_seq - { \__nicematrix_intersect_our_row_p:nnnn ##1 } - \int_set_eq:NN \l_tmpb_int \l_tmpa_int - \seq_map_inline:Nn \l_tmpb_seq { \__nicematrix_rowcolors_ii:nnnn ##1 } - \bool_if:NTF \l_tmpa_bool - { - \__nicematrix_rowcolor [ #1 ] { #4 } - { \int_use:N \l_tmpa_int - \int_use:N \l_tmpb_int } - \bool_set_false:N \l_tmpa_bool - } + \seq_set_eq:Nc \l_tmpb_seq + { c__nicematrix_pos_of_blocks_ \int_use:N \g__nicematrix_env_int _ seq } + \seq_set_filter:NNn \l_tmpa_seq \l_tmpb_seq + { \__nicematrix_not_in_exterior_p:nnnn ##1 } + } + \pgfpicture + \pgf@relevantforpicturesizefalse + \clist_map_inline:nn { #2 } + { + \tl_set:Nn \l_tmpa_tl { ##1 } + \tl_if_in:NnTF \l_tmpa_tl { - } + { \__nicematrix_cut_on_hyphen:w ##1 \q_stop } + { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@iRow } } + \int_set:Nn \l_tmpa_int \l_tmpa_tl + \bool_if:NTF \l__nicematrix_rowcolors_restart_bool + { \bool_set_true:N \l_tmpa_bool } + { \bool_set:Nn \l_tmpa_bool { \int_if_odd_p:n { \l_tmpa_tl } } } + \int_zero_new:N \l_tmpc_int + \int_set:Nn \l_tmpc_int \l_tmpb_tl + \int_do_until:nNnn \l_tmpa_int > \l_tmpc_int { - \__nicematrix_rowcolor [ #1 ] { #3 } + \int_set_eq:NN \l_tmpb_int \l_tmpa_int + \bool_lazy_and:nnT + \l__nicematrix_respect_blocks_bool + { + \cs_if_exist_p:c + { c__nicematrix_pos_of_blocks_ \int_use:N \g__nicematrix_env_int _ seq } + } + { + \seq_set_filter:NNn \l_tmpb_seq \l_tmpa_seq + { \__nicematrix_intersect_our_row_p:nnnn ####1 } + \seq_map_inline:Nn \l_tmpb_seq { \__nicematrix_rowcolors_i:nnnn ####1 } + } + \tl_set:Nx \l__nicematrix_rows_tl { \int_use:N \l_tmpa_int - \int_use:N \l_tmpb_int } - \bool_set_true:N \l_tmpa_bool + \bool_if:NTF \l_tmpa_bool + { + \tl_if_blank:nF { #3 } + { + \tl_if_empty:nTF { #1 } + \color + { \color [ #1 ] } + { #3 } + \__nicematrix_cartesian_fill: + } + \bool_set_false:N \l_tmpa_bool + } + { + \tl_if_blank:nF { #4 } + { + \tl_if_empty:nTF { #1 } + \color + { \color [ #1 ] } + { #4 } + \__nicematrix_cartesian_fill: + } + \bool_set_true:N \l_tmpa_bool + } + \int_set:Nn \l_tmpa_int { \l_tmpb_int + 1 } } - \int_set:Nn \l_tmpa_int { \l_tmpb_int + 1 } } + \endpgfpicture + \group_end: } -\cs_new_protected:Npn \__nicematrix_rowcolors_ii:nnnn #1 #2 #3 #4 +\cs_new_protected:Npn \__nicematrix_rowcolors_i:nnnn #1 #2 #3 #4 { \int_compare:nNnT { #3 } > \l_tmpb_int { \int_set:Nn \l_tmpb_int { #3 } } @@ -4383,7 +4392,6 @@ { \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 \bool_lazy_or:nnTF { \int_compare_p:nNn { \l_tmpa_int } = 1 } { \int_compare_p:nNn { \l_tmpb_int } = 1 } @@ -4479,7 +4487,7 @@ \seq_gput_right:Nx \g__nicematrix_blocks_seq { \l_tmpa_tl - { #3 , \l__nicematrix_pos_of_block_tl } + { \exp_not:n { #3 } , \l__nicematrix_pos_of_block_tl } { \box_use_drop:c { g__nicematrix_ block _ box _ \int_use:N \g__nicematrix_block_box_int _ box } @@ -4491,7 +4499,7 @@ \seq_gput_right:Nx \g__nicematrix_blocks_seq { \l_tmpa_tl - { #3 } + { \exp_not:n { #3 } } \exp_not:n { { @@ -4554,8 +4562,6 @@ } \cs_new_protected:Npn \__nicematrix_Block_iii:nnnnnn #1 #2 #3 #4 #5 #6 { - \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 } @@ -4564,6 +4570,29 @@ \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 } } + \bool_lazy_or:nnTF + { \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 } + { + \int_compare:nTF + { \l__nicematrix_last_col_int <= \g__nicematrix_static_num_of_col_int } + { + \msg_error:nnnn { nicematrix } { Block~too~large~2 } { #1 } { #2 } + \__nicematrix_msg_redirect_name:nn { Block~too~large~2 } { none } + \group_begin: + \globaldefs = 1 + \__nicematrix_msg_redirect_name:nn { columns~not~used } { none } + \group_end: + } + { \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } } + } + { \__nicematrix_Block_iv:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } } + } +\cs_new_protected:Npn \__nicematrix_Block_iv: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_lazy_or:nnT { ! \tl_if_empty_p:N \l__nicematrix_draw_tl } { \dim_compare_p:nNn \l__nicematrix_line_width_dim > \c_zero_dim } @@ -4571,7 +4600,7 @@ \tl_gput_right:Nx \g_nicematrix_code_after_tl { \__nicematrix_stroke_block:nnn - { #5 } + { \exp_not:n { #5 } } { #1 - #2 } { \int_use:N \l__nicematrix_last_row_int - \int_use:N \l__nicematrix_last_col_int } } @@ -4583,7 +4612,7 @@ \tl_gput_right:Nx \g_nicematrix_code_before_tl { \exp_not:N \rectanglecolor - { \l__nicematrix_fill_tl } + { \exp_not:V \l__nicematrix_fill_tl } { #1 - #2 } { \int_use:N \l__nicematrix_last_row_int - \int_use:N \l__nicematrix_last_col_int } } @@ -4600,93 +4629,122 @@ { \exp_not:n { ##1 } } { \exp_not:n { ##2 } } } } - \bool_lazy_or:nnTF - { \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 } - \bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box: - \pgfpicture - \pgfrememberpicturepositiononpagetrue - \pgf@relevantforpicturesizefalse - \__nicematrix_qpoint:n { row - #1 } - \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 { \l__nicematrix_last_row_int } } - \dim_set_eq:NN \l_tmpc_dim \pgf@y - \__nicematrix_qpoint:n { col - \__nicematrix_succ:n { \l__nicematrix_last_col_int } } - \dim_set_eq:NN \l_tmpd_dim \pgf@x - \begin { pgfscope } - \__nicematrix_pgf_rect_node:nnnnn - { \__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 + \hbox_set:Nn \l__nicematrix_cell_box { #6 } + \bool_if:NT \g__nicematrix_rotate_bool \__nicematrix_rotate_cell_box: + \pgfpicture + \pgfrememberpicturepositiononpagetrue + \pgf@relevantforpicturesizefalse + \__nicematrix_qpoint:n { row - #1 } + \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 { \l__nicematrix_last_row_int } } + \dim_set_eq:NN \l_tmpc_dim \pgf@y + \__nicematrix_qpoint:n { col - \__nicematrix_succ:n { \l__nicematrix_last_col_int } } + \dim_set_eq:NN \l_tmpd_dim \pgf@x + \begin { pgfscope } + \__nicematrix_pgf_rect_node:nnnnn + { \__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 } { - \cs_if_exist:cT - { pgf @ sh @ ns @ \__nicematrix_env: - ##1 - #2 } + \seq_if_in:NnF \g__nicematrix_multicolumn_cells_seq { ##1 - #2 } { - \seq_if_in:NnF \g__nicematrix_multicolumn_cells_seq { ##1 - #2 } - { - \pgfpointanchor { \__nicematrix_env: - ##1 - #2 } { west } - \dim_set:Nn \l_tmpb_dim { \dim_min:nn \l_tmpb_dim \pgf@x } - } + \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 + } + \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 - \int_use:N \l__nicematrix_last_col_int } { - \cs_if_exist:cT - { 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 } { - \seq_if_in:NnF \g__nicematrix_multicolumn_cells_seq { ##1 - #2 } - { - \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 } - } + \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 { \l__nicematrix_last_col_int } } - \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 - { \__nicematrix_env: - #1 - #2 - block - medium } - { \pgfpointanchor { \__nicematrix_env: - #1 - #2 - medium } { north~west } } + } + \dim_compare:nNnT \l_tmpd_dim = { - \c_max_dim } + { + \__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 + { \__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 + { \__nicematrix_env: - #1 - #2 - block - medium } + { \pgfpointanchor { \__nicematrix_env: - #1 - #2 - medium } { north~west } } + { + \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 } + { + \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 } } + \pgfpointanchor + { \__nicematrix_env: - #1 - #2 - block - short } + { + \str_case:Vn \l__nicematrix_pos_of_block_tl { - \pgfpointanchor - { \__nicematrix_env: - - \int_use:N \l__nicematrix_last_row_int - - \int_use:N \l__nicematrix_last_col_int - medium - } - { south~east } + c { center } + l { west } + r { east } } } - \int_compare:nNnTF { #1 } = { #3 } + \pgftransformshift { \pgfpoint \pgf@x \l_tmpa_dim } + \pgfset { inner~sep = \c_zero_dim } + \pgfnode + { rectangle } { - \int_compare:nNnTF { #1 } = 0 - { \l__nicematrix_code_for_first_row_tl } + \str_case:Vn \l__nicematrix_pos_of_block_tl { - \int_compare:nNnT { #1 } = \l__nicematrix_last_row_int - \l__nicematrix_code_for_last_row_tl + c { base } + l { base~west } + r { base~east } } - \pgfextracty \l_tmpa_dim { \__nicematrix_qpoint:n { row - #1 - base } } + } + { \box_use_drop:N \l__nicematrix_cell_box } { } { } + } + { + \int_compare:nNnT { #2 } = 0 + { \tl_set:Nn \l__nicematrix_pos_of_block_tl r } + \bool_if:nT \g__nicematrix_last_col_found_bool + { + \int_compare:nNnT { #2 } = \g__nicematrix_col_total_int + { \tl_set:Nn \l__nicematrix_pos_of_block_tl l } + } + \pgftransformshift + { \pgfpointanchor { \__nicematrix_env: - #1 - #2 - block - short } { @@ -4697,56 +4755,21 @@ r { east } } } - \pgftransformshift { \pgfpoint \pgf@x \l_tmpa_dim } - \pgfset { inner~sep = \c_zero_dim } - \pgfnode - { rectangle } - { - \str_case:Vn \l__nicematrix_pos_of_block_tl - { - c { base } - l { base~west } - r { base~east } - } - } - { \box_use_drop:N \l__nicematrix_cell_box } { } { } } + \pgfset { inner~sep = \c_zero_dim } + \pgfnode + { rectangle } { - \int_compare:nNnT { #2 } = 0 - { \tl_set:Nn \l__nicematrix_pos_of_block_tl r } - \bool_if:nT \g__nicematrix_last_col_found_bool + \str_case:Vn \l__nicematrix_pos_of_block_tl { - \int_compare:nNnT { #2 } = \g__nicematrix_col_total_int - { \tl_set:Nn \l__nicematrix_pos_of_block_tl l } + c { center } + l { west } + r { east } } - \pgftransformshift - { - \pgfpointanchor - { \__nicematrix_env: - #1 - #2 - block - short } - { - \str_case:Vn \l__nicematrix_pos_of_block_tl - { - c { center } - l { west } - r { east } - } - } - } - \pgfset { inner~sep = \c_zero_dim } - \pgfnode - { rectangle } - { - \str_case:Vn \l__nicematrix_pos_of_block_tl - { - c { center } - l { west } - r { east } - } - } - { \box_use_drop:N \l__nicematrix_cell_box } { } { } } - \endpgfpicture + { \box_use_drop:N \l__nicematrix_cell_box } { } { } } + \endpgfpicture \group_end: } \cs_new_protected:Npn \__nicematrix_stroke_block:nnn #1 #2 #3 @@ -4951,12 +4974,12 @@ \bool_new:N \c__nicematrix_footnote_bool \__nicematrix_msg_new:nnn { Unknown~option~for~package } { - The~option~'\l_keys_key_tl'~is~unknown. \\ + The~key~'\l_keys_key_str'~is~unknown. \\ If~you~go~on,~it~will~be~ignored. \\ - For~a~list~of~the~available~options,~type~H~. + For~a~list~of~the~available~keys,~type~H~. } { - The~available~options~are~(in~alphabetic~order):~ + The~available~keys~are~(in~alphabetic~order):~ define-L-C-R,~ footnote,~ footnotehyper,~ @@ -5018,25 +5041,14 @@ } \bool_set_true:N \c__nicematrix_footnote_bool } -\cs_new_protected:Npn \__nicematrix_convert_to_str_seq:N #1 - { - \seq_clear:N \l_tmpa_seq - \seq_map_inline:Nn #1 - { - \seq_put_left:Nx \l_tmpa_seq { \tl_to_str:n { ##1 } } - } - \seq_set_eq:NN #1 \l_tmpa_seq - } -\cs_new_protected:Npn \__nicematrix_set_seq_of_str_from_clist:Nn #1 #2 - { - \seq_set_from_clist:Nn #1 { #2 } - \__nicematrix_convert_to_str_seq:N #1 - } -\__nicematrix_set_seq_of_str_from_clist:Nn \c__nicematrix_types_of_matrix_seq +\seq_new:N \c__nicematrix_types_of_matrix_seq +\seq_set_from_clist:Nn \c__nicematrix_types_of_matrix_seq { NiceMatrix , pNiceMatrix , bNiceMatrix , vNiceMatrix, BNiceMatrix, VNiceMatrix } +\seq_set_map_x:NNn \c__nicematrix_types_of_matrix_seq \c__nicematrix_types_of_matrix_seq + { \tl_to_str:n { #1 } } \cs_new_protected:Npn \__nicematrix_error_too_much_cols: { \seq_if_in:NVTF \c__nicematrix_types_of_matrix_seq \g__nicematrix_name_env_str @@ -5086,9 +5098,8 @@ \__nicematrix_msg_new:nn { columns~not~used } { The~preamble~of~your~\__nicematrix_full_name_env:\ announces~\int_use:N - \g__nicematrix_static_num_of_col_int\ - columns~but~you~use~only~\int_use:N \c@jCol.\\ - However,~you~can~go~on. + \g__nicematrix_static_num_of_col_int\ columns~but~you~use~only~\int_use:N \c@jCol.\\ + You~can~go~on~but~the~columns~you~did~not~used~won't~be~created. } \__nicematrix_msg_new:nn { in~first~col } { @@ -5113,19 +5124,19 @@ \__nicematrix_msg_new:nn { bad~option~for~line-style } { Since~you~haven't~loaded~Tikz,~the~only~value~you~can~give~to~'line-style'~ - is~'standard'.~If~you~go~on,~this~option~will~be~ignored. + is~'standard'.~If~you~go~on,~this~key~will~be~ignored. } \__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_tl').~If~you~go~on,~ - this~option~will~be~ignored. + As~for~now~there~is~only~three~key~available~here:~'color',~'line-style'~ + and~'shorten'~(and~you~try~to~use~'\l_keys_key_str').~If~you~go~on,~ + this~key~will~be~ignored. } \__nicematrix_msg_new:nn { Unknown~option~for~rowcolors } { - As~for~now~there~is~only~one~option~available~here:~'respect-blocks'~ - (and~you~try~to~use~'\l_keys_key_tl').~If~you~go~on,~ - this~option~will~be~ignored. + As~for~now~there~is~only~two~keys~available~here:~'cols'~and~'respect-blocks'~ + (and~you~try~to~use~'\l_keys_key_str').~If~you~go~on,~ + this~key~will~be~ignored. } \__nicematrix_msg_new:nn { Key~color~for~Block } { @@ -5137,13 +5148,13 @@ \__nicematrix_msg_new:nn { ampersand~in~light-syntax } { You~can't~use~an~ampersand~(\token_to_str &)~to~separate~columns~because - ~you~have~used~the~option~'light-syntax'.~This~error~is~fatal. + ~you~have~used~the~key~'light-syntax'.~This~error~is~fatal. } \__nicematrix_msg_new:nn { double-backslash~in~light-syntax } { You~can't~use~\token_to_str:N \\~to~separate~rows~because~you~have~used~ - the~option~'light-syntax'.~You~must~use~the~character~'\l__nicematrix_end_of_row_tl'~ - (set~by~the~option~'end-of-row').~This~error~is~fatal. + the~key~'light-syntax'.~You~must~use~the~character~'\l__nicematrix_end_of_row_tl'~ + (set~by~the~key~'end-of-row').~This~error~is~fatal. } \__nicematrix_msg_new:nn { standard-cline~in~document } { @@ -5186,23 +5197,33 @@ } \__nicematrix_msg_new:nn { last-col~non~empty~for~NiceArray } { - In~the~\__nicematrix_full_name_env:,~you~must~use~the~option~ + In~the~\__nicematrix_full_name_env:,~you~must~use~the~key~ 'last-col'~without~value.\\ However,~you~can~go~on~for~this~time~ (the~value~'\l_keys_value_tl'~will~be~ignored). } \__nicematrix_msg_new:nn { last-col~non~empty~for~NiceMatrixOptions } { - In~\NiceMatrixoptions,~you~must~use~the~option~ + In~\NiceMatrixoptions,~you~must~use~the~key~ 'last-col'~without~value.\\ However,~you~can~go~on~for~this~time~ (the~value~'\l_keys_value_tl'~will~be~ignored). } -\__nicematrix_msg_new:nn { Block~too~large } +\__nicematrix_msg_new:nn { Block~too~large~1 } { You~try~to~draw~a~block~in~the~cell~#1-#2~of~your~matrix~but~the~matrix~is~ too~small~for~that~block. \\ } +\__nicematrix_msg_new:nn { Block~too~large~2 } + { + The~preamble~of~your~\__nicematrix_full_name_env:\ announces~\int_use:N + \g__nicematrix_static_num_of_col_int\ + columns~but~you~use~only~\int_use:N \c@jCol\ and~that's~why~a~block~ + specified~in~the~cell~#1-#2~can't~be~drawn.~You~should~add~some~ampersands~ + (&)~at~the~end~of~the~first~row~of~your~ + \__nicematrix_full_name_env:.\\ + If~you~go~on,this~block~and~maybe~others~will~be~ignored. + } \__nicematrix_msg_new:nn { unknown~column~type } { The~column~type~'#1'~in~your~\__nicematrix_full_name_env:\ @@ -5218,9 +5239,9 @@ } \__nicematrix_msg_new:nn { bottomule~without~booktabs } { - You~can't~use~the~option~'tabular/bottomrule'~because~you~haven't~ + You~can't~use~the~key~'tabular/bottomrule'~because~you~haven't~ loaded~'booktabs'.\\ - If~you~go~on,~this~option~will~be~ignored. + If~you~go~on,~this~key~will~be~ignored. } \__nicematrix_msg_new:nn { enumitem~not~loaded } { @@ -5246,27 +5267,27 @@ } \__nicematrix_msg_new:nn { Bad~value~for~letter~for~dotted~lines } { - The~value~of~key~'\l_keys_key_tl'~must~be~of~length~1.\\ + The~value~of~key~'\l_keys_key_str'~must~be~of~length~1.\\ If~you~go~on,~it~will~be~ignored. } \__nicematrix_msg_new:nnn { Unknown~key~for~Block } { - The~key~'\l_keys_key_tl'~is~unknown~for~the~command~\token_to_str:N + The~key~'\l_keys_key_str'~is~unknown~for~the~command~\token_to_str:N \Block.\\ If~you~go~on,~it~will~be~ignored. \\ For~a~list~of~the~available~keys,~type~H~. } { - The~available~options~are~(in~alphabetic~order):~-,~c,~ - color,~l,~and~r. + The~available~keys~are~(in~alphabetic~order):~-,~c,~draw,~fill,~l,~ + line-width~and~r. } \__nicematrix_msg_new:nnn { Unknown~key~for~notes } { - The~key~'\l_keys_key_tl'~is~unknown.\\ + The~key~'\l_keys_key_str'~is~unknown.\\ If~you~go~on,~it~will~be~ignored. \\ For~a~list~of~the~available~keys~about~notes,~type~H~. } { - The~available~options~are~(in~alphabetic~order):~ + The~available~keys~are~(in~alphabetic~order):~ bottomrule,~ code-after,~ code-before,~ @@ -5279,13 +5300,13 @@ } \__nicematrix_msg_new:nnn { Unknown~key~for~NiceMatrixOptions } { - The~key~'\l_keys_key_tl'~is~unknown~for~the~command~ + The~key~'\l_keys_key_str'~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~. } { - The~available~options~are~(in~alphabetic~order):~ + The~available~keys~are~(in~alphabetic~order):~ allow-duplicate-names,~ cell-space-bottom-limit,~ cell-space-top-limit,~ @@ -5322,13 +5343,13 @@ } \__nicematrix_msg_new:nnn { Unknown~option~for~NiceArray } { - The~option~'\l_keys_key_tl'~is~unknown~for~the~environment~ + The~key~'\l_keys_key_str'~is~unknown~for~the~environment~ \{NiceArray\}. \\ If~you~go~on,~it~will~be~ignored. \\ - For~a~list~of~the~*principal*~available~options,~type~H~. + For~a~list~of~the~*principal*~available~keys,~type~H~. } { - The~available~options~are~(in~alphabetic~order):~ + The~available~keys~are~(in~alphabetic~order):~ b,~ baseline,~ c,~ @@ -5373,13 +5394,13 @@ } \__nicematrix_msg_new:nnn { Unknown~option~for~NiceMatrix } { - The~option~'\l_keys_key_tl'~is~unknown~for~the~ + The~key~'\l_keys_key_str'~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~. + For~a~list~of~the~*principal*~available~keys,~type~H~. } { - The~available~options~are~(in~alphabetic~order):~ + The~available~keys~are~(in~alphabetic~order):~ b,~ baseline,~ c,~ @@ -5424,13 +5445,13 @@ } \__nicematrix_msg_new:nnn { Unknown~option~for~NiceTabular } { - The~option~'\l_keys_key_tl'~is~unknown~for~the~environment~ + The~key~'\l_keys_key_str'~is~unknown~for~the~environment~ \{NiceTabular\}. \\ If~you~go~on,~it~will~be~ignored. \\ - For~a~list~of~the~*principal*~available~options,~type~H~. + For~a~list~of~the~*principal*~available~keys,~type~H~. } { - The~available~options~are~(in~alphabetic~order):~ + The~available~keys~are~(in~alphabetic~order):~ b,~ baseline,~ c,~ @@ -5477,7 +5498,7 @@ the~same~environment~name~twice.~You~can~go~on,~but,~ maybe,~you~will~have~incorrect~results~especially~ if~you~use~'columns-width=auto'.~If~you~don't~want~to~see~this~ - message~again,~use~the~option~'allow-duplicate-names'~in~ + message~again,~use~the~key~'allow-duplicate-names'~in~ '\token_to_str:N \NiceMatrixOptions'.\\ For~a~list~of~the~names~already~used,~type~H~. \\ } @@ -5487,8 +5508,8 @@ } \__nicematrix_msg_new:nn { Option~auto~for~columns-width } { - You~can't~give~the~value~'auto'~to~the~option~'columns-width'~here.~ - If~you~go~on,~the~option~will~be~ignored. + You~can't~give~the~value~'auto'~to~the~key~'columns-width'~here.~ + If~you~go~on,~the~key~will~be~ignored. } \endinput -- cgit v1.2.3