diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/nicematrix/nicematrix.dtx | 374 |
1 files changed, 246 insertions, 128 deletions
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,11 +3408,30 @@ 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 { \tikzset { external / export = false } } @@ -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,74 +4329,73 @@ 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\}. \\ If~you~go~on,~this~dotted~line~will~be~ignored. } @@ -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 |