summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nicematrix
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-08-15 03:00:53 +0000
committerNorbert Preining <norbert@preining.info>2023-08-15 03:00:53 +0000
commit3593305133bcfb167225af1b35c299bde1456579 (patch)
treec80fe825c17682b4b49b9b2f9ac687210e5df157 /macros/latex/contrib/nicematrix
parent8360ddccbd0538a65b33a2474e0b3b79acd83dab (diff)
CTAN sync 202308150300
Diffstat (limited to 'macros/latex/contrib/nicematrix')
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-code.dtx1218
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-code.pdfbin918695 -> 939983 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.pdfbin580394 -> 584003 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.tex204
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.ins2
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.pdfbin598471 -> 602607 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.tex229
7 files changed, 1084 insertions, 569 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix-code.dtx b/macros/latex/contrib/nicematrix/nicematrix-code.dtx
index 7f7920ec77..39677ce108 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-code.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix-code.dtx
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.21a}
-\def\myfiledate{2023/07/17}
+\def\myfileversion{6.22}
+\def\myfiledate{2023/08/14}
%
%
%<*batchfile>
@@ -181,7 +181,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_new_protected:Npn \@@_msg_new:nnn #1 #2 #3
{
- \bool_if:NTF \c_@@_messages_for_Overleaf_bool
+ \bool_if:NTF \g_@@_messages_for_Overleaf_bool
{ \msg_new:nnn { nicematrix } { #1 } { #2 \\ #3 } }
{ \msg_new:nnnn { nicematrix } { #1 } { #2 } { #3 } }
}
@@ -192,14 +192,15 @@ version 2005/12/01 or later.
% warning on Overleaf. The argument is given by curryfication.
% \begin{macrocode}
\cs_new_protected:Npn \@@_error_or_warning:n
- { \bool_if:NTF \c_@@_messages_for_Overleaf_bool \@@_warning:n \@@_error:n }
+ { \bool_if:NTF \g_@@_messages_for_Overleaf_bool \@@_warning:n \@@_error:n }
% \end{macrocode}
%
% We try to detect whether the compilation is done on Overleaf. We use
% |\c_sys_jobname_str| because, with Overleaf, the value of |\c_sys_jobname_str|
% is always ``|output|''.
% \begin{macrocode}
-\bool_set:Nn \c_@@_messages_for_Overleaf_bool
+\bool_new:N \g_@@_messages_for_Overleaf_bool
+\bool_gset:Nn \g_@@_messages_for_Overleaf_bool
{
\str_if_eq_p:Vn \c_sys_jobname_str { _region_ } % for Emacs
|| \str_if_eq_p:Vn \c_sys_jobname_str { output } % for Overleaf
@@ -296,7 +297,7 @@ version 2005/12/01 or later.
\IfPackageLoadedTF { mdwtab }
{ \@@_fatal:n { mdwtab~loaded } }
{
- \bool_if:NF \c_@@_no_test_for_array_bool
+ \bool_if:NF \g_@@_no_test_for_array_bool
{
\group_begin:
\hbox_set:Nn \l_tmpa_box
@@ -310,10 +311,62 @@ version 2005/12/01 or later.
}
}
% \end{macrocode}
+%
+% \bigskip
+% \section{Collecting options}
+%
+% The following technic allows to create user commands with the ability to put
+% an arbitrary number of |[|\textsl{list of (key=val)}|]| after the name of the
+% command.
+%
+% \medskip
+% \emph{Exemple} :\par\nobreak
+%
+% |\@@_collect_options:n { \F } [x=a,y=b] [z=c,t=d] { arg }|
+%
+% will be transformed in :\quad |\F{x=a,y=b,z=c,t=d}{arg}|
+%
+% \smallskip
+% Therefore, by writing : |\def\G{\@@_collect_options:n{\F}}|,
+%
+% the command |\G| takes in an arbitrary number of optional arguments between
+% square brackets.
+%
+% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_collect_options:n #1
+ {
+ \peek_meaning:NTF [
+ { \@@_collect_options:nw { #1 } }
+ { #1 { } }
+ }
+% \end{macrocode}
+%
+% \bigskip
+% We use |\NewDocumentCommand| in order to be able to allow nested brackets
+% within the argument between |[| and |]|.
+% \begin{macrocode}
+\NewDocumentCommand \@@_collect_options:nw { m r[] }
+ { \@@_collect_options:nn { #1 } { #2 } }
+
+\cs_new_protected:Npn \@@_collect_options:nn #1 #2
+ {
+ \peek_meaning:NTF [
+ { \@@_collect_options:nnw { #1 } { #2 } }
+ { #1 { #2 } }
+ }
+
+\cs_new_protected:Npn \@@_collect_options:nnw #1#2[#3]
+ { \@@_collect_options:nn { #1 } { #2 , #3 } }
+% \end{macrocode}
+%
%
% \bigskip
% \section{Technical definitions}
%
+% The following token list will be used for definitions of user commands (with
+% |\NewDocumentCommand|) with an embellishment using an \emph{underscore} (there
+% may be problems because of the catcode of the underscore).
% \begin{macrocode}
\tl_new:N \l_@@_argspec_tl
% \end{macrocode}
@@ -942,6 +995,27 @@ version 2005/12/01 or later.
% \begin{macrocode}
\tl_new:N \g_@@_aux_tl
% \end{macrocode}
+%
+% During the second run, if informations concerning the current environment has
+% been found in the |aux| file, the following flag will be raised.
+% \begin{macrocode}
+\bool_new:N \g_@@_aux_found_bool
+% \end{macrocode}
+%
+% \bigskip
+% In particuler, in that |aux| file, there will, for each environment of
+% \pkg{nicematrix}, an affectation for the the following sequence that will
+% contain informations about the size of the array.
+% \begin{macrocode}
+\seq_new:N \g_@@_size_seq
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\tl_new:N \g_@@_left_delim_tl
+\tl_new:N \g_@@_right_delim_tl
+\tl_new:N \g_@@_preamble_tl
+% \end{macrocode}
%
% \bigskip
% The following parameter corresponds to the key |columns-type| of the
@@ -956,6 +1030,16 @@ version 2005/12/01 or later.
\hook_gput_code:nnn { begindocument } { . }
{ \@@_set_preamble:Nn \l_@@_columns_type_tl { c } }
% \end{macrocode}
+%
+% \bigskip
+% The following parameters correspond to the keys |down|, |up| and |middle| of a
+% command such as |\Cdots|. Usually, the final user doesn't use that keys
+% directly because he uses the syntax with the embellishments |_|, |^| and |:|.
+% \begin{macrocode}
+\tl_new:N \l_@@_xdots_down_tl
+\tl_new:N \l_@@_xdots_up_tl
+\tl_new:N \l_@@_xdots_middle_tl
+% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
@@ -1316,10 +1400,11 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \medskip
-% The following parameters correspond to the keys |fill|, |draw|, |tikz|, |borders|,
-% and |rounded-corners| of the command |\Block|.
+% The following parameters correspond to the keys |fill|, |opacity|, |draw|,
+% |tikz|, |borders|, and |rounded-corners| of the command |\Block|.
% \begin{macrocode}
\tl_new:N \l_@@_fill_tl
+\tl_new:N \l_@@_opacity_tl
\tl_new:N \l_@@_draw_tl
\seq_new:N \l_@@_tikz_seq
\clist_new:N \l_@@_borders_clist
@@ -1414,7 +1499,6 @@ version 2005/12/01 or later.
% \begin{macrocode}
\bool_new:N \l_@@_hvlines_bool
% \end{macrocode}
-%
%
%
% \bigskip
@@ -1569,6 +1653,27 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+% \bigskip
+% The following internal parameters are for:
+% \begin{itemize}
+% \item |\Ldots| \emph{with both extremities open} (and hence also |\Hdotsfor| in an
+% exterior row;
+% \item |\Vdots| \emph{with both extremities open} (and hence also |\Vdotsfor| in an
+% exterior column;
+% \item when the special character ``|:|'' is used in order to put the label of
+% a so-called ``dotted line'' \emph{on the line}, a margin of
+% |\c_@@_innersep_middle_dim| will be added around the label.
+% \end{itemize}
+%
+% \begin{macrocode}
+\hook_gput_code:nnn { begindocument } { . }
+ {
+ \dim_const:Nn \c_@@_shift_Ldots_last_row_dim { 0.5 em }
+ \dim_const:Nn \c_@@_shift_exterior_Vdots_dim { 0.6 em }
+ \dim_const:Nn \c_@@_innersep_middle_dim { 0.17 em }
+ }
+% \end{macrocode}
+%
%
% \bigskip
% \section{The command \textbackslash tabularnote}
@@ -1937,7 +2042,6 @@ version 2005/12/01 or later.
\begin { pgfscope }
\pgfset
{
- % outer~sep = \c_zero_dim ,
inner~sep = \c_zero_dim ,
minimum~size = \c_zero_dim
}
@@ -1969,7 +2073,6 @@ version 2005/12/01 or later.
\begin { pgfscope }
\pgfset
{
- % outer~sep = \c_zero_dim ,
inner~sep = \c_zero_dim ,
minimum~size = \c_zero_dim
}
@@ -2051,14 +2154,13 @@ version 2005/12/01 or later.
\hook_gput_code:nnn { begindocument } { . }
{ \dim_set:Nn \l_@@_xdots_inter_dim { 0.45 em } }
% \end{macrocode}
-% We use a hook only by security in case \cls{revtex4-1}
-% is used (even though it is obsolete).
+% The unit is |em| and that's why we fix the dimension after the preamble.
%
% \bigskip
-% The following dimension is the minimal distance between a node (in fact an
-% anchor of that node) and a dotted line (we say ``minimal'' because, by
-% definition, a dotted line is not a continuous line and, therefore, this
-% distance may vary a little).
+% The following dimension is the distance between a node (in fact an
+% anchor of that node) and a dotted line (for real dotted lines, the actual
+% distance may, of course, be a bit larger, depending of the exact position of
+% the dots).
% \begin{macrocode}
\dim_new:N \l_@@_xdots_shorten_start_dim
\dim_new:N \l_@@_xdots_shorten_end_dim
@@ -2068,8 +2170,7 @@ version 2005/12/01 or later.
\dim_set:Nn \l_@@_xdots_shorten_end_dim { 0.3 em }
}
% \end{macrocode}
-% We use a hook only by security in case \cls{revtex4-1} is used (even though it
-% is obsolete).
+% The unit is |em| and that's why we fix the dimension after the preamble.
%
% \bigskip
% The following dimension is the radius of the dots for the dotted lines (when
@@ -2080,8 +2181,7 @@ version 2005/12/01 or later.
\hook_gput_code:nnn { begindocument } { . }
{ \dim_set:Nn \l_@@_xdots_radius_dim { 0.53 pt } }
% \end{macrocode}
-% We use a hook only by security in case \cls{revtex4-1} is used (even though it
-% is obsolete).
+% The unit is |em| and that's why we fix the dimension after the preamble.
%
%
% \bigskip
@@ -2130,7 +2230,7 @@ version 2005/12/01 or later.
%
% \bigskip
% The following parameter correspond to the key |corners|. The elements of that
-% |clist| must be in |NW|, |SW|, |NE| and |SE|.
+% |clist| must be within |NW|, |SW|, |NE| and |SE|.
% \begin{macrocode}
\clist_new:N \l_@@_corners_clist
% \end{macrocode}
@@ -2262,8 +2362,25 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
+% \bigskip
+% \begin{macrocode}
\keys_define:nn { NiceMatrix / xdots }
{
+ shorten-start .code:n =
+ \hook_gput_code:nnn { begindocument } { . }
+ { \dim_set:Nn \l_@@_xdots_shorten_start_dim { #1 } } ,
+ shorten-end .code:n =
+ \hook_gput_code:nnn { begindocument } { . }
+ { \dim_set:Nn \l_@@_xdots_shorten_end_dim { #1 } } ,
+ shorten-start .value_required:n = true ,
+ shorten-end .value_required:n = true ,
+ shorten .code:n =
+ \hook_gput_code:nnn { begindocument } { . }
+ {
+ \dim_set:Nn \l_@@_xdots_shorten_start_dim { #1 }
+ \dim_set:Nn \l_@@_xdots_shorten_end_dim { #1 }
+ } ,
+ shorten .value_required:n = true ,
horizontal-labels .bool_set:N = \l_@@_xdots_h_labels_bool ,
horizontal-labels .default:n = true ,
line-style .code:n =
@@ -2277,25 +2394,6 @@ version 2005/12/01 or later.
line-style .value_required:n = true ,
color .tl_set:N = \l_@@_xdots_color_tl ,
color .value_required:n = true ,
- shorten .code:n =
- \hook_gput_code:nnn { begindocument } { . }
- {
- \dim_set:Nn \l_@@_xdots_shorten_start_dim { #1 }
- \dim_set:Nn \l_@@_xdots_shorten_end_dim { #1 }
- } ,
- shorten-start .code:n =
- \hook_gput_code:nnn { begindocument } { . }
- { \dim_set:Nn \l_@@_xdots_shorten_start_dim { #1 } } ,
- shorten-end .code:n =
- \hook_gput_code:nnn { begindocument } { . }
- { \dim_set:Nn \l_@@_xdots_shorten_end_dim { #1 } } ,
-% \end{macrocode}
-% We use a hook only by security in case \cls{revtex4-1}
-% is used (even though it is obsolete). Idem for the following keys.
-% \begin{macrocode}
- shorten .value_required:n = true ,
- shorten-start .value_required:n = true ,
- shorten-end .value_required:n = true ,
radius .code:n =
\hook_gput_code:nnn { begindocument } { . }
{ \dim_set:Nn \l_@@_xdots_radius_dim { #1 } } ,
@@ -2305,14 +2403,17 @@ version 2005/12/01 or later.
{ \dim_set:Nn \l_@@_xdots_inter_dim { #1 } } ,
radius .value_required:n = true ,
% \end{macrocode}
-% The options |down| and |up| are not documented for the final user because he
-% should use the syntax with |^| and |_|.
+% The options |down|, |up| and |middle| are not documented for the final user
+% because he should use the syntax with |^|, |_| and |:|. We use
+% |\tl_put_right:Nn| and not |\tl_set:Nn| (or |.tl_set:N|) because we don't want
+% a direct use of |up=...| erased by a absent |^{...}|.
% \begin{macrocode}
- down .tl_set:N = \l_@@_xdots_down_tl ,
- up .tl_set:N = \l_@@_xdots_up_tl ,
+ down .code:n = \tl_put_right:Nn \l_@@_xdots_down_tl { #1 } , % modified 2023-08-09
+ up .code:n = \tl_put_right:Nn \l_@@_xdots_up_tl { #1 } ,
+ middle .code:n = \tl_put_right:Nn \l_@@_xdots_middle_tl { #1 } ,
% \end{macrocode}
% The key |draw-first|, which is meant to be used only with |\Ddots| and
-% |\Iddots|, which be catched when |\Ddots| or |\Iddots| is used (during the
+% |\Iddots|, will be catched when |\Ddots| or |\Iddots| is used (during the
% construction of the array and not when we draw the dotted lines).
% \begin{macrocode}
draw-first .code:n = \prg_do_nothing: ,
@@ -2787,6 +2888,7 @@ version 2005/12/01 or later.
unknown .code:n = \@@_error:n { Unknown~key~for~NiceTabular }
}
% \end{macrocode}
+%
%
% \bigskip
% \section{Important code used by \{NiceArrayWithDelims\} }
@@ -2812,9 +2914,9 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_set_eq:NN \CodeAfter \@@_CodeAfter_i:
% \end{macrocode}
-% We increment |\c@jCol|, which is the counter of the columns.
+% We increment the LaTeX counter |jCol|, which is the counter of the columns.
% \begin{macrocode}
- \int_gincr:N \c@jCol
+ \int_gincr:N \c@jCol
% \end{macrocode}
% Now, we increment the counter of the rows. We don't do this incrementation in
% the |\everycr| because some packages, like \pkg{arydshln}, create special rows
@@ -3225,9 +3327,9 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_new_protected:Npn \@@_array:n
{
- \bool_if:NTF \l_@@_tabular_bool
- { \dim_set_eq:NN \col@sep \tabcolsep }
- { \dim_set_eq:NN \col@sep \arraycolsep }
+ % modified 05-08-23
+ \dim_set:Nn \col@sep
+ { \bool_if:NTF \l_@@_tabular_bool \tabcolsep \arraycolsep }
\dim_compare:nNnTF \l_@@_tabular_width_dim = \c_zero_dim
{ \cs_set_nopar:Npn \@halignto { } }
{ \cs_set_nopar:Npx \@halignto { to \dim_use:N \l_@@_tabular_width_dim } }
@@ -3240,7 +3342,7 @@ version 2005/12/01 or later.
% |\l_@@_baseline_tl| may have the value |t|, |c| or |b|. However, if the value
% is |b|, we compose the |\array| (of \pkg{array}) with the option |t| and the
% right translation will be done further. Remark that |\str_if_eq:VnTF| is
-% fully expandable and you need something fully expandable here.
+% fully expandable and we need something fully expandable here.
% \begin{macrocode}
[ \str_if_eq:VnTF \l_@@_baseline_tl c c t ]
}
@@ -3740,7 +3842,6 @@ version 2005/12/01 or later.
\box_clear_new:N \l_@@_the_array_box
% \end{macrocode}
%
-%
% \medskip
% We compute the width of both delimiters. We remind that, when the
% environment |{NiceArray}| is used, it's possible to specify the delimiters in
@@ -3759,8 +3860,10 @@ version 2005/12/01 or later.
\dim_set:Nn \l_@@_right_delim_dim { \box_wd:N \l_tmpa_box }
}
{
- \dim_gset:Nn \l_@@_left_delim_dim { 2 \arraycolsep }
- \dim_gset:Nn \l_@@_right_delim_dim { 2 \arraycolsep }
+ % modified 05-08-23
+ \dim_gset:Nn \l_@@_left_delim_dim
+ { 2 \bool_if:NTF \l_@@_tabular_bool \tabcolsep \arraycolsep }
+ \dim_gset_eq:NN \l_@@_right_delim_dim \l_@@_left_delim_dim
}
% \end{macrocode}
%
@@ -4111,7 +4214,7 @@ version 2005/12/01 or later.
%
% \begin{macrocode}
\@@_provide_pgfsyspdfmark:
- \bool_if:NT \c_@@_footnote_bool \savenotes
+ \bool_if:NT \g_@@_footnote_bool \savenotes
% \end{macrocode}
%
% The aim of the following |\bgroup| (the corresponding |\egroup| is, of course,
@@ -4130,7 +4233,6 @@ version 2005/12/01 or later.
%
%
% \bigskip
-%
% \begin{macrocode}
\int_gzero:N \g_@@_block_box_int
\dim_zero:N \g_@@_width_last_col_dim
@@ -4199,12 +4301,12 @@ version 2005/12/01 or later.
% We load all the informations written in the |aux| file during previous
% compilations corresponding to the current environment.
% \begin{macrocode}
- \bool_gset_false:N \g_@@_aux_found_bool
- \tl_if_exist:cT { c_@@ _ \int_use:N \g_@@_env_int _ tl }
+ \tl_if_exist:cTF { c_@@ _ \int_use:N \g_@@_env_int _ tl }
{
\bool_gset_true:N \g_@@_aux_found_bool
\use:c { c_@@ _ \int_use:N \g_@@_env_int _ tl }
}
+ { \bool_gset_false:N \g_@@_aux_found_bool }
% \end{macrocode}
% Now, we prepare the token list for the instructions that we will have to write
% on the |aux| file at the end of the environment.
@@ -4358,7 +4460,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\int_compare:nNnT \l_@@_first_col_int = 0
{
- \skip_horizontal:N \col@sep
+ % \skip_horizontal:N \col@sep % 05-08-23
\skip_horizontal:N \g_@@_width_first_col_dim
}
% \end{macrocode}
@@ -4466,7 +4568,7 @@ version 2005/12/01 or later.
\bool_if:NT \g_@@_last_col_found_bool
{
\skip_horizontal:N \g_@@_width_last_col_dim
- \skip_horizontal:N \col@sep
+ % \skip_horizontal:N \col@sep % 2023-08-05
}
\bool_if:NT \l_@@_preamble_bool
{
@@ -4498,7 +4600,7 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
- \bool_if:NT \c_@@_footnote_bool \endsavenotes
+ \bool_if:NT \g_@@_footnote_bool \endsavenotes
}
% \end{macrocode}
% This is the end of the environment |{NiceArrayWithDelims}|.
@@ -4652,7 +4754,8 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_new_protected:Npn \@@_transform_preamble_ii:
{
-%
+% \end{macrocode}
+%
% \medskip
% If there was delimiters at the beginning or at the end of the preamble, the
% environment |{NiceArray}| is transformed into an environment |{xNiceMatrix}|.
@@ -6030,8 +6133,11 @@ version 2005/12/01 or later.
% \begin{macrocode}
\bool_if:NT \l_@@_NiceMatrix_without_vlines_bool
{
- \box_set_wd:Nn \l_@@_the_array_box
- { \box_wd:N \l_@@_the_array_box - \arraycolsep }
+ \int_compare:nNnT \c@jCol > 1 % added 2023-08-13
+ {
+ \box_set_wd:Nn \l_@@_the_array_box
+ { \box_wd:N \l_@@_the_array_box - \arraycolsep }
+ }
}
% \end{macrocode}
% We need a |{minipage}| because we will insert a LaTeX list for the tabular
@@ -7211,6 +7317,9 @@ version 2005/12/01 or later.
% \section{After the construction of the array}
%
% \bigskip
+% The following command will be used when the key |rounded-corners| is in force
+% (this is the key |rounded-corners| for the whole environment and \emph{not}
+% the key |rounded-corners| of a command |\Block|).
% \begin{macrocode}
\cs_new_protected:Npn \@@_deal_with_rounded_corners:
{
@@ -7223,9 +7332,11 @@ version 2005/12/01 or later.
}
{
\bool_set_true:N \l_@@_except_borders_bool
+ \clist_if_empty:NF \l_@@_corners_clist
+ { \@@_error:n { hvlines,~rounded-corners~and~corners } }
\tl_gput_right:Nn \g_@@_pre_code_after_tl
{
- \_@@_stroke_block:nnn
+ \@@_stroke_block:nnn
{
rounded-corners = \dim_use:N \l_@@_tab_rounded_corners_dim ,
draw = \l_@@_rules_color_tl
@@ -7235,6 +7346,7 @@ version 2005/12/01 or later.
}
}
}
+% \end{macrocode}
%
%
% \medskip
@@ -7950,6 +8062,25 @@ version 2005/12/01 or later.
}
}
% \end{macrocode}
+%
+% \medskip
+% If the final user uses the key |xdots/shorten| in |\NiceMatrixOptions| or at the
+% level of an environment (such as |{pNiceMatrix}|, etc.), only the so called
+% ``closed extremities'' will be shortened by that key. The following command
+% will be used \emph{after} the detection of the extremities of a dotted line
+% (hence at a time when we known wheter the extremities are closed or open) but
+% before the analyse of the keys of the individual command |\Cdots|, |\Vdots|.
+% Hence, the keys |shorten|, |shorten-start| and |shorten-end| of that
+% individual command will be applied.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_open_shorten:
+ {
+ \bool_if:NT \l_@@_initial_open_bool
+ { \dim_zero:N \l_@@_xdots_shorten_start_dim }
+ \bool_if:NT \l_@@_final_open_bool
+ { \dim_zero:N \l_@@_xdots_shorten_end_dim }
+ }
+% \end{macrocode}
%
% \medskip
% The following commmand (\emph{when it will be written}) will set the four
@@ -8050,7 +8181,7 @@ version 2005/12/01 or later.
}
}
% \end{macrocode}
-% If, in fact, all the cells of the columns are empty (no PGF/Tikz nodes in
+% If, in fact, all the cells of the column are empty (no PGF/Tikz nodes in
% those cells).
% \begin{macrocode}
\dim_compare:nNnT \l_@@_x_initial_dim = \c_max_dim
@@ -8109,6 +8240,7 @@ version 2005/12/01 or later.
% of the line.
% \begin{macrocode}
\group_begin:
+ \@@_open_shorten:
\int_compare:nNnTF { #1 } = 0
{ \color { nicematrix-first-row } }
{
@@ -8159,12 +8291,30 @@ version 2005/12/01 or later.
}
{ \@@_set_final_coords_from_anchor:n { base~west } }
% \end{macrocode}
+% Now the case of a |\Hdotsfor| (or when there is only a |\Ldots|) in the ``last
+% row'' (that case will probably arise when the final user draws an arrow to
+% indicate the number of columns of the matrix). In the ``first row'', we don't
+% need any adjustment.
+% \begin{macrocode}
+ \bool_lazy_all:nTF
+ {
+ \l_@@_initial_open_bool
+ \l_@@_final_open_bool
+ { \int_compare_p:nNn \l_@@_initial_i_int = \l_@@_last_row_int }
+ }
+ {
+ \dim_add:Nn \l_@@_y_initial_dim \c_@@_shift_Ldots_last_row_dim
+ \dim_add:Nn \l_@@_y_final_dim \c_@@_shift_Ldots_last_row_dim
+ }
+% \end{macrocode}
% We raise the line of a quantity equal to the radius of the dots because we
% want the dots really ``on'' the line of texte. Of course, maybe we should not
% do that when the option |line-style| is used (?).
% \begin{macrocode}
- \dim_add:Nn \l_@@_y_initial_dim \l_@@_xdots_radius_dim
- \dim_add:Nn \l_@@_y_final_dim \l_@@_xdots_radius_dim
+ {
+ \dim_add:Nn \l_@@_y_initial_dim \l_@@_xdots_radius_dim
+ \dim_add:Nn \l_@@_y_final_dim \l_@@_xdots_radius_dim
+ }
\@@_draw_line:
}
% \end{macrocode}
@@ -8185,6 +8335,7 @@ version 2005/12/01 or later.
% of the line.
% \begin{macrocode}
\group_begin:
+ \@@_open_shorten:
\int_compare:nNnTF { #1 } = 0
{ \color { nicematrix-first-row } }
{
@@ -8248,15 +8399,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_new_protected:Npn \@@_open_y_initial_dim:
{
- \@@_qpoint:n { row - \int_use:N \l_@@_initial_i_int - base }
- \dim_set:Nn \l_@@_y_initial_dim
- {
- \fp_to_dim:n
- {
- \pgf@y
- + ( \box_ht:N \strutbox + \extrarowheight ) * \arraystretch
- }
- } % modified 6.13c
+ \dim_set:Nn \l_@@_y_initial_dim { - \c_max_dim }
\int_step_inline:nnn \l_@@_first_col_int \g_@@_col_total_int
{
\cs_if_exist:cT
@@ -8269,6 +8412,19 @@ version 2005/12/01 or later.
{ \dim_max:nn \l_@@_y_initial_dim \pgf@y }
}
}
+ % modified 2023-08-10
+ \dim_compare:nNnT \l_@@_y_initial_dim = { - \c_max_dim }
+ {
+ \@@_qpoint:n { row - \int_use:N \l_@@_initial_i_int - base }
+ \dim_set:Nn \l_@@_y_initial_dim
+ {
+ \fp_to_dim:n
+ {
+ \pgf@y
+ + ( \box_ht:N \strutbox + \extrarowheight ) * \arraystretch
+ }
+ }
+ }
}
% \end{macrocode}
%
@@ -8276,10 +8432,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_new_protected:Npn \@@_open_y_final_dim:
{
- \@@_qpoint:n { row - \int_use:N \l_@@_final_i_int - base }
- \dim_set:Nn \l_@@_y_final_dim
- { \fp_to_dim:n { \pgf@y - ( \box_dp:N \strutbox ) * \arraystretch } }
- % modified 6.13c
+ \dim_set_eq:NN \l_@@_y_final_dim \c_max_dim
\int_step_inline:nnn \l_@@_first_col_int \g_@@_col_total_int
{
\cs_if_exist:cT
@@ -8292,6 +8445,13 @@ version 2005/12/01 or later.
{ \dim_min:nn \l_@@_y_final_dim \pgf@y }
}
}
+ % modified 2023-08-10
+ \dim_compare:nNnT \l_@@_y_final_dim = \c_max_dim
+ {
+ \@@_qpoint:n { row - \int_use:N \l_@@_final_i_int - base }
+ \dim_set:Nn \l_@@_y_final_dim
+ { \fp_to_dim:n { \pgf@y - ( \box_dp:N \strutbox ) * \arraystretch } }
+ }
}
% \end{macrocode}
%
@@ -8310,6 +8470,7 @@ version 2005/12/01 or later.
% of the line.
% \begin{macrocode}
\group_begin:
+ \@@_open_shorten:
\int_compare:nNnTF { #2 } = 0
{ \color { nicematrix-first-col } }
{
@@ -8341,80 +8502,112 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_actually_draw_Vdots:
{
% \end{macrocode}
-% The boolean |\l_tmpa_bool| indicates whether the column is of type |l| or may
-% be considered as if.
-% \begin{macrocode}
- \bool_set_false:N \l_tmpa_bool
+%
+% First, the case of a dotted line open on both sides.
+% \begin{macrocode}
+ \bool_lazy_and:nnTF \l_@@_initial_open_bool \l_@@_final_open_bool
% \end{macrocode}
-% First the case when the line is closed on both ends.
+%
+% We have to determine the $x$-value of the vertical rule that we will have
+% to draw.
% \begin{macrocode}
- \bool_lazy_or:nnF \l_@@_initial_open_bool \l_@@_final_open_bool
{
- \@@_set_initial_coords_from_anchor:n { south~west }
- \@@_set_final_coords_from_anchor:n { north~west }
- \bool_set:Nn \l_tmpa_bool
- { \dim_compare_p:nNn \l_@@_x_initial_dim = \l_@@_x_final_dim }
- }
+ \@@_open_y_initial_dim:
+ \@@_open_y_final_dim:
+ \int_compare:nNnTF \l_@@_initial_j_int = \c_zero_int
% \end{macrocode}
-% Now, we try to determine whether the column is of type |c| or may be
-% considered as if.
+% We have a dotted line open on both sides in the ``first column''.
% \begin{macrocode}
- \bool_if:NTF \l_@@_initial_open_bool
- \@@_open_y_initial_dim:
- { \@@_set_initial_coords_from_anchor:n { south } }
- \bool_if:NTF \l_@@_final_open_bool
- \@@_open_y_final_dim:
- { \@@_set_final_coords_from_anchor:n { north } }
- \bool_if:NTF \l_@@_initial_open_bool
- {
- \bool_if:NTF \l_@@_final_open_bool
{
- \@@_qpoint:n { col - \int_use:N \l_@@_initial_j_int }
- \dim_set_eq:NN \l_tmpa_dim \pgf@x
- \@@_qpoint:n { col - \int_eval:n { \l_@@_initial_j_int + 1 } }
- \dim_set:Nn \l_@@_x_initial_dim { ( \pgf@x + \l_tmpa_dim ) / 2 }
- \dim_set_eq:NN \l_@@_x_final_dim \l_@@_x_initial_dim
-% \end{macrocode}
-% We may think that the final user won't use a ``last column'' which contains
-% only a command |\Vdots|. However, if the |\Vdots| is in fact used to draw, not
-% a dotted line, but an arrow (to indicate the number of rows of the matrix), it
-% may be really encountered. That's why we do an adjustemnt for that case.
-% \begin{macrocode}
- \int_compare:nNnT \l_@@_last_col_int > { -2 }
+ \@@_qpoint:n { col - 1 }
+ \dim_set_eq:NN \l_@@_x_initial_dim \pgf@x
+ \dim_sub:Nn \l_@@_x_initial_dim \l_@@_left_margin_dim
+ \dim_sub:Nn \l_@@_x_initial_dim \l_@@_extra_left_margin_dim
+ % \bool_if:NT \g_@@_delims_bool
+ % {
+ \dim_sub:Nn \l_@@_x_initial_dim \c_@@_shift_exterior_Vdots_dim
+ % }
+ }
+ {
+ \bool_lazy_and:nnTF
+ { \int_compare_p:nNn \l_@@_last_col_int > { -2 } }
+ { \int_compare_p:nNn \l_@@_initial_j_int = \g_@@_col_total_int }
+% \end{macrocode}
+% We have a dotted line open on both sides in the ``last column''.
+% \begin{macrocode}
{
- \int_compare:nNnT \l_@@_initial_j_int = \g_@@_col_total_int
- {
- \dim_set:Nn \l_tmpa_dim
- {
- \l_@@_right_margin_dim + \l_@@_extra_right_margin_dim
- + 2 mm
- }
- \dim_add:Nn \l_@@_x_initial_dim \l_tmpa_dim
- \dim_add:Nn \l_@@_x_final_dim \l_tmpa_dim
- }
+ \@@_qpoint:n { col - \int_use:N \l_@@_initial_j_int }
+ \dim_set_eq:NN \l_@@_x_initial_dim \pgf@x
+ \dim_add:Nn \l_@@_x_initial_dim \l_@@_right_margin_dim
+ \dim_add:Nn \l_@@_x_initial_dim \l_@@_extra_right_margin_dim
+ % \bool_if:NT \g_@@_delims_bool
+ % {
+ \dim_add:Nn
+ \l_@@_x_initial_dim
+ \c_@@_shift_exterior_Vdots_dim
+ % }
}
+% \end{macrocode}
+% We have a dotted line open on both sides which is \emph{not} in an exterior column.
+% \begin{macrocode}
+ {
+ \@@_qpoint:n { col - \int_use:N \l_@@_initial_j_int }
+ \dim_set_eq:NN \l_tmpa_dim \pgf@x
+ \@@_qpoint:n { col - \int_eval:n { \l_@@_initial_j_int + 1 } }
+ \dim_set:Nn \l_@@_x_initial_dim { ( \pgf@x + \l_tmpa_dim ) / 2 }
+ }
}
- { \dim_set_eq:NN \l_@@_x_initial_dim \l_@@_x_final_dim }
}
+% \end{macrocode}
+%
+% Now, the dotted line is \emph{not} open on both sides (maybe open on only one side).
+%
+% The boolean |\l_tmpa_bool| will indicate whether the column is of type |l| or
+% may be considered as if.
+% \begin{macrocode}
{
- \bool_if:NTF \l_@@_final_open_bool
- { \dim_set_eq:NN \l_@@_x_final_dim \l_@@_x_initial_dim }
+ \bool_set_false:N \l_tmpa_bool
+ \bool_lazy_and:nnT
+ { ! \l_@@_initial_open_bool }
+ { ! \l_@@_final_open_bool }
{
+ \@@_set_initial_coords_from_anchor:n { south~west }
+ \@@_set_final_coords_from_anchor:n { north~west }
+ \bool_set:Nn \l_tmpa_bool
+ { \dim_compare_p:nNn \l_@@_x_initial_dim = \l_@@_x_final_dim }
+ }
+% \end{macrocode}
+% Now, we try to determine whether the column is of type |c| or may be
+% considered as if.
+% \begin{macrocode}
+ \bool_if:NTF \l_@@_initial_open_bool
+ {
+ \@@_open_y_initial_dim:
+ \@@_set_final_coords_from_anchor:n { north }
+ \dim_set_eq:NN \l_@@_x_initial_dim \l_@@_x_final_dim
+ }
+ {
+ \@@_set_initial_coords_from_anchor:n { south }
+ \bool_if:NTF \l_@@_final_open_bool
+ \@@_open_y_final_dim:
% \end{macrocode}
% Now the case where both extremities are closed. The first conditional tests
% whether the column is of type |c| or may be considered as if.
% \begin{macrocode}
- \dim_compare:nNnF \l_@@_x_initial_dim = \l_@@_x_final_dim
{
- \dim_set:Nn \l_@@_x_initial_dim
+ \@@_set_final_coords_from_anchor:n { north }
+ \dim_compare:nNnF \l_@@_x_initial_dim = \l_@@_x_final_dim
{
- \bool_if:NTF \l_tmpa_bool \dim_min:nn \dim_max:nn
- \l_@@_x_initial_dim \l_@@_x_final_dim
+ \dim_set:Nn \l_@@_x_initial_dim
+ {
+ \bool_if:NTF \l_tmpa_bool \dim_min:nn \dim_max:nn
+ \l_@@_x_initial_dim \l_@@_x_final_dim
+ }
}
- \dim_set_eq:NN \l_@@_x_final_dim \l_@@_x_initial_dim
- }
- }
+ }
+ }
}
+ \dim_set_eq:NN \l_@@_x_final_dim \l_@@_x_initial_dim
\@@_draw_line:
}
% \end{macrocode}
@@ -8439,6 +8632,7 @@ version 2005/12/01 or later.
% of the line.
% \begin{macrocode}
\group_begin:
+ \@@_open_shorten:
\keys_set:nn { NiceMatrix / xdots } { #3 }
\tl_if_empty:VF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } }
\@@_actually_draw_Ddots:
@@ -8533,6 +8727,7 @@ version 2005/12/01 or later.
% of the line.
% \begin{macrocode}
\group_begin:
+ \@@_open_shorten:
\keys_set:nn { NiceMatrix / xdots } { #3 }
\tl_if_empty:VF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } }
\@@_actually_draw_Iddots:
@@ -8639,18 +8834,19 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_new_protected:Npn \@@_draw_unstandard_dotted_line:n #1
{
- \@@_draw_unstandard_dotted_line:nVV
+ \@@_draw_unstandard_dotted_line:nVVV
{ #1 }
\l_@@_xdots_up_tl
\l_@@_xdots_down_tl
+ \l_@@_xdots_middle_tl
}
\cs_generate_variant:Nn \@@_draw_unstandard_dotted_line:n { o }
% \end{macrocode}
%
%
% \bigskip
-% The following Tikz styles are for both labels (set by the symbols |_| and |^|)
-% of a continous line with a non-standard style.
+% The following Tikz styles are for the three labels (set by the symbols |_|,
+% |^| and |=|) of a continous line with a non-standard style.
% \begin{macrocode}
\hook_gput_code:nnn { begindocument } { . }
{
@@ -8659,7 +8855,12 @@ version 2005/12/01 or later.
\tikzset
{
@@_node_above / .style = { sloped , above } ,
- @@_node_below / .style = { sloped , below }
+ @@_node_below / .style = { sloped , below } ,
+ @@_node_middle / .style =
+ {
+ sloped ,
+ inner~sep = \c_@@_innersep_middle_dim
+ }
}
}
{ }
@@ -8668,91 +8869,103 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
-\cs_new_protected:Npn \@@_draw_unstandard_dotted_line:nnn #1 #2 #3
+\cs_new_protected:Npn \@@_draw_unstandard_dotted_line:nnnn #1 #2 #3 #4
{
+% \end{macrocode}
+% We take into account the parameters |xdots/shorten-start| and
+% |xdots/shorten-end| ``by hand'' because, when we use the key |shorten >| and
+% |shorten <| of TikZ in the command |\draw|, we don't have the expected output
+% with |{decorate,decoration=brace}| is used.
+%
+% \medskip
+% The dimension |\l_@@_l_dim| is the length $\ell$ of the line to draw. We use
+% the floating point reals of the L3 programming layer to compute this length.
+% \begin{macrocode}
+ \dim_zero_new:N \l_@@_l_dim
+ \dim_set:Nn \l_@@_l_dim
+ {
+ \fp_to_dim:n
+ {
+ sqrt
+ (
+ ( \l_@@_x_final_dim - \l_@@_x_initial_dim ) ^ 2
+ +
+ ( \l_@@_y_final_dim - \l_@@_y_initial_dim ) ^ 2
+ )
+ }
+ }
+ \bool_lazy_and:nnT % security
+ { \dim_compare_p:nNn { \dim_abs:n \l_@@_l_dim } < \c_@@_max_l_dim }
+ { \dim_compare_p:nNn { \dim_abs:n \l_@@_l_dim } > { 1 pt } }
+ {
+ \dim_set:Nn \l_tmpa_dim
+ {
+ \l_@@_x_initial_dim
+ + ( \l_@@_x_final_dim - \l_@@_x_initial_dim )
+ * \dim_ratio:nn \l_@@_xdots_shorten_start_dim \l_@@_l_dim
+ }
+ \dim_set:Nn \l_tmpb_dim
+ {
+ \l_@@_y_initial_dim
+ + ( \l_@@_y_final_dim - \l_@@_y_initial_dim )
+ * \dim_ratio:nn \l_@@_xdots_shorten_start_dim \l_@@_l_dim
+ }
+ \dim_set:Nn \l_@@_tmpc_dim
+ {
+ \l_@@_x_final_dim
+ - ( \l_@@_x_final_dim - \l_@@_x_initial_dim )
+ * \dim_ratio:nn \l_@@_xdots_shorten_end_dim \l_@@_l_dim
+ }
+ \dim_set:Nn \l_@@_tmpd_dim
+ {
+ \l_@@_y_final_dim
+ - ( \l_@@_y_final_dim - \l_@@_y_initial_dim )
+ * \dim_ratio:nn \l_@@_xdots_shorten_end_dim \l_@@_l_dim
+ }
+ \dim_set_eq:NN \l_@@_x_initial_dim \l_tmpa_dim
+ \dim_set_eq:NN \l_@@_y_initial_dim \l_tmpb_dim
+ \dim_set_eq:NN \l_@@_x_final_dim \l_@@_tmpc_dim
+ \dim_set_eq:NN \l_@@_y_final_dim \l_@@_tmpd_dim
+ }
+% \end{macrocode}
+%
+%
+% If the key |xdots/horizontal-labels| has been used.
+% \begin{macrocode}
\bool_if:NT \l_@@_xdots_h_labels_bool
{
\tikzset
{
@@_node_above / .style = { auto = left } ,
- @@_node_below / .style = { auto = right }
+ @@_node_below / .style = { auto = right } ,
+ @@_node_middle / .style = { inner~sep = \c_@@_innersep_middle_dim }
}
}
+ \tl_if_empty:nF { #4 }
+ { \tikzset { @@_node_middle / .append~style = { fill = white } } }
\draw
- [
- shorten~> = \l_@@_xdots_shorten_end_dim ,
- shorten~< = \l_@@_xdots_shorten_start_dim ,
- #1
- ]
+ [ #1 ]
( \l_@@_x_initial_dim , \l_@@_y_initial_dim )
% \end{macrocode}
% Be careful: We can't put |\c_math_toggle_token| instead of |$| in the
% following lines because we are in the contents of Tikz nodes (and they will be
% \emph{rescanned} if the Tikz library \pkg{babel} is loaded).
% \begin{macrocode}
- -- node [ @@_node_above ] { $ \scriptstyle #2 $ }
+ -- node [ @@_node_middle] { $ \scriptstyle #4 $ }
node [ @@_node_below ] { $ \scriptstyle #3 $ }
+ node [ @@_node_above ] { $ \scriptstyle #2 $ }
( \l_@@_x_final_dim , \l_@@_y_final_dim ) ;
\end { scope }
}
-\cs_generate_variant:Nn \@@_draw_unstandard_dotted_line:nnn { n V V }
+\cs_generate_variant:Nn \@@_draw_unstandard_dotted_line:nnnn { n V V V }
% \end{macrocode}
%
% \bigskip
% The command |\@@_draw_standard_dotted_line:| draws the line with our system of dots
-% (which gives a dotted line with real round dots).
+% (which gives a dotted line with real rounded dots).
% \begin{macrocode}
\cs_new_protected:Npn \@@_draw_standard_dotted_line:
- {
- \bool_lazy_and:nnF
- { \tl_if_empty_p:N \l_@@_xdots_up_tl }
- { \tl_if_empty_p:N \l_@@_xdots_down_tl }
- {
- \pgfscope
- \pgftransformshift
- {
- \pgfpointlineattime { 0.5 }
- { \pgfpoint \l_@@_x_initial_dim \l_@@_y_initial_dim }
- { \pgfpoint \l_@@_x_final_dim \l_@@_y_final_dim }
- }
- \fp_set:Nn \l_tmpa_fp
- {
- atand
- (
- \l_@@_y_final_dim - \l_@@_y_initial_dim ,
- \l_@@_x_final_dim - \l_@@_x_initial_dim
- )
- }
- \pgftransformrotate { \fp_use:N \l_tmpa_fp }
- \bool_if:NF \l_@@_xdots_h_labels_bool { \fp_zero:N \l_tmpa_fp }
- \pgfnode
- { rectangle }
- { south }
- {
- \rotatebox { \fp_eval:n { - \l_tmpa_fp } }
- {
- \c_math_toggle_token
- \scriptstyle \l_@@_xdots_up_tl
- \c_math_toggle_token
- }
- }
- { }
- { \pgfusepath { } }
- \pgfnode
- { rectangle }
- { north }
- {
- \rotatebox { \fp_eval:n { - \l_tmpa_fp } }
- {
- \c_math_toggle_token
- \scriptstyle \l_@@_xdots_down_tl
- \c_math_toggle_token
- }
- }
- { }
- { \pgfusepath { } }
- \endpgfscope
- }
+ {
\group_begin:
% \end{macrocode}
% The dimension |\l_@@_l_dim| is the length $\ell$ of the line to draw. We use
@@ -8783,6 +8996,15 @@ version 2005/12/01 or later.
{ \dim_compare_p:nNn \l_@@_l_dim = \c_zero_dim }
\@@_draw_standard_dotted_line_i:
\group_end:
+% \end{macrocode}
+% \begin{macrocode}
+ \bool_lazy_all:nF
+ {
+ { \tl_if_empty_p:N \l_@@_xdots_up_tl }
+ { \tl_if_empty_p:N \l_@@_xdots_down_tl }
+ { \tl_if_empty_p:N \l_@@_xdots_middle_tl }
+ }
+ \l_@@_labels_standard_dotted_line:
}
% \end{macrocode}
%
@@ -8796,43 +9018,15 @@ version 2005/12/01 or later.
% \end{macrocode}
% The number of dots will be |\l_tmpa_int + 1|.
% \begin{macrocode}
- \bool_if:NTF \l_@@_initial_open_bool
- {
- \bool_if:NTF \l_@@_final_open_bool
- {
- \int_set:Nn \l_tmpa_int
- { \dim_ratio:nn \l_@@_l_dim \l_@@_xdots_inter_dim }
- }
- {
- \int_set:Nn \l_tmpa_int
- {
- \dim_ratio:nn
- { \l_@@_l_dim - \l_@@_xdots_shorten_start_dim }
- \l_@@_xdots_inter_dim
- }
- }
- }
+ \int_set:Nn \l_tmpa_int
{
- \bool_if:NTF \l_@@_final_open_bool
+ \dim_ratio:nn
{
- \int_set:Nn \l_tmpa_int
- {
- \dim_ratio:nn
- { \l_@@_l_dim - \l_@@_xdots_shorten_end_dim }
- \l_@@_xdots_inter_dim
- }
- }
- {
- \int_set:Nn \l_tmpa_int
- {
- \dim_ratio:nn
- {
- \l_@@_l_dim
- - \l_@@_xdots_shorten_start_dim - \l_@@_xdots_shorten_end_dim
- }
- \l_@@_xdots_inter_dim
- }
- }
+ \l_@@_l_dim
+ - \l_@@_xdots_shorten_start_dim
+ - \l_@@_xdots_shorten_end_dim
+ }
+ \l_@@_xdots_inter_dim
}
% \end{macrocode}
%
@@ -8873,7 +9067,7 @@ version 2005/12/01 or later.
\dim_ratio:nn
{
\l_@@_l_dim - \l_@@_xdots_inter_dim * \l_tmpa_int
- + \l_@@_xdots_shorten_start_dim - \l_@@_xdots_shorten_end_dim
+ + \l_@@_xdots_shorten_start_dim - \l_@@_xdots_shorten_end_dim
}
{ 2 \l_@@_l_dim }
}
@@ -8891,6 +9085,85 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \l_@@_labels_standard_dotted_line:
+ {
+ \pgfscope
+ \pgftransformshift
+ {
+ \pgfpointlineattime { 0.5 }
+ { \pgfpoint \l_@@_x_initial_dim \l_@@_y_initial_dim }
+ { \pgfpoint \l_@@_x_final_dim \l_@@_y_final_dim }
+ }
+ \fp_set:Nn \l_tmpa_fp
+ {
+ atand
+ (
+ \l_@@_y_final_dim - \l_@@_y_initial_dim ,
+ \l_@@_x_final_dim - \l_@@_x_initial_dim
+ )
+ }
+ \pgftransformrotate { \fp_use:N \l_tmpa_fp }
+ \bool_if:NF \l_@@_xdots_h_labels_bool { \fp_zero:N \l_tmpa_fp }
+ \tl_if_empty:NF \l_@@_xdots_middle_tl
+ {
+ \begin { pgfscope }
+ \pgfset { inner~sep = \c_@@_innersep_middle_dim }
+ \pgfnode
+ { rectangle }
+ { center }
+ {
+ \rotatebox { \fp_eval:n { - \l_tmpa_fp } }
+ {
+ \c_math_toggle_token
+ \scriptstyle \l_@@_xdots_middle_tl
+ \c_math_toggle_token
+ }
+ }
+ { }
+ {
+ \pgfsetfillcolor { white }
+ \pgfusepath { fill }
+ }
+ \end { pgfscope }
+ }
+ \tl_if_empty:NF \l_@@_xdots_up_tl
+ {
+ \pgfnode
+ { rectangle }
+ { south }
+ {
+ \rotatebox { \fp_eval:n { - \l_tmpa_fp } }
+ {
+ \c_math_toggle_token
+ \scriptstyle \l_@@_xdots_up_tl
+ \c_math_toggle_token
+ }
+ }
+ { }
+ { \pgfusepath { } }
+ }
+ \tl_if_empty:NF \l_@@_xdots_down_tl
+ {
+ \pgfnode
+ { rectangle }
+ { north }
+ {
+ \rotatebox { \fp_eval:n { - \l_tmpa_fp } }
+ {
+ \c_math_toggle_token
+ \scriptstyle \l_@@_xdots_down_tl
+ \c_math_toggle_token
+ }
+ }
+ { }
+ { \pgfusepath { } }
+ }
+ \endpgfscope
+ }
+% \end{macrocode}
+%
+% \bigskip
% \section{User commands available in the new environments}
%
%
@@ -8912,9 +9185,11 @@ version 2005/12/01 or later.
% \begin{macrocode}
\hook_gput_code:nnn { begindocument } { . }
{
- \tl_set:Nn \l_@@_argspec_tl { O { } E { _ ^ } { { } { } } }
+ \tl_set:Nn \l_@@_argspec_tl { m E { _ ^ : } { { } { } { } } }
\tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl
- \exp_args:NNV \NewDocumentCommand \@@_Ldots \l_@@_argspec_tl
+ \cs_new_protected:Npn \@@_Ldots
+ { \@@_collect_options:n { \@@_Ldots_i } }
+ \exp_args:NNV \NewDocumentCommand \@@_Ldots_i \l_@@_argspec_tl
{
\int_compare:nNnTF \c@jCol = 0
{ \@@_error:nn { in~first~col } \Ldots }
@@ -8923,7 +9198,7 @@ version 2005/12/01 or later.
{ \@@_error:nn { in~last~col } \Ldots }
{
\@@_instruction_of_type:nnn \c_false_bool { Ldots }
- { #1 , down = #2 , up = #3 }
+ { #1 , down = #2 , up = #3 , middle = #4 }
}
}
\bool_if:NF \l_@@_nullify_dots_bool
@@ -8934,7 +9209,9 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
- \exp_args:NNV \NewDocumentCommand \@@_Cdots \l_@@_argspec_tl
+ \cs_new_protected:Npn \@@_Cdots
+ { \@@_collect_options:n { \@@_Cdots_i } }
+ \exp_args:NNV \NewDocumentCommand \@@_Cdots_i \l_@@_argspec_tl
{
\int_compare:nNnTF \c@jCol = 0
{ \@@_error:nn { in~first~col } \Cdots }
@@ -8943,7 +9220,7 @@ version 2005/12/01 or later.
{ \@@_error:nn { in~last~col } \Cdots }
{
\@@_instruction_of_type:nnn \c_false_bool { Cdots }
- { #1 , down = #2 , up = #3 }
+ { #1 , down = #2 , up = #3 , middle = #4 }
}
}
\bool_if:NF \l_@@_nullify_dots_bool
@@ -8954,7 +9231,9 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
- \exp_args:NNV \NewDocumentCommand \@@_Vdots \l_@@_argspec_tl
+ \cs_new_protected:Npn \@@_Vdots
+ { \@@_collect_options:n { \@@_Vdots_i } }
+ \exp_args:NNV \NewDocumentCommand \@@_Vdots_i \l_@@_argspec_tl
{
\int_compare:nNnTF \c@iRow = 0
{ \@@_error:nn { in~first~row } \Vdots }
@@ -8963,7 +9242,7 @@ version 2005/12/01 or later.
{ \@@_error:nn { in~last~row } \Vdots }
{
\@@_instruction_of_type:nnn \c_false_bool { Vdots }
- { #1 , down = #2 , up = #3 }
+ { #1 , down = #2 , up = #3 , middle = #4 }
}
}
\bool_if:NF \l_@@_nullify_dots_bool
@@ -8975,7 +9254,9 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
- \exp_args:NNV \NewDocumentCommand \@@_Ddots \l_@@_argspec_tl
+ \cs_new_protected:Npn \@@_Ddots
+ { \@@_collect_options:n { \@@_Ddots_i } }
+ \exp_args:NNV \NewDocumentCommand \@@_Ddots_i \l_@@_argspec_tl
{
\int_case:nnF \c@iRow
{
@@ -8991,7 +9272,7 @@ version 2005/12/01 or later.
{
\keys_set_known:nn { NiceMatrix / Ddots } { #1 }
\@@_instruction_of_type:nnn \l_@@_draw_first_bool { Ddots }
- { #1 , down = #2 , up = #3 }
+ { #1 , down = #2 , up = #3 , middle = #4 }
}
}
@@ -9003,7 +9284,9 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
- \exp_args:NNV \NewDocumentCommand \@@_Iddots \l_@@_argspec_tl
+ \cs_new_protected:Npn \@@_Iddots
+ { \@@_collect_options:n { \@@_Iddots_i } }
+ \exp_args:NNV \NewDocumentCommand \@@_Iddots_i \l_@@_argspec_tl
{
\int_case:nnF \c@iRow
{
@@ -9019,7 +9302,7 @@ version 2005/12/01 or later.
{
\keys_set_known:nn { NiceMatrix / Ddots } { #1 }
\@@_instruction_of_type:nnn \l_@@_draw_first_bool { Iddots }
- { #1 , down = #2 , up = #3 }
+ { #1 , down = #2 , up = #3 , middle = #4 }
}
}
\bool_if:NF \l_@@_nullify_dots_bool
@@ -9099,13 +9382,15 @@ version 2005/12/01 or later.
% \begin{macrocode}
\hook_gput_code:nnn { begindocument } { . }
{
- \tl_set:Nn \l_@@_argspec_tl { O { } m O { } E { _ ^ } { { } { } } }
+ \tl_set:Nn \l_@@_argspec_tl { m m O { } E { _ ^ : } { { } { } { } } }
\tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl
% \end{macrocode}
% We don't put |!| before the last optionnal argument for homogeneity with
% |\Cdots|, etc. which have only one optional argument.
% \begin{macrocode}
- \exp_args:NNV \NewDocumentCommand \@@_Hdotsfor_i \l_@@_argspec_tl
+ \cs_new_protected:Npn \@@_Hdotsfor_i
+ { \@@_collect_options:n { \@@_Hdotsfor_ii } }
+ \exp_args:NNV \NewDocumentCommand \@@_Hdotsfor_ii \l_@@_argspec_tl
{
\tl_gput_right:Nx \g_@@_HVdotsfor_lines_tl
{
@@ -9116,7 +9401,8 @@ version 2005/12/01 or later.
{
#1 , #3 ,
down = \exp_not:n { #4 } ,
- up = \exp_not:n { #5 }
+ up = \exp_not:n { #5 } ,
+ middle = \exp_not:n { #6 }
}
}
\prg_replicate:nn { #2 - 1 } { & \multicolumn { 1 } { c } { } }
@@ -9178,12 +9464,17 @@ version 2005/12/01 or later.
%
% \begin{macrocode}
\group_begin:
+
+ \@@_open_shorten:
+
+
\int_compare:nNnTF { #1 } = 0
{ \color { nicematrix-first-row } }
{
\int_compare:nNnT { #1 } = \g_@@_row_total_int
{ \color { nicematrix-last-row } }
}
+
\keys_set:nn { NiceMatrix / xdots } { #4 }
\tl_if_empty:VF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } }
\@@_actually_draw_Ldots:
@@ -9205,9 +9496,11 @@ version 2005/12/01 or later.
% \begin{macrocode}
\hook_gput_code:nnn { begindocument } { . }
{
- \tl_set:Nn \l_@@_argspec_tl { O { } m O { } E { _ ^ } { { } { } } }
+ \tl_set:Nn \l_@@_argspec_tl { m m O { } E { _ ^ : } { { } { } { } } }
\tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl
- \exp_args:NNV \NewDocumentCommand \@@_Vdotsfor: \l_@@_argspec_tl
+ \cs_new_protected:Npn \@@_Vdotsfor:
+ { \@@_collect_options:n { \@@_Vdotsfor_i } }
+ \exp_args:NNV \NewDocumentCommand \@@_Vdotsfor_i \l_@@_argspec_tl
{
\bool_gset_true:N \g_@@_empty_cell_bool
\tl_gput_right:Nx \g_@@_HVdotsfor_lines_tl
@@ -9218,14 +9511,16 @@ version 2005/12/01 or later.
{ #2 }
{
#1 , #3 ,
- down = \exp_not:n { #4 } , up = \exp_not:n { #5 }
+ down = \exp_not:n { #4 } ,
+ up = \exp_not:n { #5 } ,
+ middle = \exp_not:n { #6 }
}
}
}
}
% \end{macrocode}
-% Enf of |\AddToHook|.
%
+% \bigskip
% \begin{macrocode}
\cs_new_protected:Npn \@@_Vdotsfor:nnnn #1 #2 #3 #4
{
@@ -9279,6 +9574,11 @@ version 2005/12/01 or later.
%
% \begin{macrocode}
\group_begin:
+ \@@_open_shorten:
+
+
+
+
\int_compare:nNnTF { #2 } = 0
{ \color { nicematrix-first-col } }
{
@@ -9309,8 +9609,11 @@ version 2005/12/01 or later.
% \begin{macrocode}
\NewDocumentCommand \@@_rotate: { O { } }
{
- \bool_gset_true:N \g_@@_rotate_bool
- \keys_set:nn { NiceMatrix / rotate } { #1 }
+ \peek_remove_spaces:n
+ {
+ \bool_gset_true:N \g_@@_rotate_bool
+ \keys_set:nn { NiceMatrix / rotate } { #1 }
+ }
}
% \end{macrocode}
%
@@ -9364,7 +9667,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\hook_gput_code:nnn { begindocument } { . }
{
- \tl_set:Nn \l_@@_argspec_tl { O { } m m ! O { } E { _ ^ } { { } { } } }
+ \tl_set:Nn \l_@@_argspec_tl { O { } m m ! O { } E { _ ^ : } { { } { } { } } }
\tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl
\exp_args:NNV \NewDocumentCommand \@@_line \l_@@_argspec_tl
{
@@ -9659,28 +9962,23 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% The macro |\@@_actually_color:| will actually fill all the rectangles, color by
-% color (using the sequence |\l_@@_colors_seq| and all the token lists of the
-% form |\l_@@_color_|$i$|_tl|).
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_actually_color:
- {
- \pgfpicture
- \pgf@relevantforpicturesizefalse
-% \end{macrocode}
-% If the final user has used the key |rounded-corners| for the environment
-% |{NiceTabular}|, we will clip to a rectangle with rounded corners before
-% filling the rectangles.
+% The following command must be used within a |\pgfpicture|.
% \begin{macrocode}
+\cs_new_protected:Npn \@@_clip_with_rounded_corners:
+ {
\dim_compare:nNnT \l_@@_tab_rounded_corners_dim > \c_zero_dim
{
+% \end{macrocode}
+% The TeX group is for |\pgfsetcornersarced| (whose scope is the TeX scope).
+% \begin{macrocode}
+ \group_begin:
\pgfsetcornersarced
{
\pgfpoint
{ \l_@@_tab_rounded_corners_dim }
{ \l_@@_tab_rounded_corners_dim }
}
-% \end{macrococde}
+% \end{macrocode}
% Because we want \pkg{nicematrix} compatible with arrays constructed by
% \pkg{array}, the nodes for the rows and columns (that is to say the nodes
% |row-|\textsl{i} and |col-|\textsl{j}) have not always the expected position,
@@ -9719,7 +10017,29 @@ version 2005/12/01 or later.
}
}
\pgfusepath { clip }
+ \group_end:
+% \end{macrocode}
+% The TeX group was for |\pgfsetcornersarced|.
+% \begin{macrocode}
}
+ }
+% \end{macrocode}
+%
+% \bigskip
+% The macro |\@@_actually_color:| will actually fill all the rectangles, color by
+% color (using the sequence |\l_@@_colors_seq| and all the token lists of the
+% form |\l_@@_color_|$i$|_tl|).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_actually_color:
+ {
+ \pgfpicture
+ \pgf@relevantforpicturesizefalse
+% \end{macrocode}
+% If the final user has used the key |rounded-corners| for the environment
+% |{NiceTabular}|, we will clip to a rectangle with rounded corners before
+% filling the rectangles.
+% \begin{macrocode}
+ \@@_clip_with_rounded_corners:
\seq_map_indexed_inline:Nn \g_@@_colors_seq
{
\begin { pgfscope }
@@ -9916,11 +10236,12 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \medskip
-% The command |\rowcolors| (accessible in the |code-before|) is inspired by the
+% The command |\rowcolors| (accessible in the |\CodeBefore|) is inspired by the
% command |\rowcolors| of the package \pkg{xcolor} (with the option |table|).
% However, the command |\rowcolors| of \pkg{nicematrix} has \emph{not} the
-% optional argument of the command |\rowcolors| of \pkg{xcolor}. Here is an
-% example: |\rowcolors{1}{blue!10}{}[respect-blocks]|.
+% optional argument of the command |\rowcolors| of \pkg{xcolor}.
+%
+% Here is an example: |\rowcolors{1}{blue!10}{}[respect-blocks]|.
%
% In \pkg{nicematrix}, the commmand |\@@_rowcolors| apperas as a special case of
% |\@@_rowlistcolors|.
@@ -9951,7 +10272,7 @@ version 2005/12/01 or later.
{
% \end{macrocode}
% We don't want to take into account a block which is completely in the ``first
-% column'' of (number $0$) or in the ``last column'' and that's why we filter
+% column'' (number~$0$) or in the ``last column'' and that's why we filter
% the sequence of the blocks (in a the sequence |\l_tmpa_seq|).
% \begin{macrocode}
\seq_set_eq:NN \l_tmpb_seq \g_@@_pos_of_blocks_seq
@@ -10276,7 +10597,8 @@ version 2005/12/01 or later.
\tl_gput_right:Nx \g__nicematrix_pre_code_before_tl
{
\@@_rowlistcolors
- [ #1 ] { \int_use:N \c@iRow } { #2 } [ restart, #3 ]
+ [ #1 ] { \int_use:N \c@iRow } { #2 }
+ [ restart, cols = \int_use:N \c@jCol - , #3 ]
}
}
}
@@ -10806,7 +11128,6 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_new_protected:Npn \@@_hline_ii:
{
- % \bool_set_false:N \l_@@_dotted_bool
\keys_set:nV { NiceMatrix / RulesBis } \l_@@_other_keys_tl
\bool_if:NTF \l_@@_dotted_bool
\@@_hline_iv:
@@ -10989,7 +11310,7 @@ version 2005/12/01 or later.
% \bigskip
% The command |\@@_draw_hlines:| draws all the horizontal rules excepted in the
% blocks (even the virtual blocks determined by commands such as |\Cdots| and in
-% the corners (if the key |corners| is used)).
+% the corners --- if the key |corners| is used).
% \begin{macrocode}
\cs_new_protected:Npn \@@_draw_hlines:
{
@@ -11097,6 +11418,7 @@ version 2005/12/01 or later.
\str_clear_new:N \l_@@_command_str
\str_clear_new:N \l_@@_ccommand_str
\str_clear_new:N \l_@@_letter_str
+ \tl_clear_new:N \l_@@_other_keys_tl
\keys_set_known:nnN { NiceMatrix / custom-line } { #1 } \l_@@_other_keys_tl
% \end{macrocode}
% If the final user only wants to draw horizontal rules, he does not need to
@@ -11277,7 +11599,6 @@ version 2005/12/01 or later.
}
\seq_put_left:NV \l_@@_custom_line_commands_seq \l_@@_command_str
}
-\cs_generate_variant:Nn \@@_h_custom_line:nn { n V }
% \end{macrocode}
%
% \bigskip
@@ -11330,7 +11651,6 @@ version 2005/12/01 or later.
}
}
}
-\cs_generate_variant:Nn \@@_c_custom_line:nn { n V }
% \end{macrocode}
%
% \begin{macrocode}
@@ -11705,6 +12025,7 @@ version 2005/12/01 or later.
}
\iow_shipout:Nn \@mainaux \ExplSyntaxOff
}
+ \ignorespacesafterend
}
% \end{macrocode}
%
@@ -12089,12 +12410,21 @@ version 2005/12/01 or later.
C .value_forbidden:n = true ,
t .code:n = \str_set:Nn \l_@@_vpos_of_block_str t ,
t .value_forbidden:n = true ,
+ T .code:n = \str_set:Nn \l_@@_vpos_of_block_str T ,
+ T .value_forbidden:n = true ,
b .code:n = \str_set:Nn \l_@@_vpos_of_block_str b ,
b .value_forbidden:n = true ,
- color .tl_set:N = \l_@@_color_tl ,
+ B .code:n = \str_set:Nn \l_@@_vpos_of_block_str B ,
+ B .value_forbidden:n = true ,
+ color .code:n =
+ \@@_color:n { #1 }
+ \tl_set_rescan:Nnn
+ \l_@@_draw_tl
+ { \char_set_catcode_other:N ! }
+ { #1 } ,
color .value_required:n = true ,
respect-arraystretch .bool_set:N = \l_@@_respect_arraystretch_bool ,
- respect-arraystretch .default:n = true ,
+ respect-arraystretch .default:n = true
}
% \end{macrocode}
%
@@ -12105,22 +12435,14 @@ version 2005/12/01 or later.
% |<| and |>|. It's mandatory to use an expandable command.
%
%
+%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_block:n #1
- {
- \peek_meaning:NTF [
- { \@@_block_i:n { #1 } }
- { \@@_Block_i:[#1] }
- }
-
-\cs_new_protected:Npn \@@_block_i:n #1[#2] { \@@_block:n {#1,#2} }
-
-\cs_new_protected:Npn \@@_Block: { \@@_block:n { } }
+\cs_new_protected:Npn \@@_Block: { \@@_collect_options:n { \@@_Block_i: } }
% \end{macrocode}
-%
+%
% \bigskip
% \begin{macrocode}
-\NewExpandableDocumentCommand \@@_Block_i: { O { } m D < > { } +m }
+\NewExpandableDocumentCommand \@@_Block_i: { m m D < > { } +m }
{
% \end{macrocode}
% If the first mandatory argument of the command (which is the size of the block
@@ -12160,11 +12482,11 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \medskip
-% Now, the arguments have been extracted: |#1| is $i$ (the number of rows of the
-% block), |#2| is $j$ (the number of columns of the block), |#3| is the list of
-% \textsl{key=values} pairs, |#4| are the tokens to put before the math mode and
-% the beginning of the small array of the block and |#5| is the label of the
-% block.
+% Now, the arguments have been extracted:
+% |#1| is $i$ (the number of rows of the block), |#2| is $j$ (the number of
+% columns of the block), |#3| is the list of \textsl{key=values} pairs, |#4| are
+% the tokens to put before the math mode and before the composition of the block
+% and |#5| is the label (=content) of the block.
% \begin{macrocode}
\cs_new_protected:Npn \@@_Block_ii:nnnnn #1 #2 #3 #4 #5
{
@@ -12261,7 +12583,13 @@ version 2005/12/01 or later.
% right now in a box (because we have to take into account the dimensions of
% that box for the width of the current column or the height and the depth of the
% current row). However, that box will be put in the array \emph{after the
-% construction of the array} (by using \textsc{pgf}).
+% construction of the array} (by using \textsc{pgf}) with |\@@_draw_blocks:| and
+% above all |\@@_Block_v:nnnnnn| which will do the main job.
+%
+% |#1| is $i$ (the number of rows of the block), |#2| is $j$ (the number of
+% columns of the block), |#3| is the list of \textsl{key=values} pairs, |#4| are
+% the tokens to put before the math mode and before the composition of the block
+% and |#5| is the label (=content) of the block.
% \begin{macrocode}
\cs_new_protected:Npn \@@_Block_iv:nnnnn #1 #2 #3 #4 #5
{
@@ -12280,6 +12608,13 @@ version 2005/12/01 or later.
}
\box_gclear_new:c
{ g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
+% \end{macrocode}
+% Now, we will actually compose the content of the |\Block| in a TeX box.
+% \emph{Be careful}: if after, the construction of the box, the boolean
+% |\g_@@_rotate_bool| is raised (which means that the command |\rotate| was
+% present in the content of the |\Block|) we will rotate the box but also,
+% maybe, change the position of the baseline!
+% \begin{macrocode}
\hbox_gset:cn
{ g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
{
@@ -12309,30 +12644,44 @@ version 2005/12/01 or later.
}
\g_@@_row_style_tl
}
- \group_begin:
\bool_if:NF \l_@@_respect_arraystretch_bool
{ \cs_set:Npn \arraystretch { 1 } }
\dim_zero:N \extrarowheight
+% \end{macrocode}
+% |#4| is the optional argument of the command |\Block|, provided with the
+% syntax |<...>|.
+% \begin{macrocode}
#4
% \end{macrocode}
-% If the box is rotated (the key |\rotate| may be in the previous |#4|), the
-% tabular used for the content of the cell will be constructed with a format
-% |c|. In the other cases, the tabular will be constructed with a format equal
-% to the key of position of the box. In other words: the alignment internal to
-% the tabular is the same as the external alignment of the tabular (that is to
-% say the position of the block in its zone of merged cells).
+% We adjust |\l_@@_hpos_block_str| when |\rotate| has been used (in the cell
+% where the command |\Block| is used but maybe in |#4|, |\RowStyle|,
+% |code-for-first-row|, etc.).
+% \begin{macrocode}
+ \@@_adjust_hpos_rotate:
+% \end{macrocode}
+% The boolean |\g_@@_rotate_bool| will be also considered \emph{after the composition
+% of the box} (in order to rotate the box).
+%
+% \medskip
+% Remind that we are in the command of composition of the box of the block.
+% Previously, we have only done some tuning. Now, we will actually compose the
+% content with a |{tabular}|, an |{array}| or a |{minipage}|.
% \begin{macrocode}
- \bool_if:NT \g_@@_rotate_bool { \str_set:Nn \l_@@_hpos_block_str c }
\bool_if:NTF \l_@@_tabular_bool
{
\bool_lazy_all:nTF
{
{ \int_compare_p:nNn { #2 } = 1 }
- { \dim_compare_p:n { \l_@@_col_width_dim >= \c_zero_dim } }
+% \end{macrocode}
+% Remind that, when the column has not a fixed width, the dimension
+% |\l_@@_col_width_dim| has the conventionnal value of $-1$~cm.
+% \begin{macrocode}
+ { \dim_compare_p:n { \l_@@_col_width_dim >= \c_zero_dim } }
{ ! \g_@@_rotate_bool }
}
% \end{macrocode}
-% When the block is mono-column in a column with a fixed width (eg |p{3cm}|).
+% When the block is mono-column in a column with a fixed width (eg |p{3cm}|), we
+% use a |{minipage}|.
% \begin{macrocode}
{
\use:x
@@ -12341,16 +12690,15 @@ version 2005/12/01 or later.
[ \str_lowercase:V { \l_@@_vpos_of_block_str } ]
{ \l_@@_col_width_dim }
\str_case:Vn \l_@@_hpos_block_str
- {
- c \centering
- r \raggedleft
- l \raggedright
- }
+ { c \centering r \raggedleft l \raggedright }
}
#5
\end { minipage }
}
- {
+% \end{macrocode}
+% In the other cases, we use a |{tabular}|.
+% \begin{macrocode}
+ {
\use:x
{
\exp_not:N \begin { tabular }%
@@ -12361,6 +12709,10 @@ version 2005/12/01 or later.
\end { tabular }
}
}
+% \end{macrocode}
+% If we are in a mathematical array (|\l_@@_tabular_bool| is |false|). The
+% composition is always done with an |{array}| (never with a |{minipage}|).
+% \begin{macrocode}
{
\c_math_toggle_token
\use:x
@@ -12373,30 +12725,18 @@ version 2005/12/01 or later.
\end { array }
\c_math_toggle_token
}
- \group_end:
- }
- \bool_if:NT \g_@@_rotate_bool
- {
- \box_grotate:cn
- { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
- { 90 }
- \bool_if:NT \g_@@_rotate_c_bool
- {
- \hbox_gset:cn
- { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
- {
- \c_math_toggle_token
- \vcenter
- {
- \box_use:c
- { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
- }
- \c_math_toggle_token
- }
- }
- \bool_gset_false:N \g_@@_rotate_bool
}
% \end{macrocode}
+% The box which will contain the content of the block has now been composed.
+%
+% \bigskip
+% If there were |\rotate| (which raises |\g_@@_rotate_bool|) in the content of
+% the |\Block|, we do a rotation of the box (and we also adjust the
+% baseline the rotated box).
+% \begin{macrocode}
+ \bool_if:NT \g_@@_rotate_bool \@@_rotate_box_of_block:
+% \end{macrocode}
+%
% If we are in a mono-column block, we take into account the width of that block
% for the width of the column.
% \begin{macrocode}
@@ -12449,8 +12789,17 @@ version 2005/12/01 or later.
% \begin{macrocode}
{
\exp_not:n { #3 } ,
- \l_@@_hpos_block_str ,
- \bool_if:NT \g_@@_rotate_c_bool { v-center }
+ \l_@@_hpos_block_str ,
+% \end{macrocode}
+% Now, we put a key for the vertical alignment.
+% \begin{macrocode}
+ \bool_if:NT \g_@@_rotate_bool
+ {
+ \bool_if:NTF \g_@@_rotate_c_bool
+ { v-center }
+ { \int_compare:nNnT \c@iRow = \l_@@_last_row_int T }
+ }
+
}
{
\box_use_drop:c
@@ -12460,12 +12809,74 @@ version 2005/12/01 or later.
\bool_set_false:N \g_@@_rotate_c_bool
}
% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\cs_new:Npn \@@_adjust_hpos_rotate:
+ {
+ \bool_if:NT \g_@@_rotate_bool
+ {
+ \str_set:Nx \l_@@_hpos_block_str
+ {
+ \bool_if:NTF \g_@@_rotate_c_bool
+ { c }
+ {
+ \str_case:VnF \l_@@_vpos_of_block_str
+ { b l B l t r T r }
+ { \int_compare:nNnTF \c@iRow = \l_@@_last_row_int r l }
+ }
+ }
+ }
+ }
+% \end{macrocode}
+%
+% \bigskip
+% Despite its name the following command rotates the box of the block \emph{but
+% also does vertical adjustement of the baseline of the block}.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_rotate_box_of_block:
+ {
+ \box_grotate:cn
+ { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
+ { 90 }
+ \int_compare:nNnT \c@iRow = \l_@@_last_row_int
+ {
+ \vbox_gset_top:cn
+ { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
+ {
+ \skip_vertical:n { 0.8 ex }
+ \box_use:c
+ { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
+ }
+ }
+ \bool_if:NT \g_@@_rotate_c_bool
+ {
+ \hbox_gset:cn
+ { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
+ {
+ \c_math_toggle_token
+ \vcenter
+ {
+ \box_use:c
+ { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box }
+ }
+ \c_math_toggle_token
+ }
+ }
+ }
+% \end{macrocode}
%
% \bigskip
% The following macro is for the standard case, where the block is not mono-row
% and not mono-column. In that case, the content of the block is \emph{not}
% composed right now in a box. The composition in a box will be done further,
-% just after the construction of the array.
+% just after the construction of the array (cf. |\@@_draw_blocks:| and
+% above all |\@@_Block_v:nnnnnn|).
+%
+% |#1| is $i$ (the number of rows of the block), |#2| is $j$ (the number of
+% columns of the block), |#3| is the list of \textsl{key=values} pairs, |#4| are
+% the tokens to put before the math mode and before the composition of the block
+% and |#5| is the label (=content) of the block.
% \begin{macrocode}
\cs_new_protected:Npn \@@_Block_v:nnnnn #1 #2 #3 #4 #5
{
@@ -12491,8 +12902,7 @@ version 2005/12/01 or later.
% the tabular is the same as the external alignment of the tabular (that is to
% say the position of the block in its zone of merged cells).
% \begin{macrocode}
- \bool_if:NT \g_@@_rotate_bool
- { \str_set:Nn \l_@@_hpos_block_str c }
+ % \@@_adjust_hpos_rotate:
\use:x
{
\exp_not:N \begin { tabular } [ \l_@@_vpos_of_block_str ]
@@ -12503,6 +12913,9 @@ version 2005/12/01 or later.
}
\group_end:
}
+% \end{macrocode}
+% When we are \emph{not} in an environments |{NiceTabular}| (or similar).
+% \begin{macrocode}
{
\group_begin:
\bool_if:NF \l_@@_respect_arraystretch_bool
@@ -12511,9 +12924,8 @@ version 2005/12/01 or later.
{
\dim_zero:N \extrarowheight
#4
- \bool_if:NT \g_@@_rotate_bool
- { \str_set:Nn \l_@@_hpos_block_str c }
- \c_math_toggle_token
+ % \@@_adjust_hpos_rotate:
+ \c_math_toggle_token % :n c
\use:x
{
\exp_not:N \begin { array } [ \l_@@_vpos_of_block_str ]
@@ -12550,6 +12962,8 @@ version 2005/12/01 or later.
{ \char_set_catcode_other:N ! }
{ #1 } ,
fill .value_required:n = true ,
+ opacity .tl_set:N = \l_@@_opacity_tl ,
+ opacity .value_required:n = true ,
draw .code:n =
\tl_set_rescan:Nnn
\l_@@_draw_tl
@@ -12564,7 +12978,6 @@ version 2005/12/01 or later.
\l_@@_draw_tl
{ \char_set_catcode_other:N ! }
{ #1 } ,
- color .value_required:n = true ,
borders .clist_set:N = \l_@@_borders_clist ,
borders .value_required:n = true ,
hvlines .meta:n = { vlines , hlines } ,
@@ -12574,36 +12987,29 @@ version 2005/12/01 or later.
hlines .default:n = true ,
line-width .dim_set:N = \l_@@_line_width_dim ,
line-width .value_required:n = true ,
+% \end{macrocode}
+% Some keys have not a property |.value_required:n| (or similar) because they
+% are in |FirstPass|.
+% \begin{macrocode}
l .code:n = \str_set:Nn \l_@@_hpos_block_str l ,
- l .value_forbidden:n = true ,
r .code:n = \str_set:Nn \l_@@_hpos_block_str r ,
- r .value_forbidden:n = true ,
c .code:n = \str_set:Nn \l_@@_hpos_block_str c ,
- c .value_forbidden:n = true ,
L .code:n = \str_set:Nn \l_@@_hpos_block_str l
\bool_set_true:N \l_@@_hpos_of_block_cap_bool ,
- L .value_forbidden:n = true ,
R .code:n = \str_set:Nn \l_@@_hpos_block_str r
\bool_set_true:N \l_@@_hpos_of_block_cap_bool ,
- R .value_forbidden:n = true ,
C .code:n = \str_set:Nn \l_@@_hpos_block_str c
\bool_set_true:N \l_@@_hpos_of_block_cap_bool ,
- C .value_forbidden:n = true ,
t .code:n = \str_set:Nn \l_@@_vpos_of_block_str t ,
- t .value_forbidden:n = true ,
T .code:n = \str_set:Nn \l_@@_vpos_of_block_str T ,
- T .value_forbidden:n = true ,
b .code:n = \str_set:Nn \l_@@_vpos_of_block_str b ,
- b .value_forbidden:n = true ,
B .code:n = \str_set:Nn \l_@@_vpos_of_block_str B ,
- B .value_forbidden:n = true ,
v-center .code:n = \str_set:Nn \l_@@_vpos_of_block_str { c } ,
v-center .value_forbidden:n = true ,
name .tl_set:N = \l_@@_block_name_str ,
name .value_required:n = true ,
name .initial:n = ,
respect-arraystretch .bool_set:N = \l_@@_respect_arraystretch_bool ,
- respect-arraystretch .default:n = true ,
transparent .bool_set:N = \l_@@_transparent_bool ,
transparent .default:n = true ,
transparent .initial:n = false ,
@@ -12765,6 +13171,21 @@ version 2005/12/01 or later.
% \begin{macrocode}
\tl_if_empty:NF \l_@@_fill_tl
{
+ \tl_if_empty:NF \l_@@_opacity_tl
+ {
+ \tl_if_head_eq_meaning:nNTF \l_@@_fill_tl [
+ {
+ \tl_set:Nx \l_@@_fill_tl
+ {
+ [ opacity = \l_@@_opacity_tl ,
+ \tl_tail:V \l_@@_fill_tl
+ }
+ }
+ {
+ \tl_set:Nx \l_@@_fill_tl
+ { [ opacity = \l_@@_opacity_tl ] { \l_@@_fill_tl } }
+ }
+ }
\tl_gput_right:Nx \g_@@_pre_code_before_tl
{
\exp_not:N \roundedrectanglecolor
@@ -13005,14 +13426,17 @@ version 2005/12/01 or later.
% \end{macrocode}
% If we are in the first column, we must put the block as if it was with the key~|r|.
% \begin{macrocode}
- \int_compare:nNnT { #2 } = 0
- { \str_set:Nn \l_@@_hpos_block_str r }
+ \int_compare:nNnT { #2 } = 0 { \str_set:Nn \l_@@_hpos_block_str r }
+% \end{macrocode}
+% If we are in the last column, we must put the block as if it was with the key~|l|.
+% \begin{macrocode}
\bool_if:nT \g_@@_last_col_found_bool
{
\int_compare:nNnT { #2 } = \g_@@_col_total_int
{ \str_set:Nn \l_@@_hpos_block_str l }
}
% \end{macrocode}
+% |\l_tmpa_tl| will contain the anchor of the \textsc{pgf} node which will be used.
% \begin{macrocode}
\tl_set:Nx \l_tmpa_tl
{
@@ -13069,9 +13493,10 @@ version 2005/12/01 or later.
{ \box_use_drop:N \l_@@_cell_box } { } { }
}
% \end{macrocode}
-%
+% End of the case when |\l_@@_vpos_of_block_str| is equal to |c|, |T| or |B|.
+% Now, the other cases.
% \begin{macrocode}
- {
+ {
% \end{macrocode}
%
% \begin{macrocode}
@@ -13151,11 +13576,11 @@ version 2005/12/01 or later.
{ \CT@arc@ }
{ \@@_color:V \l_@@_draw_tl }
}
- \pgfsetcornersarced
+ \pgfsetcornersarced
{
\pgfpoint
- { \dim_use:N \l_@@_rounded_corners_dim }
- { \dim_use:N \l_@@_rounded_corners_dim }
+ { \l_@@_rounded_corners_dim }
+ { \l_@@_rounded_corners_dim }
}
\@@_cut_on_hyphen:w #2 \q_stop
\bool_lazy_and:nnT
@@ -13163,22 +13588,22 @@ version 2005/12/01 or later.
{ \int_compare_p:n { \l_tmpb_tl <= \c@jCol } }
{
\@@_qpoint:n { row - \l_tmpa_tl }
- \dim_set:Nn \l_tmpb_dim { \pgf@y }
+ \dim_set_eq:NN \l_tmpb_dim \pgf@y
\@@_qpoint:n { col - \l_tmpb_tl }
- \dim_set:Nn \l_@@_tmpc_dim { \pgf@x }
+ \dim_set_eq:NN \l_@@_tmpc_dim \pgf@x
\@@_cut_on_hyphen:w #3 \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 } }
\@@_qpoint:n { row - \int_eval:n { \l_tmpa_tl + 1 } }
- \dim_set:Nn \l_tmpa_dim { \pgf@y }
+ \dim_set_eq:NN \l_tmpa_dim \pgf@y
\@@_qpoint:n { col - \int_eval:n { \l_tmpb_tl + 1 } }
- \dim_set:Nn \l_@@_tmpd_dim { \pgf@x }
+ \dim_set_eq:NN \l_@@_tmpd_dim \pgf@x
+ \pgfsetlinewidth { 1.1 \l_@@_line_width_dim }
\pgfpathrectanglecorners
{ \pgfpoint \l_@@_tmpc_dim \l_tmpb_dim }
{ \pgfpoint \l_@@_tmpd_dim \l_tmpa_dim }
- \pgfsetlinewidth { 1.1 \l_@@_line_width_dim }
\dim_compare:nNnTF \l_@@_rounded_corners_dim = \c_zero_dim
{ \pgfusepathqstroke }
{ \pgfusepath { stroke } }
@@ -13252,7 +13677,7 @@ version 2005/12/01 or later.
position = ##1 ,
start = \l_@@_tmpd_tl ,
end = \int_eval:n { \l_tmpb_tl - 1 } ,
- total-width = \dim_use:N \l_@@_line_width_dim % added 2022-08-06
+ total-width = \dim_use:N \l_@@_line_width_dim
}
}
}
@@ -13405,6 +13830,7 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_block_tikz:nnnnn #1 #2 #3 #4 #5
{
\begin { tikzpicture }
+ \@@_clip_with_rounded_corners:
\clist_map_inline:nn { #5 }
{
\path [ ##1 ]
@@ -13702,6 +14128,7 @@ version 2005/12/01 or later.
delimiters / color .value_required:n = true ,
rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
rules .value_required:n = true ,
+ xdots .code:n = \keys_set:nn { NiceMatrix / xdots } { #1 } ,
unknown .code:n = \@@_error:n { Unknown~key~for~CodeAfter }
}
% \end{macrocode}
@@ -14863,15 +15290,15 @@ version 2005/12/01 or later.
% The boolean |\g_@@_footnotehyper_bool| will indicate if the option
% |footnotehyper| is used.
% \begin{macrocode}
-\bool_new:N \c_@@_footnotehyper_bool
+\bool_new:N \g_@@_footnotehyper_bool
% \end{macrocode}
%
% \medskip
-% The boolean |\c_@@_footnote_bool| will indicate if the option |footnote| is
+% The boolean |\g_@@_footnote_bool| will indicate if the option |footnote| is
% used, but quicky, it will also be set to |true| if the option |footnotehyper|
% is used.
% \begin{macrocode}
-\bool_new:N \c_@@_footnote_bool
+\bool_new:N \g_@@_footnote_bool
% \end{macrocode}
%
% \begin{macrocode}
@@ -14900,10 +15327,10 @@ version 2005/12/01 or later.
renew-dots .value_forbidden:n = true ,
renew-matrix .code:n = \@@_renew_matrix: ,
renew-matrix .value_forbidden:n = true ,
- messages-for-Overleaf .bool_set:N = \c_@@_messages_for_Overleaf_bool ,
- footnote .bool_set:N = \c_@@_footnote_bool ,
- footnotehyper .bool_set:N = \c_@@_footnotehyper_bool ,
- no-test-for-array .bool_set:N = \c_@@_no_test_for_array_bool ,
+ messages-for-Overleaf .bool_set:N = \g_@@_messages_for_Overleaf_bool ,
+ footnote .bool_set:N = \g_@@_footnote_bool ,
+ footnotehyper .bool_set:N = \g_@@_footnotehyper_bool ,
+ no-test-for-array .bool_set:N = \g_@@_no_test_for_array_bool ,
no-test-for-array .default:n = true ,
unknown .code:n = \@@_error:n { Unknown~key~for~package }
}
@@ -14937,14 +15364,14 @@ version 2005/12/01 or later.
%
% \medskip
% \begin{macrocode}
-\bool_if:NT \c_@@_footnote_bool
+\bool_if:NT \g_@@_footnote_bool
{
% \end{macrocode}
% The class \cls{beamer} has its own system to extract footnotes and that's why
% we have nothing to do if \cls{beamer} is used.
% \begin{macrocode}
\IfClassLoadedTF { beamer }
- { \bool_set_false:N \c_@@_footnote_bool }
+ { \bool_set_false:N \g_@@_footnote_bool }
{
\IfPackageLoadedTF { footnotehyper }
{ \@@_error:n { footnote~with~footnotehyper~package } }
@@ -14954,24 +15381,24 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
-\bool_if:NT \c_@@_footnotehyper_bool
+\bool_if:NT \g_@@_footnotehyper_bool
{
% \end{macrocode}
% The class \cls{beamer} has its own system to extract footnotes and that's why
% we have nothing to do if \cls{beamer} is used.
% \begin{macrocode}
\IfClassLoadedTF { beamer }
- { \bool_set_false:N \c_@@_footnote_bool }
+ { \bool_set_false:N \g_@@_footnote_bool }
{
\IfPackageLoadedTF { footnote }
{ \@@_error:n { footnotehyper~with~footnote~package } }
{ \usepackage { footnotehyper } }
}
- \bool_set_true:N \c_@@_footnote_bool
+ \bool_set_true:N \g_@@_footnote_bool
}
% \end{macrocode}
-% The flag |\c_@@_footnote_bool| is raised and so, we will only have to test
-% |\c_@@_footnote_bool| in order to know if we have to insert an environment
+% The flag |\g_@@_footnote_bool| is raised and so, we will only have to test
+% |\g_@@_footnote_bool| in order to know if we have to insert an environment
% |{savenotes}|.
%
% \bigskip
@@ -15004,7 +15431,7 @@ version 2005/12/01 or later.
% \section{Error messages of the package}
%
% \begin{macrocode}
-\bool_if:NTF \c_@@_messages_for_Overleaf_bool
+\bool_if:NTF \g_@@_messages_for_Overleaf_bool
{ \str_const:Nn \c_@@_available_keys_str { } }
{
\str_const:Nn \c_@@_available_keys_str
@@ -15078,6 +15505,15 @@ version 2005/12/01 or later.
{ ~Maybe~your~use~of~\token_to_str:N \Hdotsfor\ is~incorrect.}
}
% \end{macrocode}
+%
+% \begin{macrocode}
+\@@_msg_new:nn { hvlines,~rounded-corners~and~corners }
+ {
+ Incompatible~options.\\
+ You~should~not~use~'hvlines',~'rounded-corners'~and~'corners'~at~this~time.\\
+ The~output~will~not~be~reliable.
+ }
+% \end{macrocode}
%
% \begin{macrocode}
\@@_msg_new:nn { negative~weight }
@@ -15159,7 +15595,7 @@ version 2005/12/01 or later.
The~preamble~of~your~\@@_full_name_env:\ announces~\int_use:N
\g_@@_static_num_of_col_int\ columns~but~you~use~only~\int_use:N \c@jCol.\\
The~columns~you~did~not~used~won't~be~created.\\
- We~won't~have~similar~error~till~the~end~of~the~document.
+ You~won't~have~similar~error~till~the~end~of~the~document.
}
% \end{macrocode}
%
@@ -15546,7 +15982,7 @@ version 2005/12/01 or later.
The~name~'#1'~is~already~used~for~a~\token_to_str:N \SubMatrix\
in~this~\@@_full_name_env:.\\
This~key~will~be~ignored.\\
- \bool_if:NF \c_@@_messages_for_Overleaf_bool
+ \bool_if:NF \g_@@_messages_for_Overleaf_bool
{ For~a~list~of~the~names~already~used,~type~H~<return>. }
}
{
@@ -15626,7 +16062,7 @@ version 2005/12/01 or later.
\@@_msg_new:nn { last-col~non~empty~for~NiceMatrixOptions }
{
Erroneous~use.\\
- In~\NiceMatrixoptions,~you~must~use~the~key~
+ In~\token_to_str:N \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).
@@ -15844,8 +16280,8 @@ version 2005/12/01 or later.
}
{
The~available~keys~are~(in~alphabetic~order):~b,~B,~borders,~c,~draw,~fill,~
- hlines,~hvlines,~l,~line-width,~name,~rounded-corners,~r,~respect-arraystretch,~
- t,~T,~tikz,~transparent~and~vlines.
+ hlines,~hvlines,~l,~line-width,~name,~opacity,~rounded-corners,~r,~
+ respect-arraystretch,~t,~T,~tikz,~transparent~and~vlines.
}
% \end{macrocode}
%
@@ -16231,7 +16667,7 @@ version 2005/12/01 or later.
if~you~use~'columns-width=auto'.~If~you~don't~want~to~see~this~
message~again,~use~the~key~'allow-duplicate-names'~in~
'\token_to_str:N \NiceMatrixOptions'.\\
- \bool_if:NF \c_@@_messages_for_Overleaf_bool
+ \bool_if:NF \g_@@_messages_for_Overleaf_bool
{ For~a~list~of~the~names~already~used,~type~H~<return>. }
}
{
diff --git a/macros/latex/contrib/nicematrix/nicematrix-code.pdf b/macros/latex/contrib/nicematrix/nicematrix-code.pdf
index bb9e3275e4..9f6fdcb2d2 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-code.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
index 8e78d18d23..ffb5945c23 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex
index 072769dfa6..cbb86d0723 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex
@@ -509,7 +509,8 @@ option à mettre entre chevrons est proposée par |\Block| pour spécifier du co
LaTeX qui sera inséré \emph{avant} le début du mode mathématique.\footnote{Cet
argument entre chevrons peut aussi être utilisé pour insérer une commande de
fonte comme |\bfseries|, ce qui peut être utile dans le cas où la commande |\\| apparaît dans le
- contenu du bloc.}
+ contenu du bloc. On peut aussi y mettre la commmande |\rotate| fournie par
+ \pkg{nicematrix} (cf. partie~\ref{rotate}, p.~\pageref{rotate}).}
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
@@ -537,6 +538,10 @@ liste de couples \textsl{clé=valeur}. Les clés sont les suivantes :
\item \index{fill (clé de \texttt{\textbackslash Block})}
la clé \Definition{fill} prend en argument une couleur et remplit le bloc
avec cette couleur ;
+\item \index{opacity! (clé de la commande \texttt{\textbackslash Block})}
+\colorbox{yellow!50}{\bfseries Nouveau 6.22}\enskip
+la clé \Definition{opacity} fixe l'opacité de la couleur de remplissage donnée
+par |fill| ;
\item \index{draw (clé de \texttt{\textbackslash Block})}
la clé \Definition{draw} prend en argument une couleur et trace le cadre
avec cette couleur (la valeur par défaut de cette clé est la couleur courante
@@ -549,7 +554,8 @@ contenu et trace également le cadre avec cette couleur ;
les clés \Definition{hlines}, \Definition{vlines} et \Definition{hvlines}
tracent les filets correspondants dans le bloc\footnote{Néanmoins, les filets ne
sont pas tracés dans les sous-blocs du bloc, conformément à l'esprit de
- \pkg{nicematrix}: les filets ne sont pas tracés dans les blocs (cf.
+ \pkg{nicematrix}: les filets ne sont pas tracés dans les blocs, sauf s'ils
+ possèdent la clé |transparent| (cf.
section~\ref{rules} p.~\pageref{rules}).} ;
\item \index{line-width (clé de \texttt{\textbackslash Block})}
la clé \Definition{line-width} fixe la largeur utilisée pour tracer les
@@ -642,7 +648,7 @@ Les blocs mono-colonne ont un comportement spécial.
largeur de la colonne courante.
Dans les colonnes à largeur fixée (|p{...}|, |b{...}|, |m{...}|, |w{...}{...}|,
-|W{...}{...}|, |V| et |X|), le contenu du bloc est mis en forme comme un
+|W{...}{...}|, |V| et~|X|), le contenu du bloc est mis en forme comme un
paragraphe de cette largeur.
\item La spécification d'alignement horizontal donnée par le type de
@@ -867,23 +873,23 @@ Concernant le positionnement vertical, la commande |\Block| admet les clés
\begin{itemize}
\item \index{v-center (clé de \texttt{\textbackslash Block)})}
-Avec la clé |v-center|, le contenu du bloc est centré verticalement.
+Avec la clé \Definition{v-center}, le contenu du bloc est centré verticalement.
-\item Avec la clé |t|, la ligne de base du contenu du bloc est alignée avec la
+\item Avec la clé \Definition{t}, la ligne de base du contenu du bloc est alignée avec la
ligne de base de la première rangée concernée par le bloc.
-\item Avec la clé |b|, la ligne de base de la dernière rangée du contenu du bloc
+\item Avec la clé \Definition{b}, la ligne de base de la dernière rangée du contenu du bloc
(rappelons que le contenu du bloc peut comporter plusieurs rangées séparées par
|\\|) est alignée avec la ligne de base de la dernière des rangées du tableau
impliquées dans le bloc.
-\item Avec la clé |T|, le contenu du bloc est calé vers le haut.
+\item Avec la clé \Definition{T}, le contenu du bloc est calé vers le haut.
\colorbox{yellow!50}{Modification 6.18}\enskip Il n'y a plus de marge verticale.
Néanmoins, le contenu du bloc est (toujours) composé en interne dans une |{minipage}|, un
|{tabular}| ou un |{array}|, ce qui fait qu'il y souvent déjà une marge.
-\item Avec la clé |B|, le contenu du bloc est calé vers le bas.
+\item Avec la clé \Definition{B}, le contenu du bloc est calé vers le bas.
\end{itemize}
Quand aucune clé n'est donnée, c'est la clé |v-center| qui s'applique (sauf pour
@@ -1457,20 +1463,20 @@ la forme \textsl{clé=valeur}. Il y a d'abord trois clés pour spécifier les ou
qui permettront d'utiliser ce nouveau type de filet.
\begin{itemize}
-\item la clé |command| indique le nom (sans la contre-oblique) d'une commande
+\item la clé \Definition{command} indique le nom (sans la contre-oblique) d'une commande
qui sera créée par \pkg{nicematrix} et que l'utilisateur pourra utiliser pour
tracer des filets horizontaux (de manière similaire à |\hline|) ;
-\item la clé |ccommand| indique le nom (sans la contre-oblique) d'une commande
-qui sera créée par \pkg{nicematrix} et que l'utilisateur pourra utiliser pour
-tracer des filets horizontaux partiels (de manière similaire à |\cline|, d'où le
-nom |ccommand|) : l'argument de cette commande est une liste d'intervalles de
-colonnes spécifiés par la syntaxe $i$ ou $i$-$j$ ;\footnote{Il est recommandé de
- n'utiliser ces commandes qu'une seule fois par ligne car chaque utilisation
- crée un espace vertical entre les rangées correspondant à la largeur totale du
- trait qui sera tracé.}
-
-\item la clé |letter| prend en argument une lettre\footnote{Les lettres
+\item la clé \Definition{ccommand} indique le nom (sans la contre-oblique) d'une
+commande qui sera créée par \pkg{nicematrix} et que l'utilisateur pourra
+utiliser pour tracer des filets horizontaux partiels (de manière similaire à
+|\cline|, d'où le nom |ccommand|) : l'argument de cette commande est une liste
+d'intervalles de colonnes spécifiés par la syntaxe $i$ ou $i$-$j$ ;\footnote{Il
+ est recommandé de n'utiliser ces commandes qu'une seule fois par ligne car
+ chaque utilisation crée un espace vertical entre les rangées correspondant à
+ la largeur totale du trait qui sera tracé.}
+
+\item la clé \Definition{letter} prend en argument une lettre\footnote{Les lettres
suivantes ne sont pas autorisées : \verb+lcrpmbVX|()[]!@<>+} qui pourra être
utilisée par l'utilisateur dans le préambule d'un environnement à préambule
(comme |{NiceTabular}|) pour spécifier un filet vertical.
@@ -1494,14 +1500,14 @@ entre les filets (comme on peut le faire avec \pkg{colortbl} par exemple).
\index{multiplicity (clé de «custom-line»)}
\index{color!clé de «custom-line»}
\index{sep-color (clé de «custom-line»)}
-\item la clé |multiplicity| indique le nombre de traits successifs qui seront
-tracés : par exemple, une valeur de~$2$ va créer des filets doubles comme créés
-en standard par |\hline\hline| ou bien \verb+||+ dans le préambule d'un
-environnement ;
+\item la clé \Definition{multiplicity} indique le nombre de traits successifs
+qui seront tracés : par exemple, une valeur de~$2$ va créer des filets doubles
+comme créés en standard par |\hline\hline| ou bien \verb+||+ dans le préambule
+d'un environnement ;
-\item la clé |color| fixe la couleur des filets ;
+\item la clé \Definition{color} fixe la couleur des filets ;
-\item la clé |sep-color| fixe la couleur entre deux filets consécutifs (n'a
+\item la clé \Definition{sep-color} fixe la couleur entre deux filets consécutifs (n'a
d'intérêt que dans le cas où la clé |multiplicity| est utilisée).
\end{itemize}
@@ -1544,7 +1550,7 @@ Produit C & 5 & 4 & 1 \\
\index{tikzz@tikz!clé de «custom-line»}
\index{total-width (clé de «custom-line»)}
-On peut utiliser la clé |tikz| (si TikZ est chargé, \pkg{nicematrix} ne
+On peut utiliser la clé \Definition{tikz} (si TikZ est chargé, \pkg{nicematrix} ne
chargeant par défaut que \textsc{pgf}). Dans ce cas-là, le filet est tracé
directement avec TikZ en utilisant comme paramètres la valeur de la clé |tikz|
qui doit être une liste de couples \textsl{clé=valeur} applicables à un chemin
@@ -2288,7 +2294,10 @@ préambule) ;
\item \colorbox{yellow!50}{\textbf{Nouveau 6.21}}\enskip |\rowcolors| qui prend pour arguments deux couleurs et colorie la suite du
tableau avec ces deux couleurs ;
\item \colorbox{yellow!50}{\textbf{Nouveau 6.21}}\enskip |\rowlistcolors| qui prend pour argument une liste de couleurs et colorie
-la suite du tableau avec ces couleurs.
+la suite du tableau avec ces couleurs.\footnote{Quand la commande
+ |\rowlistcolors| (ou la commande |\rowcolors|) est utilisée dans une case de
+ la colonne~$j$, le coloriage ne s'applique que les colonnes au-delà de~$j$
+ (à dessein).}
\end{itemize}
\medskip
@@ -2340,24 +2349,24 @@ Elle prend aussi en premier argument optionnel, entre crochets, une liste de
couples \textsl{clé=valeur}.
\begin{itemize}
\item \index{nb-rows (clé de \texttt{\textbackslash RowStyle})}
-La clé |nb-rows| indique le nombre de rangées consécutives concernées par
+La clé \Definition{nb-rows} indique le nombre de rangées consécutives concernées par
les spécifications de cette commande (une valeur |*| signifie que toutes les
rangées restantes seront concernées).
-\item Les clés |cell-space-top-limit|, |cell-space-bottom-limit|
-et |cell-space-limits| sont disponibles avec le même effet que les clés globales
-de même nom (cf. p.~\pageref{cell-space}).
+\item Les clés \Definition{cell-space-top-limit}, \Definition{cell-space-bottom-limit}
+et \Definition{cell-space-limits} sont disponibles avec le même effet que les
+clés globales de même nom (cf. p.~\pageref{cell-space}).
\item
\index{rowcolor (clé de \texttt{\textbackslash RowStyle})}
\index{color!clé de \texttt{\textbackslash RowStyle}}
-La clé |rowcolor| fixe la couleur de fond et la clé |color| fixe la
-couleur du texte.\footnote{La clé |color| utilise la commande |\color| mais
+La clé \Definition{rowcolor} fixe la couleur de fond et la clé \Definition{color}
+fixe la couleur du texte.\footnote{La clé |color| utilise la commande |\color| mais
insère aussi une instruction |\leavevmode| devant. Cela évite un espace
vertical parasite dans les cases qui correspondent à des colonnes de type
|p|, |b|, |m|, |X| et |V| (qui débutent en mode vertical de LateX).}
\item \index{bold (clé de \texttt{\textbackslash RowStyle})}
-La clé |bold| impose des caractères gras aux éléments de la rangée, qu'ils
+La clé \Definition{bold} impose des caractères gras aux éléments de la rangée, qu'ils
soient en mode texte ou bien en mode mathématique.
\end{itemize}
@@ -3211,13 +3220,20 @@ $\begin{pmatrix}
\subsection{Les labels des lignes en pointillés}
-Les commandes |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots| et |\Hdotsfor|
-(ainsi que la commande |\line| dans le |\CodeAfter| décrite
+Les commandes |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots|, |\Hdotsfor| et
+|\Vdotsfor| (ainsi que la commande |\line| dans le |\CodeAfter| décrite
p.~\pageref{line-in-code-after}) peuvent en fait prendre deux arguments
optionnels spécifiés par les caractères |_| et |^| pour des labels situés
au-dessous et au-dessus de la ligne. Les arguments sont composés en mode
mathématique avec |\scriptstyle|.
+\smallskip
+\colorbox{yellow!50}{\textbf{Nouveau 6.22}}\enskip La version 6.22 introduit un
+nouveau label spécifié par le caractère~«|:|» pour un label situé sur la ligne
+elle-même. Ce label est en fait composé sur un fond blanc qui est superposé sur
+la ligne en pointillés (voir un exemple p.~\pageref{ex:colon}).
+
+\bigskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
$\begin{bNiceMatrix}
1 & \hspace*{1cm} & 0 \\[8mm]
@@ -3231,8 +3247,9 @@ $\begin{bNiceMatrix}
0 & & 1
\end{bNiceMatrix}$
-\medskip
-\colorbox{yellow!50}{\textbf{Nouveau 6.20}}\enskip
+
+
+\bigskip
Avec la clé |xdots/horizontal-labels|, les labels restent horizontaux.\par\nobreak
\smallskip
@@ -3313,7 +3330,11 @@ Les clés \Definition{xdots/shorten-start} et \Definition{xdots/shorten-end}
indiquent la marge qui est laissée aux deux extrémités de la ligne. La clé
\Definition{xdots/shorten} fixe les deux clés simultanément. La valeur initiale
de $0.3$~em (il est conseillé d'utiliser une unité de mesure dépendante de la
-fonte courante).
+fonte courante).\footnote{En fait, quand on utilise ces clés au niveau de
+ |\NiceMatrixOptions| ou bien d'un environnement, seules les extrémités des
+ lignes qui s'arrêtent au niveau d'un contenu non vide de case sont concernées.
+ Quand on les utilise sur une commande |\Cdots| (ou |\Vdots|, etc.), toutes les
+ extrémités sont concernées.}
\medskip
L'option \Definition{xdots/inter} indique la distance entre deux points. La
@@ -3507,8 +3528,9 @@ peut spécifier les instructions du |code-after| à la fin de l'environnement,
après le mot-clé |\CodeAfter|. Bien que ce soit un mot-clé, |\CodeAfter| accepte
quand même un argument optionnel (entre crochets).\footnote{Les clés autorisées
dans cet argument optionnel sont les suivantes : |delimiters/color|, |rules|
- et ses sous-clés ainsi que |sub-matrix| (en lien avec la commande
- |\SubMatrix|) et ses sous-clés.}
+ et ses sous-clés, |sub-matrix| (en lien avec la commande
+ |\SubMatrix|) et ses sous-clés et |xdots| (pour la commande |\line|) et ses
+ sous-clés.}
\medskip
@@ -4141,7 +4163,7 @@ les notes de pied de page).
(sans aucun espace après), l'appel de note est composé en débordement vers la
droite (cela peut permettre de mieux conserver l'alignement des contenus d'une
colonne). Depuis la version 6.20a, ce comportement n'a lieu que le mode
-l'alignement de la cellule est |c| ou |r| (alignement horizontal centré ou en
+l'alignement de la case est |c| ou |r| (alignement horizontal centré ou en
butée à droite).
\item Si la clé |notes/para| est utilisée, les notes sont composées à la fin du
@@ -4483,7 +4505,6 @@ les environnements et commandes de \pkg{nicematrix} (comme
Nom & Prénom & Profession \\
Arvy & Jacques & Dentiste \\
Jalon & Amandine & Dentiste \\
- Sept & Huit & Neuf
\end{NiceTabular}
@@ -4654,9 +4675,10 @@ $A = \begin{pNiceMatrix}[last-row,last-col=4]
\bigskip
\colorbox{yellow!50}{\textbf{Nouveau 6.21}}\enskip La commande |\rotate| accepte
-une option |c| entre crochets : |\rotate[c]|. Quand cette clé est utilisée, le
-contenu, après rotation, est composé dans une |\vcenter|, ce qui fait que, le
-plus souvent, on obtiendra un centrage vertical.
+une option |c| entre crochets : |\rotate[c]| (les espaces sont supprimés après
+|\rotate[c]|). Quand cette clé est utilisée, le contenu, après rotation, est
+composé dans une |\vcenter|, ce qui fait que, le plus souvent, on obtiendra un
+centrage vertical.
\medskip
@@ -4670,7 +4692,7 @@ seront peut-être pas ceux attendus.
\label{small}
\index{small (clé pour un environnement)}
-\index{smallmatrix@\texttt{\{smallmatrix\}} (envionnement de \pkg{amsmath})}
+\index{smallmatrix@\texttt{\{smallmatrix\}} (environnement de \pkg{amsmath})}
Avec l'option |small|, les environnements de l'extension \pkg{nicematrix} sont
@@ -5038,10 +5060,10 @@ a & a & a
\end{pNiceMatrix}\]
\bigskip
-\colorbox{yellow!50}{\textbf{Nouveau 6.17}}\enskip Puisque ces nœuds sont des
-nœuds PGF, on ne sera pas étonné d'appendre qu'ils sont tracés en utilisant un
-style PGF spécifique. Ce style est nommé |nicematrix/cell-node| et sa définition
-dans le fichier source |nicematrix.sty| est la suivante :
+Puisque ces nœuds sont des nœuds PGF, on ne sera pas étonné d'appendre qu'ils
+sont tracés en utilisant un style PGF spécifique. Ce style est nommé
+|nicematrix/cell-node| et sa définition dans le fichier source |nicematrix.sty|
+est la suivante :
\begin{Verbatim}
\pgfset
@@ -5065,14 +5087,12 @@ p.~\pageref{triangular}.
\subsubsection{La clé pgf-node-code}
\index{pgf-node-code}
-
-\colorbox{yellow!50}{\textbf{Nouveau 6.17}}\enskip \textbf{Pour les utilisateurs
-expérimentés}, \pkg{nicematrix} fournit la clé |pgf-node-code| qui correspond à
-du code PGF qui sera exécuté à la création, par PGF, des nœuds correspondants aux
-cases du tableau. Plus précisément, la valeur fournie à la clé |pgf-node-code|
-sera passée en cinquième argument de la commande |\pgfnode|. Cette valeur doit
-contenir au moins une instruction comme |\pgfusepath|, |\pgfusepathqstroke|,
-|\pgfusepathqfill|, etc.
+\textbf{Pour les utilisateurs expérimentés}, \pkg{nicematrix} fournit la clé
+|pgf-node-code| qui correspond à du code PGF qui sera exécuté à la création, par
+PGF, des nœuds correspondants aux cases du tableau. Plus précisément, la valeur
+fournie à la clé |pgf-node-code| sera passée en cinquième argument de la
+commande |\pgfnode|. Cette valeur doit contenir au moins une instruction comme
+|\pgfusepath|, |\pgfusepathqstroke|, |\pgfusepathqfill|, etc.
\subsubsection{Les colonnes V de varwidth}
@@ -5831,6 +5851,8 @@ avec |\RequirePackage|:
\RequirePackage{pgf}
\documentclass{sn-jnl}
\end{Verbatim}
+Mais il semble que ce ne soit plus nécessaire avec les versions récentes de
+\cls{sn-jnl}.
\medskip
L'extension \pkg{nicematrix} n'est pas parfaitement compatible avec les classes
@@ -5847,7 +5869,7 @@ cf.~p.~\pageref{custom-line}.
\medskip
Les colonnes |d| de l'extension \pkg{dcolumn} ne sont pas prises en compte (mais
-on utiliser la colonne |S| de \pkg{siunitx}).
+on peut utiliser les colonnes |S| de \pkg{siunitx}).
\section{Exemples}
@@ -5870,7 +5892,7 @@ Pour l'exemple suivant, la bibliothèque \pkg{patterns} de TikZ doit aussi être
\begin{Verbatim}
\ttfamily \small
-\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt]
+\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt,rounded-corners]
\Block[~emphase#tikz={pattern=grid,pattern color=lightgray}@]{}
{pattern = grid,\\ pattern color = lightgray}
& \Block[~emphase#tikz={pattern = north west lines,pattern color=blue}@]{}
@@ -5886,7 +5908,7 @@ Pour l'exemple suivant, la bibliothèque \pkg{patterns} de TikZ doit aussi être
\begin{center}
\ttfamily \small
-\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt]
+\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt,rounded-corners]
\Block[tikz={pattern=grid,pattern color=lightgray}]{}
{pattern = grid,\\ pattern color = lightgray}
& \Block[tikz={pattern = north west lines,pattern color=blue}]{}
@@ -5953,7 +5975,6 @@ tous les filets sauf ceux sur les bords (qui sont, bien entendu, ajoutés par
{
colframe = blue!50!black ,
colback = white ,
- colupper = red!50!black ,
fonttitle = \bfseries ,
nobeforeafter ,
center title
@@ -5994,7 +6015,6 @@ tous les filets sauf ceux sur les bords (qui sont, bien entendu, ajoutés par
{
colframe = blue!50!black ,
colback = white ,
- colupper = red!50!black ,
fonttitle = \bfseries ,
nobeforeafter ,
center title
@@ -6265,36 +6285,66 @@ On peut même tracer des lignes continues.\footnote{Dans ce document, la
sur la forme des pointes de flèches.}
\begin{Verbatim}
-\tikzset{H/.style = {solid,<->,shorten > = -1mm, shorten < = -1mm}}
-\tikzset{V/.style = {solid,<->}}
-\NiceMatrixOptions{xdots/horizontal-labels}
+\NiceMatrixOptions{xdots={horizontal-labels,line-style = <->}}
$\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin]
-\Hdotsfor[line-style=H]{3}^{3} & \Hdotsfor[line-style=H]{2}^{2} \\
-2 & 1 & 1 & 1 & 1 & \hspace*{4mm}\Vdotsfor[line-style=V]{3}^{3}\\
+\Hdotsfor{3}^{3} & \Hdotsfor{2}^{2} \\
+2 & 1 & 1 & 1 & 1 & \Vdotsfor{3}^{3}\\
1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 \\
\Hline
-1 & 1 & 1 & 1 & 1 & \Vdotsfor[line-style=V]{2}^{2}\\
+1 & 1 & 1 & 1 & 1 & \Vdotsfor{2}^{2}\\
1 & 1 & 1 & 1 & 1 \\
\end{pNiceArray}$
\end{Verbatim}
\begin{center}
-\tikzset{H/.style = {solid,<->,shorten > = -1mm, shorten < = -1mm}}
-\tikzset{V/.style = {solid,<->}}
-\NiceMatrixOptions{xdots/horizontal-labels}
+\NiceMatrixOptions{xdots={horizontal-labels,line-style = <->}}
$\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin]
-\Hdotsfor[line-style=H]{3}^{3} & \Hdotsfor[line-style=H]{2}^{2} \\
-2 & 1 & 1 & 1 & 1 & \hspace*{4mm}\Vdotsfor[line-style=V]{3}^{3}\\
+\Hdotsfor{3}^{3} & \Hdotsfor{2}^{2} \\
+2 & 1 & 1 & 1 & 1 & \Vdotsfor{3}^{3}\\
1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 \\
\Hline
-1 & 1 & 1 & 1 & 1 & \Vdotsfor[line-style=V]{2}^{2}\\
+1 & 1 & 1 & 1 & 1 & \Vdotsfor{2}^{2}\\
1 & 1 & 1 & 1 & 1 \\
\end{pNiceArray}$
\end{center}
+\interitem
+\label{ex:colon}
+Si on veut mettre les labels sur les flèches, il convient d'utiliser le
+caractère spécial~«|:|» :
+
+\begin{Verbatim}
+\NiceMatrixOptions{xdots={horizontal-labels,line-style = <->}}
+$\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin]
+\Hdotsfor{3}:{3} & \Hdotsfor{2}:{2} \\
+2 & 1 & 1 & 1 & 1 & \Vdotsfor{3}:{3}\\
+1 & 1 & 1 & 1 & 1 \\
+1 & 1 & 1 & 1 & 1 \\
+\Hline
+1 & 1 & 1 & 1 & 1 & \Vdotsfor{2}:{2}\\
+1 & 1 & 1 & 1 & 1 \\
+\end{pNiceArray}$
+\end{Verbatim}
+
+
+\begin{center}
+\NiceMatrixOptions{xdots={horizontal-labels,line-style = <->}}
+$\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin]
+\Hdotsfor{3}:{3} & \Hdotsfor{2}:{2} \\
+2 & 1 & 1 & 1 & 1 & \Vdotsfor{3}:{3}\\
+1 & 1 & 1 & 1 & 1 \\
+1 & 1 & 1 & 1 & 1 \\
+\Hline
+1 & 1 & 1 & 1 & 1 & \Vdotsfor{2}:{2}\\
+1 & 1 & 1 & 1 & 1 \\
+\end{pNiceArray}$
+\end{center}
+
+
+
\subsection{Lignes en tiretés}
\label{tiretes}
@@ -6678,7 +6728,7 @@ composantes de la matrice.\footnote{Pour la commande |\cline|, voir la remarque
\vspace{1cm}
Il est possible de colorier une rangée avec |\rowcolor| dans le |\CodeBefore|
(ou avec |\rowcolor| dans une case de la rangée si on utilise la clé
-|color-inside| − même si \pkg{colortbl} n'est pas chargé).
+|color-inside|).
\index{color-inside|textit}
diff --git a/macros/latex/contrib/nicematrix/nicematrix.ins b/macros/latex/contrib/nicematrix/nicematrix.ins
index 838315cbb2..171d3f7449 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.ins
+++ b/macros/latex/contrib/nicematrix/nicematrix.ins
@@ -38,7 +38,7 @@ LaTeX version 2005/12/01 or later.
\Msg{*}
\Msg{* \space\space nicematrix.sty}
\Msg{*}
-\Msg{* To produce the documentation run the file nicematrix.dtx}
+\Msg{* To produce the documentation run the file nicematrix.tex}
\Msg{* through XeLaTeX.}
\Msg{*}
\Msg{* Happy TeXing!}
diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf
index d25ed70564..9bfc22dfcd 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix.tex b/macros/latex/contrib/nicematrix/nicematrix.tex
index 91758773dd..77c4e8d9f9 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix.tex
@@ -435,8 +435,8 @@ In the environments of \pkg{nicematrix}, it's possible to use the command
|\Block| in order to place an element in the center of a rectangle of merged
cells of the array.\footnote{The spaces after a command |\Block| are deleted.}
-The command |\Block| must be used in the upper leftmost cell of the array with
-two arguments.
+The command |\Block| must be used in the upper leftmost cell of the cells of the
+block with two mandatory arguments.
\begin{itemize}
\item The first argument is the size of the block with the syntax
@@ -483,7 +483,9 @@ That's why the command |\Block| provides an option between angle brackets to
specify some TeX code which will be inserted before the beginning of the
math mode.\footnote{This argument between angular brackets may also be used to
insert a command of font such as |\bfseries| when the command |\\| is used in
-the content of the block.}
+the content of the block. It's also possible to put in that optional argument
+the command |\rotate| provided by \pkg{nicematrix} (cf. part~\ref{rotate},
+p.~\pageref{rotate}).}
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
@@ -515,6 +517,10 @@ follows:
\item \index{fill (key of \texttt{\textbackslash Block})}
the key \Definition{fill} takes in as value a color and fills the block
with that color;
+\item \index{opacity (key of \texttt{\textbackslash Block})}
+\colorbox{yellow!50}{\bfseries New 6.22}\enskip the key
+\Definition{opacity} sets the opacity of
+the filling color specified by |fill|;
\item \index{draw (key of \texttt{\textbackslash Block})}
the key \Definition{draw} takes in as value a color and strokes the
frame of the block with that color (the default value of that key is the
@@ -529,7 +535,8 @@ color;
the keys \Definition{hlines}, \Definition{vlines} and
\Definition{hvlines} draw all the corresponding rules in the
block;\footnote{However, the rules are not drawn in the sub-blocks of the
-block, as always with \pkg{nicematrix}: the rules are not drawn in the blocks
+block, as always with \pkg{nicematrix}: the rules are not drawn in the blocks,
+except when they have the key |transparent|
(cf. section~\ref{rules} p.~\pageref{rules}).}
\item \index{line-width (key of \texttt{\textbackslash Block})}
the key \Definition{line-width} is the width of the rules (is relevant
@@ -842,24 +849,24 @@ is used for the horizontal alignement.},
\begin{itemize}
\item \index{v-center (key of \texttt{\textbackslash Block})}
-With the key |v-center|, the content of the block is vertically centered.
-\item With the key |t|, the baseline of the content of the block is aligned
-With the basline of the first row concerned by the block).
-\item with the key |b|, the baseline of the last row of the content of the
+With the key \Definition{v-center}, the content of the block is vertically centered.
+\item With the key \Definition{t}, the baseline of the content of the block is aligned
+with the baseline of the first row concerned by the block.
+\item with the key \Definition{b}, the baseline of the last row of the content of the
block (we recall that the content of a block may contains several lines
separated by |\\|) is aligned with the baseline of the last of the rows of the
array involved in the block.
-\item With the key |T|, the content of the block is set upwards.
+\item With the key \Definition{T}, the content of the block is set upwards.
\colorbox{yellow!50}{\textbf{Modification 6.18}}\enskip No vertical margin is
added. However, the contents of the block is (always) composed by
\pkg{nicematrix} in a |{minipage}|, a |{tabular}| or an |{array}| and, hence,
there will still remain a margin (in most cases).
-\item With the key |B|, the content of the block is set downwards.
+\item With the key \Definition{B}, the content of the block is set downwards.
\end{itemize}
-When no key is given, the key |v-center| applies (excepted in the mono-row blocks).
+When no key is given, the key |v-center| applies (except in the mono-row blocks).
@@ -967,7 +974,7 @@ text & text \\
\index{Lines in the tabulars|see{Rules}}
The usual techniques for the rules may be used in the environments of
-\pkg{nicematrix} (excepted |\vline|). However, there is some small differences
+\pkg{nicematrix} (except |\vline|). However, there is some small differences
with the classical environments.
\bigskip
@@ -1826,7 +1833,7 @@ h & i & j \\
\bigskip
\item The command \Definition{\textbackslash arraycolor} takes in as mandatory
-argument a color and color the whole tabular with that color (excepted the
+argument a color and color the whole tabular with that color (except the
potential exterior rows and columns: cf.~p.~\pageref{exterior}). It's only a
particular case of |\rectanglecolor|.
@@ -2227,7 +2234,10 @@ preamble of the array);
\item \colorbox{yellow!50}{\textbf{New 6.21}}\enskip |\rowcolors| which takes in as arguments two colors and color the rest of
the tabular with those colors;
\item \colorbox{yellow!50}{\textbf{New 6.21}}\enskip |\rowlistcolors| which takes in as argument a color and color the rest of
-the tabular with the colors of that list of colors.
+the tabular with the colors of that list of colors.\footnote{When the command
+ |\rowlistcolors| (or the command |\rowcolors| is used in a cell of the
+ column~$j$ of the array, the command applies only on the columns above~$j$ (by
+design).}
\end{itemize}
\smallskip
@@ -2278,23 +2288,23 @@ will be applied to each cell on the rest of the current row.
That command also takes in as optional argument (between square brackets)
a list of \textsl{key=value} pairs.
\begin{itemize}
-\item \index{nb-rows (key of \texttt{\textbackslash RowStyle})} The key |nb-rows| sets
+\item \index{nb-rows (key of \texttt{\textbackslash RowStyle})} The key \Definition{nb-rows} sets
the number of rows to which the specifications of the current command will
apply (with the special value |*|, it will apply to all the following rows).
-\item The keys |cell-space-top-limit|, |cell-space-bottom-limit| and
-|cell-space-limits| are available with the same meaning that the corresponding
-global keys (cf. p.~\pageref{cell-space}).
+\item The keys \Definition{cell-space-top-limit}, \Definition{cell-space-bottom-limit} and
+\Definition{cell-space-limits} are available with the same meaning that the
+corresponding global keys (cf. p.~\pageref{cell-space}).
\item \index{rowcolor (key of \texttt{\textbackslash RowStyle})}
\index{color!key of \texttt{\textbackslash RowStyle}}
-The key |rowcolor| sets
-the color of the background and the key |color| sets the
-color of the text.\footnote{The key |color| uses the command
+The key \Definition{rowcolor} sets the color of the background and the key
+\Definition{color} sets the color of the text.\footnote{The key |color| uses the command
|\color| but inserts also an instruction |\leavevmode| before. This
instruction prevents a extra vertical space in the cells which belong to
columns of type |p|, |b|, |m|, |X| and |V| (which start in
vertical mode of LaTeX).}
-\item \index{bold (key of \texttt{\textbackslash RowStyle})} The key |bold|
-enforces bold characters for the cells of the row, both in math and text mode.
+\item \index{bold (key of \texttt{\textbackslash RowStyle})} The key
+\Definition{bold} enforces bold characters for the cells of the row, both in
+math and text mode.
\end{itemize}
\medskip
@@ -2350,7 +2360,7 @@ Rio & Tokyo & Oslo
\bigskip
\index{columns-width}
In the environments of \pkg{nicematrix}, it's also possible to fix the \emph{minimal}
-width of all the columns (excepted the potential exterior columns: cf. p.~\pageref{exterior}) directly
+width of all the columns (except the potential exterior columns: cf. p.~\pageref{exterior}) directly
with the key |columns-width|.
\medskip
@@ -2745,7 +2755,7 @@ customized rules created by the key |custom-line|
(cf.~p.~\pageref{custom-line}).
\item A specification of color present in |code-for-first-row| also applies to
-a dotted line drawn in that exterior ``first row'' (excepted if a value has
+a dotted line drawn in that exterior ``first row'' (except if a value has
been given to |xdots/color|). Idem for the other exterior rows and columns.
\item Logically, the potential option |columns-width| (described
@@ -3135,12 +3145,18 @@ $\begin{pmatrix}
\subsection{The labels of the dotted lines}
-The commands |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots| and |\Hdotsfor|
-(and the command |\line| in the |\CodeAfter| which is described
-p.~\pageref{line-in-code-after}) accept two optional arguments specified
-by the tokens |_| and |^| for labels positionned below and above the line. The
+The commands |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots|, |\Hdotsfor| and
+|\Vdotsfor| (and the command |\line| in the |\CodeAfter| which is described
+p.~\pageref{line-in-code-after}) accept two optional arguments specified by the
+tokens |_| and |^| for labels positionned below and above the line. The
arguments are composed in math mode with |\scriptstyle|.
+\colorbox{yellow!50}{\textbf{New 6.22}}\enskip The version 6.22 introduces a new
+label, specified by the token ``|:|'' for a label placed on the line. The label
+is composed on a white background which is put on the line previously drawn (see
+example on p.~\pageref{ex:colon}).
+
+\bigskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
$\begin{bNiceMatrix}
1 & \hspace*{1cm} & 0 \\[8mm]
@@ -3156,7 +3172,6 @@ $\begin{bNiceMatrix}
\bigskip
-\colorbox{yellow!50}{\textbf{New 6.20}}\enskip
With the key |xdots/horizontal-labels|, the labels stay horizontal.\par\nobreak
%
\medskip
@@ -3232,7 +3247,13 @@ is 0.53~pt.
The keys \Definition{xdots/shorten-start} and \Definition{xdots/shorten-end} fix
the margin at the extremities of the line. The key |xdots/shorten| fixes both
parameters. The initial value is 0.3~em (it is recommanded to use a unit of
-length dependent of the current font).
+length dependent of the current font).\footnote{In fact, when
+ |xdots/shorten|, |xdots/shorten-start| and |xdots/shorten-end| are used in
+ |\NiceMatrixOptions| or at the level of an environment (such as
+ |{pNiceMatrix}|), those keys only apply to the extremeties of dotted lines
+ corresponding to a non-empty content of a cell. When they are used for a command
+ such as |\Cdots| (and, in that case, their names are |shorten|,
+ |shorten-start| and |shorten-end|), they apply to all the extremities.}
\bigskip
The option \Definition{xdots/inter} fixes the length between the dots. The
@@ -3427,8 +3448,9 @@ possible to give the instructions of the |code-after| at the end of the
environment, after the keyword |\CodeAfter|. Although |\CodeAfter| is a
keyword, it takes in an optional argument (between square
brackets).\footnote{Here are the keys accepted in that argument:
-|delimiters/color|, |rules| and its sub-keys and |sub-matrix| (linked to the
-command |\SubMatrix|) and its sub-keys.}
+|delimiters/color|, |rules| and its sub-keys, |sub-matrix| (linked to the
+command |\SubMatrix|) and its sub-keys and |xdots| (for the command |\line|) and
+its sub-keys.}
\medskip
@@ -3927,7 +3949,7 @@ environment (typically the environment |{table}|).
\smallskip
With the key |caption|, the caption, when it is long, is wrapped at the width of
-the tabular (excepted the potential exterior columns specified by |first-col|
+the tabular (except the potential exterior columns specified by |first-col|
and |last-col|: cf.~\ref{exterior}, p.~\pageref{exterior}), without the use of
the package \pkg{threeparttable} or the package \pkg{floatrow}.
@@ -3988,7 +4010,7 @@ perfectly compatible with \pkg{hyperref}.
The package \pkg{nicematrix} also provides a command |\tabularnote| which gives
the ability to specify notes that will be composed at the end of the array with
-a width of line equal to the width of the array (excepted the potential exterior
+a width of line equal to the width of the array (except the potential exterior
columns specified by |first-col| and |last-col|: cf.~\ref{exterior},
p.~\pageref{exterior}). With no surprise, that command is available only in the
environments |{NiceTabular}|, |{NiceTabular*}| and |{NiceTabularX}|.
@@ -4557,18 +4579,16 @@ $A = \begin{pNiceMatrix}[last-row=4,last-col=4]
\end{varwidth}
\bigskip
-\colorbox{yellow!50}{\textbf{New 6.21}}\enskip The command |\tabular| has a key
-|c|: |\tabular[c]|. When that key is used, the content is composed in a
-|\vcenter| and, therefore, in most cases, we will have a vertical alignment.
-
-
+\colorbox{yellow!50}{\textbf{New 6.21}}\enskip The command |\rotate| has a key
+|c|: |\rotate[c]| (spaces are deleted after |\rotate[c]|). When that key is
+used, the content is composed in a |\vcenter| and, therefore, in most cases, we
+will have a vertical alignment.
\bigskip
Caution: the command |\rotate| is designed to be used in a |\Block| or in
columns of type |l|, |r|, |c|, |w| ou |W|; if it is used in other column types
(such as |p{...}|), the result will maybe differ from what is expected.
-
\subsection{The option small}
\label{small}
@@ -4640,8 +4660,8 @@ value of these counters which are used internally by \pkg{nicematrix}.
In the |\CodeBefore| (cf. p. \pageref{code-before}) and in the |\CodeAfter|
(cf. p. \pageref{code-after}), |iRow| represents the total number of rows
-(excepted the potential exterior rows) and |jCol| represents the total number
-of columns (excepted the potential exterior columns).
+(except the potential exterior rows) and |jCol| represents the total number
+of columns (except the potential exterior columns).
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
@@ -4911,7 +4931,7 @@ $\begin{pNiceMatrix}
\end{pNiceMatrix}$
\medskip
-The nodes of the last column (excepted the potential ``last column'' specified
+The nodes of the last column (except the potential ``last column'' specified
by |last-col|\footnote{For the exterior columns, cf. part~\ref{exterior},
p.~\pageref{exterior}.}) may also be indicated by $i$-|last|. Similarly, the
nodes of the last row may be indicated by |last|-$j$.
@@ -4936,10 +4956,9 @@ a & a & a
\bigskip
-\colorbox{yellow!50}{\textbf{New 6.17}}\enskip Since those nodes are PGF
-nodes, one won't be surprised to learn that they are drawn by using a specific
-PGF style. That style is called |nicematrix/cell-node| and its definition in
-the source file |nicematrix.sty| is as follows:
+Since those nodes are PGF nodes, one won't be surprised to learn that they are
+drawn by using a specific PGF style. That style is called |nicematrix/cell-node|
+and its definition in the source file |nicematrix.sty| is as follows:
\begin{Verbatim}
\pgfset
@@ -4964,13 +4983,13 @@ For an example of utilisation, see part~\ref{triangular}, p.~\pageref{triangular
\index{pgf-node-code}
-\colorbox{yellow!50}{\textbf{New 6.17}}\enskip \textbf{For the experienced
-users}, \pkg{nicematrix} provides the key |pgf-node-code| which corresponds to
-some PGF node that will be executed at the creation, by PGF, of the nodes
-corresponding to the cells of the array. More pricisely, the value given to
-the key |pgf-node-code| will be passed in the fifth argument of the command
-|\pgfnode|. That value should contain at least an instruction such as
-|\pgfusepath|, |\pgfusepathqstroke|, |\pgfusepathqfill|, etc.
+\textbf{For the experienced users}, \pkg{nicematrix} provides the key
+|pgf-node-code| which corresponds to some PGF node that will be executed at the
+creation, by PGF, of the nodes corresponding to the cells of the array. More
+pricisely, the value given to the key |pgf-node-code| will be passed in the
+fifth argument of the command |\pgfnode|. That value should contain at least an
+instruction such as |\pgfusepath|, |\pgfusepathqstroke|, |\pgfusepathqfill|,
+etc.
\subsubsection{The columns V of varwidth}
@@ -5717,6 +5736,9 @@ be loaded before the |\documentclass| with |\RequirePackage|:
\documentclass{sn-jnl}
\end{Verbatim}
+However, it seems that this is no longer mandatory with the recent versions of
+\cls{sn-jnl}.
+
\bigskip
The package \pkg{nicematrix} is not fully compatible with the packages and classes
of \LuaTeX-ja: the detection of the empty corners (cf. % p.~\pageref{corners})
@@ -5754,7 +5776,7 @@ For the following example, we also need the Tikz library |patterns|.
\begin{Verbatim}
\ttfamily \small
-\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt]
+\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt,rounded-corners]
\Block[~emphase#tikz={pattern=grid,pattern color=lightgray}@]{}
{pattern = grid,\\ pattern color = lightgray}
& \Block[~emphase#tikz={pattern = north west lines,pattern color=blue}@]{}
@@ -5770,7 +5792,7 @@ For the following example, we also need the Tikz library |patterns|.
\begin{center}
\ttfamily \small
-\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt]
+\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt,rounded-corners]
\Block[tikz={pattern=grid,pattern color=lightgray}]{}
{pattern = grid,\\ pattern color = lightgray}
& \Block[tikz={pattern = north west lines,pattern color=blue}]{}
@@ -5826,7 +5848,7 @@ seven & eight & nine
Here is an example of use of |{NiceTabular}| within a command |\tcbox| of
\pkg{tcolorbox}. We have used the key |hvlines-except-borders| in order all
-the rules excepted on the borders (which are, of course, added by \pkg{tcolorbox})
+the rules except on the borders (which are, of course, added by \pkg{tcolorbox})
\medskip
\begin{BVerbatim}
@@ -5834,7 +5856,6 @@ the rules excepted on the borders (which are, of course, added by \pkg{tcolorbox
{
colframe = blue!50!black ,
colback = white ,
- colupper = red!50!black ,
fonttitle = \bfseries ,
nobeforeafter ,
center title
@@ -5875,7 +5896,6 @@ the rules excepted on the borders (which are, of course, added by \pkg{tcolorbox
{
colframe = blue!50!black ,
colback = white ,
- colupper = red!50!black ,
fonttitle = \bfseries ,
nobeforeafter ,
center title
@@ -5905,34 +5925,6 @@ the rules excepted on the borders (which are, of course, added by \pkg{tcolorbox
\end{center}
-
-\vspace{1cm}
-That example shows the use of \pkg{nicematrix} in conjunction with
-\pkg{tcolorbox}. If one wishes a tabular with an exterior frame with rounded
-corners, it's not necessary to use \pkg{tcolorbox}: it's possible to use the
-command |\Block| with the key |rounded-corners|.
-
-\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.5cm]
-\begin{NiceTabular}{rcl}[hvlines-except-borders]
-\Block[draw,transparent,~emphase#rounded-corners@]{*-*}{}
- One & Two & Three \\
- Men & Mice & Lions \\
- Upper & Middle & Lower
-\end{NiceTabular}
-\end{BVerbatim}
-\begin{NiceTabular}{rcl}[hvlines-except-borders]
-\Block[draw,transparent,rounded-corners]{*-*}{}
- One & Two & Three \\
- Men & Mice & Lions \\
- Upper & Middle & Lower
-\end{NiceTabular}
-
-\medskip
-We have used the key |transparent| to have the rules specified by
-|hvlines-except-borders| drawn in the blocks (by default, the rules are not
-drawn in the blocks).
-
\subsection{Notes in the tabulars}
\index{nota@\textbf{Notes in the tabulars}|textit}
@@ -6168,36 +6160,65 @@ In fact, it's even possible to draw solid lines with the commands |\Cdots|,
has been loaded, which impacts the shape of the arrow tips.}
\begin{Verbatim}
-\tikzset{H/.style = {solid,<->,shorten > = -1mm, shorten < = -1mm}}
-\tikzset{V/.style = {solid,<->}}
-\NiceMatrixOptions{xdots/horizontal-labels}
+\NiceMatrixOptions{xdots={horizontal-labels,line-style = <->}}
$\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin]
-\Hdotsfor[line-style=H]{3}^{3} & \Hdotsfor[line-style=H]{2}^{2} \\
-2 & 1 & 1 & 1 & 1 & \hspace*{4mm}\Vdotsfor[line-style=V]{3}^{3}\\
+\Hdotsfor{3}^{3} & \Hdotsfor{2}^{2} \\
+2 & 1 & 1 & 1 & 1 & \Vdotsfor{3}^{3}\\
1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 \\
\Hline
-1 & 1 & 1 & 1 & 1 & \Vdotsfor[line-style=V]{2}^{2}\\
+1 & 1 & 1 & 1 & 1 & \Vdotsfor{2}^{2}\\
1 & 1 & 1 & 1 & 1 \\
\end{pNiceArray}$
\end{Verbatim}
\begin{center}
-\tikzset{H/.style = {solid,<->,shorten > = -1mm, shorten < = -1mm}}
-\tikzset{V/.style = {solid,<->}}
-\NiceMatrixOptions{xdots/horizontal-labels}
+\NiceMatrixOptions{xdots={horizontal-labels,line-style = <->}}
$\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin]
-\Hdotsfor[line-style=H]{3}^{3} & \Hdotsfor[line-style=H]{2}^{2} \\
-2 & 1 & 1 & 1 & 1 & \hspace*{4mm}\Vdotsfor[line-style=V]{3}^{3}\\
+\Hdotsfor{3}^{3} & \Hdotsfor{2}^{2} \\
+2 & 1 & 1 & 1 & 1 & \Vdotsfor{3}^{3}\\
1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 \\
\Hline
-1 & 1 & 1 & 1 & 1 & \Vdotsfor[line-style=V]{2}^{2}\\
+1 & 1 & 1 & 1 & 1 & \Vdotsfor{2}^{2}\\
1 & 1 & 1 & 1 & 1 \\
\end{pNiceArray}$
\end{center}
+\interitem
+\label{ex:colon}
+If you want the lable \emph{on the line}, you should use the special token~``|:|'':
+
+\begin{Verbatim}
+\NiceMatrixOptions{xdots={horizontal-labels,line-style = <->}}
+$\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin]
+\Hdotsfor{3}:{3} & \Hdotsfor{2}:{2} \\
+2 & 1 & 1 & 1 & 1 & \Vdotsfor{3}:{3}\\
+1 & 1 & 1 & 1 & 1 \\
+1 & 1 & 1 & 1 & 1 \\
+\Hline
+1 & 1 & 1 & 1 & 1 & \Vdotsfor{2}:{2}\\
+1 & 1 & 1 & 1 & 1 \\
+\end{pNiceArray}$
+\end{Verbatim}
+
+
+\begin{center}
+\NiceMatrixOptions{xdots={horizontal-labels,line-style = <->}}
+$\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin]
+\Hdotsfor{3}:{3} & \Hdotsfor{2}:{2} \\
+2 & 1 & 1 & 1 & 1 & \Vdotsfor{3}:{3}\\
+1 & 1 & 1 & 1 & 1 \\
+1 & 1 & 1 & 1 & 1 \\
+\Hline
+1 & 1 & 1 & 1 & 1 & \Vdotsfor{2}:{2}\\
+1 & 1 & 1 & 1 & 1 \\
+\end{pNiceArray}$
+\end{center}
+
+
+
\subsection{Dashed rules}
\label{dashed}
@@ -6903,6 +6924,14 @@ The successive versions of the file |nicematrix.sty| provided by TeXLive are ava
\nolinkurl{https:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty}
}
+\subsection*{Changes between version 6.21 and 6.22}
+
+Key |opacity| for the command |\Block|.
+
+It's now possible to put a label on a ``continuous dotted line'' with the
+specifier ``|:|''.
+
+
\subsection*{Changes between version 6.20a and 6.21}
Key |c| for the command |\tabularnote|.