diff options
author | Karl Berry <karl@freefriends.org> | 2020-10-20 20:40:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-10-20 20:40:24 +0000 |
commit | 25a4aae02e284152fc0a57c6c6ba87e3242dedbc (patch) | |
tree | eceba8c99b58bf15dacb3b3986124ae9cbf537dc /Master/texmf-dist/source | |
parent | 555796a9dcf50f8997d2d26611609cb60d1dee7c (diff) |
nicematrix (20oct20)
git-svn-id: svn://tug.org/texlive/trunk@56717 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx | 368 |
1 files changed, 181 insertions, 187 deletions
diff --git a/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx b/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx index 22c7112ee08..0383626f2f8 100644 --- a/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx +++ b/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx @@ -15,8 +15,8 @@ % % \fi % \iffalse -\def\myfileversion{5.4} -\def\myfiledate{2020/10/06} +\def\myfileversion{5.5} +\def\myfiledate{2020/10/20} % % %<*batchfile> @@ -410,10 +410,10 @@ version 2005/12/01 or later. % \end{minipage} % % \bigskip -% \colorbox{yellow!30}{\textbf{New 5.2}}\enskip It's also possible to use the -% key |baseline| to align a matrix on an horizontal rule (drawn by |\hline|). In -% this aim, one should give the value |line-|\textsl{i} where \textsl{i} is the -% number of the row following the horizontal rule. +% It's also possible to use the key |baseline| to align a matrix on an +% horizontal rule (drawn by |\hline|). In this aim, one should give the value +% |line-|\textsl{i} where \textsl{i} is the number of the row following the +% horizontal rule. % % \smallskip % \begin{Verbatim} @@ -510,7 +510,7 @@ version 2005/12/01 or later. % \end{scope} % % \medskip -% \colorbox{yellow!50}{\textbf{New 5.3}}\enskip It's possible to set the +% \colorbox{yellow!30}{New 5.3}\enskip It's possible to set the % horizontal position of the block with one of the keys |l|, |c| and |r|. % % @@ -565,7 +565,7 @@ version 2005/12/01 or later. % % \subsection{The mono-column blocks} % -% % \colorbox{yellow!50}{\textbf{New 5.4}}\enskip The mono-column blocks have a +% % \colorbox{yellow!30}{New 5.4}\enskip The mono-column blocks have a % special behaviour. % % \begin{itemize} @@ -691,8 +691,7 @@ version 2005/12/01 or later. % % % \bigskip -% \colorbox{yellow!30}{\textbf{New 5.2}}\enskip However, the vertical rules are -% not drawn in the blocks. +% However, the vertical rules are not drawn in the blocks. % % \bigskip % If you use \pkg{booktabs} (which provides |\toprule|, |\midrule|, @@ -925,11 +924,10 @@ version 2005/12/01 or later. % rectangles starting from the cell actually in the corner of the array. % % \bigskip -% \colorbox{yellow!30}{\textbf{New 5.2}}\enskip It's possible to give as value to the -% key |\hvlines-except-corners| a list of the corners to take into -% consideration. The corners are designed by |NW|, |SW|, |NE| and |SE| -% (\emph{north west}, \emph{south west}, \emph{north east} and \emph{south -% east}). +% It's possible to give as value to the key |\hvlines-except-corners| a list of +% the corners to take into consideration. The corners are designed by |NW|, +% |SW|, |NE| and |SE| (\emph{north west}, \emph{south west}, \emph{north east} +% and \emph{south east}). % % \bigskip % \begin{BVerbatim}[boxwidth=11cm,baseline=c] @@ -1243,9 +1241,9 @@ version 2005/12/01 or later. % \end{scope} % % \bigskip -% \colorbox{yellow!30}{\textbf{New 5.2}}\enskip There is a key |respect-blocks| -% for the instruction |\rowcolors|. With that key, the ``rows'' alternately -% colored may extend over several rows if they have to incorporate blocks. +% There is a key |respect-blocks| for the instruction |\rowcolors|. With that +% key, the ``rows'' alternately colored may extend over several rows if they +% have to incorporate blocks. % % \medskip % \begin{scope} @@ -2255,10 +2253,10 @@ version 2005/12/01 or later. % \medskip % For the legibility of the code, an alternative syntax is provided: it's % possible to give the instructions of the |\code-after| at the end of the -% environment, after the keyword |\CodeAfter|\footnote{In some circonstancies, -% one must put |\omit \CodeAfter|. |\omit| is a keyword of TeX which cancels -% the pattern of the current cell.}. For an example, cf. -% p.~\pageref{example-CodeAfter}. +% environment, after the keyword |\CodeAfter| (for an example, cf. +% p.~\pageref{example-CodeAfter}). \colorbox{yellow!50}{\textbf{New 5.5}}\enskip +% Before the version 5.5, it was necessary, in some circonstancies, to put the +% keyword |\omit| before |\CodeAfter|. Since version~5.5, one must never put~|\omit|. % % % @@ -2358,8 +2356,8 @@ version 2005/12/01 or later. % \item If the key |notes/para| is used, the notes are composed at the end of % the array in a single paragraph (as with the key |para| of \pkg{threeparttable}). % -% \item \colorbox{yellow!50}{\textbf{New 5.4}}\enskip There is a key -% |tabularnote| which provides a way to insert some texte in the zone of the +% \item \colorbox{yellow!30}{New 5.4}\enskip There is a key +% |tabularnote| which provides a way to insert some text in the zone of the % notes before the numbered tabular notes. % % \item If the package \pkg{booktabs} has been loaded (before or after @@ -2580,16 +2578,15 @@ version 2005/12/01 or later. % % If you wish to use the environment |{NiceTabular}| or |{NiceTabular*}| in an % environment |{threeparttable}| of the eponymous package, you have to patch the -% environment |{threeparttable}| with the following code: +% environment |{threeparttable}| with the following code (with a version of +% LaTeX at least 2020/10/01). % \begin{Verbatim}[commandchars=\~\#\!] % \makeatletter -% \AtBeginEnvironment{threeparttable} +% \AddToHook{env/threeparttable/begin} % {\TPT@hookin{NiceTabular}\TPT@hookin{NiceTabular*}} % \makeatother % \end{Verbatim} % -% The command |\AtBeginEnvironment| is a command of the package \pkg{etoolbox} -% which must have been loaded previously. % % % \section{Other features} @@ -3286,7 +3283,7 @@ version 2005/12/01 or later. % public and each variable with name beginning with |\g__nicematrix| or % |\l__nicematrix| is private.}: % \begin{itemize} -% \item \colorbox{yellow!30}{\textbf{New 5.2}}\enskip |\g_nicematrix_code_before_tl| ; +% \item |\g_nicematrix_code_before_tl| ; % \item |\g_nicematrix_code_after_tl|. % \end{itemize} % @@ -3500,9 +3497,9 @@ version 2005/12/01 or later. % % \end{scope} % -% \colorbox{yellow!50}{\textbf{New 5.3}}\enskip It's possible to specify the +% \colorbox{yellow!30}{New 5.3}\enskip It's possible to specify the % instruction |\Ddots| which will be drawn first (and which will be used to draw -% the other diagonal dotted line when the parallelization is in force) with the +% the other diagonal dotted lines when the parallelization is in force) with the % key |draw-first|: |\Ddots[draw-first]|. % % \subsection{The ``empty'' cells} @@ -3990,7 +3987,7 @@ version 2005/12/01 or later. % a_{11} & a_{12} & a_{13} & a_{14} \\ % a_{21} & a_{22} & a_{23} & a_{24} \\ % a_{31} & a_{32} & a_{33} & a_{34} \\ -% a_{41} & a_{42} & a_{43} & a_{44} +% a_{41} & a_{42} & a_{43} & a_{44} \\ % \CodeAfter % \begin{tikzpicture}[~emphase#name suffix = -large@, % every node/.style = {draw,~emphase#inner sep = 0 pt@}] @@ -4006,7 +4003,7 @@ version 2005/12/01 or later. % a_{11} & a_{12} & a_{13} & a_{14} \\ % a_{21} & a_{22} & a_{23} & a_{24} \\ % a_{31} & a_{32} & a_{33} & a_{34} \\ -% a_{41} & a_{42} & a_{43} & a_{44} +% a_{41} & a_{42} & a_{43} & a_{44} \\ % \CodeAfter % \begin{tikzpicture}[name suffix = -large, % every node/.style = {draw,inner sep = 0 pt}] @@ -4066,27 +4063,6 @@ version 2005/12/01 or later. % \end{bNiceMatrix}\] % % -% \bigskip -% This code fails with |latex|-|dvips|-|ps2pdf| because Tikz for |dvips|, as for -% now, doesn't support blend modes. However, the following code, in the -% preamble, should activate blend modes in this way of compilation. -% -% -% \begin{scope} \small -% |\ExplSyntaxOn| -% -% |\makeatletter| -% -% |\tl_set:Nn \l_tmpa_tl {pgfsys-dvips.def}| -% -% |\tl_if_eq:NNT \l_tmpa_tl \pgfsysdriver| -% -% | {\cs_set:Npn\pgfsys@blend@mode#1{\special{ps:~/\tl_upper_case:n #1~.setblendmode}}}| -% -% |\makeatother| -% -% |\ExplSyntaxOff| -% \end{scope} % % \vspace{1cm} % We recall that, for a rectangle of merged cells (with the command |\Block|), a @@ -4431,21 +4407,6 @@ version 2005/12/01 or later. \RequirePackage { xparse } % \end{macrocode} % -% \begin{macrocode} -\cs_set_eq:NN \box_use_drop_i:N \box_use_drop:N -\cs_set_eq:NN \box_use_drop_ii:N \box_use_drop:N -\cs_set_eq:NN \box_use_drop_iii:N \box_use_drop:N -\cs_set_eq:NN \box_use_drop_iv:N \box_use_drop:N -\cs_set_eq:NN \box_use_drop_v:N \box_use_drop:N -\cs_set_eq:NN \box_use_drop_vi:N \box_use_drop:N -\cs_set_eq:NN \box_use_drop_vii:N \box_use_drop:N -\cs_set_eq:NN \box_use_drop_viii:N \box_use_drop:N -\cs_set_eq:NN \box_use_drop_ix:N \box_use_drop:N -\cs_set_eq:NN \box_use_drop_x:N \box_use_drop:N -\cs_set_eq:NN \box_use_drop_xi:N \box_use_drop:N -\cs_set_eq:NN \box_use_drop_xii:N \box_use_drop:N -% \end{macrocode} -% % \bigskip % \begin{macrocode} \cs_new_protected:Npn \@@_error:n { \msg_error:nn { nicematrix } } @@ -6284,6 +6245,12 @@ version 2005/12/01 or later. \cs_new_protected:Npn \@@_Cell: { % \end{macrocode} +% At the beginning of the cell, we link |\CodeAfter| to a command which do +% \emph{not} begin with |\omit| (whereas the standard version of |\CodeAfter| +% begins with |\omit|). +% \begin{macrocode} + \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i:n +% \end{macrocode} % We increment |\c@jCol|, which is the counter of the columns. % \begin{macrocode} \int_gincr:N \c@jCol @@ -6469,11 +6436,11 @@ version 2005/12/01 or later. % \end{itemize} % \begin{macrocode} \bool_if:NTF \g_@@_empty_cell_bool - { \box_use_drop_i:N \l_@@_cell_box } + { \box_use_drop:N \l_@@_cell_box } { \dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > \c_zero_dim \@@_node_for_the_cell: - { \box_use_drop_ii:N \l_@@_cell_box } + { \box_use_drop:N \l_@@_cell_box } } \bool_gset_false:N \g_@@_empty_cell_bool } @@ -6496,7 +6463,7 @@ version 2005/12/01 or later. \pgfnode { rectangle } { base } - { \box_use_drop_iii:N \l_@@_cell_box } + { \box_use_drop:N \l_@@_cell_box } { \@@_env: - \int_use:N \c@iRow - \int_use:N \c@jCol } { } \str_if_empty:NF \l_@@_name_str @@ -6863,7 +6830,7 @@ version 2005/12/01 or later. \cs_set_eq:NN \rotate \@@_rotate: \cs_set_eq:NN \OnlyMainNiceMatrix \@@_OnlyMainNiceMatrix:n \cs_set_eq:NN \dotfill \@@_old_dotfill: - \cs_set_eq:NN \CodeAfter \@@_CodeAfter:n + \cs_set_eq:NN \CodeAfter \@@_CodeAfter: \cs_set_eq:NN \diagbox \@@_diagbox:nn \bool_if:NT \l_@@_colortbl_like_bool \@@_colortbl_like: \bool_if:NT \l_@@_renew_dots_bool \@@_renew_dots: @@ -7334,27 +7301,16 @@ version 2005/12/01 or later. \int_compare:nNnT \l_@@_first_col_int = 0 { \skip_horizontal:N \col@sep - \dim_if_exist:cTF { g_@@_ block _ width _col _ 0 _ dim } - { - \skip_horizontal:n - { - \dim_max:nn - { - \dim_use:c { g_@@_ block _ width _col _ 0 _ dim } - - 2 \col@sep - } - \g_@@_width_first_col_dim - } - \dim_gzero:c { g_@@_ block _ width _col _ 0 _ dim } - } - { \skip_horizontal:N \g_@@_width_first_col_dim } + \skip_horizontal:N \g_@@_width_first_col_dim } % \end{macrocode} % % The construction of the real box is different when |\l_@@_NiceArray_bool| is % true (|{NiceArray}| or |{NiceTabular}|) and in the other environments because, -% in |{NiceArray}| or |{NiceTabular}|, we have no delimiter to put. We begin -% with this case. +% in |{NiceArray}| or |{NiceTabular}|, we have no delimiter to put (but we have +% tabular notes to put). We begin with this case. +% +% Remark that, in all cases, |@@_use_arraybox_with_notes_c:| is used. % \begin{macrocode} \bool_if:NTF \l_@@_NiceArray_bool { @@ -7447,36 +7403,22 @@ version 2005/12/01 or later. % \begin{macrocode} \bool_if:NT \g_@@_last_col_found_bool { - \dim_if_exist:cTF - { g_@@_ block _ width _col _ \int_use:N \g_@@_col_total_int _ dim } - { - \skip_horizontal:n - { - \dim_max:nn - { - \dim_use:c - { - g_@@_ block _ width _col _ - \int_use:N \g_@@_col_total_int - _ dim - } - } - { \g_@@_width_first_col_dim + \col@sep } - } - } - { - \skip_horizontal:N \g_@@_width_last_col_dim - \skip_horizontal:N \col@sep - } + \skip_horizontal:N \g_@@_width_last_col_dim + \skip_horizontal:N \col@sep } \@@_after_array: +% \end{macrocode} +% The aim of the following |\egroup| (the corresponding |\bgroup| is, of course, +% at the beginning of the environment) is to be able to put an exposant to a matrix in +% a mathematical formula. +% \begin{macrocode} \egroup \bool_if:NT \c_@@_footnote_bool \endsavenotes } % \end{macrocode} % This is the end of the environment |{NiceArrayWithDelims}|. % -% +% \vspace{1cm} % \subsection*{We construct the preamble of the array} % % The transformation of the preamble is an operation in several steps. @@ -7773,7 +7715,7 @@ version 2005/12/01 or later. \hbox_set_end: \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box: \@@_adjust_width_box: - \makebox [ #4 ] [ #3 ] { \box_use_drop_iv:N \l_@@_cell_box } + \makebox [ #4 ] [ #3 ] { \box_use_drop:N \l_@@_cell_box } } } % \end{macrocode} @@ -7855,7 +7797,7 @@ version 2005/12/01 or later. \box_set_ht:Nn \l_tmpa_box { \box_ht:N \l_tmpa_box + \l_tmpa_dim } \box_set_dp:Nn \l_tmpa_box { \box_dp:N \l_tmpa_box + \l_tmpb_dim } \str_if_eq:VnTF \l_@@_baseline_str { c } - { \box_use_drop_v:N \l_tmpa_box } + { \box_use_drop:N \l_tmpa_box } \@@_put_box_in_flow_i: } % \end{macrocode} @@ -7913,78 +7855,98 @@ version 2005/12/01 or later. % Now, |\g_tmpa_dim| contains the value of the $y$ translation we have to to. % \begin{macrocode} \endpgfpicture - \box_move_up:nn \g_tmpa_dim { \box_use_drop_vi:N \l_tmpa_box } - \box_use_drop_vii:N \l_tmpa_box + \box_move_up:nn \g_tmpa_dim { \box_use_drop:N \l_tmpa_box } + \box_use_drop:N \l_tmpa_box } % \end{macrocode} % % \bigskip +% The following command is \emph{always} used by |{NiceArrayWithDelims}| (even +% if, in fact, there is no tabular notes: in fact, it's not possible to know +% whether there is or not before the composition of the blocks). % \begin{macrocode} \cs_new_protected:Npn \@@_use_arraybox_with_notes_c: { - \bool_lazy_and:nnTF - { \int_compare_p:nNn \c@tabularnote = 0 } - { \tl_if_empty_p:V \l_@@_tabularnote_tl } - { \box_use_drop_viii:N \l_@@_the_array_box } - { - \begin { minipage } { \box_wd:N \l_@@_the_array_box } - \box_use_drop_ix:N \l_@@_the_array_box - \skip_vertical:N 0.65ex +% \end{macrocode} +% We need a |{minipage}| because we will insert a LaTeX list for the tabular +% notes (that means that a |\vtop{\hsize=...}| is not enough). +% \begin{macrocode} + \begin { minipage } [ t ] { \box_wd:N \l_@@_the_array_box } + \box_use_drop:N \l_@@_the_array_box +% \end{macrocode} +% We have to draw the blocks right now because there may be tabular notes in +% some blocks (which are not mono-column: the blocks which are mono-column +% have been composed in boxes yet)... and we have to create (potentially) the +% extra nodes before creating the blocks since there are |medium| nodes to create +% for the blocks. +% \begin{macrocode} + \@@_create_extra_nodes: + \seq_if_empty:NF \g_@@_blocks_seq \@@_draw_blocks: + \bool_lazy_or:nnT + { \int_compare_p:nNn \c@tabularnote > 0 } + { ! \tl_if_empty_p:V \l_@@_tabularnote_tl } + \@@_insert_tabularnotes: + \end { minipage } + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_insert_tabularnotes: + { + \skip_vertical:N 0.65ex % \end{macrocode} % The TeX group is for potential specifications in the % |\l_@@_notes_code_before_tl|. % \begin{macrocode} - \group_begin: - \l_@@_notes_code_before_tl - \tl_if_empty:NF \l_@@_tabularnote_tl { \l_@@_tabularnote_tl \par } + \group_begin: + \l_@@_notes_code_before_tl + \tl_if_empty:NF \l_@@_tabularnote_tl { \l_@@_tabularnote_tl \par } % \end{macrocode} % We compose the tabular notes with a list of \pkg{enumitem}. The |\strut| and % the |\unskip| are designed to give the ability to put a |\bottomrule| at the % end of the notes with a good vertical space. % \begin{macrocode} - \int_compare:nNnF \c@tabularnote = 0 + \int_compare:nNnT \c@tabularnote > 0 + { + \bool_if:NTF \l_@@_notes_para_bool { - \bool_if:NTF \l_@@_notes_para_bool - { - \begin { tabularnotes* } - \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut - \end { tabularnotes* } + \begin { tabularnotes* } + \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut + \end { tabularnotes* } % \end{macrocode} % The following |\par| is mandatory for the event that the user has put % |\footnotesize| (for example) in the |notes/code-before|. % \begin{macrocode} - \par - } - { - \tabularnotes - \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut - \endtabularnotes - } + \par } - \unskip - \group_end: - \bool_if:NT \l_@@_notes_bottomrule_bool { - \bool_if:NTF \c_@@_booktabs_loaded_bool - { + \tabularnotes + \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut + \endtabularnotes + } + } + \unskip + \group_end: + \bool_if:NT \l_@@_notes_bottomrule_bool + { + \bool_if:NTF \c_@@_booktabs_loaded_bool + { % \end{macrocode} % The two dimensions |\aboverulesep| et |\heavyrulewidth| are parameters defined % by \pkg{booktabs}. % \begin{macrocode} - \skip_vertical:N \aboverulesep + \skip_vertical:N \aboverulesep % \end{macrocode} % |\CT@arc@| is the specification of color defined by \pkg{colortbl} but you use it % even if \pkg{colortbl} is not loaded. % \begin{macrocode} - { \CT@arc@ \hrule height \heavyrulewidth } - } - { \@@_error:n { bottomule~without~booktabs } } + { \CT@arc@ \hrule height \heavyrulewidth } } - \l_@@_notes_code_after_tl - \end { minipage } - \seq_gclear:N \g_@@_tabularnotes_seq - \int_gzero:N \c@tabularnote + { \@@_error:n { bottomule~without~booktabs } } } + \l_@@_notes_code_after_tl + \seq_gclear:N \g_@@_tabularnotes_seq + \int_gzero:N \c@tabularnote } % \end{macrocode} % @@ -8007,12 +7969,12 @@ version 2005/12/01 or later. \dim_gadd:Nn \g_tmpa_dim \g_@@_ht_row_zero_dim \dim_gadd:Nn \g_tmpa_dim \g_@@_dp_row_zero_dim } - \box_move_up:nn \g_tmpa_dim { \@@_use_arraybox_with_notes_c: } + \box_move_up:nn \g_tmpa_dim { \hbox { \@@_use_arraybox_with_notes_c: } } } % \end{macrocode} % % \medskip -% Now, the general case (hence the |g| in the name). +% Now, the general case. % \begin{macrocode} \cs_new_protected:Npn \@@_use_arraybox_with_notes: { @@ -8058,7 +8020,7 @@ version 2005/12/01 or later. \dim_gadd:Nn \g_tmpa_dim \g_@@_ht_row_zero_dim \dim_gadd:Nn \g_tmpa_dim \g_@@_dp_row_zero_dim } - \box_move_up:nn \g_tmpa_dim { \@@_use_arraybox_with_notes_c: } + \box_move_up:nn \g_tmpa_dim { \hbox { \@@_use_arraybox_with_notes_c: } } } % \end{macrocode} % @@ -8499,7 +8461,7 @@ version 2005/12/01 or later. { \dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > \c_zero_dim \@@_node_for_the_cell: - { \box_use_drop_x:N \l_@@_cell_box } + { \box_use_drop:N \l_@@_cell_box } \skip_horizontal:N \l_@@_left_delim_dim \skip_horizontal:N \l_@@_left_margin_dim \skip_horizontal:N \l_@@_extra_left_margin_dim @@ -8844,13 +8806,6 @@ version 2005/12/01 or later. % \end{macrocode} % % \begin{macrocode} - \bool_if:nTF \l_@@_medium_nodes_bool - { - \bool_if:NTF \l_@@_large_nodes_bool - \@@_create_medium_and_large_nodes: - \@@_create_medium_nodes: - } - { \bool_if:NT \l_@@_large_nodes_bool \@@_create_large_nodes: } \int_zero_new:N \l_@@_initial_i_int \int_zero_new:N \l_@@_initial_j_int \int_zero_new:N \l_@@_final_i_int @@ -8913,14 +8868,6 @@ version 2005/12/01 or later. \bool_if:NT \l_@@_vlines_bool \@@_draw_vlines: % \end{macrocode} % -% \bigskip -% We draw the blocks. We have to revert to a clean version of |\ialign| because -% there may be tabulars in the |\Block| instructions that will be composed now. -% \begin{macrocode} - \cs_set_eq:NN \ialign \@@_old_ialign: - \seq_if_empty:NF \g_@@_blocks_seq \@@_draw_blocks: -% \end{macrocode} -% % \begin{macrocode} \g_@@_internal_code_after_tl \tl_gclear:N \g_@@_internal_code_after_tl @@ -9003,6 +8950,7 @@ version 2005/12/01 or later. % \end{macrocode} % % +% % \bigskip % We recall that, when externalization is used, |\tikzpicture| and % |\endtikzpicture| (or |\pgfpicture| and |\endpgfpicture|) must be directly @@ -11953,6 +11901,26 @@ version 2005/12/01 or later. \cs_generate_variant:Nn \dim_max:nn { v n } % \end{macrocode} % +% +% \bigskip +% The following command is called in |\@@_use_arraybox_with_notes_c:| just +% before the construction of the blocks (if the creation of medium nodes is +% required, medium nodes are also created for the blocks dans that construction +% uses the standard medium nodes). +% \begin{macrocode} +\cs_new_protected:Npn \@@_create_extra_nodes: + { + \bool_if:nTF \l_@@_medium_nodes_bool + { + \bool_if:NTF \l_@@_large_nodes_bool + \@@_create_medium_and_large_nodes: + \@@_create_medium_nodes: + } + { \bool_if:NT \l_@@_large_nodes_bool \@@_create_large_nodes: } + } +% \end{macrocode} +% +% % \bigskip % We have three macros of creation of nodes: |\@@_create_medium_nodes:|, % |\@@_create_large_nodes:| and |\@@_create_medium_and_large_nodes:|. @@ -12387,11 +12355,12 @@ version 2005/12/01 or later. { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } { % \end{macrocode} -% The main aim of the following |\color_ensure_current:| is to retrieve in the -% box a color specified for that column in the preamble (e.g. something like -% |>{\color{red}}|). +% If the user has specified a color for the column in the preamble of the array, +% we want to fix that color in the box we construct. We do that with +% |\set@color| and not |\color_ensure_current:| because that command seems to be +% bugged: it doesn't work in XeLaTeX when \pkg{fontspec} is loaded. % \begin{macrocode} - \color_ensure_current: + \set@color \bool_if:NTF \l_@@_NiceTabular_bool { \group_begin: @@ -12541,10 +12510,15 @@ version 2005/12/01 or later. % % \bigskip % The command |\@@_draw_blocks:| will draw all the blocks. This command is used -% after the construction of the array. +% after the construction of the array. We have to revert to a clean version of +% |\ialign| because there may be tabulars in the |\Block| instructions that will +% be composed now. % \begin{macrocode} \cs_new_protected:Npn \@@_draw_blocks: - { \seq_map_inline:Nn \g_@@_blocks_seq { \@@_Block_iii:nnnnnn ##1 } } + { + \cs_set_eq:NN \ialign \@@_old_ialign: + \seq_map_inline:Nn \g_@@_blocks_seq { \@@_Block_iii:nnnnnn ##1 } + } % \end{macrocode} % % \begin{macrocode} @@ -12787,7 +12761,7 @@ version 2005/12/01 or later. r { base~east } } } - { \box_use_drop_xi:N \l_@@_cell_box } { } { } + { \box_use_drop:N \l_@@_cell_box } { } { } } % \end{macrocode} % @@ -12828,7 +12802,7 @@ version 2005/12/01 or later. r { east } } } - { \box_use_drop_xii:N \l_@@_cell_box } { } { } + { \box_use_drop:N \l_@@_cell_box } { } { } } \endpgfpicture } @@ -13060,21 +13034,34 @@ version 2005/12/01 or later. % definition of the environment |{@@-light-syntax}| on % p.~\pageref{code-light-syntax}. % -% The command |\CodeAfter| catches everything until the end of the current -% environment (of \pkg{nicematrix}). +% \medskip +% In the environments of \pkg{nicematrix}, |\CodeAfter| will be linked to the +% following command |\@@_CodeAfter:|. That macro must \emph{not} be protected +% since it begins with |\omit|. +% \begin{macrocode} +\cs_new:Npn \@@_CodeAfter: { \omit \@@_CodeAfter_i:n } +% \end{macrocode} % -% First, we go until the next command |\end|. +% \medskip +% However, in each cell of the environment, the command |\CodeAfter| will be +% linked to the following command |\@@_CodeAfter_i:n| which do \emph{not} begins +% with |\omit| (and thus, the user will be able to use |\CodeAfter| without +% error and without the need to prefix by |\omit|. +% +% \smallskip +% We have to catch everything until the end of the current environment (of +% \pkg{nicematrix}). First, we go until the next command |\end|. % \begin{macrocode} -\cs_new_protected:Npn \@@_CodeAfter:n #1 \end +\cs_new_protected:Npn \@@_CodeAfter_i:n #1 \end { \tl_gput_right:Nn \g_nicematrix_code_after_tl { #1 } - \@@_CodeAfter_i:n + \@@_CodeAfter_ii:n } % \end{macrocode} % % We catch the argument of the command |\end| (in |#1|). % \begin{macrocode} -\cs_new_protected:Npn \@@_CodeAfter_i:n #1 +\cs_new_protected:Npn \@@_CodeAfter_ii:n #1 { % \end{macrocode} % If this is really the end of the current environment (of \pkg{nicematrix}), we @@ -13089,7 +13076,7 @@ version 2005/12/01 or later. % \begin{macrocode} { \tl_gput_right:Nn \g_nicematrix_code_after_tl { \end { #1 } } - \@@_CodeAfter:n + \@@_CodeAfter_i:n } } % \end{macrocode} @@ -14217,7 +14204,14 @@ version 2005/12/01 or later. % Key |tabularnote|. % % Different behaviour for the mono-column blocks. -% +% +% \subsection*{Changes between versions 5.3 and 5.4} +% +% The user must never put |\omit| before |\CodeAfter|. +% +% Correction of a bug: the tabular notes |\tabularnotes| were not composed when +% present in a block (except a mono-column block). +% % \PrintIndex % % \tableofcontents |