From 5fcccb4971727314c23b4a8a1af4dd4d7b60f934 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 2 Jul 2019 21:03:43 +0000 Subject: nicematrix (2jul19) git-svn-id: svn://tug.org/texlive/trunk@51536 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/nicematrix/nicematrix.pdf | Bin 418609 -> 422728 bytes .../source/latex/nicematrix/nicematrix.dtx | 374 ++++++++++++++------- .../texmf-dist/tex/latex/nicematrix/nicematrix.sty | 192 ++++++----- 3 files changed, 351 insertions(+), 215 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf b/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf index 80f13ee4382..d93901c70fe 100644 Binary files a/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf and b/Master/texmf-dist/doc/latex/nicematrix/nicematrix.pdf differ diff --git a/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx b/Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx index c3aaadec488..095ec34bfdc 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{2.2} -\def\myfiledate{2019/06/23} +\def\myfileversion{2.2.1} +\def\myfiledate{2019/07/02} % % %<*batchfile> @@ -52,7 +52,6 @@ version 2005/12/01 or later. \usepackage{geometry} \geometry{left=2.8cm,right=2.8cm,top=2.5cm,bottom=2.5cm,papersize={21cm,29.7cm}} \usepackage{nicematrix} -\usetikzlibrary{fit} \NewDocumentEnvironment {scope} {} {} {} \def\interitem{\vskip 7mm plus 2 mm minus 3mm} \def\emphase{\bgroup\color{RoyalPurple}\let\next=} @@ -807,7 +806,8 @@ version 2005/12/01 or later. % technical reasons, in this preamble, the user must use the letters |L|, |C| % and~|R|\footnote{The column types |L|, |C| and |R| are defined locally inside % |{NiceArray}| with |\newcolumntype| of \pkg{array}. This definition overrides -% an eventual previous definition.} instead of |l|, |c| and |r|. It's possible +% an eventual previous definition. In fact, the column types |w| and |W| are +% also redefined.} instead of |l|, |c| and |r|. It's possible % to use the constructions \verb|w{...}{...}|, \verb|W{...}{...}|, \verb+|+, % |>{...}|, |<{...}|, |@{...}|, |!{...}| and |*{n}{...}| but the letters |p|, % |m| and |b| should not be used.\footnote{In a command |\multicolumn|, one @@ -1081,7 +1081,8 @@ version 2005/12/01 or later. % 6 & 7 & 8 & 9 & 10 \\ % 11 & 12 & 13 & 14 & 15 % \end{pNiceMatrix}$ -% +% +% % \bigskip % In the environments with an explicit preamble (like |{NiceArray}|, etc.), it's % possible to draw a vertical dotted line with the specifier ``|:|''. @@ -1103,7 +1104,7 @@ version 2005/12/01 or later. % % \bigskip % These dotted lines do \emph{not} extend in the ``first row'' and the ``last column'' -% of the environments with such features. +% of the environments for the environments with such features (\emph{e.g.} |{pNiceArrayRC}|). % % \medskip % \begin{BVerbatim}[baseline=c,boxwidth=9.5cm] @@ -2107,7 +2108,7 @@ version 2005/12/01 or later. % % \subsection{Technical definitions} % -% We test wether the current class is \cls{revtex4-1} or \cls{revtex4-2}. +% We test whether the current class is \cls{revtex4-1} or \cls{revtex4-2}. % \begin{macrocode} \bool_new:N \c_@@_revtex_bool \@ifclassloaded { revtex4-1 } @@ -2202,14 +2203,47 @@ version 2005/12/01 or later. \bool_new:N \l_@@_exterior_column_bool % \end{macrocode} % +% \bigskip +% Consider the following code : +% \begin{center} +% \begin{BVerbatim} +% \begin{pNiceArrayC}{CC} +% 1 & 2 +% 3 & 4 +% \end{pNiceArrayC} +% \end{BVerbatim} +% \end{center} +% In such a code, the last column of the environment |{pNiceArrayC}| is not +% used. We want to be able to detect such a situation. We create a boolean for +% that job. +% \begin{macrocode} +\bool_new:N \g_@@_exterior_column_found_bool +% \end{macrocode} +% This boolean will be raised in the last column of environments like |{pNiceArrayC}|. % % \bigskip -% We want to known if we are in a environment |{NiceArray}| because we want to +% We want to known if we are in an environment |{NiceArray}| because we want to % raise an error if the user tries to use nested environments |{NiceArray}|. % \begin{macrocode} \bool_new:N \l_@@_in_NiceArray_bool % \end{macrocode} % +% +% \bigskip +% A list of names of environments of the extension \pkg{nicematrix} which have a +% preamble as argument. This list is used to parameter some erros messages. +% +% \begin{macrocode} +\seq_new:N \c_@@_env_with_preamble_seq +\seq_set_from_clist:Nn \c_@@_env_with_preamble_seq + { + NiceArray , NiceArrayCwithDelims , pNiceArrayC , vNiceArrayC , VNiceArrayC , + bNiceArrayC , BNiceArrayC , NiceArrayRCwithDelims , pNiceArrayRC , + vNiceArrayRC , VNiceArrayRC , bNiceArrayRC , BNiceArrayRC + } +% \end{macrocode} +% +% % \bigskip % \subsection{The options} % @@ -2235,7 +2269,7 @@ version 2005/12/01 or later. % \end{macrocode} % % \bigskip -% The flag |\l_@@_parallelize_diags_bool| controls wether the diagonals are +% The flag |\l_@@_parallelize_diags_bool| controls whether the diagonals are % parallelized. The initial value is~|true|. % \begin{macrocode} \bool_new:N \l_@@_parallelize_diags_bool @@ -2288,7 +2322,7 @@ version 2005/12/01 or later. % \end{macrocode} % % \bigskip -% The boolean |\l_@@_extra_nodes_bool| will be used to indicate wether the +% The boolean |\l_@@_extra_nodes_bool| will be used to indicate whether the % ``medium nodes'' and ``large nodes'' are created in the array. % \begin{macrocode} \bool_new:N \l_@@_extra_nodes_bool @@ -2338,7 +2372,7 @@ version 2005/12/01 or later. % \end{macrocode} % % \bigskip -% An option to test wether the extra nodes will be created (these nodes are the +% An option to test whether the extra nodes will be created (these nodes are the % ``medium nodes'' and ``large nodes''). In some circonstancies, the extra nodes % are created automatically, for example when a dotted line has an ``open'' % extremity. @@ -2467,13 +2501,22 @@ version 2005/12/01 or later. % \end{macrocode} % % \bigskip +% Usually, an error is raised when the user tries to give the same to name two +% distincts environments of \pkg{nicematrix} (theses names are global and not +% local to the current TeX scope). However, the option |allow-duplicate-names| +% disables this feature. % \begin{macrocode} allow-duplicate-names .code:n = - \@@_msg_redirect_name:nn { Duplicate~name } {none} , + \@@_msg_redirect_name:nn { Duplicate~name } { none } , allow-duplicate-names .value_forbidden:n = true , % \end{macrocode} % % \bigskip +% By default, the specifier used in the preamble of the array (for example in +% |{pNiceArrayC}| to draw a vertical dotted line between two columns is the +% colon ``|:|''. However, it's possible to change this letter with +% |letter-for-dotted-lines| and, by the way, the letter ``|:|'' will remain free +% for other packages (for example \pkg{arydshln}). % \begin{macrocode} letter-for-dotted-lines .tl_set:N = \l_@@_letter_for_dotted_lines_str , letter-for-dotted-lines .value_required:n = true , @@ -2646,8 +2689,7 @@ version 2005/12/01 or later. % the |\everycr| because some packages, like \pkg{arydshln}, create special rows % in the |\halign| that we don't want to take into account. % \begin{macrocode} - \int_compare:nNnT \g_@@_column_int = \c_one_int - { \int_gincr:N \g_@@_row_int } + \int_compare:nNnT \g_@@_column_int = 1 { \int_gincr:N \g_@@_row_int } \int_gset:Nn \g_@@_column_total_int { \int_max:nn \g_@@_column_total_int \g_@@_column_int } \hbox_set:Nw \l_tmpa_box $ % $ @@ -2948,27 +2990,27 @@ version 2005/12/01 or later. \bool_if:NT \l_@@_auto_columns_width_bool { \group_insert_after:N \@@_write_max_cell_width: - \cs_if_free:cTF { _@@_max_cell_width_ \int_use:N \g_@@_env_int } - { \dim_set:Nn \l_@@_columns_width_dim \c_zero_dim } - { - \dim_set:Nx \l_@@_columns_width_dim - { \use:c { _@@_max_cell_width _ \int_use:N \g_@@_env_int } } - } + \cs_if_free:cTF { _@@_max_cell_width_ \int_use:N \g_@@_env_int } + { \dim_set:Nn \l_@@_columns_width_dim \c_zero_dim } + { + \dim_set:Nx \l_@@_columns_width_dim + { \use:c { _@@_max_cell_width _ \int_use:N \g_@@_env_int } } + } % \end{macrocode} % If the environment has a name, we read the value of the maximal value of the % columns from |_@@_name_cell_width|{\ttfamily\slshape name} (the value will be % the correct value even if the number of the environment has changed (for % example because the user has created or deleted an environment before the -% current one). +% current one)). % \begin{macrocode} - \str_if_empty:NF \l_@@_name_str - { - \cs_if_free:cF { _@@_max_cell_width_ \l_@@_name_str } - { - \dim_set:Nx \l_@@_columns_width_dim - { \use:c { _@@_max_cell_width_ \l_@@_name_str } } - } - } + \str_if_empty:NF \l_@@_name_str + { + \cs_if_free:cF { _@@_max_cell_width_ \l_@@_name_str } + { + \dim_set:Nx \l_@@_columns_width_dim + { \use:c { _@@_max_cell_width_ \l_@@_name_str } } + } + } } % \end{macrocode} % We don't want to patch any code and that's why some code is executed in a @@ -3056,19 +3098,38 @@ version 2005/12/01 or later. { \skip_horizontal:n { 0.53 pt } \bool_gset_true:N \g_@@_extra_nodes_bool - \int_compare:nNnT \g_@@_row_int = 1 +% \end{macrocode} +% +% \medskip +% Consider the following code: +% \begin{center} +% \begin{BVerbatim} +% \begin{NiceArray}{C:CC:C} +% a & b +% c & d \\ +% e & f & g & h \\ +% i & j & k & l +% \end{NiceArray} +% \end{BVerbatim} +% \end{center} +% The first ``|:|'' in the preamble will be encountered during the first row of +% the environment |{NiceArray}| but the second one will be encountered only in +% the third row. We have to issue a command |\vdottedline:n| in the |code-after| +% only one time for each ``|:|'' in the preamble. That's why we keep a counter +% |\g_@@_last_vdotted_col_int| and with this counter, we know whether a letter +% ``|:|'' encountered during the parsing has already been taken into account in +% the |code-after|. +% \begin{macrocode} + \int_compare:nNnT \g_@@_column_int > \g_@@_last_vdotted_col_int { - \int_compare:nNnTF \g_@@_column_int = \c_zero_dim - { \@@_error:n { Use~of~:~in~first~position } } + \int_gset_eq:NN \g_@@_last_vdotted_col_int \g_@@_column_int + \tl_gput_right:Nx \g_@@_code_after_tl { - \tl_gput_right:Nx \g_@@_code_after_tl - { - \exp_not:N \@@_vdottedline:n - \exp_not:N { - \int_use:N \g_@@_column_int - \exp_not:N } - } - } + \exp_not:N \@@_vdottedline:n + \exp_not:N { + \int_use:N \g_@@_column_int + \exp_not:N } + } } } } @@ -3125,6 +3186,11 @@ version 2005/12/01 or later. % \begin{macrocode} \int_gzero_new:N \g_@@_column_int \int_gzero_new:N \g_@@_column_total_int +% \end{macrocode} +% +% \begin{macrocode} + \int_gzero_new:N \g_@@_last_vdotted_col_int + \int_gset:Nn \g_@@_last_vdotted_col_int { -1 } \cs_set_eq:NN \@ifnextchar \new@ifnextchar % \end{macrocode} % @@ -3245,14 +3311,14 @@ version 2005/12/01 or later. % \end{macrocode} % % \interitem -% The conditionnal |\@@_if_not_empty_cell:nnT| tests wether a cell is empty. The +% The conditionnal |\@@_if_not_empty_cell:nnT| tests whether a cell is empty. The % first two arguments must be LaTeX3 counters for the row and the column of the % considered cell. % \begin{macrocode} \prg_set_conditional:Npnn \@@_if_not_empty_cell:nn #1 #2 { T , TF } % \end{macrocode} % If the cell is an implicit cell (that is after the symbol |\\| of end of row), -% the cell must, of course, be considered as empty. It's easy to check wether we +% the cell must, of course, be considered as empty. It's easy to check whether we % are in this situation considering the correspondant Tikz node. % \begin{macrocode} { @@ -3342,10 +3408,29 @@ version 2005/12/01 or later. % % \subsection{After the construction of the array} % -% First, we deactivate Tikz externalization (since we use Tikz pictures with the -% options |overlay| and |remember picture|, there would be errors). % \begin{macrocode} \cs_new_protected:Nn \@@_after_array: + { + \int_compare:nNnTF \g_@@_row_int > 0 + \@@_after_array_i: + { \@@_error:n { Zero~row } } + } +% \end{macrocode} +% +% \begin{macrocode} +\@@_msg_new:nn { Zero~row } + { + There~is~a~problem.~Maybe~your~environment~is~empty.~Maybe~you~have~used~L,~ + ~C~and~R~instead~of~l,~c~and~r~in~the~preamble~of~your~environment.\\ + If~you~go~on,~the~result~may~be~incorrect. + } +% \end{macrocode} +% +% \medskip +% We deactivate Tikz externalization (since we use Tikz pictures with the +% options |overlay| and |remember picture|, there would be errors). +% \begin{macrocode} +\cs_new_protected:Nn \@@_after_array_i: { \group_begin: \cs_if_exist:NT \tikz@library@external@loaded @@ -3358,7 +3443,8 @@ version 2005/12/01 or later. % column. % \begin{macrocode} \int_gset_eq:NN \g_@@_column_int \g_@@_column_total_int - \bool_if:NT \l_@@_exterior_column_bool { \int_gdecr:N \g_@@_column_int } + \bool_if:nT { \l_@@_exterior_column_bool && \g_@@_exterior_column_found_bool } + { \int_gdecr:N \g_@@_column_int } % \end{macrocode} % % The sequence |\g_@@_yet_drawn_seq| contains a list of lines which have been @@ -3371,7 +3457,7 @@ version 2005/12/01 or later. % By default, the diagonal lines will be parallelized\footnote{It's possible to % use the option |parallelize-diags| to disable this parallelization.}. There % are two types of diagonals lines: the $|\Ddots|$ diagonals and the |\Iddots| -% diagonals. We have to count both types in order to know wether a diagonal is +% diagonals. We have to count both types in order to know whether a diagonal is % the first of its type in the current |{NiceArray}| environment. % \begin{macrocode} \bool_if:NT \l_@@_parallelize_diags_bool @@ -3481,7 +3567,7 @@ version 2005/12/01 or later. % coordinates of one extremity of the line; % \item |\l_@@_final_i_int| and |\l_@@_final_j_int| which are the coordinates of % the other extremity of the line; -% \item |\l_@@_initial_open_bool| and |\l_@@_final_open_bool| to indicate wether +% \item |\l_@@_initial_open_bool| and |\l_@@_final_open_bool| to indicate whether % the extremities are open or not. % \end{itemize} % @@ -3643,13 +3729,13 @@ version 2005/12/01 or later. \dim_gzero_new:N \g_@@_x_final_dim \dim_gzero_new:N \g_@@_y_final_dim \begin { tikzpicture } [ remember~picture ] - \tikz@parse@node\pgfutil@firstofone + \tikz@parse@node \pgfutil@firstofone ( nm - \int_use:N \g_@@_env_int - \int_use:N \l_@@_initial_i_int - \int_use:N \l_@@_initial_j_int #1 ) \dim_gset:Nn \g_@@_x_initial_dim \pgf@x \dim_gset:Nn \g_@@_y_initial_dim \pgf@y - \tikz@parse@node\pgfutil@firstofone + \tikz@parse@node \pgfutil@firstofone ( nm - \int_use:N \g_@@_env_int - \int_use:N \l_@@_final_i_int - \int_use:N \l_@@_final_j_int #2 ) @@ -3751,7 +3837,7 @@ version 2005/12/01 or later. { .north~west } } % \end{macrocode} -% The boolean |\l_tmpa_bool| indicates wether the column is of type |l| (|L| of +% The boolean |\l_tmpa_bool| indicates whether the column is of type |l| (|L| of % |{NiceArray}|) or may be considered as if. % \begin{macrocode} \bool_set:Nn \l_tmpa_bool @@ -3768,7 +3854,7 @@ version 2005/12/01 or later. { .north } } % \end{macrocode} -% The boolean |\l_tmpb_bool| indicates wether the column is of type |c| (|C| of +% The boolean |\l_tmpb_bool| indicates whether the column is of type |c| (|C| of % |{NiceArray}|) or may be considered as if. % \begin{macrocode} \bool_set:Nn \l_tmpb_bool @@ -4243,72 +4329,71 @@ version 2005/12/01 or later. % \bigskip % \subsection{The commands to draw dotted lines to separate columns and rows} % -% The command |\hdottedline| draws a horizontal dotted line to separate two +% The command |\hdottedline| draws an horizontal dotted line to separate two % rows. Similarly, the letter ``:'' in the preamble draws a vertical dotted line % (the letter can be changed with the option |letter-for-dotted-lines|). Both % mechanisms write instructions in the |code-after|. The actual instructions in % the |code-after| use the commands |\@@_hdottedline:n| and |\@@_vdottedline:n|. % % \bigskip -% -% The following command must \emph{not} be protected because it starts with |\noalign|. +% We want the horizontal lines at the same position\footnote{In fact, almost the +% same position because of the width of the line: the width of a dotted line is +% not the same as the width of a line created by |\hline|.} as the line created +% by |\hline| (or |\hdashline| of \pkg{arydshln}). To this end, we construct a +% ``false row'' and, in this row, we create a Tikz node (|\coordinate|) that +% will be used to have the $y$-value of the line. +% % \begin{macrocode} -\cs_new:Nn \@@_hdottedline: - { - \noalign { \skip_vertical:n { 0.53 pt } } - \@@_hdottedline_i: - } +\cs_generate_variant:Nn \dim_set:Nn { N v } % \end{macrocode} % +% \medskip +% The command |\@@_hdottedline:| (which is linked to |\hdottedline| in the +% environment |{NiceArray}|) begins with a |\noalign| which contains a +% vertical skip which is part of the construction of the ``false row''. +% +% \medskip +% Some extension, like the extension \pkg{doc} do a redefinition of the command +% |\dotfill| of LaTeX. That's why we define a command |\@@_dotfill:| as we wish. % \begin{macrocode} -\cs_new_protected:Nn \@@_hdottedline_i: - { - \int_compare:nNnTF \g_@@_row_int < 2 - { \@@_error:n { Use~of~hdottedline~in~first~position } } - { +\cs_set:Npn \@@_dotfill: + { \cleaders \hbox_to_wd:nn {.44em} {\hss .\hss } \hfill \kern \c_zero_dim } +% \end{macrocode} +% + +% This command must \emph{not} be protected because it starts with |\noalign|. +% \begin{macrocode} +\cs_new:Nn \@@_hdottedline: + { + \noalign + { \bool_gset_true:N \g_@@_extra_nodes_bool - \bool_if:NF \c_@@_draft_bool - { - \tl_gput_right:Nx \g_@@_code_after_tl + \cs_if_exist:cTF { @@_width_ \int_use:N \g_@@_env_int } + { \dim_set:Nv \l_tmpa_dim { @@_width_ \int_use:N \g_@@_env_int } } + { \dim_set:Nn \l_tmpa_dim { 5 mm } } + \hbox_overlap_right:n + { \hbox_to_wd:nn { - \exp_not:N \@@_hdottedline:n - \exp_not:N { - \int_eval:n { \g_@@_row_int - 1 } - \exp_not:N } + \l_tmpa_dim + 2 \arraycolsep + - \l_@@_left_margin_dim - \g_@@_right_margin_dim } - } - } - } -% \end{macrocode} -% -% The argument of |\@@_hdottedline:n| is the number of the row \emph{after} which -% we have to draw a dotted line. -% \begin{macrocode} -\cs_new_protected:Nn \@@_hdottedline:n - { - \@@_create_extra_nodes: - \dim_zero_new:N \g_@@_x_initial_dim - \dim_zero_new:N \g_@@_y_initial_dim - \dim_zero_new:N \g_@@_x_final_dim - \dim_zero_new:N \g_@@_y_final_dim - \bool_set_true:N \l_@@_initial_open_bool - \bool_set_true:N \l_@@_final_open_bool - \begin { tikzpicture } [ remember~picture ] - \tikz@parse@node\pgfutil@firstofone - ( #1 - 1 -large .south~west ) - \dim_gset:Nn \g_@@_x_initial_dim \pgf@x - \dim_gset:Nn \g_@@_y_initial_dim \pgf@y - \tikz@parse@node\pgfutil@firstofone - ( #1 - \int_use:N \g_@@_column_int -large .south~east ) - \dim_gset:Nn \g_@@_x_final_dim \pgf@x - \dim_gset:Nn \g_@@_y_final_dim \pgf@y - \end { tikzpicture } - \@@_draw_tikz_line: + \@@_dotfill: + } + } } % \end{macrocode} % +% +% % \begin{macrocode} \@@_msg_new:nn { Use~of~hdottedline~in~first~position } + { + You~can't~use~the~command~\token_to_str:N\hdottedline\ in~the~first~row~ + of~the~environment~\{\@currenvir\}.~But~maybe~you~have~used~l,~c~and~r~ + instead~of~L,~C,~R~in~the~preamble~of~the~array.\\ + If~you~go~on,~this~dotted~line~will~be~ignored. + } +\@@_msg_new:nn { Use~of~hdottedline~in~first~position~bis } { You~can't~use~the~command~\token_to_str:N\hdottedline\ in~the~first~row~ of~the~environment~\{\@currenvir\}. \\ @@ -4322,8 +4407,8 @@ version 2005/12/01 or later. \cs_new_protected:Nn \@@_vdottedline:n { % \end{macrocode} -% The following test is a security: normally, the error should have been capted -% before. +% We should allow the letter ``|:|'' in the first position of the preamble +% but that would need a special programmation. % \begin{macrocode} \int_compare:nNnTF #1 = \c_zero_int { \@@_error:n { Use~of~:~in~first~position } } @@ -4338,39 +4423,42 @@ version 2005/12/01 or later. \bool_set_true:N \l_@@_initial_open_bool \bool_set_true:N \l_@@_final_open_bool % \end{macrocode} -% If the |w|-nodes are created in the previous column (that is if the previous -% column was constructed explicitly of implicitly with a letter |w|), we use -% that column in order to have the dotted lines perfectly aligned when we use -% the environment |{NiceMatrixBlock}| with the option |auto-columns-width|. -% \begin{macrocode} - \cs_if_exist:cTF +% In order to have the coordinates of the line to draw, we use the ``large nodes''. +% \begin{macrocode} + \begin { tikzpicture } [ remember~picture ] + \tikz@parse@node\pgfutil@firstofone + ( 1 - #1 - large .north~east ) + \dim_gset:Nn \g_@@_x_initial_dim \pgf@x + \dim_gset:Nn \g_@@_y_initial_dim \pgf@y + \tikz@parse@node\pgfutil@firstofone + ( \int_use:N \g_@@_row_int - #1 - large .south~east ) + \dim_gset:Nn \g_@@_x_final_dim \pgf@x + \dim_gset:Nn \g_@@_y_final_dim \pgf@y + \end { tikzpicture } +% \end{macrocode} +% However, if the |w|-nodes are created in the previous column (that is if the +% previous column was constructed explicitly or implicitly\footnote{A column is +% constructed implicitly with the letter |w| if the option |columns-width| is +% used or if the environment |{NiceMatrixBlock}| is used with the option +% |auto-columns-width|.} with a letter |w|), we use the |w|-nodes to change the +% $x$-value of the nodes in order to have the dotted lines perfectly aligned +% when we use the environment |{NiceMatrixBlock}| with the option +% |auto-columns-width|. +% \begin{macrocode} + \cs_if_exist:cT { pgf@sh@ns@nm -\int_use:N \g_@@_env_int - 1 - #1 - w } { \begin { tikzpicture } [ remember~picture ] \tikz@parse@node\pgfutil@firstofone ( 1 - #1 - w .north~east ) \dim_gset:Nn \g_@@_x_initial_dim \pgf@x - \dim_gset:Nn \g_@@_y_initial_dim \pgf@y \tikz@parse@node\pgfutil@firstofone ( \int_use:N \g_@@_row_int - #1 - w .south~east ) \dim_gset:Nn \g_@@_x_final_dim \pgf@x - \dim_gset:Nn \g_@@_y_final_dim \pgf@y \end { tikzpicture } \dim_gadd:Nn \g_@@_x_initial_dim \arraycolsep \dim_gadd:Nn \g_@@_x_final_dim \arraycolsep } - { - \begin { tikzpicture } [ remember~picture ] - \tikz@parse@node\pgfutil@firstofone - ( 1 - #1 - large .north~east ) - \dim_gset:Nn \g_@@_x_initial_dim \pgf@x - \dim_gset:Nn \g_@@_y_initial_dim \pgf@y - \tikz@parse@node\pgfutil@firstofone - ( \int_use:N \g_@@_row_int - #1 - large .south~east ) - \dim_gset:Nn \g_@@_x_final_dim \pgf@x - \dim_gset:Nn \g_@@_y_final_dim \pgf@y - \end { tikzpicture } - } \@@_draw_tikz_line: } } @@ -4502,6 +4590,7 @@ version 2005/12/01 or later. \cs_new_protected:Nn \@@_NiceArrayC:n { \bool_set_true:N \l_@@_exterior_column_bool + \bool_gset_false:N \g_@@_exterior_column_found_bool \begin { NiceArray } % \end{macrocode} % The beginning of the preamble is the argument of the environment @@ -4517,6 +4606,7 @@ version 2005/12/01 or later. % \begin{macrocode} > { + \bool_gset_true:N \g_@@_exterior_column_found_bool \int_gincr:N \g_@@_column_int \int_gset:Nn \g_@@_column_total_int { \int_max:nn \g_@@_column_total_int \g_@@_column_int } @@ -4526,7 +4616,7 @@ version 2005/12/01 or later. l % \end{macrocode} % -% We actualize the value of |\g_@@_with_last_col_dim| which, at the end of the +% We actualize the value of |\g_@@_width_last_col_dim| which, at the end of the % array, will contain the maximal width of the cells of the last column (thus, % it will be equal to the width of the last column). % \begin{macrocode} @@ -4803,7 +4893,7 @@ version 2005/12/01 or later. \dim_zero_new:c { l_@@_row_\@@_i _max_dim } \dim_set:cn { l_@@_row_\@@_i _max_dim } { - \c_max_dim } } - \int_step_variable:nnnNn 1 1 \g_@@_column_total_int \@@_j + \int_step_variable:nNn \g_@@_column_total_int \@@_j { \dim_zero_new:c { l_@@_column_\@@_j _min_dim } \dim_set_eq:cN { l_@@_column_\@@_j _min_dim } \c_max_dim @@ -4842,8 +4932,8 @@ version 2005/12/01 or later. % We retrieve the coordinates of the anchor |north east| of the (normal) node of % the cell ($i$-$j$). They will be stored in |\pgf@x| and |\pgf@y|. % \begin{macrocode} - \tikz@parse@node \pgfutil@firstofone - ( nm - \int_use:N \g_@@_env_int - \@@_i - \@@_j .north~east ) + \tikz@parse@node \pgfutil@firstofone + ( nm - \int_use:N \g_@@_env_int - \@@_i - \@@_j .north~east ) \dim_set:cn { l_@@_row _ \@@_i _ max_dim } { \dim_max:vn { l_@@_row _ \@@_i _ max_dim } \pgf@y } \seq_if_in:NxF \g_@@_multicolumn_cells_seq { \@@_i - \@@_j } @@ -4879,7 +4969,7 @@ version 2005/12/01 or later. % \texttt{l_@@_column_\textsl{j}_min_dim} and % \texttt{l_@@_column_\textsl{j}_max_dim}. % \begin{macrocode} - \int_step_variable:nnnNn 1 1 { \g_@@_row_int - 1 } \@@_i + \int_step_variable:nNn { \g_@@_row_int - 1 } \@@_i { \dim_set:cn { l_@@_row _ \@@_i _ min _ dim } { @@ -4892,7 +4982,7 @@ version 2005/12/01 or later. \dim_set_eq:cc { l_@@_row _ \int_eval:n { \@@_i + 1 } _ max _ dim } { l_@@_row_\@@_i _min_dim } } - \int_step_variable:nnnNn 1 1 { \g_@@_column_int - 1 } \@@_j + \int_step_variable:nNn { \g_@@_column_int - 1 } \@@_j { \dim_set:cn { l_@@_column _ \@@_j _ max _ dim } { @@ -4926,6 +5016,27 @@ version 2005/12/01 or later. % the current TeX group). That's why we put a nullification of the command. % \begin{macrocode} \cs_set:Nn \@@_create_extra_nodes: { } +% \end{macrocode} +% +% \medskip +% We can now compute the width of the array (used by |\hdottedline|). +% \begin{macrocode} + \begin { tikzpicture } [ remember~picture , overlay ] + \tikz@parse@node \pgfutil@firstofone + ( nm - \int_use:N \g_@@_env_int - 1 - 1 - large .north~west ) + \dim_gset:Nn \g_tmpa_dim \pgf@x + \tikz@parse@node \pgfutil@firstofone + ( nm - \int_use:N \g_@@_env_int - 1 - + \int_use:N \g_@@_column_int - large .north~east ) + \dim_gset:Nn \g_tmpb_dim \pgf@x + \end { tikzpicture } + \iow_now:Nn \@mainaux \ExplSyntaxOn + \iow_now:Nx \@mainaux + { + \cs_gset:cpn { @@_width_ \int_use:N \g_@@_env_int } + { \dim_eval:n { \g_tmpb_dim - \g_tmpa_dim } } + } + \iow_now:Nn \@mainaux \ExplSyntaxOff } % \end{macrocode} % @@ -5061,7 +5172,7 @@ version 2005/12/01 or later. % \end{macrocode} % In the group, we can use |\seq_pop:NN| safely. % \begin{macrocode} - \int_step_inline:nnnn 1 1 { \seq_count:N #1 } + \int_step_inline:nn { \seq_count:N #1 } { \seq_pop:NN #1 \l_tmpa_tl \seq_pop:NN #2 \l_tmpb_tl @@ -5201,6 +5312,13 @@ version 2005/12/01 or later. % specifier ``|:|'' in the preamble (similar to the classical specifier % ``\verb+|+'' and the specifier ``|:|'' of \pkg{arydshln}). % +% \subsection{Changes between version 2.2 and 2.2.1} +% +% Improvment of the vertical dotted lines drawn by the specifier ``:'' in the +% preamble. +% +% Modification of the position of the dotted lines drawn by |\hdottedline|. +% % \endinput % Local Variables: % TeX-fold-mode: nil diff --git a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty index 20432043d69..86dc6b39765 100644 --- a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty +++ b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty @@ -18,8 +18,8 @@ %% and version 1.3 or later is part of all distributions of %% LaTeX version 2005/12/01 or later. %% -\def\myfileversion{2.2} -\def\myfiledate{2019/06/23} +\def\myfileversion{2.2.1} +\def\myfiledate{2019/07/02} \RequirePackage{tikz} \usetikzlibrary{fit} \RequirePackage{expl3}[2019/02/15] @@ -66,7 +66,15 @@ \int_new:N \l__nm_nb_first_row_int \int_set:Nn \l__nm_nb_first_row_int 1 \bool_new:N \l__nm_exterior_column_bool +\bool_new:N \g__nm_exterior_column_found_bool \bool_new:N \l__nm_in_NiceArray_bool +\seq_new:N \c__nm_env_with_preamble_seq +\seq_set_from_clist:Nn \c__nm_env_with_preamble_seq + { + NiceArray , NiceArrayCwithDelims , pNiceArrayC , vNiceArrayC , VNiceArrayC , + bNiceArrayC , BNiceArrayC , NiceArrayRCwithDelims , pNiceArrayRC , + vNiceArrayRC , VNiceArrayRC , bNiceArrayRC , BNiceArrayRC + } \str_new:N \l__nm_pos_env_str \str_set:Nn \l__nm_pos_env_str c \bool_new:N \l__nm_exterior_arraycolsep_bool @@ -163,7 +171,7 @@ { \__nm_error:n { Option~auto~for~columns-width } } { \dim_set:Nn \l__nm_columns_width_dim { #1 } } , allow-duplicate-names .code:n = - \__nm_msg_redirect_name:nn { Duplicate~name } {none} , + \__nm_msg_redirect_name:nn { Duplicate~name } { none } , allow-duplicate-names .value_forbidden:n = true , letter-for-dotted-lines .tl_set:N = \l__nm_letter_for_dotted_lines_str , letter-for-dotted-lines .value_required:n = true , @@ -268,8 +276,7 @@ \cs_new_protected:Nn \__nm_Cell: { \int_gincr:N \g__nm_column_int - \int_compare:nNnT \g__nm_column_int = \c_one_int - { \int_gincr:N \g__nm_row_int } + \int_compare:nNnT \g__nm_column_int = 1 { \int_gincr:N \g__nm_row_int } \int_gset:Nn \g__nm_column_total_int { \int_max:nn \g__nm_column_total_int \g__nm_column_int } \hbox_set:Nw \l_tmpa_box $ % $ @@ -446,20 +453,20 @@ \bool_if:NT \l__nm_auto_columns_width_bool { \group_insert_after:N \__nm_write_max_cell_width: - \cs_if_free:cTF { __nm_max_cell_width_ \int_use:N \g__nm_env_int } - { \dim_set:Nn \l__nm_columns_width_dim \c_zero_dim } - { - \dim_set:Nx \l__nm_columns_width_dim - { \use:c { __nm_max_cell_width _ \int_use:N \g__nm_env_int } } - } - \str_if_empty:NF \l__nm_name_str - { - \cs_if_free:cF { __nm_max_cell_width_ \l__nm_name_str } - { - \dim_set:Nx \l__nm_columns_width_dim - { \use:c { __nm_max_cell_width_ \l__nm_name_str } } - } - } + \cs_if_free:cTF { __nm_max_cell_width_ \int_use:N \g__nm_env_int } + { \dim_set:Nn \l__nm_columns_width_dim \c_zero_dim } + { + \dim_set:Nx \l__nm_columns_width_dim + { \use:c { __nm_max_cell_width _ \int_use:N \g__nm_env_int } } + } + \str_if_empty:NF \l__nm_name_str + { + \cs_if_free:cF { __nm_max_cell_width_ \l__nm_name_str } + { + \dim_set:Nx \l__nm_columns_width_dim + { \use:c { __nm_max_cell_width_ \l__nm_name_str } } + } + } } \bool_gset_eq:NN \g__nm_extra_nodes_bool \l__nm_extra_nodes_bool \dim_gset_eq:NN \g__nm_left_margin_dim \l__nm_left_margin_dim @@ -499,18 +506,15 @@ { \skip_horizontal:n { 0.53 pt } \bool_gset_true:N \g__nm_extra_nodes_bool - \int_compare:nNnT \g__nm_row_int = 1 + \int_compare:nNnT \g__nm_column_int > \g__nm_last_vdotted_col_int { - \int_compare:nNnTF \g__nm_column_int = \c_zero_dim - { \__nm_error:n { Use~of~:~in~first~position } } + \int_gset_eq:NN \g__nm_last_vdotted_col_int \g__nm_column_int + \tl_gput_right:Nx \g__nm_code_after_tl { - \tl_gput_right:Nx \g__nm_code_after_tl - { - \exp_not:N \__nm_vdottedline:n - \exp_not:N { - \int_use:N \g__nm_column_int - \exp_not:N } - } + \exp_not:N \__nm_vdottedline:n + \exp_not:N { + \int_use:N \g__nm_column_int + \exp_not:N } } } } @@ -529,6 +533,8 @@ \int_gset:Nn \g__nm_row_int { \l__nm_nb_first_row_int - 1 } \int_gzero_new:N \g__nm_column_int \int_gzero_new:N \g__nm_column_total_int + \int_gzero_new:N \g__nm_last_vdotted_col_int + \int_gset:Nn \g__nm_last_vdotted_col_int { -1 } \cs_set_eq:NN \@ifnextchar \new@ifnextchar \bool_if:NF \l__nm_exterior_arraycolsep_bool { \skip_horizontal:n { - \arraycolsep } } @@ -617,12 +623,25 @@ } } \cs_new_protected:Nn \__nm_after_array: + { + \int_compare:nNnTF \g__nm_row_int > 0 + \__nm_after_array_i: + { \__nm_error:n { Zero~row } } + } +\__nm_msg_new:nn { Zero~row } + { + There~is~a~problem.~Maybe~your~environment~is~empty.~Maybe~you~have~used~L,~ + ~C~and~R~instead~of~l,~c~and~r~in~the~preamble~of~your~environment.\\ + If~you~go~on,~the~result~may~be~incorrect. + } +\cs_new_protected:Nn \__nm_after_array_i: { \group_begin: \cs_if_exist:NT \tikz@library@external@loaded { \tikzset { external / export = false } } \int_gset_eq:NN \g__nm_column_int \g__nm_column_total_int - \bool_if:NT \l__nm_exterior_column_bool { \int_gdecr:N \g__nm_column_int } + \bool_if:nT { \l__nm_exterior_column_bool && \g__nm_exterior_column_found_bool } + { \int_gdecr:N \g__nm_column_int } \seq_gclear_new:N \g__nm_yet_drawn_seq \bool_if:NT \l__nm_parallelize_diags_bool { @@ -746,13 +765,13 @@ \dim_gzero_new:N \g__nm_x_final_dim \dim_gzero_new:N \g__nm_y_final_dim \begin { tikzpicture } [ remember~picture ] - \tikz@parse@node\pgfutil@firstofone + \tikz@parse@node \pgfutil@firstofone ( nm - \int_use:N \g__nm_env_int - \int_use:N \l__nm_initial_i_int - \int_use:N \l__nm_initial_j_int #1 ) \dim_gset:Nn \g__nm_x_initial_dim \pgf@x \dim_gset:Nn \g__nm_y_initial_dim \pgf@y - \tikz@parse@node\pgfutil@firstofone + \tikz@parse@node \pgfutil@firstofone ( nm - \int_use:N \g__nm_env_int - \int_use:N \l__nm_final_i_int - \int_use:N \l__nm_final_j_int #2 ) @@ -1139,51 +1158,36 @@ \end { tikzpicture } \__nm_draw_tikz_line: } +\cs_generate_variant:Nn \dim_set:Nn { N v } +\cs_set:Npn \__nm_dotfill: + { \cleaders \hbox_to_wd:nn {.44em} {\hss .\hss } \hfill \kern \c_zero_dim } + \cs_new:Nn \__nm_hdottedline: { - \noalign { \skip_vertical:n { 0.53 pt } } - \__nm_hdottedline_i: - } -\cs_new_protected:Nn \__nm_hdottedline_i: - { - \int_compare:nNnTF \g__nm_row_int < 2 - { \__nm_error:n { Use~of~hdottedline~in~first~position } } + \noalign { \bool_gset_true:N \g__nm_extra_nodes_bool - \bool_if:NF \c__nm_draft_bool - { - \tl_gput_right:Nx \g__nm_code_after_tl + \cs_if_exist:cTF { __nm_width_ \int_use:N \g__nm_env_int } + { \dim_set:Nv \l_tmpa_dim { __nm_width_ \int_use:N \g__nm_env_int } } + { \dim_set:Nn \l_tmpa_dim { 5 mm } } + \hbox_overlap_right:n + { \hbox_to_wd:nn { - \exp_not:N \__nm_hdottedline:n - \exp_not:N { - \int_eval:n { \g__nm_row_int - 1 } - \exp_not:N } + \l_tmpa_dim + 2 \arraycolsep + - \l__nm_left_margin_dim - \g__nm_right_margin_dim } + \__nm_dotfill: } } } -\cs_new_protected:Nn \__nm_hdottedline:n +\__nm_msg_new:nn { Use~of~hdottedline~in~first~position } { - \__nm_create_extra_nodes: - \dim_zero_new:N \g__nm_x_initial_dim - \dim_zero_new:N \g__nm_y_initial_dim - \dim_zero_new:N \g__nm_x_final_dim - \dim_zero_new:N \g__nm_y_final_dim - \bool_set_true:N \l__nm_initial_open_bool - \bool_set_true:N \l__nm_final_open_bool - \begin { tikzpicture } [ remember~picture ] - \tikz@parse@node\pgfutil@firstofone - ( #1 - 1 -large .south~west ) - \dim_gset:Nn \g__nm_x_initial_dim \pgf@x - \dim_gset:Nn \g__nm_y_initial_dim \pgf@y - \tikz@parse@node\pgfutil@firstofone - ( #1 - \int_use:N \g__nm_column_int -large .south~east ) - \dim_gset:Nn \g__nm_x_final_dim \pgf@x - \dim_gset:Nn \g__nm_y_final_dim \pgf@y - \end { tikzpicture } - \__nm_draw_tikz_line: + You~can't~use~the~command~\token_to_str:N\hdottedline\ in~the~first~row~ + of~the~environment~\{\@currenvir\}.~But~maybe~you~have~used~l,~c~and~r~ + instead~of~L,~C,~R~in~the~preamble~of~the~array.\\ + If~you~go~on,~this~dotted~line~will~be~ignored. } -\__nm_msg_new:nn { Use~of~hdottedline~in~first~position } +\__nm_msg_new:nn { Use~of~hdottedline~in~first~position~bis } { You~can't~use~the~command~\token_to_str:N\hdottedline\ in~the~first~row~ of~the~environment~\{\@currenvir\}. \\ @@ -1203,34 +1207,30 @@ \dim_zero_new:N \g__nm_y_final_dim \bool_set_true:N \l__nm_initial_open_bool \bool_set_true:N \l__nm_final_open_bool - \cs_if_exist:cTF + \begin { tikzpicture } [ remember~picture ] + \tikz@parse@node\pgfutil@firstofone + ( 1 - #1 - large .north~east ) + \dim_gset:Nn \g__nm_x_initial_dim \pgf@x + \dim_gset:Nn \g__nm_y_initial_dim \pgf@y + \tikz@parse@node\pgfutil@firstofone + ( \int_use:N \g__nm_row_int - #1 - large .south~east ) + \dim_gset:Nn \g__nm_x_final_dim \pgf@x + \dim_gset:Nn \g__nm_y_final_dim \pgf@y + \end { tikzpicture } + \cs_if_exist:cT { pgf@sh@ns@nm -\int_use:N \g__nm_env_int - 1 - #1 - w } { \begin { tikzpicture } [ remember~picture ] \tikz@parse@node\pgfutil@firstofone ( 1 - #1 - w .north~east ) \dim_gset:Nn \g__nm_x_initial_dim \pgf@x - \dim_gset:Nn \g__nm_y_initial_dim \pgf@y \tikz@parse@node\pgfutil@firstofone ( \int_use:N \g__nm_row_int - #1 - w .south~east ) \dim_gset:Nn \g__nm_x_final_dim \pgf@x - \dim_gset:Nn \g__nm_y_final_dim \pgf@y \end { tikzpicture } \dim_gadd:Nn \g__nm_x_initial_dim \arraycolsep \dim_gadd:Nn \g__nm_x_final_dim \arraycolsep } - { - \begin { tikzpicture } [ remember~picture ] - \tikz@parse@node\pgfutil@firstofone - ( 1 - #1 - large .north~east ) - \dim_gset:Nn \g__nm_x_initial_dim \pgf@x - \dim_gset:Nn \g__nm_y_initial_dim \pgf@y - \tikz@parse@node\pgfutil@firstofone - ( \int_use:N \g__nm_row_int - #1 - large .south~east ) - \dim_gset:Nn \g__nm_x_final_dim \pgf@x - \dim_gset:Nn \g__nm_y_final_dim \pgf@y - \end { tikzpicture } - } \__nm_draw_tikz_line: } } @@ -1303,10 +1303,12 @@ \cs_new_protected:Nn \__nm_NiceArrayC:n { \bool_set_true:N \l__nm_exterior_column_bool + \bool_gset_false:N \g__nm_exterior_column_found_bool \begin { NiceArray } { #1 > { + \bool_gset_true:N \g__nm_exterior_column_found_bool \int_gincr:N \g__nm_column_int \int_gset:Nn \g__nm_column_total_int { \int_max:nn \g__nm_column_total_int \g__nm_column_int } @@ -1487,7 +1489,7 @@ \dim_zero_new:c { l__nm_row_\__nm_i _max_dim } \dim_set:cn { l__nm_row_\__nm_i _max_dim } { - \c_max_dim } } - \int_step_variable:nnnNn 1 1 \g__nm_column_total_int \__nm_j + \int_step_variable:nNn \g__nm_column_total_int \__nm_j { \dim_zero_new:c { l__nm_column_\__nm_j _min_dim } \dim_set_eq:cN { l__nm_column_\__nm_j _min_dim } \c_max_dim @@ -1510,8 +1512,8 @@ \dim_set:cn { l__nm_column _ \__nm_j _ min_dim} { \dim_min:vn { l__nm_column _ \__nm_j _min_dim } \pgf@x } } - \tikz@parse@node \pgfutil@firstofone - ( nm - \int_use:N \g__nm_env_int - \__nm_i - \__nm_j .north~east ) + \tikz@parse@node \pgfutil@firstofone + ( nm - \int_use:N \g__nm_env_int - \__nm_i - \__nm_j .north~east ) \dim_set:cn { l__nm_row _ \__nm_i _ max_dim } { \dim_max:vn { l__nm_row _ \__nm_i _ max_dim } \pgf@y } \seq_if_in:NxF \g__nm_multicolumn_cells_seq { \__nm_i - \__nm_j } @@ -1525,7 +1527,7 @@ \tikzset { name~suffix = -medium } \__nm_create_nodes: \int_set:Nn \l__nm_nb_first_row_int 1 - \int_step_variable:nnnNn 1 1 { \g__nm_row_int - 1 } \__nm_i + \int_step_variable:nNn { \g__nm_row_int - 1 } \__nm_i { \dim_set:cn { l__nm_row _ \__nm_i _ min _ dim } { @@ -1538,7 +1540,7 @@ \dim_set_eq:cc { l__nm_row _ \int_eval:n { \__nm_i + 1 } _ max _ dim } { l__nm_row_\__nm_i _min_dim } } - \int_step_variable:nnnNn 1 1 { \g__nm_column_int - 1 } \__nm_j + \int_step_variable:nNn { \g__nm_column_int - 1 } \__nm_j { \dim_set:cn { l__nm_column _ \__nm_j _ max _ dim } { @@ -1563,6 +1565,22 @@ \__nm_create_nodes: \end{tikzpicture} \cs_set:Nn \__nm_create_extra_nodes: { } + \begin { tikzpicture } [ remember~picture , overlay ] + \tikz@parse@node \pgfutil@firstofone + ( nm - \int_use:N \g__nm_env_int - 1 - 1 - large .north~west ) + \dim_gset:Nn \g_tmpa_dim \pgf@x + \tikz@parse@node \pgfutil@firstofone + ( nm - \int_use:N \g__nm_env_int - 1 - + \int_use:N \g__nm_column_int - large .north~east ) + \dim_gset:Nn \g_tmpb_dim \pgf@x + \end { tikzpicture } + \iow_now:Nn \@mainaux \ExplSyntaxOn + \iow_now:Nx \@mainaux + { + \cs_gset:cpn { __nm_width_ \int_use:N \g__nm_env_int } + { \dim_eval:n { \g_tmpb_dim - \g_tmpa_dim } } + } + \iow_now:Nn \@mainaux \ExplSyntaxOff } \cs_new_protected:Nn \__nm_create_nodes: { @@ -1627,7 +1645,7 @@ \cs_new:Npn \__nm_seq_mapthread_function:NNN #1 #2 #3 { \group_begin: - \int_step_inline:nnnn 1 1 { \seq_count:N #1 } + \int_step_inline:nn { \seq_count:N #1 } { \seq_pop:NN #1 \l_tmpa_tl \seq_pop:NN #2 \l_tmpb_tl -- cgit v1.2.3