diff options
author | Karl Berry <karl@freefriends.org> | 2019-09-04 21:47:57 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-09-04 21:47:57 +0000 |
commit | 44e65427bf48a4f0e8ec4fa535155720bcc80cae (patch) | |
tree | 6e46bed91c6b9a9d1fae298fbc59a6262bcc3e86 /Master/texmf-dist/tex/latex/nicematrix | |
parent | 9c2d59c2078da9c770a3e1015d0c10f2bcf9a990 (diff) |
nicematrix (4sep19)
git-svn-id: svn://tug.org/texlive/trunk@52028 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/nicematrix')
-rw-r--r-- | Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty | 1018 |
1 files changed, 607 insertions, 411 deletions
diff --git a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty index a8c8baaf489..82a4d074ac7 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{3.0} -\def\myfiledate{2019/08/15} +\def\myfileversion{3.1} +\def\myfiledate{2019/09/04} \RequirePackage{tikz} \usetikzlibrary{fit} \RequirePackage{expl3}[2019/02/15] @@ -38,6 +38,7 @@ \RequirePackage { xparse } [ 2018-10-17 ] \cs_new_protected:Npn \__nm_error:n { \msg_error:nn { nicematrix } } \cs_new_protected:Npn \__nm_error:nn { \msg_error:nn { nicematrix } } +\cs_new_protected:Npn \__nm_error:nnn { \msg_error:nnn { nicematrix } } \cs_new_protected:Npn \__nm_fatal:n { \msg_fatal:nn { nicematrix } } \cs_new_protected:Npn \__nm_fatal:nn { \msg_fatal:nn { nicematrix } } \cs_new_protected:Npn \__nm_msg_new:nn { \msg_new:nnn { nicematrix } } @@ -51,8 +52,6 @@ \@ifclassloaded { revtex4-2 } { \bool_set_true:N \c__nm_revtex_bool } { } -\__nm_msg_new:nn { Draft~mode } - { The~compilation~is~in~draft~mode:~the~dotted~lines~won't~be~drawn. } \bool_if:NT \c__nm_draft_bool { \msg_warning:nn { nicematrix } { Draft~mode } } \ProvideDocumentCommand \iddots { } @@ -80,23 +79,15 @@ \__nm_fatal:n { Outside~math~mode } \fi: } -\__nm_msg_new:nn { Yet~in~env } - { - Environments~\{NiceArray\}~(or~\{NiceMatrix\},~etc.)~can't~be~ - nested.\\ - This~error~is~fatal. - } -\__nm_msg_new:nn { Outside~math~mode } - { - The~environment~\{\@currenvir\}~can~be~used~only~in~math~mode~ - (and~not~in~\token_to_str:N \vcenter).\\ - This~error~is~fatal. - } +\bool_new:N \l__nm_impossible_line_bool \bool_new:N \c__nm_colortbl_loaded_bool \AtBeginDocument { \@ifpackageloaded { colortbl } - { \bool_set_true:N \c__nm_colortbl_loaded_bool } + { + \bool_set_true:N \c__nm_colortbl_loaded_bool + \cs_set_protected:Npn \__nm_vline_i: { { \CT@arc@ \vline } } + } { } } \int_new:N \l__nm_first_row_int @@ -151,16 +142,6 @@ \NC@find } } -\__nm_msg_new:nn { Option~Transparent~suppressed } - { - The~option~'Transparent'~has~been~renamed~'transparent'.\\ - However,~you~can~go~on~for~this~time. - } -\__nm_msg_new:nn { Option~RenewMatrix~suppressed } - { - The~option~'RenewMatrix'~has~been~renamed~'renew-matrix'.\\ - However,~you~can~go~on~for~this~time. - } \str_new:N \l__nm_pos_env_str \str_set:Nn \l__nm_pos_env_str c \bool_new:N \l__nm_exterior_arraycolsep_bool @@ -281,87 +262,16 @@ letter-for-dotted-lines .code:n = { \int_compare:nTF { \tl_count:n { #1 } = \c_one_int } - { \tl_set:Nx \l__nm_letter_for_dotted_lines_str { #1 } } + { \str_set:Nx \l__nm_letter_for_dotted_lines_str { #1 } } { \__nm_error:n { Bad~value~for~letter~for~dotted~lines } } } , letter-for-dotted-lines .value_required:n = true , letter-for-dotted-lines .initial:n = \c_colon_str , unknown .code:n = \__nm_error:n { Unknown~key~for~NiceMatrixOptions } } -\__nm_msg_new:nn { Bad~value~for~letter~for~dotted~lines } - { - The~value~of~key~'\tl_use:N\l_keys_key_tl'~must~be~of~length~1.\\ - If~you~go~on,~it~will~be~ignored. - } -\__nm_msg_new:nnn { Unknown~key~for~NiceMatrixOptions } - { - 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~available~keys,~type~H~<return>. - } - { - The~available~keys~are~(in~alphabetic~order):~ - allow-duplicate-names,~ - code-for-first-col,~ - code-for-first-row,~ - code-for-last-col,~ - code-for-last-row,~ - exterior-arraycolsep,~ - hlines,~ - left-margin,~ - letter-for-dotted-lines,~ - nullify-dots,~ - parallelize-diags,~ - renew-dots,~ - renew-matrix,~ - right-margin,~ - and~transparent - } -\__nm_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. - } \NewDocumentCommand \NiceMatrixOptions { m } { \keys_set:nn { NiceMatrix / NiceMatrixOptions } { #1 } } \keys_define:nn { NiceMatrix / NiceMatrix } { unknown .code:n = \__nm_error:n { Unknown~option~for~NiceMatrix } } -\__nm_msg_new:nnn { Unknown~option~for~NiceMatrix } - { - The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~ - \{NiceMatrix\}~and~its~variants. \\ - If~you~go~on,~it~will~be~ignored. \\ - For~a~list~of~the~available~options,~type~H~<return>. - } - { - The~available~options~are~(in~alphabetic~order):~ - code-after,~ - columns-width,~ - create-extra-nodes,~ - extra-left-margin,~ - extra-right-margin,~ - hlines,~ - left-margin,~ - name,~ - nullify-dots,~ - parallelize-diags,~ - renew-dots~ - and~right-margin. - } -\__nm_msg_new:nnn { Duplicate~name } - { - The~name~'\l_keys_value_tl'~is~already~used~and~you~shouldn't~use~ - the~same~environment~name~twice.~You~can~go~on,~but,~ - maybe,~you~will~have~incorrect~results~especially~ - if~you~use~'columns-width=auto'. \\ - For~a~list~of~the~names~already~used,~type~H~<return>. \\ - If~you~don't~want~to~see~this~message~again,~use~the~option~ - 'allow-duplicate-names'. - } - { - The~names~already~defined~in~this~document~are:~ - \seq_use:Nnnn \g__nm_names_seq { ,~ } { ,~ } { ~and~ }. - } \keys_define:nn { NiceMatrix / NiceArray } { c .code:n = \str_set:Nn \l__nm_pos_env_str c , @@ -374,35 +284,6 @@ last-row .default:n = -1 , unknown .code:n = \__nm_error:n { Unknown~option~for~NiceArray } } -\__nm_msg_new:nnn { Unknown~option~for~NiceArray } - { - 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~available~options,~type~H~<return>. - } - { - The~available~options~are~(in~alphabetic~order):~ - b,~ - c,~ - code-after,~ - code-for-first-col,~ - code-for-first-row,~ - code-for-last-col,~ - code-for-last-row,~ - columns-width,~ - create-extra-nodes,~ - extra-left-margin,~ - extra-right-margin,~ - hlines,~ - left-margin,~ - name,~ - nullify-dots,~ - parallelize-diags,~ - renew-dots,~ - right-margin,~ - and~t. - } \keys_define:nn { NiceMatrix / pNiceArray } { first-col .code:n = \int_zero:N \l__nm_first_col_int , @@ -412,36 +293,6 @@ last-row .default:n = -1 , unknown .code:n = \__nm_error:n { Unknown~option~for~pNiceArray } } -\__nm_msg_new:nnn { Unknown~option~for~pNiceArray } - { - The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~ - \{\@currenvir\}. \\ - If~you~go~on,~it~will~be~ignored. \\ - For~a~list~of~the~available~options,~type~H~<return>. - } - { - The~available~options~are~(in~alphabetic~order):~ - code-after,~ - code-for-first-col,~ - code-for-first-row,~ - code-for-last-col,~ - code-for-last-row,~ - columns-width,~ - create-extra-nodes,~ - extra-left-margin,~ - extra-right-margin,~ - first-col,~ - first-row,~ - last-col,~ - last-row,~ - hlines,~ - left-margin,~ - name,~ - nullify-dots,~ - parallelize-diags,~ - renew-dots,~ - and~right-margin. - } \cs_new_protected:Nn \__nm_Cell: { \int_gincr:N \g__nm_col_int @@ -580,7 +431,8 @@ { \cs_new_protected:Npn \__nm_instruction_of_type:n #1 { - \tl_gput_right:Nx \g__nm_lines_to_draw_tl + \tl_gput_right:cx + { g__nm_ #1 _ lines _ tl } { \use:c { __nm _ draw _ #1 : nn } { \int_use:N \g__nm_row_int } @@ -648,38 +500,38 @@ \int_gset_eq:NN \g__nm_first_col_int \l__nm_first_col_int \bool_gset_eq:NN \g__nm_NiceArray_bool \l__nm_NiceArray_bool \bool_gset_eq:NN \g__nm_last_row_without_value_bool - \l__nm_last_row_without_value_bool + \l__nm_last_row_without_value_bool \cs_set:Npn \ialign - { - \bool_if:NTF \c__nm_colortbl_loaded_bool + { + \bool_if:NTF \c__nm_colortbl_loaded_bool + { + \CT@everycr + { + \noalign { \cs_gset_eq:NN \CT@row@color \prg_do_nothing: } + \__nm_everycr: + } + } + { \everycr { \__nm_everycr: } } + \tabskip = \c_zero_skip + \cs_set:Npn \ialign { - \CT@everycr - { - \noalign { \global\let\CT@row@color\relax } - \__nm_everycr: - } + \everycr { } + \tabskip = \c_zero_skip + \halign } - { \everycr { \__nm_everycr: } } - \tabskip = \c_zero_skip - \cs_set:Npn \ialign - { - \everycr { } - \tabskip = \c_zero_skip - \halign - } - \halign - } + \halign + } \dim_compare:nNnTF \l__nm_columns_width_dim = \c_zero_dim - { - \newcolumntype L { > \__nm_Cell: l < \__nm_end_Cell: } - \newcolumntype C { > \__nm_Cell: c < \__nm_end_Cell: } - \newcolumntype R { > \__nm_Cell: r < \__nm_end_Cell: } - } - { - \newcolumntype L { w l { \dim_use:N \l__nm_columns_width_dim } } - \newcolumntype C { w c { \dim_use:N \l__nm_columns_width_dim } } - \newcolumntype R { w r { \dim_use:N \l__nm_columns_width_dim } } - } + { + \newcolumntype L { > \__nm_Cell: l < \__nm_end_Cell: } + \newcolumntype C { > \__nm_Cell: c < \__nm_end_Cell: } + \newcolumntype R { > \__nm_Cell: r < \__nm_end_Cell: } + } + { + \newcolumntype L { w l { \dim_use:N \l__nm_columns_width_dim } } + \newcolumntype C { w c { \dim_use:N \l__nm_columns_width_dim } } + \newcolumntype R { w r { \dim_use:N \l__nm_columns_width_dim } } + } \cs_set_eq:NN \Ldots \__nm_Ldots \cs_set_eq:NN \Cdots \__nm_Cdots \cs_set_eq:NN \Vdots \__nm_Vdots @@ -689,6 +541,7 @@ \cs_set_eq:NN \Hspace \__nm_Hspace: \cs_set_eq:NN \Hdotsfor \__nm_Hdotsfor: \cs_set_eq:NN \multicolumn \__nm_multicolumn:nnn + \cs_set_eq:NN \Block \__nm_Block: \bool_if:NT \l__nm_renew_dots_bool { \cs_set_eq:NN \ldots \__nm_Ldots @@ -699,7 +552,6 @@ \cs_set_eq:NN \dots \__nm_Ldots \cs_set_eq:NN \hdotsfor \__nm_Hdotsfor: } - \seq_gclear_new:N \g__nm_empty_cells_seq \seq_gclear_new:N \g__nm_multicolumn_cells_seq \seq_gclear_new:N \g__nm_multicolumn_sizes_seq \int_gzero_new:N \g__nm_row_int @@ -718,7 +570,9 @@ \dim_gzero_new:N \g__nm_dp_ante_last_row_dim \dim_gzero_new:N \g__nm_ht_last_row_dim \dim_gzero_new:N \g__nm_dp_last_row_dim - \exp_args:Nx \newcolumntype \l__nm_letter_for_dotted_lines_str + \tl_set_rescan:Nno + \l__nm_letter_for_dotted_lines_str { } \l__nm_letter_for_dotted_lines_str + \exp_args:NV \newcolumntype \l__nm_letter_for_dotted_lines_str { ! { @@ -736,6 +590,12 @@ \bool_if:NT \c__nm_siunitx_loaded_bool \__nm_renew_NC@rewrite@S: \int_gset:Nn \g__nm_last_vdotted_col_int { -1 } \bool_gset_false:N \g__nm_last_col_found_bool + \tl_gclear_new:N \g__nm_Cdots_lines_tl + \tl_gclear_new:N \g__nm_Ldots_lines_tl + \tl_gclear_new:N \g__nm_Vdots_lines_tl + \tl_gclear_new:N \g__nm_Ddots_lines_tl + \tl_gclear_new:N \g__nm_Iddots_lines_tl + \tl_gclear_new:N \g__nm_Hdotsfor_lines_tl } \NewDocumentEnvironment { NiceArrayWithDelims } { m m O { } m ! O { } } { @@ -746,7 +606,6 @@ \cs_if_exist:NT \tikz@library@external@loaded { \tikzset { external / export = false } } \group_insert_after:N \__nm_after_array: - \tl_gclear_new:N \g__nm_lines_to_draw_tl \int_gincr:N \g__nm_env_int \bool_if:NF \l__nm_block_auto_columns_width_bool { \dim_gzero_new:N \g__nm_max_cell_width_dim } @@ -788,7 +647,7 @@ \hbox_set:Nn \l_tmpa_box { \c_math_toggle_token - \left #1 \vcenter to 1 cm { } \right. + \left #1 \vcenter to 3 cm { } \right. \c_math_toggle_token } @@ -797,7 +656,7 @@ { \dim_set_eq:NN \nulldelimiterspace \c_zero_dim \c_math_toggle_token - \left. \vcenter to 1 cm { } \right #2 + \left. \vcenter to 3 cm { } \right #2 \c_math_toggle_token } \dim_gset:Nn \g__nm_right_delim_dim { \box_wd:N \l_tmpa_box } @@ -835,6 +694,17 @@ \skip_horizontal:n \g__nm_right_margin_dim \skip_horizontal:n \g__nm_extra_right_margin_dim \hbox_set_end: + \int_compare:nNnT \g__nm_last_row_int > { -2 } + { + \bool_if:NF \g__nm_last_row_without_value_bool + { + \int_compare:nNnF \g__nm_last_row_int = \g__nm_row_int + { + \__nm_error:n { Wrong~last~row } + \int_gset_eq:NN \g__nm_last_row_int \g__nm_row_int + } + } + } \int_compare:nNnTF \l__nm_first_row_int = \c_zero_int { \dim_compare:nNnTF @@ -1097,7 +967,6 @@ \cs_if_exist:NT \tikz@library@external@loaded { \tikzset { external / export = false } } \group_insert_after:N \__nm_after_array: - \tl_gclear_new:N \g__nm_lines_to_draw_tl \int_gincr:N \g__nm_env_int \bool_if:NF \l__nm_block_auto_columns_width_bool { \dim_gzero_new:N \g__nm_max_cell_width_dim } @@ -1169,25 +1038,51 @@ } \prg_set_conditional:Npnn \__nm_if_not_empty_cell:nn #1 #2 { T , TF } { - \cs_if_free:cTF - { pgf@sh@ns@nm -\int_use:N \g__nm_env_int - \int_use:N #1 - \int_use:N #2 } - \prg_return_false: - { - \seq_if_in:NxTF \g__nm_empty_cells_seq { \int_use:N #1 - \int_use:N #2 } - \prg_return_false: - { - \begin { pgfpicture } - \tl_set:Nx \l_tmpa_tl - { nm - \int_use:N \g__nm_env_int - \int_use:N #1 - \int_use:N #2 } - \pgfpointanchor \l_tmpa_tl { east } - \dim_gset:Nn \g_tmpa_dim \pgf@x - \pgfpointanchor \l_tmpa_tl { west } - \dim_gset:Nn \g_tmpb_dim \pgf@x - \end { pgfpicture } - \dim_compare:nNnTF - { \dim_abs:n { \g_tmpb_dim - \g_tmpa_dim } } < { 0.5 pt } + \bool_set_false:N \l_tmpa_bool + \cs_if_exist:cTF + { __nm _ dotted _ \int_use:N #1 - \int_use:N #2 } + \prg_return_true: + { + \cs_if_free:cTF + { + pgf@sh@ns@nm - + \int_use:N \g__nm_env_int - + \int_use:N #1 - + \int_use:N #2 + } + { \prg_return_false: } + { + \bool_set_false:N \l_tmpa_bool + \cs_if_exist:cT + { __nm _ empty _ \int_use:N #1 - \int_use:N #2 } + { + \int_compare:nNnT + { \use:c { __nm _ empty _ \int_use:N #1 - \int_use:N #2 } } + = + \g__nm_env_int + { \bool_set_true:N \l_tmpa_bool } + } + \bool_if:NTF \l_tmpa_bool \prg_return_false: - \prg_return_true: + { + \begin { pgfpicture } + \tl_set:Nx \l_tmpa_tl + { + nm - + \int_use:N \g__nm_env_int - + \int_use:N #1 - + \int_use:N #2 + } + \pgfpointanchor \l_tmpa_tl { east } + \dim_gset:Nn \g_tmpa_dim \pgf@x + \pgfpointanchor \l_tmpa_tl { west } + \dim_gset:Nn \g_tmpb_dim \pgf@x + \end { pgfpicture } + \dim_compare:nNnTF + { \dim_abs:n { \g_tmpb_dim - \g_tmpa_dim } } < { 0.5 pt } + \prg_return_false: + \prg_return_true: + } } } } @@ -1197,13 +1092,6 @@ \__nm_after_array_i: { \__nm_error:n { Zero~row } } } -\__nm_msg_new:nn { Zero~row } - { - There~is~a~problem.~Maybe~your~environment~\{\@currenvir\}~is~empty.~ - Maybe~you~have~used~l,~c~and~r~instead~of~L,~C~and~R~in~the~preamble~ - of~your~environment. \\ - If~you~go~on,~the~result~may~be~incorrect. - } \cs_new_protected:Nn \__nm_after_array_i: { \group_begin: @@ -1232,7 +1120,6 @@ } \iow_now:Nn \@mainaux \ExplSyntaxOff } - \seq_gclear_new:N \g__nm_yet_drawn_seq \bool_if:NT \l__nm_parallelize_diags_bool { \int_zero_new:N \l__nm_ddots_int @@ -1243,17 +1130,18 @@ \dim_zero_new:N \l__nm_delta_y_two_dim } \bool_if:NT \g__nm_extra_nodes_bool \__nm_create_extra_nodes: - \tl_if_empty:NF \g__nm_lines_to_draw_tl - { - \int_zero_new:N \l__nm_initial_i_int - \int_zero_new:N \l__nm_initial_j_int - \int_zero_new:N \l__nm_final_i_int - \int_zero_new:N \l__nm_final_j_int - \bool_set_false:N \l__nm_initial_open_bool - \bool_set_false:N \l__nm_final_open_bool - \g__nm_lines_to_draw_tl - } - \tl_gclear:N \g__nm_lines_to_draw_tl + \int_zero_new:N \l__nm_initial_i_int + \int_zero_new:N \l__nm_initial_j_int + \int_zero_new:N \l__nm_final_i_int + \int_zero_new:N \l__nm_final_j_int + \bool_set_false:N \l__nm_initial_open_bool + \bool_set_false:N \l__nm_final_open_bool + \g__nm_Hdotsfor_lines_tl + \g__nm_Vdots_lines_tl + \g__nm_Ddots_lines_tl + \g__nm_Iddots_lines_tl + \g__nm_Cdots_lines_tl + \g__nm_Ldots_lines_tl \tikzset { every~picture / .style = @@ -1270,6 +1158,7 @@ } \cs_new_protected:Nn \__nm_find_extremities_of_line:nnnn { + \cs_set:cpn { __nm _ dotted _ #1 - #2 } { } \int_set:Nn \l__nm_initial_i_int { #1 } \int_set:Nn \l__nm_initial_j_int { #2 } \int_set:Nn \l__nm_final_i_int { #1 } @@ -1306,8 +1195,32 @@ \bool_set_true:N \l__nm_stop_loop_bool } { - \__nm_if_not_empty_cell:nnT \l__nm_final_i_int \l__nm_final_j_int + \__nm_if_not_empty_cell:nnTF \l__nm_final_i_int \l__nm_final_j_int { \bool_set_true:N \l__nm_stop_loop_bool } + { + \cs_set:cpn + { + __nm _ dotted _ + \int_use:N \l__nm_final_i_int - + \int_use:N \l__nm_final_j_int + } + { } + } + } + } + \cs_if_free:cT + { + pgf@sh@ns@nm - + \int_use:N \g__nm_env_int - + \int_use:N \l__nm_final_i_int - + \int_use:N \l__nm_final_j_int + } + { + \bool_if:NF \l__nm_final_open_bool + { + \msg_error:nnx { nicematrix } { Impossible~line } + { \int_use:N \l__nm_final_i_int } + \bool_set_true:N \l__nm_impossible_line_bool } } \bool_set_false:N \l__nm_stop_loop_bool @@ -1342,29 +1255,37 @@ \bool_set_true:N \l__nm_stop_loop_bool } { - \__nm_if_not_empty_cell:nnT + \__nm_if_not_empty_cell:nnTF \l__nm_initial_i_int \l__nm_initial_j_int { \bool_set_true:N \l__nm_stop_loop_bool } + { + \cs_set:cpn + { + __nm _ dotted _ + \int_use:N \l__nm_initial_i_int - + \int_use:N \l__nm_initial_j_int + } + { } + } } } - \bool_if:nT { \l__nm_initial_open_bool || \l__nm_final_open_bool } - \__nm_create_extra_nodes: - } -\prg_set_conditional:Npnn \__nm_if_yet_drawn: { F } - { - \tl_set:Nx \l_tmpa_tl + \cs_if_free:cT { + pgf@sh@ns@nm - + \int_use:N \g__nm_env_int - \int_use:N \l__nm_initial_i_int - - \int_use:N \l__nm_initial_j_int - - \int_use:N \l__nm_final_i_int - - \int_use:N \l__nm_final_j_int + \int_use:N \l__nm_initial_j_int } - \seq_if_in:NVTF \g__nm_yet_drawn_seq \l_tmpa_tl - \prg_return_true: { - \seq_gput_left:NV \g__nm_yet_drawn_seq \l_tmpa_tl - \prg_return_false: + \bool_if:NF \l__nm_initial_open_bool + { + \msg_error:nnx { nicematrix } { Impossible~line } + { \int_use:N \l__nm_initial_i_int } + \bool_set_true:N \l__nm_impossible_line_bool + } } + \bool_if:nT \l__nm_initial_open_bool \__nm_create_extra_nodes: + \bool_if:NT \l__nm_final_open_bool \__nm_create_extra_nodes: } \cs_new_protected:Nn \__nm_retrieve_coords:nn { @@ -1390,42 +1311,46 @@ \cs_generate_variant:Nn \__nm_retrieve_coords:nn { x x } \cs_new_protected:Nn \__nm_draw_Ldots:nn { - \__nm_find_extremities_of_line:nnnn { #1 } { #2 } \c_zero_int \c_one_int - \__nm_if_yet_drawn:F \__nm_actually_draw_Ldots: + \cs_if_free:cT { __nm _ dotted _ #1 - #2 } + { + \bool_set_false:N \l__nm_impossible_line_bool + \__nm_find_extremities_of_line:nnnn { #1 } { #2 } \c_zero_int \c_one_int + \bool_if:NF \l__nm_impossible_line_bool \__nm_actually_draw_Ldots: + } } \cs_new_protected:Nn \__nm_actually_draw_Ldots: { - \__nm_retrieve_coords:xx + \__nm_retrieve_coords:xx + { + \bool_if:NTF \l__nm_initial_open_bool { - \bool_if:NTF \l__nm_initial_open_bool - { - \cs_if_exist:cTF - { - pgf@sh@ns@nm - - \int_use:N \g__nm_env_int - - \int_use:N \l__nm_initial_i_int - - \int_use:N \l__nm_initial_j_int - w - } - { - w.base~west } - { - medium.base~west } - } - { .base~east } - } + \cs_if_exist:cTF + { + pgf@sh@ns@nm + - \int_use:N \g__nm_env_int + - \int_use:N \l__nm_initial_i_int + - \int_use:N \l__nm_initial_j_int - w + } + { - w.base~west } + { - medium.base~west } + } + { .base~east } + } + { + \bool_if:NTF \l__nm_final_open_bool { - \bool_if:NTF \l__nm_final_open_bool + \cs_if_exist:cTF { - \cs_if_exist:cTF - { - pgf@sh@ns@nm - - \int_use:N \g__nm_env_int - - \int_use:N \l__nm_final_i_int - - \int_use:N \l__nm_final_j_int - w - } - { - w.base~east } - { - medium.base~east } + pgf@sh@ns@nm + - \int_use:N \g__nm_env_int + - \int_use:N \l__nm_final_i_int + - \int_use:N \l__nm_final_j_int - w } - { .base~west } + { - w.base~east } + { - medium.base~east } } + { .base~west } + } \bool_if:NT \l__nm_initial_open_bool { \dim_gset_eq:NN \g__nm_y_initial_dim \g__nm_y_final_dim } \bool_if:NT \l__nm_final_open_bool @@ -1436,162 +1361,180 @@ } \cs_new_protected:Nn \__nm_draw_Cdots:nn { - \__nm_find_extremities_of_line:nnnn { #1 } { #2 } \c_zero_int \c_one_int - \__nm_if_yet_drawn:F + \cs_if_free:cT { __nm _ dotted _ #1 - #2 } { - \__nm_retrieve_coords:xx + \bool_set_false:N \l__nm_impossible_line_bool + \__nm_find_extremities_of_line:nnnn { #1 } { #2 } \c_zero_int \c_one_int + \bool_if:NF \l__nm_impossible_line_bool { - \bool_if:NTF \l__nm_initial_open_bool + \__nm_retrieve_coords:xx { - \cs_if_exist:cTF + \bool_if:NTF \l__nm_initial_open_bool { - pgf@sh@ns@nm - - \int_use:N \g__nm_env_int - - \int_use:N \l__nm_initial_i_int - - \int_use:N \l__nm_initial_j_int - w + \cs_if_exist:cTF + { + pgf@sh@ns@nm + - \int_use:N \g__nm_env_int + - \int_use:N \l__nm_initial_i_int + - \int_use:N \l__nm_initial_j_int - w + } + { - w.mid~west } + { - medium.mid~west } } - { - w.mid~west } - { - medium.mid~west } + { .mid~east } } - { .mid~east } - } - { - \bool_if:NTF \l__nm_final_open_bool { - \cs_if_exist:cTF + \bool_if:NTF \l__nm_final_open_bool { - pgf@sh@ns@nm - - \int_use:N \g__nm_env_int - - \int_use:N \l__nm_final_i_int - - \int_use:N \l__nm_final_j_int - w + \cs_if_exist:cTF + { + pgf@sh@ns@nm + - \int_use:N \g__nm_env_int + - \int_use:N \l__nm_final_i_int + - \int_use:N \l__nm_final_j_int - w + } + { - w.mid~east } + { - medium.mid~east } } - { - w.mid~east } - { - medium.mid~east } + { .mid~west } } - { .mid~west } + \bool_if:NT \l__nm_initial_open_bool + { \dim_gset_eq:NN \g__nm_y_initial_dim \g__nm_y_final_dim } + \bool_if:NT \l__nm_final_open_bool + { \dim_gset_eq:NN \g__nm_y_final_dim \g__nm_y_initial_dim } + \__nm_draw_tikz_line: } - \bool_if:NT \l__nm_initial_open_bool - { \dim_gset_eq:NN \g__nm_y_initial_dim \g__nm_y_final_dim } - \bool_if:NT \l__nm_final_open_bool - { \dim_gset_eq:NN \g__nm_y_final_dim \g__nm_y_initial_dim } - \__nm_draw_tikz_line: } } \cs_new_protected:Nn \__nm_draw_Vdots:nn { - \__nm_find_extremities_of_line:nnnn { #1 } { #2 } \c_one_int \c_zero_int - \__nm_if_yet_drawn:F - { \__nm_retrieve_coords:xx - { - \bool_if:NTF \l__nm_initial_open_bool - { - medium.north~west } - { .south~west } - } - { - \bool_if:NTF \l__nm_final_open_bool - { - medium.south~west } - { .north~west } - } - \bool_set:Nn \l_tmpa_bool - { \dim_compare_p:nNn \g__nm_x_initial_dim = \g__nm_x_final_dim } - \__nm_retrieve_coords:xx - { - \bool_if:NTF \l__nm_initial_open_bool - { - medium.north } - { .south } - } - { - \bool_if:NTF \l__nm_final_open_bool - { - medium.south } - { .north } - } - \bool_set:Nn \l_tmpb_bool - { \dim_compare_p:nNn \g__nm_x_initial_dim = \g__nm_x_final_dim } - \bool_if:NF \l_tmpb_bool + \cs_if_free:cT { __nm _ dotted _ #1 - #2 } + { + \bool_set_false:N \l__nm_impossible_line_bool + \__nm_find_extremities_of_line:nnnn { #1 } { #2 } \c_one_int \c_zero_int + \bool_if:NF \l__nm_impossible_line_bool { - \dim_gset:Nn \g__nm_x_initial_dim + \__nm_retrieve_coords:xx + { + \bool_if:NTF \l__nm_initial_open_bool + { - medium.north~west } + { .south~west } + } + { + \bool_if:NTF \l__nm_final_open_bool + { - medium.south~west } + { .north~west } + } + \bool_set:Nn \l_tmpa_bool + { \dim_compare_p:nNn \g__nm_x_initial_dim = \g__nm_x_final_dim } + \__nm_retrieve_coords:xx + { + \bool_if:NTF \l__nm_initial_open_bool + { - medium.north } + { .south } + } { - \bool_if:NTF \l_tmpa_bool \dim_min:nn \dim_max:nn - \g__nm_x_initial_dim \g__nm_x_final_dim + \bool_if:NTF \l__nm_final_open_bool + { - medium.south } + { .north } } - \dim_gset_eq:NN \g__nm_x_final_dim \g__nm_x_initial_dim + \bool_set:Nn \l_tmpb_bool + { \dim_compare_p:nNn \g__nm_x_initial_dim = \g__nm_x_final_dim } + \bool_if:NF \l_tmpb_bool + { + \dim_gset:Nn \g__nm_x_initial_dim + { + \bool_if:NTF \l_tmpa_bool \dim_min:nn \dim_max:nn + \g__nm_x_initial_dim \g__nm_x_final_dim + } + \dim_gset_eq:NN \g__nm_x_final_dim \g__nm_x_initial_dim + } + \__nm_draw_tikz_line: } - \__nm_draw_tikz_line: } } \cs_new_protected:Nn \__nm_draw_Ddots:nn { - \__nm_find_extremities_of_line:nnnn { #1 } { #2 } \c_one_int \c_one_int - \__nm_if_yet_drawn:F + \cs_if_free:cT { __nm _ dotted _ #1 - #2 } { - \__nm_retrieve_coords:xx - { - \bool_if:NTF \l__nm_initial_open_bool - { - medium.north~west } - { .south~east } - } + \bool_set_false:N \l__nm_impossible_line_bool + \__nm_find_extremities_of_line:nnnn { #1 } { #2 } \c_one_int \c_one_int + \bool_if:NF \l__nm_impossible_line_bool { - \bool_if:NTF \l__nm_final_open_bool - { - medium.south~east } - { .north~west } - } - \bool_if:NT \l__nm_parallelize_diags_bool - { - \int_incr:N \l__nm_ddots_int - \int_compare:nNnTF \l__nm_ddots_int = \c_one_int + \__nm_retrieve_coords:xx + { + \bool_if:NTF \l__nm_initial_open_bool + { - medium.north~west } + { .south~east } + } { - \dim_set:Nn \l__nm_delta_x_one_dim - { \g__nm_x_final_dim - \g__nm_x_initial_dim } - \dim_set:Nn \l__nm_delta_y_one_dim - { \g__nm_y_final_dim - \g__nm_y_initial_dim } + \bool_if:NTF \l__nm_final_open_bool + { - medium.south~east } + { .north~west } } + \bool_if:NT \l__nm_parallelize_diags_bool { - \dim_gset:Nn \g__nm_y_final_dim + \int_incr:N \l__nm_ddots_int + \int_compare:nNnTF \l__nm_ddots_int = \c_one_int + { + \dim_set:Nn \l__nm_delta_x_one_dim + { \g__nm_x_final_dim - \g__nm_x_initial_dim } + \dim_set:Nn \l__nm_delta_y_one_dim + { \g__nm_y_final_dim - \g__nm_y_initial_dim } + } { - \g__nm_y_initial_dim + - ( \g__nm_x_final_dim - \g__nm_x_initial_dim ) * - \dim_ratio:nn \l__nm_delta_y_one_dim \l__nm_delta_x_one_dim + \dim_gset:Nn \g__nm_y_final_dim + { + \g__nm_y_initial_dim + + ( \g__nm_x_final_dim - \g__nm_x_initial_dim ) * + \dim_ratio:nn \l__nm_delta_y_one_dim \l__nm_delta_x_one_dim + } } } + \__nm_draw_tikz_line: } - \__nm_draw_tikz_line: } } \cs_new_protected:Nn \__nm_draw_Iddots:nn { - \__nm_find_extremities_of_line:nnnn { #1 } { #2 } 1 { -1 } - \__nm_if_yet_drawn:F - { \__nm_retrieve_coords:xx - { - \bool_if:NTF \l__nm_initial_open_bool - { - medium.north~east } - { .south~west } - } - { - \bool_if:NTF \l__nm_final_open_bool - { - medium.south~west } - { .north~east } - } - \bool_if:NT \l__nm_parallelize_diags_bool + \cs_if_free:cT { __nm _ dotted _ #1 - #2 } + { + \bool_set_false:N \l__nm_impossible_line_bool + \__nm_find_extremities_of_line:nnnn { #1 } { #2 } 1 { -1 } + \bool_if:NF \l__nm_impossible_line_bool { - \int_incr:N \l__nm_iddots_int - \int_compare:nNnTF \l__nm_iddots_int = \c_one_int + \__nm_retrieve_coords:xx { - \dim_set:Nn \l__nm_delta_x_two_dim - { \g__nm_x_final_dim - \g__nm_x_initial_dim } - \dim_set:Nn \l__nm_delta_y_two_dim - { \g__nm_y_final_dim - \g__nm_y_initial_dim } + \bool_if:NTF \l__nm_initial_open_bool + { - medium.north~east } + { .south~west } } { - \dim_gset:Nn \g__nm_y_final_dim - { - \g__nm_y_initial_dim + - ( \g__nm_x_final_dim - \g__nm_x_initial_dim ) * - \dim_ratio:nn \l__nm_delta_y_two_dim \l__nm_delta_x_two_dim - } + \bool_if:NTF \l__nm_final_open_bool + { - medium.south~west } + { .north~east } + } + \bool_if:NT \l__nm_parallelize_diags_bool + { + \int_incr:N \l__nm_iddots_int + \int_compare:nNnTF \l__nm_iddots_int = \c_one_int + { + \dim_set:Nn \l__nm_delta_x_two_dim + { \g__nm_x_final_dim - \g__nm_x_initial_dim } + \dim_set:Nn \l__nm_delta_y_two_dim + { \g__nm_y_final_dim - \g__nm_y_initial_dim } + } + { + \dim_gset:Nn \g__nm_y_final_dim + { + \g__nm_y_initial_dim + + ( \g__nm_x_final_dim - \g__nm_x_initial_dim ) * + \dim_ratio:nn \l__nm_delta_y_two_dim \l__nm_delta_x_two_dim + } + } } + \__nm_draw_tikz_line: } - \__nm_draw_tikz_line: } } \cs_new_protected:Nn \__nm_draw_tikz_line: @@ -1689,8 +1632,9 @@ \cs_set_eq:NN \__nm_iddots \iddots \cs_new_protected:Nn \__nm_add_to_empty_cells: { - \seq_gput_right:Nx \g__nm_empty_cells_seq - { \int_use:N \g__nm_row_int - \int_use:N \g__nm_col_int } + \cs_gset:cpx + { __nm _ empty _ \int_use:N \g__nm_row_int - \int_use:N \g__nm_col_int } + { \int_use:N \g__nm_env_int } } \NewDocumentCommand \__nm_Ldots { s } { @@ -1747,14 +1691,12 @@ \bool_if:NTF \c__nm_draft_bool { \NewDocumentCommand \__nm_Hdotsfor_i { O { } m } - { - \prg_replicate:nn { #2 - 1 } { & \multicolumn { 1 } { C } { } } - } + { \prg_replicate:nn { #2 - 1 } { & \multicolumn { 1 } { C } { } } } } { \NewDocumentCommand \__nm_Hdotsfor_i { O { } m } { - \tl_gput_right:Nx \g__nm_lines_to_draw_tl + \tl_gput_right:Nx \g__nm_Hdotsfor_lines_tl { \__nm_draw_Hdotsfor:nnn { \int_use:N \g__nm_row_int } @@ -1801,6 +1743,8 @@ \bool_if:nT { \l__nm_initial_open_bool || \l__nm_final_open_bool } \__nm_create_extra_nodes: \__nm_actually_draw_Ldots: + \int_step_inline:nnn { #2 } { #2 + #3 - 1 } + { \cs_set:cpn { __nm _ dotted _ #1 - ##1 } { } } } \cs_new_protected:Nn \__nm_line:nn { @@ -1892,12 +1836,6 @@ } } } -\__nm_msg_new:nn { Use~of~:~in~first~position } - { - You~can't~use~the~column~specifier~"\l__nm_letter_for_dotted_lines_str"~in~the~ - first~position~of~the~preamble~of~the~environment~\{\@currenvir\}. \\ - If~you~go~on,~this~dotted~line~will~be~ignored. - } \cs_new_protected:Npn \__nm_vline: { \int_compare:nNnTF \l__nm_first_col_int = \c_zero_int @@ -1908,19 +1846,24 @@ { \int_compare:nNnF \g__nm_row_int = \c_zero_int { - \int_compare:nNnF \g__nm_row_int = \l__nm_last_row_int \vline + \int_compare:nNnF \g__nm_row_int = \l__nm_last_row_int + \__nm_vline_i: } } { \int_compare:nNnF \g__nm_row_int = \c_zero_int { - \int_compare:nNnF \g__nm_row_int = \l__nm_last_row_int \vline + \int_compare:nNnF \g__nm_row_int = \l__nm_last_row_int + \__nm_vline_i: } } } { \int_compare:nNnF \g__nm_row_int = \c_zero_int - { \int_compare:nNnF \g__nm_row_int = \l__nm_last_row_int \vline } + { + \int_compare:nNnF \g__nm_row_int = \l__nm_last_row_int + \__nm_vline_i: + } } } { @@ -1929,15 +1872,19 @@ \int_compare:nNnF \g__nm_row_int = { -1 } { \int_compare:nNnF \g__nm_row_int = { \l__nm_last_row_int - 1 } - \vline + \__nm_vline_i: } } { \int_compare:nNnF \g__nm_row_int = \c_zero_int - { \int_compare:nNnF \g__nm_row_int = \l__nm_last_row_int \vline } + { + \int_compare:nNnF \g__nm_row_int = \l__nm_last_row_int + \__nm_vline_i: + } } } } +\cs_set_eq:NN \__nm_vline_i: \vline \bool_new:N \l__nm_block_auto_columns_width_bool \keys_define:nn { NiceMatrix / NiceMatrixBlock } { @@ -2060,13 +2007,13 @@ \end{tikzpicture} \cs_set:Npn \__nm_create_extra_nodes: { } \begin { tikzpicture } [ remember~picture , overlay ] - \tikz@parse@node \pgfutil@firstofone - ( nm - \int_use:N \g__nm_env_int - 1 - 1 - large .north~west ) - \dim_gset:Nn \g_tmpa_dim \pgf@x - \tikz@parse@node \pgfutil@firstofone - ( nm - \int_use:N \g__nm_env_int - 1 - - \int_use:N \g__nm_col_int - large .north~east ) - \dim_gset:Nn \g_tmpb_dim \pgf@x + \tikz@parse@node \pgfutil@firstofone + ( nm - \int_use:N \g__nm_env_int - 1 - 1 - large .north~west ) + \dim_gset:Nn \g_tmpa_dim \pgf@x + \tikz@parse@node \pgfutil@firstofone + ( nm - \int_use:N \g__nm_env_int - 1 - + \int_use:N \g__nm_col_int - large .north~east ) + \dim_gset:Nn \g_tmpb_dim \pgf@x \end { tikzpicture } \iow_now:Nn \@mainaux \ExplSyntaxOn \iow_now:Nx \@mainaux @@ -2135,7 +2082,256 @@ ] ; } +\NewExpandableDocumentCommand \__nm_Block: { m D < > { } m } + { + \__nm_Block_i #1 \q_stop { #2 } { #3 } + } +\cs_new:Npn \__nm_Block_i #1-#2 \q_stop + { + \__nm_Block_ii:nnnn { #1 } { #2 } + } +\cs_new:Npn \__nm_Block_ii:nnnn #1 #2 #3 #4 + { + \int_compare:nNnTF { #1 } = 1 + { + \multicolumn { #2 } { C } { \hbox:n { #3 $#4$ } } + \__nm_gobble_ampersands:n { #2 - 1 } + } + { \__nm_Block_iii:nnnn { #1 } { #2 } { #3 } { #4 } } + } +\cs_new_protected:Npn \__nm_Block_iii:nnnn #1 #2 #3 #4 + { + \bool_gset_true:N \g__nm_extra_nodes_bool + \tl_gput_left:Nx \g__nm_code_after_tl + { + \__nm_Block_iv:nnnnn + { \int_use:N \g__nm_row_int } + { \int_use:N \g__nm_col_int } + { \int_eval:n { \g__nm_row_int + #1 - 1 } } + { \int_eval:n { \g__nm_col_int + #2 - 1 } } + \exp_not:n { { #3 $ #4 $ } } + } + } +\group_begin: + \char_set_catcode_letter:N \& + \cs_new:Npn \__nm_gobble_ampersands:n #1 + { + \int_compare:nNnT { #1 } > 0 + { + \peek_charcode_remove_ignore_spaces:NT & + { \__nm_gobble_ampersands:n { #1 - 1 } } + } + } +\group_end: +\cs_new_protected:Npn \__nm_Block_iv:nnnnn #1 #2 #3 #4 #5 + { + \bool_if:nTF + { + \int_compare_p:nNn { #3 } > \g__nm_row_int + || \int_compare_p:nNn { #4 } > \g__nm_col_int + } + { \msg_error:nnnn { nicematrix } { Block~too~large } { #1 } { #2 } } + { + \begin{tikzpicture} + \node + [ + fit = ( #1 - #2 - medium . north~west ) + ( #3 - #4 - medium . south~east ) , + inner~sep = 0 pt , + ] + (#1-#2) { } ; + \node at (#1-#2.center) { #5 } ; + \end{tikzpicture} + } + } \ProcessKeysOptions { NiceMatrix } +\__nm_msg_new:nn { Block~too~large } + { + You~try~to~draw~a~block~in~the~cell~#1-#2~of~your~matrix~but~the~matrix~is~ + too~small~for~that~block.\\ + If~you~go~on,~this~command~line~will~be~ignored. + } +\__nm_msg_new:nn { Impossible~line } + { + A~dotted~line~can't~be~drawn~because~you~have~not~put~ + all~the~ampersands~required~on~the~row~#1.\\ + If~you~go~on,~this~dotted~line~will~be~ignored. + } +\__nm_msg_new:nn { Wrong~last~row } + { + You~have~used~'last-row=\int_use:N \g__nm_last_row_int'~but~your~environment~ + \{\@currenvir\}~seems~to~have~\int_use:N \g__nm_row_int\ + rows~(remark~that~you~can~use~'last-row'~without~value).~If~you~go~on, + ~the~value~of~\int_use:N \g__nm_row_int\ + will~be~used~for~last~row. + } +\__nm_msg_new:nn { Draft~mode } + { The~compilation~is~in~draft~mode:~the~dotted~lines~won't~be~drawn. } +\__nm_msg_new:nn { Yet~in~env } + { + Environments~\{NiceArray\}~(or~\{NiceMatrix\},~etc.)~can't~be~ + nested.\\ + This~error~is~fatal. + } +\__nm_msg_new:nn { Outside~math~mode } + { + The~environment~\{\@currenvir\}~can~be~used~only~in~math~mode~ + (and~not~in~\token_to_str:N \vcenter).\\ + This~error~is~fatal. + } +\__nm_msg_new:nn { Option~Transparent~suppressed } + { + The~option~'Transparent'~has~been~renamed~'transparent'.\\ + However,~you~can~go~on~for~this~time. + } +\__nm_msg_new:nn { Option~RenewMatrix~suppressed } + { + The~option~'RenewMatrix'~has~been~renamed~'renew-matrix'.\\ + However,~you~can~go~on~for~this~time. + } +\__nm_msg_new:nn { Bad~value~for~letter~for~dotted~lines } + { + The~value~of~key~'\tl_use:N\l_keys_key_tl'~must~be~of~length~1.\\ + If~you~go~on,~it~will~be~ignored. + } +\__nm_msg_new:nnn { Unknown~key~for~NiceMatrixOptions } + { + 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~available~keys,~type~H~<return>. + } + { + The~available~keys~are~(in~alphabetic~order):~ + allow-duplicate-names,~ + code-for-first-col,~ + code-for-first-row,~ + code-for-last-col,~ + code-for-last-row,~ + exterior-arraycolsep,~ + hlines,~ + left-margin,~ + letter-for-dotted-lines,~ + nullify-dots,~ + parallelize-diags,~ + renew-dots,~ + renew-matrix,~ + right-margin,~ + and~transparent + } +\__nm_msg_new:nnn { Unknown~option~for~NiceArray } + { + 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~available~options,~type~H~<return>. + } + { + The~available~options~are~(in~alphabetic~order):~ + b,~ + c,~ + code-after,~ + code-for-first-col,~ + code-for-first-row,~ + code-for-last-col,~ + code-for-last-row,~ + columns-width,~ + create-extra-nodes,~ + extra-left-margin,~ + extra-right-margin,~ + hlines,~ + left-margin,~ + name,~ + nullify-dots,~ + parallelize-diags,~ + renew-dots,~ + right-margin,~ + and~t. + } +\__nm_msg_new:nnn { Unknown~option~for~NiceMatrix } + { + The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~ + \{NiceMatrix\}~and~its~variants. \\ + If~you~go~on,~it~will~be~ignored. \\ + For~a~list~of~the~available~options,~type~H~<return>. + } + { + The~available~options~are~(in~alphabetic~order):~ + code-after,~ + columns-width,~ + create-extra-nodes,~ + extra-left-margin,~ + extra-right-margin,~ + hlines,~ + left-margin,~ + name,~ + nullify-dots,~ + parallelize-diags,~ + renew-dots~ + and~right-margin. + } +\__nm_msg_new:nnn { Unknown~option~for~pNiceArray } + { + The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~ + \{\@currenvir\}. \\ + If~you~go~on,~it~will~be~ignored. \\ + For~a~list~of~the~available~options,~type~H~<return>. + } + { + The~available~options~are~(in~alphabetic~order):~ + code-after,~ + code-for-first-col,~ + code-for-first-row,~ + code-for-last-col,~ + code-for-last-row,~ + columns-width,~ + create-extra-nodes,~ + extra-left-margin,~ + extra-right-margin,~ + first-col,~ + first-row,~ + last-col,~ + last-row,~ + hlines,~ + left-margin,~ + name,~ + nullify-dots,~ + parallelize-diags,~ + renew-dots,~ + and~right-margin. + } +\__nm_msg_new:nnn { Duplicate~name } + { + The~name~'\l_keys_value_tl'~is~already~used~and~you~shouldn't~use~ + the~same~environment~name~twice.~You~can~go~on,~but,~ + maybe,~you~will~have~incorrect~results~especially~ + if~you~use~'columns-width=auto'. \\ + For~a~list~of~the~names~already~used,~type~H~<return>. \\ + If~you~don't~want~to~see~this~message~again,~use~the~option~ + 'allow-duplicate-names'. + } + { + The~names~already~defined~in~this~document~are:~ + \seq_use:Nnnn \g__nm_names_seq { ,~ } { ,~ } { ~and~ }. + } +\__nm_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. + } +\__nm_msg_new:nn { Zero~row } + { + There~is~a~problem.~Maybe~your~environment~\{\@currenvir\}~is~empty.~ + Maybe~you~have~used~l,~c~and~r~instead~of~L,~C~and~R~in~the~preamble~ + of~your~environment. \\ + If~you~go~on,~the~result~may~be~incorrect. + } +\__nm_msg_new:nn { Use~of~:~in~first~position } + { + You~can't~use~the~column~specifier~'\l__nm_letter_for_dotted_lines_str'~in~the~ + first~position~of~the~preamble~of~the~environment~\{\@currenvir\}. \\ + If~you~go~on,~this~dotted~line~will~be~ignored. + } \cs_new:Npn \__nm_seq_mapthread_function:NNN #1 #2 #3 { \group_begin: |