summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nicematrix/nicematrix-code.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/nicematrix/nicematrix-code.dtx')
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-code.dtx109
1 files changed, 77 insertions, 32 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix-code.dtx b/macros/latex/contrib/nicematrix/nicematrix-code.dtx
index 93555aa1e5..07b6fe8513 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.19a}
-\def\myfiledate{2023/05/25}
+\def\myfileversion{6.20}
+\def\myfiledate{2023/06/04}
%
%
%<*batchfile>
@@ -173,11 +173,11 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_msg_new:nn { \msg_new:nnn { nicematrix } }
% \end{macrocode}
%
-% With Overleaf, a document is compiled in non-stop mode. When there is an
-% error, there is no way to the user to use the key H in order to have more
-% information. That's why we decide to put that piece of information (for the
-% messages with such information) in the main part of the message when the key
-% |messages-for-Overleaf| is used (at load-time).
+% With Overleaf, by default, a document is compiled in non-stop mode. When there
+% is an error, there is no way to the user to use the key H in order to have
+% more information. That's why we decide to put that piece of information (for
+% the messages with such information) in the main part of the message when the
+% key |messages-for-Overleaf| is used (at load-time).
% \begin{macrocode}
\cs_new_protected:Npn \@@_msg_new:nnn #1 #2 #3
{
@@ -188,8 +188,8 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% We also create a command which will genereate usually an error but only a
-% warning on Overleaf. The argument is given by currification.
+% We also create a command which will generate usually an error but only a
+% 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 }
@@ -1998,6 +1998,11 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
+% The following parameter corresponds to the key |xdots/horizontal_labels|.
+% \begin{macrocode}
+\bool_new:N \l_@@_xdots_h_labels_bool
+% \end{macrocode}
+% \bigskip
% The following dimension is the distance between two dots for the dotted lines
% (when |line-style| is equal to |standard|, which is the initial value). The
% initial value is 0.45~em but it will be changed if the option |small| is used.
@@ -2219,6 +2224,8 @@ version 2005/12/01 or later.
% \begin{macrocode}
\keys_define:nn { NiceMatrix / xdots }
{
+ horizontal-labels .bool_set:N = \l_@@_xdots_h_labels_bool ,
+ horizontal-labels .default:n = true ,
line-style .code:n =
{
\bool_lazy_or:nnTF
@@ -3145,7 +3152,8 @@ version 2005/12/01 or later.
%
% \bigskip
% The first argument is a boolean which indicates whether you must put the
-% instruction on the left or on the right on the list of instructions.
+% instruction on the left or on the right on the list of instructions (with
+% consequences for the parallelisation of the diagonal lines).
% \begin{macrocode}
\cs_new_protected:Npn \@@_instruction_of_type:nnn #1 #2 #3
{
@@ -6169,7 +6177,7 @@ version 2005/12/01 or later.
% (with the command |\item|) . |#1| is the label (when the command
% |\tabularnote| has been used with an optional argument between square
% brackets) and |#2| is the text of the note. The second argument is provided by
-% currification.
+% curryfication.
% \begin{macrocode}
\cs_set_protected:Npn \@@_one_tabularnote:nn #1
{
@@ -8532,8 +8540,8 @@ version 2005/12/01 or later.
\pgfrememberpicturepositiononpagetrue
\pgf@relevantforpicturesizefalse
\bool_lazy_or:nnTF
- { \tl_if_eq_p:NN \l_@@_xdots_line_style_tl \c_@@_standard_tl }
- \l_@@_dotted_bool
+ { \tl_if_eq_p:NN \l_@@_xdots_line_style_tl \c_@@_standard_tl }
+ \l_@@_dotted_bool
\@@_draw_standard_dotted_line:
\@@_draw_unstandard_dotted_line:
}
@@ -8566,9 +8574,37 @@ version 2005/12/01 or later.
\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.
+% \begin{macrocode}
+\hook_gput_code:nnn { begindocument } { . }
+ {
+ \IfPackageLoadedTF { tikz }
+ {
+ \tikzset
+ {
+ @@_node_above / .style = { sloped , above } ,
+ @@_node_below / .style = { sloped , below }
+ }
+ }
+ { }
+ }
+% \end{macrocode}
+%
+% \bigskip
% \begin{macrocode}
\cs_new_protected:Npn \@@_draw_unstandard_dotted_line:nnn #1 #2 #3
{
+ \bool_if:NT \l_@@_xdots_h_labels_bool
+ {
+ \tikzset
+ {
+ @@_node_above / .style = { auto = left } ,
+ @@_node_below / .style = { auto = right }
+ }
+ }
\draw
[
#1 ,
@@ -8581,8 +8617,8 @@ version 2005/12/01 or later.
% 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 [ sloped , above ] { $ \scriptstyle #2 $ }
- node [ sloped , below ] { $ \scriptstyle #3 $ }
+ -- node [ @@_node_above ] { $ \scriptstyle #2 $ }
+ node [ @@_node_below ] { $ \scriptstyle #3 $ }
( \l_@@_x_final_dim , \l_@@_y_final_dim ) ;
\end { scope }
}
@@ -8606,24 +8642,26 @@ version 2005/12/01 or later.
{ \pgfpoint \l_@@_x_initial_dim \l_@@_y_initial_dim }
{ \pgfpoint \l_@@_x_final_dim \l_@@_y_final_dim }
}
- \pgftransformrotate
+ \fp_set:Nn \l_tmpa_fp
{
- \fp_eval:n
- {
- atand
- (
- \l_@@_y_final_dim - \l_@@_y_initial_dim ,
- \l_@@_x_final_dim - \l_@@_x_initial_dim
- )
- }
- }
+ 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 }
{
- \c_math_toggle_token
- \scriptstyle \l_@@_xdots_up_tl
- \c_math_toggle_token
+ \rotatebox { \fp_eval:n { - \l_tmpa_fp } }
+ {
+ \c_math_toggle_token
+ \scriptstyle \l_@@_xdots_up_tl
+ \c_math_toggle_token
+ }
}
{ }
{ \pgfusepath { } }
@@ -8631,9 +8669,12 @@ version 2005/12/01 or later.
{ rectangle }
{ north }
{
- \c_math_toggle_token
- \scriptstyle \l_@@_xdots_down_tl
- \c_math_toggle_token
+ \rotatebox { \fp_eval:n { - \l_tmpa_fp } }
+ {
+ \c_math_toggle_token
+ \scriptstyle \l_@@_xdots_down_tl
+ \c_math_toggle_token
+ }
}
{ }
{ \pgfusepath { } }
@@ -9619,7 +9660,7 @@ version 2005/12/01 or later.
% \bigskip
% The command |\@@_color_opacity:w| takes in as argument only the optional
% argument. One may consider that the second argument (the actual definition of
-% the color) is provided by currification.
+% the color) is provided by curryfication.
% \begin{macrocode}
\cs_new_protected:Npn \@@_color_opacity:w [ #1 ]
{
@@ -13851,6 +13892,9 @@ version 2005/12/01 or later.
% The four following token lists correspond to the position of the |\SubMatrix|.
% \begin{macrocode}
\@@_compute_i_j:nn { #2 } { #3 }
+ % added 6.19b
+ \int_compare:nNnT \l_@@_first_i_tl = \l_@@_last_i_tl
+ { \cs_set:Npn \arraystretch { 1 } }
\bool_lazy_or:nnTF
{ \int_compare_p:nNn \l_@@_last_i_tl > \g_@@_row_total_int }
{ \int_compare_p:nNn \l_@@_last_j_tl > \g_@@_col_total_int }
@@ -15105,6 +15149,7 @@ version 2005/12/01 or later.
{
The~available~keys~are~(in~alphabetic~order):~
'color',~
+ 'horizontal-labels',~
'inter',~
'line-style',~
'radius',~