diff options
Diffstat (limited to 'macros/latex/contrib/nicematrix/nicematrix-code.dtx')
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix-code.dtx | 84 |
1 files changed, 49 insertions, 35 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix-code.dtx b/macros/latex/contrib/nicematrix/nicematrix-code.dtx index 4eced4eac5..3ffdfca274 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.29b} -\def\myfiledate{2024/11/12} +\def\myfileversion{7.0} +\def\myfiledate{2024/11/18} % % %<*batchfile> @@ -162,11 +162,10 @@ version 2005/12/01 or later. % In the version 2.6a of \pkg{array}, important modifications have been done for % the Tagging Project. % \begin{macrocode} -\bool_const:Nn \c_@@_tagging_array_bool +\bool_const:Nn \c_@@_recent_array_bool { \IfPackageAtLeastTF { array } { 2024/05/01 } \c_true_bool \c_false_bool } \bool_const:Nn \c_@@_testphase_table_bool - { \IfPackageLoadedTF { latex-lab-testphase-table } \c_true_bool \c_false_bool - } + { \IfPackageLoadedTF { latex-lab-testphase-table } \c_true_bool \c_false_bool } % \end{macrocode} % % @@ -3503,7 +3502,7 @@ version 2005/12/01 or later. % |\ialign|. In that case, of course, you do a saving of |\ar@ialign|. % \begin{macrocode} \bool_if:nTF - { \c_@@_tagging_array_bool && ! \c_@@_revtex_bool } + { \c_@@_recent_array_bool && ! \c_@@_revtex_bool } { \cs_set_eq:NN \@@_old_ar@ialign: \ar@ialign } { \cs_set_eq:NN \@@_old_ialign: \ialign } % \end{macrocode} @@ -3558,9 +3557,9 @@ version 2005/12/01 or later. % % \bigskip % \begin{macrocode} -\cs_new_protected:Npn \@@_everycr: +\cs_new_protected:Npn \@@_in_everycr: { - \bool_if:NT \c_@@_testphase_table_bool + \bool_if:NT \c_@@_recent_array_bool { \tbl_if_row_was_started:T { \UseTaggingSocket { tbl / row / end } } \tbl_update_cell_data_for_next_row: @@ -3643,12 +3642,12 @@ version 2005/12/01 or later. { \IfPackageLoadedTF { colortbl } { - \cs_set_protected:Npn \@@_redefine_everycr: - { \CT@everycr { \noalign { \@@_everycr: } } } + \cs_set_protected:Npn \@@_everycr: + { \CT@everycr { \noalign { \@@_in_everycr: } } } } { - \cs_new_protected:Npn \@@_redefine_everycr: - { \everycr { \noalign { \@@_everycr: } } } + \cs_new_protected:Npn \@@_everycr: + { \everycr { \noalign { \@@_in_everycr: } } } } } % \end{macrocode} @@ -3688,6 +3687,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_some_initialization: { + \@@_everycr: \dim_gset:Nn \g_@@_dp_row_zero_dim { \box_dp:N \@arstrutbox } \dim_gset:Nn \g_@@_ht_row_zero_dim { \box_ht:N \@arstrutbox } \dim_gset_eq:NN \g_@@_ht_row_one_dim \g_@@_ht_row_zero_dim @@ -3750,19 +3750,19 @@ version 2005/12/01 or later. % % \bigskip % The environment |{array}| (since version 2.6) uses internally the command -% |\ar@ialign|. We change the definition of |\ialign| for several reasons. In -% particular, |\ialign| sets |\everycr| to |{ }| and we \emph{need} to have to -% change the value of |\everycr|. +% |\ar@ialign| (and previously, it was |\ialign|). We change that command for +% several reasons. In particular, |\ar@ialign| sets |\everycr| to |{ }| and we +% \emph{need} to change the value of |\everycr|. % \begin{macrocode} \bool_if:nTF - { \c_@@_tagging_array_bool && ! \c_@@_revtex_bool } + { \c_@@_recent_array_bool && ! \c_@@_revtex_bool } { \cs_set_nopar:Npn \ar@ialign { - \bool_if:NT \c_@@_testphase_table_bool \tbl_init_cell_data_for_table: - \@@_redefine_everycr: - \dim_zero:N \tabskip + \bool_if:NT \c_@@_testphase_table_bool + \tbl_init_cell_data_for_table: \@@_some_initialization: + \dim_zero:N \tabskip % \end{macrocode} % % After its first use, the definition of |\ar@ialign| will revert @@ -3775,8 +3775,8 @@ version 2005/12/01 or later. } % \end{macrocode} % The following part will be deleted when we will delete the boolean -% |\c_@@_tagging_array_bool| (when we consider the version 2.6a of \pkg{array} -% is required). Morevover, \cls{revtex4-2} modifies \pkg{array} and provides +% |\c_@@_recent_array_bool| (when we consider the version 2.6a of \pkg{array} +% is required). Moreover, \cls{revtex4-2} modifies \pkg{array} and provides % commands which are meant to be the standard version of \pkg{array} but, at the % date of november 2024, these commands corresponds to the \emph{old} version of % \pkg{array}, that is to say without the |\ar@ialign|. @@ -3784,9 +3784,8 @@ version 2005/12/01 or later. { \cs_set_nopar:Npn \ialign { - \@@_redefine_everycr: - \dim_zero:N \tabskip \@@_some_initialization: + \dim_zero:N \tabskip \cs_set_eq:NN \ialign \@@_old_ialign: \halign } @@ -4050,7 +4049,7 @@ version 2005/12/01 or later. } { \dim_gset:Nn \l_@@_left_delim_dim - { 2 \bool_if:NTF \l_@@_tabular_bool \tabcolsep \arraycolsep } + { 2 \bool_if:NTF \l_@@_tabular_bool \tabcolsep \arraycolsep } \dim_gset_eq:NN \l_@@_right_delim_dim \l_@@_left_delim_dim } % \end{macrocode} @@ -4061,13 +4060,20 @@ version 2005/12/01 or later. % part of the environment (and the closing |\c_math_toggle_token| also). % \begin{macrocode} \hbox_set:Nw \l_@@_the_array_box - \bool_if:NT \c_@@_testphase_table_bool + \bool_if:NT \c_@@_recent_array_bool { \UseTaggingSocket { tbl / hmode / begin } } % \end{macrocode} % % \begin{macrocode} \skip_horizontal:N \l_@@_left_margin_dim \skip_horizontal:N \l_@@_extra_left_margin_dim +% \end{macrocode} +% +% The following code is a workaround to specify to the tagging system that the +% following code is \emph{fake math} (it raises |\l__math_fakemath_bool| in +% recent versions of LaTEX). +% \begin{macrocode} + \m@th \c_math_toggle_token \bool_if:NTF \l_@@_light_syntax_bool { \use:c { @@-light-syntax } } @@ -4980,11 +4986,19 @@ version 2005/12/01 or later. % possible to do that in |{NiceTabular*}| (we control that with the value of % |\l_@@_tabular_width_dim|). % \begin{macrocode} - \dim_compare:nNnT \l_@@_tabular_width_dim = \c_zero_dim - { - \tl_gput_right:Nn \g_@@_array_preamble_tl - { > { \@@_error_too_much_cols: } l } - } + \dim_compare:nNnT \l_@@_tabular_width_dim = \c_zero_dim + { +% \end{macrocode} +% If the tagging of the tabulars is done (part of the Tagging Project), you +% don't activate that mechanism because it would create a dummy column of tagged +% empty cells. +% \begin{macrocode} + \bool_if:NF \c_@@_testphase_table_bool + { + \tl_gput_right:Nn \g_@@_array_preamble_tl + { > { \@@_error_too_much_cols: } l } + } + } } % \end{macrocode} % @@ -6071,7 +6085,7 @@ version 2005/12/01 or later. \exp_args:No \@mkpream \g_@@_preamble_tl \@addtopreamble \@empty \endgroup - \bool_if:NT \c_@@_testphase_table_bool + \bool_if:NT \c_@@_recent_array_bool { \UseTaggingSocket { tbl / colspan } { #1 } } % \end{macrocode} % @@ -6488,7 +6502,7 @@ version 2005/12/01 or later. { \group_begin: % \end{macrocode} -% The flag |\l_@@_in_caption_bool| affects only the behaviour of the command +% The flag |\l_@@_in_caption_bool| affects only the behavior of the command % |\tabularnote| when used in the caption. % \begin{macrocode} \bool_set_true:N \l_@@_in_caption_bool @@ -7524,7 +7538,7 @@ version 2005/12/01 or later. } { \endNiceArray - \bool_if:NT \c_@@_testphase_table_bool + \bool_if:NT \c_@@_recent_array_bool { \UseTaggingSocket { tbl / hmode / end } } } % \end{macrocode} @@ -7830,7 +7844,7 @@ version 2005/12/01 or later. } } } - \bool_if:NT \c_@@_tagging_array_bool + \bool_if:NT \c_@@_recent_array_bool { \cs_set_eq:NN \ar@ialign \@@_old_ar@ialign: } \cs_set_eq:NN \SubMatrix \@@_SubMatrix \cs_set_eq:NN \UnderBrace \@@_UnderBrace @@ -13746,7 +13760,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_draw_blocks: { - \bool_if:NTF \c_@@_tagging_array_bool + \bool_if:NTF \c_@@_recent_array_bool { \cs_set_eq:NN \ar@ialign \@@_old_ar@ialign: } { \cs_set_eq:NN \ialign \@@_old_ialign: } \seq_map_inline:Nn \g_@@_blocks_seq { \@@_Block_iv:nnnnnn ##1 } |