summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nicematrix
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-07-16 22:02:56 +0000
committerKarl Berry <karl@freefriends.org>2020-07-16 22:02:56 +0000
commit5e7c45a283a2403c25348d1f470fed5654d78d63 (patch)
treedad2092972a9b7aab9cb33b7c5097a4cdb5cdaf1 /Master/texmf-dist/tex/latex/nicematrix
parent59fb84256b2284a3fe3197d49e20136772e8d77e (diff)
nicematrix (16jul20)
git-svn-id: svn://tug.org/texlive/trunk@55851 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/nicematrix')
-rw-r--r--Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty611
1 files changed, 467 insertions, 144 deletions
diff --git a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
index 70dedcb495c..54c7dd90b56 100644
--- a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
+++ b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty
@@ -6,7 +6,7 @@
%%
%% nicematrix.dtx (with options: `package')
%%
-%% Copyright (C) 2017-2019 by F. Pantigny
+%% Copyright (C) 2018-2020 by F. Pantigny
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -18,8 +18,8 @@
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%%
-\def\myfileversion{4.4}
-\def\myfiledate{2020/06/30}
+\def\myfileversion{5.0}
+\def\myfiledate{2020/07/15}
\RequirePackage{pgfcore}
\usepgfmodule{shapes}
\RequirePackage{l3keys2e}
@@ -27,7 +27,7 @@
{nicematrix}
{\myfiledate}
{\myfileversion}
- {Mathematical matrices with PGF/TikZ}
+ {Enhanced arrays with the help of PGF/TikZ}
\RequirePackage { array }
\RequirePackage { amsmath }
\RequirePackage { xparse }
@@ -35,18 +35,24 @@
\cs_new_protected:Npn \__nicematrix_error:nn { \msg_error:nnn { nicematrix } }
\cs_new_protected:Npn \__nicematrix_error:nnn { \msg_error:nnnn { nicematrix } }
\cs_new_protected:Npn \__nicematrix_fatal:n { \msg_fatal:nn { nicematrix } }
-\cs_new_protected:Npn \__nicematrix_fatal:nn { \msg_fatal:nnn { nicematrix } }
\cs_new_protected:Npn \__nicematrix_msg_new:nn { \msg_new:nnn { nicematrix } }
\cs_new_protected:Npn \__nicematrix_msg_new:nnn { \msg_new:nnnn { nicematrix } }
\cs_new_protected:Npn \__nicematrix_msg_redirect_name:nn
{ \msg_redirect_name:nnn { nicematrix } }
+\bool_new:N \c__nicematrix_in_preamble_bool
+\bool_set_true:N \c__nicematrix_in_preamble_bool
+\AtBeginDocument { \bool_set_false:N \c__nicematrix_in_preamble_bool }
\bool_new:N \c__nicematrix_booktabs_loaded_bool
+\bool_new:N \c__nicematrix_enumitem_loaded_bool
\bool_new:N \c__nicematrix_tikz_loaded_bool
\AtBeginDocument
{
\@ifpackageloaded { booktabs }
{ \bool_set_true:N \c__nicematrix_booktabs_loaded_bool }
{ }
+ \@ifpackageloaded { enumitem }
+ { \bool_set_true:N \c__nicematrix_enumitem_loaded_bool }
+ { }
\@ifpackageloaded { tikz }
{
\bool_set_true:N \c__nicematrix_tikz_loaded_bool
@@ -154,6 +160,8 @@
{ \cs_set:Npn \CT@arc@ { \color [ #1 ] { #2 } } }
\cs_new_protected:Npn \__nicematrix_set_CT@arc@_ii: #1 \q_stop
{ \cs_set:Npn \CT@arc@ { \color { #1 } } }
+\cs_new:Npn \__nicematrix_tab_or_array_colsep:
+ { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
\bool_new:N \c__nicematrix_siunitx_loaded_bool
\AtBeginDocument
{
@@ -179,20 +187,34 @@
\cs_gset_eq:NN \__nicematrix_adapt_S_column: \prg_do_nothing:
}
}
-\cs_new_protected:Npn \__nicematrix_renew_NC@rewrite@S:
+\AtBeginDocument
{
- \renewcommand*{\NC@rewrite@S}[1][]
+ \bool_if:nTF { ! \c__nicematrix_siunitx_loaded_bool }
+ { \cs_set_eq:NN \__nicematrix_renew_NC@rewrite@S: \prg_do_nothing: }
{
- \@temptokena \exp_after:wN
+ \cs_new_protected:Npn \__nicematrix_renew_NC@rewrite@S:
{
- \tex_the:D \@temptokena
- > { \__nicematrix_Cell: \c__nicematrix_table_collect_begin_tl S {##1} }
- c
- < { \c__nicematrix_table_print_tl \__nicematrix_end_Cell: }
+ \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
+ }
}
- \NC@find
}
}
+\bool_new:N \c__nicematrix_define_L_C_R_bool
+\cs_new_protected:Npn \__nicematrix_define_L_C_R:
+ {
+ \newcolumntype L l
+ \newcolumntype C c
+ \newcolumntype R r
+ }
\int_new:N \g__nicematrix_env_int
\cs_new:Npn \__nicematrix_env: { nm - \int_use:N \g__nicematrix_env_int }
\NewExpandableDocumentCommand \NiceMatrixLastEnv { }
@@ -214,7 +236,6 @@
\colorlet { nicematrix-last-col } { . }
\colorlet { nicematrix-last-row } { . }
\str_new:N \g__nicematrix_name_env_str
-\str_new:N \g__nicematrix_com_or_env_str
\str_set:Nn \g__nicematrix_com_or_env_str { environment }
\cs_new:Npn \__nicematrix_full_name_env:
{
@@ -253,6 +274,69 @@
\int_new:N \l__nicematrix_last_col_int
\int_set:Nn \l__nicematrix_last_col_int { -2 }
\bool_new:N \g__nicematrix_last_col_found_bool
+\newcounter { tabularnote }
+\seq_new:N \g__nicematrix_tabularnotes_seq
+\int_new:N \l__nicematrix_number_of_notes_int
+\cs_new:Npn \__nicematrix_notes_style:n #1 { \emph { \alph { #1 } } }
+\cs_new:Npn \__nicematrix_notes_label_in_tabular:n #1 { \textsuperscript { #1 } }
+\cs_new:Npn \__nicematrix_notes_label_in_list:n #1 { \textsuperscript { #1 } }
+\cs_set:Npn \thetabularnote { { \__nicematrix_notes_style:n { tabularnote } } }
+\AtBeginDocument
+ {
+ \bool_if:nTF { ! \c__nicematrix_enumitem_loaded_bool }
+ {
+ \NewDocumentCommand \tabularnote { m }
+ { \__nicematrix_error:n { enumitem~not~loaded } }
+ }
+ {
+ \newlist { tabularnotes } { enumerate } { 1 }
+ \setlist [ tabularnotes ]
+ {
+ noitemsep , leftmargin = * , align = left , labelsep = 0pt ,
+ label =
+ \__nicematrix_notes_label_in_list:n { \__nicematrix_notes_style:n { tabularnotesi } } ,
+ }
+ \newlist { tabularnotes* } { enumerate* } { 1 }
+ \setlist [ tabularnotes* ]
+ {
+ afterlabel = \nobreak ,
+ itemjoin = \quad ,
+ label =
+ \__nicematrix_notes_label_in_list:n { \__nicematrix_notes_style:n { tabularnotes*i } }
+ }
+ \NewDocumentCommand \tabularnote { m }
+ {
+ \bool_if:nTF { ! \l__nicematrix_NiceArray_bool && \l__nicematrix_in_env_bool }
+ { \__nicematrix_error:n { tabularnote~forbidden } }
+ {
+ \int_incr:N \l__nicematrix_number_of_notes_int
+ \seq_gput_right:Nx \g__nicematrix_tabularnotes_seq { #1 }
+ \peek_meaning:NF \tabularnote
+ {
+ \hbox_set:Nn \l_tmpa_box
+ {
+ \__nicematrix_notes_label_in_tabular:n
+ {
+ \stepcounter { tabularnote }
+ \__nicematrix_notes_style:n { tabularnote }
+ \prg_replicate:nn { \l__nicematrix_number_of_notes_int - 1 }
+ {
+ ,
+ \stepcounter { tabularnote }
+ \__nicematrix_notes_style:n { tabularnote }
+ }
+ }
+ }
+ \addtocounter { tabularnote } { -1 }
+ \refstepcounter { tabularnote }
+ \int_zero:N \l__nicematrix_number_of_notes_int
+ \hbox_overlap_right:n { \box_use:N \l_tmpa_box }
+ \skip_horizontal:n { \box_wd:N \l_tmpa_box }
+ }
+ }
+ }
+ }
+ }
\cs_new_protected:Npn \__nicematrix_pgf_rect_node:nnnnn #1 #2 #3 #4 #5
{
\begin { pgfscope }
@@ -324,6 +408,8 @@
\bool_new:N \l__nicematrix_vlines_bool
\bool_new:N \l__nicematrix_hvlines_bool
\bool_new:N \l__nicematrix_hvlines_except_corners_bool
+\dim_new:N \l__nicematrix_notes_above_space_dim
+\dim_set:Nn \l__nicematrix_notes_above_space_dim { 1 mm }
\bool_new:N \l__nicematrix_nullify_dots_bool
\bool_new:N \l__nicematrix_auto_columns_width_bool
\str_new:N \l__nicematrix_name_str
@@ -340,13 +426,13 @@
\keys_define:nn { NiceMatrix / xdots }
{
line-style .code:n =
- {
- \bool_lazy_or:nnTF
- { \cs_if_exist_p:N \tikzpicture }
- { \str_if_eq_p:nn { #1 } { standard } }
- { \tl_set:Nn \l__nicematrix_xdots_line_style_tl { #1 } }
- { \__nicematrix_error:n { bad~option~for~line-style } }
- } ,
+ {
+ \bool_lazy_or:nnTF
+ { \cs_if_exist_p:N \tikzpicture }
+ { \str_if_eq_p:nn { #1 } { standard } }
+ { \tl_set:Nn \l__nicematrix_xdots_line_style_tl { #1 } }
+ { \__nicematrix_error:n { bad~option~for~line-style } }
+ } ,
line-style .value_required:n = true ,
color .tl_set:N = \l__nicematrix_xdots_color_tl ,
color .value_required:n = true ,
@@ -392,11 +478,11 @@
hlines .bool_set:N = \l__nicematrix_hlines_bool ,
vlines .bool_set:N = \l__nicematrix_vlines_bool ,
hvlines .code:n =
- {
- \bool_set_true:N \l__nicematrix_hvlines_bool
- \bool_set_true:N \l__nicematrix_vlines_bool
- \bool_set_true:N \l__nicematrix_hlines_bool
- } ,
+ {
+ \bool_set_true:N \l__nicematrix_hvlines_bool
+ \bool_set_true:N \l__nicematrix_vlines_bool
+ \bool_set_true:N \l__nicematrix_hlines_bool
+ } ,
parallelize-diags .bool_set:N = \l__nicematrix_parallelize_diags_bool ,
renew-dots .bool_set:N = \l__nicematrix_renew_dots_bool ,
renew-dots .value_forbidden:n = true ,
@@ -422,13 +508,13 @@
hvlines-except-corners .bool_set:N = \l__nicematrix_hvlines_except_corners_bool ,
hvlines-except-corners .default:n = true ,
code-before .code:n =
- {
- \tl_if_empty:nF { #1 }
- {
- \tl_set:Nn \l__nicematrix_code_before_tl { #1 }
- \bool_set_true:N \l__nicematrix_code_before_bool
- }
- } ,
+ {
+ \tl_if_empty:nF { #1 }
+ {
+ \tl_set:Nn \l__nicematrix_code_before_tl { #1 }
+ \bool_set_true:N \l__nicematrix_code_before_bool
+ }
+ } ,
c .code:n = \str_set:Nn \l__nicematrix_baseline_str c ,
t .code:n = \str_set:Nn \l__nicematrix_baseline_str t ,
b .code:n = \str_set:Nn \l__nicematrix_baseline_str b ,
@@ -452,6 +538,58 @@
code-after .tl_gset:N = \g__nicematrix_code_after_tl ,
code-after .value_required:n = true ,
}
+\keys_define:nn { NiceMatrix / notes }
+ {
+ para .bool_set:N = \l__nicematrix_notes_para_bool ,
+ para .default:n = true ,
+ code-before .tl_set:N = \l__nicematrix_notes_code_before_tl ,
+ code-before .value_required:n = true ,
+ code-after .tl_set:N = \l__nicematrix_notes_code_after_tl ,
+ code-after .value_required:n = true ,
+ bottomrule .bool_set:N = \l__nicematrix_notes_bottomrule_bool ,
+ bottomrule .default:n = true ,
+ style .code:n = \cs_set:Nn \__nicematrix_notes_style:n { #1 } ,
+ style .value_required:n = true ,
+ label-in-tabular .code:n =
+ \cs_set:Nn \__nicematrix_notes_label_in_tabular:n { #1 } ,
+ label-in-tabular .value_required:n = true ,
+ label-in-list .code:n =
+ \cs_set:Nn \__nicematrix_notes_label_in_list:n { #1 } ,
+ label-in-list .value_required:n = true ,
+ enumitem-keys .code:n =
+ {
+ \bool_if:NTF \c__nicematrix_in_preamble_bool
+ {
+ \AtBeginDocument
+ {
+ \bool_if:NT \c__nicematrix_enumitem_loaded_bool
+ { \setlist* [ tabularnotes ] { #1 } }
+ }
+ }
+ {
+ \bool_if:NT \c__nicematrix_enumitem_loaded_bool
+ { \setlist* [ tabularnotes ] { #1 } }
+ }
+ } ,
+ enumitem-keys .value_required:n = true ,
+ enumitem-keys-para .code:n =
+ {
+ \bool_if:NTF \c__nicematrix_in_preamble_bool
+ {
+ \AtBeginDocument
+ {
+ \bool_if:NT \c__nicematrix_enumitem_loaded_bool
+ { \setlist* [ tabularnotes* ] { #1 } }
+ }
+ }
+ {
+ \bool_if:NT \c__nicematrix_enumitem_loaded_bool
+ { \setlist* [ tabularnotes* ] { #1 } }
+ }
+ } ,
+ enumitem-keys-para .value_required:n = true ,
+ unknown .code:n = \__nicematrix_error:n { Unknown~key~for~notes }
+ }
\keys_define:nn { NiceMatrix }
{
NiceMatrixOptions .inherit:n =
@@ -459,6 +597,8 @@
NiceMatrix / Global ,
} ,
NiceMatrixOptions / xdots .inherit:n = NiceMatrix / xdots ,
+ NiceMatrixOptions / rules .inherit:n = NiceMatrix / rules ,
+ NiceMatrixOptions / notes .inherit:n = NiceMatrix / notes ,
NiceMatrix .inherit:n =
{
NiceMatrix / Global ,
@@ -514,6 +654,8 @@
{ \__nicematrix_error:n { Bad~value~for~letter~for~dotted~lines } }
} ,
letter-for-dotted-lines .value_required:n = true ,
+ notes .code:n = \keys_set:nn { NiceMatrix / notes } { #1 } ,
+ notes .value_required:n = true ,
unknown .code:n = \__nicematrix_error:n { Unknown~key~for~NiceMatrixOptions }
}
\str_new:N \l__nicematrix_letter_for_dotted_lines_str
@@ -528,10 +670,10 @@
\int_set:Nn \l__nicematrix_last_col_int { -1 }
}
{ \int_set:Nn \l__nicematrix_last_col_int { #1 } } ,
- l .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl L ,
- r .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl R ,
- L .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl L ,
- R .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl R ,
+ l .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl l ,
+ r .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl r ,
+ L .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl l ,
+ R .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl r ,
S .code:n = \bool_if:NTF \c__nicematrix_siunitx_loaded_bool
{ \tl_set:Nn \l__nicematrix_type_of_col_tl S }
{ \__nicematrix_error:n { option~S~without~siunitx } } ,
@@ -546,6 +688,10 @@
last-col .code:n = \tl_if_empty:nF { #1 }
{ \__nicematrix_error:n { last-col~non~empty~for~NiceArray } }
\int_zero:N \l__nicematrix_last_col_int ,
+ notes / para .bool_set:N = \l__nicematrix_notes_para_bool ,
+ notes / para .default:n = true ,
+ notes / bottomrule .bool_set:N = \l__nicematrix_notes_bottomrule_bool ,
+ notes / bottomrule .default:n = true ,
unknown .code:n = \__nicematrix_error:n { Unknown~option~for~NiceArray }
}
\keys_define:nn { NiceMatrix / pNiceArray }
@@ -561,6 +707,10 @@
}
\keys_define:nn { NiceMatrix / NiceTabular }
{
+ notes / para .bool_set:N = \l__nicematrix_notes_para_bool ,
+ notes / para .default:n = true ,
+ notes / bottomrule .bool_set:N = \l__nicematrix_notes_bottomrule_bool ,
+ notes / bottomrule .default:n = true ,
last-col .code:n = \tl_if_empty:nF {#1}
{ \__nicematrix_error:n { last-col~non~empty~for~NiceArray } }
\int_zero:N \l__nicematrix_last_col_int ,
@@ -744,9 +894,9 @@
}
\cs_set_protected:Npn \__nicematrix_newcolumntype #1
{
- \cs_if_free:cT { NC @ find @ #1 }
- { \NC@list \expandafter { \the \NC@list \NC@do #1 } }
- \cs_set:cpn {NC @ find @ #1 } ##1 #1 { \NC@ { ##1 } }
+ % \cs_if_free:cT { NC @ find @ #1 }
+ % { \NC@list \exp_after:wN { \the \NC@list \NC@do #1 } }
+ \cs_set:cpn { NC @ find @ #1 } ##1 #1 { \NC@ { ##1 } }
\peek_meaning:NTF [
{ \newcol@ #1 }
{ \newcol@ #1 [ 0 ] }
@@ -851,9 +1001,6 @@
\int_gzero_new:N \g__nicematrix_row_total_int
\int_gzero_new:N \g__nicematrix_col_total_int
\cs_set_eq:NN \@ifnextchar \new@ifnextchar
- \__nicematrix_newcolumntype L { > \__nicematrix_Cell: l < \__nicematrix_end_Cell: }
- \__nicematrix_newcolumntype C { > \__nicematrix_Cell: c < \__nicematrix_end_Cell: }
- \__nicematrix_newcolumntype R { > \__nicematrix_Cell: r < \__nicematrix_end_Cell: }
\__nicematrix_define_columntype:nn p t
\__nicematrix_define_columntype:nn m c
\__nicematrix_define_columntype:nn b b
@@ -863,12 +1010,13 @@
\hbox_set:Nw \l__nicematrix_cell_box
\__nicematrix_Cell:
}
- c
+ \__nicematrix_true_c:
< {
\__nicematrix_end_Cell:
\hbox_set_end:
- \makebox [ ##2 ] [ \str_lowercase:n { ##1 } ]
- { \box_use_drop:N \l__nicematrix_cell_box }
+ \tl_set:Nn \l_tmpa_tl { ##1 }
+ \makebox [ ##2 ] [ \__nicematrix_foldcase: ]
+ { \box_use_drop:N \l__nicematrix_cell_box }
}
}
\__nicematrix_newcolumntype W [ 2 ]
@@ -877,12 +1025,13 @@
\hbox_set:Nw \l__nicematrix_cell_box
\__nicematrix_Cell:
}
- c
+ \__nicematrix_true_c:
< {
\__nicematrix_end_Cell:
\hbox_set_end:
\cs_set_eq:NN \hss \hfil
- \makebox [ ##2 ] [ \str_lowercase:n { ##1 } ]
+ \tl_set:Nn \l_tmpa_tl { ##1 }
+ \makebox [ ##2 ] [ \__nicematrix_foldcase: ]
{ \box_use_drop:N \l__nicematrix_cell_box }
}
}
@@ -906,7 +1055,7 @@
}
}
\int_gzero_new:N \g__nicematrix_last_vdotted_col_int
- \bool_if:NT \c__nicematrix_siunitx_loaded_bool \__nicematrix_renew_NC@rewrite@S:
+ \__nicematrix_renew_NC@rewrite@S:
\int_gset:Nn \g__nicematrix_last_vdotted_col_int { -1 }
\bool_gset_false:N \g__nicematrix_last_col_found_bool
\tl_gclear_new:N \g__nicematrix_Cdots_lines_tl
@@ -915,9 +1064,20 @@
\tl_gclear_new:N \g__nicematrix_Ddots_lines_tl
\tl_gclear_new:N \g__nicematrix_Iddots_lines_tl
\tl_gclear_new:N \g__nicematrix_HVdotsfor_lines_tl
- }
+ }
+\cs_set:Npn \__nicematrix_foldcase:
+ {
+ \tl_case:NnF \l_tmpa_tl
+ {
+ C { c }
+ L { l }
+ R { r }
+ }
+ { \l_tmpa_tl }
+ }
\NewDocumentEnvironment { NiceArrayWithDelims } { m m O { } m ! O { } }
{
+ \bool_if:NT \c__nicematrix_footnote_bool { \begin { savenotes } }
\bgroup
\tl_set:Nn \l__nicematrix_left_delim_tl { #1 }
\tl_set:Nn \l__nicematrix_right_delim_tl { #2 }
@@ -1062,11 +1222,20 @@
{
\hbox_set:Nn \l_tmpa_box { $ \bBigg@ 5 #1 $ }
\dim_set:Nn \l__nicematrix_left_delim_dim { \box_wd:N \l_tmpa_box }
- \hbox_set:Nn \l_tmpa_box { $\bBigg@ 5 #2 $ }
+ \hbox_set:Nn \l_tmpa_box { $ \bBigg@ 5 #2 $ }
\dim_set:Nn \l__nicematrix_right_delim_dim { \box_wd:N \l_tmpa_box }
}
\box_clear_new:N \l__nicematrix_the_array_box
\tl_set:Nn \l_tmpa_tl { #4 }
+ \bool_if:NT \c__nicematrix_define_L_C_R_bool \__nicematrix_define_L_C_R:
+ \@temptokena \exp_after:wN { \l_tmpa_tl }
+ \@tempswatrue
+ \@whilesw \if@tempswa \fi { \@tempswafalse \the \NC@list }
+ \tl_gset:NV \l_tmpa_tl \@temptokena
+ \tl_replace_all:Nnn \l_tmpa_tl c { > \__nicematrix_Cell: c < \__nicematrix_end_Cell: }
+ \tl_replace_all:Nnn \l_tmpa_tl l { > \__nicematrix_Cell: l < \__nicematrix_end_Cell: }
+ \tl_replace_all:Nnn \l_tmpa_tl r { > \__nicematrix_Cell: r < \__nicematrix_end_Cell: }
+ \tl_replace_all:Nnn \l_tmpa_tl \__nicematrix_true_c: c
\int_compare:nNnTF \l__nicematrix_first_col_int = 0
{ \tl_put_left:NV \l_tmpa_tl \c__nicematrix_preamble_first_col_tl }
{
@@ -1091,7 +1260,7 @@
}
{ \tl_put_right:Nn \l_tmpa_tl { @ { } } }
}
- \tl_put_right:Nn \l_tmpa_tl { > { \__nicematrix_error_too_much_cols: } L }
+ \tl_put_right:Nn \l_tmpa_tl { > { \__nicematrix_error_too_much_cols: } l }
\hbox_set:Nw \l__nicematrix_the_array_box
\bool_if:NT \l__nicematrix_NiceTabular_bool
{
@@ -1143,31 +1312,30 @@
{
\str_if_eq:VnTF \l__nicematrix_baseline_str { b }
{
- \pgfpicture
- \__nicematrix_qpoint:n { row - 1 }
- \dim_gset_eq:NN \g_tmpa_dim \pgf@y
- \__nicematrix_qpoint:n { row - \int_use:N \c@iRow - base }
- \dim_gsub:Nn \g_tmpa_dim \pgf@y
- \endpgfpicture
- \int_compare:nNnT \l__nicematrix_first_row_int = 0
- {
- \dim_gadd:Nn \g_tmpa_dim
- { \g__nicematrix_ht_row_zero_dim + \g__nicematrix_dp_row_zero_dim }
- }
- \box_move_up:nn \g_tmpa_dim { \box_use_drop:N \l__nicematrix_the_array_box }
+ \pgfpicture
+ \__nicematrix_qpoint:n { row - 1 }
+ \dim_gset_eq:NN \g_tmpa_dim \pgf@y
+ \__nicematrix_qpoint:n { row - \int_use:N \c@iRow - base }
+ \dim_gsub:Nn \g_tmpa_dim \pgf@y
+ \endpgfpicture
+ \dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
+ \int_compare:nNnT \l__nicematrix_first_row_int = 0
+ {
+ \dim_gadd:Nn \g_tmpa_dim \g__nicematrix_ht_row_zero_dim
+ \dim_gadd:Nn \g_tmpa_dim \g__nicematrix_dp_row_zero_dim
+ }
+ \box_move_up:nn \g_tmpa_dim { \__nicematrix_use_array_box_with_notes: }
}
{
\str_if_eq:VnTF \l__nicematrix_baseline_str { c }
- { \box_use_drop:N \l__nicematrix_the_array_box }
+ { \__nicematrix_use_array_box_with_notes: }
{
\str_if_eq:VnT \l__nicematrix_baseline_str { t }
{ \str_set:Nn \l__nicematrix_baseline_str { 1 } }
\int_set:Nn \l_tmpa_int \l__nicematrix_baseline_str
- \bool_if:nT
- {
- \int_compare_p:nNn \l_tmpa_int < \l__nicematrix_first_row_int
- || \int_compare_p:nNn \l_tmpa_int > \g__nicematrix_row_total_int
- }
+ \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 }
{
\__nicematrix_error:n { bad~value~for~baseline }
\int_set:Nn \l_tmpa_int 1
@@ -1178,13 +1346,13 @@
\__nicematrix_qpoint:n { row - \int_use:N \l_tmpa_int - base }
\dim_gsub:Nn \g_tmpa_dim \pgf@y
\endpgfpicture
+ \dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
\int_compare:nNnT \l__nicematrix_first_row_int = 0
{
- \dim_gadd:Nn \g_tmpa_dim
- { \g__nicematrix_ht_row_zero_dim + \g__nicematrix_dp_row_zero_dim }
+ \dim_gadd:Nn \g_tmpa_dim \g__nicematrix_ht_row_zero_dim
+ \dim_gadd:Nn \g_tmpa_dim \g__nicematrix_dp_row_zero_dim
}
- \box_move_up:nn \g_tmpa_dim
- { \box_use_drop:N \l__nicematrix_the_array_box }
+ \box_move_up:nn \g_tmpa_dim { \__nicematrix_use_array_box_with_notes: }
}
}
}
@@ -1208,17 +1376,19 @@
\vcenter
{
\skip_vertical:N -\l_tmpa_dim
+ \skip_vertical:N -\arrayrulewidth
\hbox
{
\bool_if:NTF \l__nicematrix_NiceTabular_bool
{ \skip_horizontal:N -\tabcolsep }
{ \skip_horizontal:N -\arraycolsep }
- \box_use_drop:N \l__nicematrix_the_array_box
+ \__nicematrix_use_array_box_with_notes:
\bool_if:NTF \l__nicematrix_NiceTabular_bool
{ \skip_horizontal:N -\tabcolsep }
{ \skip_horizontal:N -\arraycolsep }
}
\skip_vertical:N -\l_tmpb_dim
+ \skip_vertical:N \arrayrulewidth
}
\right #2
\c_math_toggle_token
@@ -1234,6 +1404,7 @@
}
\__nicematrix_after_array:
\egroup
+ \bool_if:NT \c__nicematrix_footnote_bool { \end { savenotes } }
}
\cs_new_protected:Npn \__nicematrix_put_box_in_flow:
{
@@ -1273,6 +1444,45 @@
\box_move_up:nn \g_tmpa_dim { \box_use_drop:N \l_tmpa_box }
\box_use_drop:N \l_tmpa_box
}
+\cs_new_protected:Npn \__nicematrix_use_array_box_with_notes:
+ {
+ \int_compare:nNnTF \c@tabularnote = 0
+ { \box_use_drop:N \l__nicematrix_the_array_box }
+ {
+ \begin { minipage } { \box_wd:N \l__nicematrix_the_array_box }
+ \box_use_drop:N \l__nicematrix_the_array_box
+ \skip_vertical:N 0.65ex
+ \group_begin:
+ \l__nicematrix_notes_code_before_tl
+ \bool_if:NTF \l__nicematrix_notes_para_bool
+ {
+ \begin { tabularnotes* }
+ \seq_map_inline:Nn \g__nicematrix_tabularnotes_seq { \item ##1 } \strut
+ \end { tabularnotes* }
+ \par
+ }
+ {
+ \tabularnotes
+ \seq_map_inline:Nn \g__nicematrix_tabularnotes_seq { \item ##1 } \strut
+ \endtabularnotes
+ }
+ \unskip
+ \group_end:
+ \bool_if:NT \l__nicematrix_notes_bottomrule_bool
+ {
+ \bool_if:NTF \c__nicematrix_booktabs_loaded_bool
+ {
+ \skip_vertical:N \aboverulesep
+ { \CT@arc@ \hrule height \heavyrulewidth }
+ }
+ { \__nicematrix_error:n { bottomule~without~booktabs } }
+ }
+ \l__nicematrix_notes_code_after_tl
+ \end { minipage }
+ \seq_gclear:N \g__nicematrix_tabularnotes_seq
+ \int_gzero:N \c@tabularnote
+ }
+ }
\cs_new_protected:Npn \__nicematrix_put_box_in_flow_bis:nn #1 #2
{
\dim_zero_new:N \l__nicematrix_real_left_delim_dim
@@ -1367,7 +1577,6 @@
\cs_new:Npn \__nicematrix_create_col_nodes:
{
\crcr
- \int_compare:nNnT \c@iRow = 0 { \__nicematrix_fatal:n { Zero~row } }
\int_compare:nNnT \l__nicematrix_first_col_int = 0
{
\omit
@@ -1639,7 +1848,7 @@
\NewDocumentEnvironment { #1 NiceMatrix } { ! O { } }
{
\str_gset:Nn \g__nicematrix_name_env_str { #1 NiceMatrix }
- \tl_set:Nn \l__nicematrix_type_of_col_tl C
+ \tl_set:Nn \l__nicematrix_type_of_col_tl c
\keys_set:nn { NiceMatrix / NiceMatrix } { ##1 }
\exp_args:Nnx \__nicematrix_begin_of_NiceMatrix:nn { #1 } \l__nicematrix_type_of_col_tl
}
@@ -2037,8 +2246,7 @@
{
\__nicematrix_qpoint:n { col - \int_use:N \l__nicematrix_initial_j_int }
\dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf@x
- \dim_add:Nn \l__nicematrix_x_initial_dim
- { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
+ \dim_add:Nn \l__nicematrix_x_initial_dim \__nicematrix_tab_or_array_colsep:
\__nicematrix_qpoint:n { row - \int_use:N \l__nicematrix_initial_i_int - base }
\dim_set_eq:NN \l__nicematrix_y_initial_dim \pgf@y
}
@@ -2047,8 +2255,7 @@
{
\__nicematrix_qpoint:n { col - \__nicematrix_succ:n \l__nicematrix_final_j_int }
\dim_set_eq:NN \l__nicematrix_x_final_dim \pgf@x
- \dim_sub:Nn \l__nicematrix_x_final_dim
- { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
+ \dim_sub:Nn \l__nicematrix_x_final_dim \__nicematrix_tab_or_array_colsep:
\__nicematrix_qpoint:n { row - \int_use:N \l__nicematrix_final_i_int - base }
\dim_set_eq:NN \l__nicematrix_y_final_dim \pgf@y
}
@@ -2082,7 +2289,7 @@
\__nicematrix_qpoint:n { col - \int_use:N \l__nicematrix_initial_j_int }
\dim_set_eq:NN \l__nicematrix_x_initial_dim \pgf@x
\dim_add:Nn \l__nicematrix_x_initial_dim
- { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
+ { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
}
{ \__nicematrix_set_initial_coords_from_anchor:n { mid~east } }
\bool_if:NTF \l__nicematrix_final_open_bool
@@ -2090,7 +2297,7 @@
\__nicematrix_qpoint:n { col - \__nicematrix_succ:n \l__nicematrix_final_j_int }
\dim_set_eq:NN \l__nicematrix_x_final_dim \pgf@x
\dim_sub:Nn \l__nicematrix_x_final_dim
- { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
+ { \bool_if:NTF \l__nicematrix_NiceTabular_bool \tabcolsep \arraycolsep }
}
{ \__nicematrix_set_final_coords_from_anchor:n { mid~west } }
\bool_lazy_and:nnTF
@@ -2336,7 +2543,7 @@
\pgftransformshift
{
\pgfpointlineattime { 0.5 }
- { \pgfpoint \l__nicematrix_x_initial_dim \l__nicematrix_y_initial_dim }
+ { \pgfpoint \l__nicematrix_x_initial_dim \l__nicematrix_y_initial_dim }
{ \pgfpoint \l__nicematrix_x_final_dim \l__nicematrix_y_final_dim }
}
\pgftransformrotate
@@ -2345,7 +2552,7 @@
{
atand
(
- \l__nicematrix_y_final_dim - \l__nicematrix_y_initial_dim ,
+ \l__nicematrix_y_final_dim - \l__nicematrix_y_initial_dim ,
\l__nicematrix_x_final_dim - \l__nicematrix_x_initial_dim
)
}
@@ -2577,7 +2784,16 @@
\cs_set_eq:NN \__nicematrix_old_multicolumn \multicolumn
\cs_new:Npn \__nicematrix_multicolumn:nnn #1 #2 #3
{
- \__nicematrix_old_multicolumn { #1 } { #2 } { #3 }
+ \exp_args:NNe
+ \__nicematrix_old_multicolumn
+ { #1 }
+ {
+ > \__nicematrix_Cell:
+ \bool_if:NT \c__nicematrix_define_L_C_R_bool \tl_lower_case:n
+ #2
+ < \__nicematrix_end_Cell:
+ }
+ { #3 }
\peek_remove_spaces:n
{
\int_compare:nNnT #1 > 1
@@ -2598,7 +2814,7 @@
}
\cs_new:Npn \__nicematrix_Hdotsfor:
{
- \multicolumn { 1 } { C } { }
+ \multicolumn { 1 } { c } { }
\__nicematrix_Hdotsfor_i
}
\AtBeginDocument
@@ -2618,7 +2834,7 @@
down = \exp_not:n { #4 } , up = \exp_not:n { #5 }
}
}
- \prg_replicate:nn { #2 - 1 } { & \multicolumn { 1 } { C } { } }
+ \prg_replicate:nn { #2 - 1 } { & \multicolumn { 1 } { c } { } }
}
}
\cs_new_protected:Npn \__nicematrix_Hdotsfor:nnnn #1 #2 #3 #4
@@ -3200,31 +3416,25 @@
}
\cs_new_protected:Npn \__nicematrix_test_if_hline_in_block:nnnn #1 #2 #3 #4
{
- \int_compare:nNnT \l_tmpa_tl > { #1 }
+ \bool_lazy_all:nT
{
- \int_compare:nNnT \l_tmpa_tl < { #3 + 1 }
- {
- \int_compare:nNnT \l_tmpb_tl > { #2 - 1 }
- {
- \int_compare:nNnT \l_tmpb_tl < { #4 + 1 }
- { \bool_gset_false:N \g_tmpa_bool }
- }
- }
+ { \int_compare_p:nNn \l_tmpa_tl > { #1 } }
+ { \int_compare_p:nNn \l_tmpa_tl < { #3 + 1 } }
+ { \int_compare_p:nNn \l_tmpb_tl > { #2 - 1 } }
+ { \int_compare_p:nNn \l_tmpb_tl < { #4 + 1 } }
}
+ { \bool_gset_false:N \g_tmpa_bool }
}
\cs_new_protected:Npn \__nicematrix_test_if_vline_in_block:nnnn #1 #2 #3 #4
{
- \int_compare:nNnT \l_tmpa_tl > { #1 - 1 }
+ \bool_lazy_all:nT
{
- \int_compare:nNnT \l_tmpa_tl < { #3 + 1 }
- {
- \int_compare:nNnT \l_tmpb_tl > { #2 }
- {
- \int_compare:nNnT \l_tmpb_tl < { #4 + 1 }
- { \bool_gset_false:N \g_tmpa_bool }
- }
- }
+ { \int_compare_p:nNn \l_tmpa_tl > { #1 - 1 } }
+ { \int_compare_p:nNn \l_tmpa_tl < { #3 + 1 } }
+ { \int_compare_p:nNn \l_tmpb_tl > { #2 } }
+ { \int_compare_p:nNn \l_tmpb_tl < { #4 + 1 } }
}
+ { \bool_gset_false:N \g_tmpa_bool }
}
\cs_new_protected:Npn \__nicematrix_draw_hvlines_except_corners:
{
@@ -3241,7 +3451,7 @@
\int_zero_new:N \l__nicematrix_last_empty_row_int
\int_step_inline:nnnn { #1 } { #3 } { #5 }
{
- \__nicematrix_test_if_cell_in_a_block:nx { ##1 } { \int_eval:n { #2 } }
+ \__nicematrix_test_if_cell_in_a_block:nn { ##1 } { \int_eval:n { #2 } }
\bool_if:nTF
{
\cs_if_exist_p:c
@@ -3259,7 +3469,7 @@
\int_zero_new:N \l__nicematrix_last_empty_column_int
\int_step_inline:nnnn { #2 } { #4 } { #6 }
{
- \__nicematrix_test_if_cell_in_a_block:xn { \int_eval:n { #1 } } { ##1 }
+ \__nicematrix_test_if_cell_in_a_block:nn { \int_eval:n { #1 } } { ##1 }
\bool_if:nTF
{
\cs_if_exist_p:c
@@ -3299,19 +3509,20 @@
}
\cs_new_protected:Npn \__nicematrix_test_if_cell_in_a_block:nn #1 #2
{
+ \int_set:Nn \l_tmpa_int { #1 }
+ \int_set:Nn \l_tmpb_int { #2 }
\bool_set_false:N \l_tmpb_bool
\seq_map_inline:Nn \g__nicematrix_pos_of_blocks_seq
- { \__nicematrix_test_if_cell_in_block:nnnnnnn { #1 } { #2 } ##1 }
+ { \__nicematrix_test_if_cell_in_block:nnnnnnn { \l_tmpa_int } { \l_tmpb_int } ##1 }
}
-\cs_generate_variant:Nn \__nicematrix_test_if_cell_in_a_block:nn { nx , xn }
\cs_new_protected:Npn \__nicematrix_test_if_cell_in_block:nnnnnnn #1 #2 #3 #4 #5 #6
{
- \bool_if:nT
+ \bool_lazy_all:nT
{
- \int_compare_p:n { #3 <= #1 }
- && \int_compare_p:n { #1 <= #5 }
- && \int_compare_p:n { #4 <= #2 }
- && \int_compare_p:n { #2 <= #6 }
+ { \int_compare_p:n { #3 <= #1 } }
+ { \int_compare_p:n { #1 <= #5 } }
+ { \int_compare_p:n { #4 <= #2 } }
+ { \int_compare_p:n { #2 <= #6 } }
}
{ \bool_set_true:N \l_tmpb_bool }
}
@@ -3622,6 +3833,8 @@
\cs_new:Npn \__nicematrix_Block_i #1-#2 \q_stop { \__nicematrix_Block_ii:nnnnn { #1 } { #2 } }
\cs_new_protected:Npn \__nicematrix_Block_ii:nnnnn #1 #2 #3 #4 #5
{
+ \bool_if:NT \l__nicematrix_NiceTabular_bool
+ { \tl_if_empty:nF { #4 } { \__nicematrix_error:n { angle~option~in~NiceTabular } } }
\tl_set:Nx \l_tmpa_tl
{
{ \int_use:N \c@iRow }
@@ -3648,6 +3861,14 @@
{
\group_begin:
\keys_set:nn { NiceMatrix / Block } { #5 }
+ \cs_set_protected:Npn \diagbox ##1 ##2
+ {
+ \tl_gput_right:Nx \g__nicematrix_internal_code_after_tl
+ {
+ \__nicematrix_actually_diagbox:nnnnnn
+ { #1 } { #2 } { #3 } { #4 } { ##1 } { ##2 }
+ }
+ }
\bool_lazy_or:nnTF
{ \int_compare_p:nNn { #3 } > \g__nicematrix_row_total_int }
{ \int_compare_p:nNn { #4 } > \c@jCol }
@@ -3763,7 +3984,7 @@
\int_zero_new:N \l__nicematrix_nb_cols_int
\__nicematrix_set_size:n #4 \q_stop
\begin { NiceArrayWithDelims } { #1 } { #2 }
- { * { \l__nicematrix_nb_cols_int } { C } } [ #3 , #5 , #7 ]
+ { * { \l__nicematrix_nb_cols_int } { c } } [ #3 , #5 , #7 ]
\int_compare:nNnT \l__nicematrix_first_row_int = 0
{
\int_compare:nNnT \l__nicematrix_first_col_int = 0 { & }
@@ -3820,11 +4041,23 @@
{
\tl_gput_right:Nx \g__nicematrix_internal_code_after_tl
{
- \__nicematrix_actually_diagbox:nnnn
- { \int_use:N \c@iRow } { \int_use:N \c@jCol } { #1 } { #2 }
+ \__nicematrix_actually_diagbox:nnnnnn
+ { \int_use:N \c@iRow }
+ { \int_use:N \c@jCol }
+ { \int_use:N \c@iRow }
+ { \int_use:N \c@jCol }
+ { #1 }
+ { #2 }
+ }
+ \seq_gput_right:Nx \g__nicematrix_pos_of_blocks_seq
+ {
+ { \int_use:N \c@iRow }
+ { \int_use:N \c@jCol }
+ { \int_use:N \c@iRow }
+ { \int_use:N \c@jCol }
}
}
-\cs_new_protected:Npn \__nicematrix_actually_diagbox:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \__nicematrix_actually_diagbox:nnnnnn #1 #2 #3 #4 #5 #6
{
\pgfpicture
\pgf@relevantforpicturesizefalse
@@ -3834,9 +4067,9 @@
\__nicematrix_qpoint:n { col - #2 }
\dim_set_eq:NN \l_tmpb_dim \pgf@x
\pgfpathmoveto { \pgfpoint \l_tmpb_dim \l_tmpa_dim }
- \__nicematrix_qpoint:n { row - \__nicematrix_succ:n { #1 } }
+ \__nicematrix_qpoint:n { row - \__nicematrix_succ:n { #3 } }
\dim_set_eq:NN \l_tmpc_dim \pgf@y
- \__nicematrix_qpoint:n { col - \__nicematrix_succ:n { #2 } }
+ \__nicematrix_qpoint:n { col - \__nicematrix_succ:n { #4 } }
\dim_set_eq:NN \l_tmpd_dim \pgf@x
\pgfpathlineto { \pgfpoint \l_tmpd_dim \l_tmpc_dim }
{
@@ -3848,11 +4081,11 @@
\pgfscope
\pgftransformshift { \pgfpoint \l_tmpb_dim \l_tmpc_dim }
\pgfnode { rectangle } { south~west }
- { \__nicematrix_math_toggle_token: #3 \__nicematrix_math_toggle_token: } { } { }
+ { \__nicematrix_math_toggle_token: #5 \__nicematrix_math_toggle_token: } { } { }
\endpgfscope
\pgftransformshift { \pgfpoint \l_tmpd_dim \l_tmpa_dim }
\pgfnode { rectangle } { north~east }
- { \__nicematrix_math_toggle_token: #4 \__nicematrix_math_toggle_token: } { } { }
+ { \__nicematrix_math_toggle_token: #6 \__nicematrix_math_toggle_token: } { } { }
\endpgfpicture
}
\cs_new_protected:Npn \__nicematrix_CodeAfter:n #1 \end
@@ -3869,29 +4102,82 @@
\__nicematrix_CodeAfter:n
}
}
+%% \medskip
+\bool_new:N \c__nicematrix_footnotehyper_bool
+\bool_new:N \c__nicematrix_footnote_bool
+\__nicematrix_msg_new:nnn { Unknown~option~for~package }
+ {
+ The~option~'\l_keys_key_tl'~is~unknown. \\
+ 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):~
+ define-L-C-R,~
+ footnote,~
+ footnotehyper,~
+ renew-dots,~
+ renew-matrix~and~
+ transparent.
+ }
\keys_define:nn { NiceMatrix / Package }
{
+ define-L-C-R .bool_set:N = \c__nicematrix_define_L_C_R_bool ,
+ define-L-C-R .default:n = true ,
renew-dots .bool_set:N = \l__nicematrix_renew_dots_bool ,
renew-dots .value_forbidden:n = true ,
renew-matrix .code:n = \__nicematrix_renew_matrix: ,
renew-matrix .value_forbidden:n = true ,
transparent .meta:n = { renew-dots , renew-matrix } ,
transparent .value_forbidden:n = true,
+ footnote .bool_set:N = \c__nicematrix_footnote_bool ,
+ footnotehyper .bool_set:N = \c__nicematrix_footnotehyper_bool ,
+ unknown .code:n = \__nicematrix_error:n { Unknown~option~for~package }
}
\ProcessKeysOptions { NiceMatrix / Package }
-\cs_new_protected:Npn \__nicematrix_convert_to_str_seq:N #1
+\__nicematrix_msg_new:nn { footnote~with~footnotehyper~package }
+ {
+ You~can't~use~the~option~'footnote'~because~the~package~
+ footnotehyper~has~already~been~loaded.~
+ If~you~want,~you~can~use~the~option~'footnotehyper'~and~the~footnotes~
+ within~the~environments~of~nicematrix~will~be~extracted~with~the~tools~
+ of~the~package~footnotehyper.\\
+ If~you~go~on,~the~package~footnote~won't~be~loaded.
+ }
+\__nicematrix_msg_new:nn { footnotehyper~with~footnote~package }
+ {
+ You~can't~use~the~option~'footnotehyper'~because~the~package~
+ footnote~has~already~been~loaded.~
+ If~you~want,~you~can~use~the~option~'footnote'~and~the~footnotes~
+ within~the~environments~of~nicematrix~will~be~extracted~with~the~tools~
+ of~the~package~footnote.\\
+ If~you~go~on,~the~package~footnotehyper~won't~be~loaded.
+ }
+\bool_if:NT \c__nicematrix_footnote_bool
{
- \seq_clear:N \l_tmpa_seq
- \seq_map_inline:Nn #1
+ \@ifclassloaded { beamer }
+ { \msg_info:nn { nicematrix } { Option~incompatible~with~Beamer } }
{
- \seq_put_left:Nx \l_tmpa_seq { \tl_to_str:n { ##1 } }
+ \@ifpackageloaded { footnotehyper }
+ { \__nicematrix_error:n { footnote~with~footnotehyper~package } }
+ { \usepackage { footnote } }
}
- \seq_set_eq:NN #1 \l_tmpa_seq
+ }
+\bool_if:NT \c__nicematrix_footnotehyper_bool
+ {
+ \@ifclassloaded { beamer }
+ { \__nicematrix_info:n { Option~incompatible~with~Beamer } }
+ {
+ \@ifpackageloaded { footnote }
+ { \__nicematrix_error:n { footnotehyper~with~footnote~package } }
+ { \usepackage { footnotehyper } }
+ }
+ \bool_set_true:N \c__nicematrix_footnote_bool
}
\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
+ \seq_set_map:NNn #1 #1 { \tl_to_str:n { ##1 } }
}
\__nicematrix_set_seq_of_str_from_clist:Nn \c__nicematrix_types_of_matrix_seq
{
@@ -4024,6 +4310,29 @@
{
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 { angle~option~in~NiceTabular }
+ {
+ You~should~not~the~option~between~angle~brackets~(<~and~>)~for~a~command~
+ \token_to_str:N \Block\ in~\{NiceTabular\}.~However,~you~can~go~on.
+ }
+\__nicematrix_msg_new:nn { tabularnote~forbidden }
+ {
+ You~can't~use~the~command~\token_to_str:N\tabularnote\
+ ~in~a~\__nicematrix_full_name_env:.~This~command~is~available~only~in~
+ \{NiceTabular\},~\{NiceArray\}~and~\{NiceMatrix\}. \\
+ If~you~go~on,~this~command~will~be~ignored.
+ }
+\__nicematrix_msg_new:nn { bottomule~without~booktabs }
+ {
+ You~can't~use~the~option~'tabular/bottomrule'~because~you~haven't~
+ loaded~'booktabs'.\\
+ If~you~go~on,~this~option~will~be~ignored.
+ }
+\__nicematrix_msg_new:nn { enumitem~not~loaded }
+ {
+ You~can't~use~the~command~\token_to_str:N\tabularnote\
+ ~because~you~haven't~loaded~'enumitem'.\\
If~you~go~on,~this~command~will~be~ignored.
}
\__nicematrix_msg_new:nn { Wrong~last~row }
@@ -4035,10 +4344,7 @@
without~value~(more~compilations~might~be~necessary).
}
\__nicematrix_msg_new:nn { Yet~in~env }
- {
- Environments~\{NiceArray\}~(or~\{NiceMatrix\},~etc.)~can't~be~nested.\\
- This~error~is~fatal.
- }
+ { Environments~of~nicematrix~can't~be~nested.\\ This~error~is~fatal. }
\__nicematrix_msg_new:nn { Outside~math~mode }
{
The~\__nicematrix_full_name_env:\ can~be~used~only~in~math~mode~
@@ -4047,12 +4353,30 @@
}
\__nicematrix_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.\\
+ The~value~of~key~'\l_keys_key_tl'~must~be~of~length~1.\\
If~you~go~on,~it~will~be~ignored.
}
+\__nicematrix_msg_new:nnn { Unknown~key~for~notes }
+ {
+ The~key~'\l_keys_key_tl'~is~unknown.\\
+ If~you~go~on,~it~will~be~ignored. \\
+ For~a~list~of~the~available~keys~about~notes,~type~H~<return>.
+ }
+ {
+ The~available~options~are~(in~alphabetic~order):~
+ bottomrule,~
+ code-after,~
+ code-before,~
+ enumitem-keys,~
+ enumitem-keys-para,~
+ para,~
+ label-in-list,~
+ label-in-tabular~and~
+ style.
+ }
\__nicematrix_msg_new:nnn { Unknown~key~for~NiceMatrixOptions }
{
- The~key~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~command~
+ The~key~'\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~*principal*~available~keys,~type~H~<return>.
@@ -4080,6 +4404,7 @@
left-margin,~
letter-for-dotted-lines,~
light-syntax,~
+ notes~(several subkeys),~
nullify-dots,~
renew-dots,~
renew-matrix,~
@@ -4093,7 +4418,7 @@
}
\__nicematrix_msg_new:nnn { Unknown~option~for~NiceArray }
{
- The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~
+ The~option~'\l_keys_key_tl'~is~unknown~for~the~environment~
\{NiceArray\}. \\
If~you~go~on,~it~will~be~ignored. \\
For~a~list~of~the~*principal*~available~options,~type~H~<return>.
@@ -4125,6 +4450,8 @@
left-margin,~
light-syntax,~
name,~
+ notes/bottomrule,~
+ notes/para,~
nullify-dots,~
renew-dots,~
right-margin,~
@@ -4139,7 +4466,7 @@
}
\__nicematrix_msg_new:nnn { Unknown~option~for~NiceMatrix }
{
- The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~
+ The~option~'\l_keys_key_tl'~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~<return>.
@@ -4188,7 +4515,7 @@
}
\__nicematrix_msg_new:nnn { Unknown~option~for~NiceTabular }
{
- The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~
+ The~option~'\l_keys_key_tl'~is~unknown~for~the~environment~
\{NiceTabular\}. \\
If~you~go~on,~it~will~be~ignored. \\
For~a~list~of~the~*principal*~available~options,~type~H~<return>.
@@ -4220,6 +4547,8 @@
left-margin,~
light-syntax,~
name,~
+ notes/bottomrule,~
+ notes/para,~
nullify-dots,~
renew-dots,~
right-margin,~
@@ -4249,12 +4578,6 @@
You~can't~give~the~value~'auto'~to~the~option~'columns-width'~here.~
If~you~go~on,~the~option~will~be~ignored.
}
-\__nicematrix_msg_new:nn { Zero~row }
- {
- There~is~a~problem.~Maybe~you~have~used~l,~c~and~r~instead~of~L,~C~
- and~R~in~the~preamble~of~your~environment. \\
- This~error~is~fatal.
- }
\endinput
%%