From f5460c92605f1b3b17448b27ce53375157c3e4b1 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 15 Nov 2023 03:01:12 +0000 Subject: CTAN sync 202311150301 --- macros/latex/contrib/zref-check/zref-check.dtx | 97 ++++++++++++++++---------- 1 file changed, 61 insertions(+), 36 deletions(-) (limited to 'macros/latex/contrib/zref-check/zref-check.dtx') diff --git a/macros/latex/contrib/zref-check/zref-check.dtx b/macros/latex/contrib/zref-check/zref-check.dtx index c3a05b9990..438c89d2af 100644 --- a/macros/latex/contrib/zref-check/zref-check.dtx +++ b/macros/latex/contrib/zref-check/zref-check.dtx @@ -4,7 +4,7 @@ % % This file is part of the LaTeX package "zref-check". % -% Copyright (C) 2021-2023 Gustavo Barros +% Copyright (C) 2021-2023 gusbrs % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -17,8 +17,7 @@ % version 2005/12/01 or later. % % -% This work is "maintained" (as per LPPL maintenance status) by -% Gustavo Barros. +% This work is "maintained" (as per LPPL maintenance status) by gusbrs. % % This work consists of the files zref-check.dtx, % zref-check.ins, @@ -70,9 +69,11 @@ % % For the \texttt{chapter} and \texttt{section} checks, \pkg{zref-check} uses % the new hook system in \pkg{ltcmdhooks}, which was released with the -% 2021/06/01 \LaTeX{} kernel. +% 2021/06/01 \LaTeX{} kernel. And, since we followed the move to +% \texttt{e}-type expansion, to play safe we require the 2023-11-01 kernel or +% newer. % \begin{macrocode} -\def\zrefcheck@required@kernel{2021-06-01} +\def\zrefcheck@required@kernel{2023-11-01} \NeedsTeXFormat{LaTeX2e}[\zrefcheck@required@kernel] \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} \IfFormatAtLeastTF{\zrefcheck@required@kernel} @@ -87,7 +88,7 @@ % % Identify the package. % \begin{macrocode} -\ProvidesExplPackage {zref-check} {2023-08-13} {0.3.4} +\ProvidesExplPackage {zref-check} {2023-11-14} {0.3.5} {Flexible cross-references with contextual checks based on zref} % \end{macrocode} % @@ -168,16 +169,38 @@ % % \section{Plumbing} % +% \subsection{Auxiliary} +% +% \begin{macro} +% { +% \l_@@_tmpa_tl , +% \l_@@_tmpb_tl , +% \g_@@_tmpa_tl , +% \l_@@_tmpa_int , +% \l_@@_tmpa_bool , +% \g_@@_tmpa_ior , +% } +% Temporary scratch variables. +% \begin{macrocode} +\tl_new:N \l_@@_tmpa_tl +\tl_new:N \l_@@_tmpb_tl +\tl_new:N \g_@@_tmpa_tl +\int_new:N \l_@@_tmpa_int +\bool_new:N \l_@@_tmpa_bool +\ior_new:N \g_@@_tmpa_ior +% \end{macrocode} +% \end{macro} +% % \subsection{Messages} % -% \begin{macro}{\@@_message:nnnn, \@@_message:nnnx} +% \begin{macro}{\@@_message:nnnn, \@@_message:nnne} % \begin{macrocode} \cs_new_protected:Npn \@@_message:nnnn #1#2#3#4 { \use:c { msg_ \l_@@_msglevel_tl :nnnnn } { zref-check } {#1} {#2} {#3} {#4} } -\cs_generate_variant:Nn \@@_message:nnnn { nnnx } +\cs_generate_variant:Nn \@@_message:nnnn { nnne } % \end{macrocode} % \end{macro} % @@ -594,37 +617,38 @@ % \end{variable} % % \begin{macrocode} -\tl_gset:Nn \g_tmpa_tl { \c_sys_jobname_str .aux } -\file_if_exist:nT { \g_tmpa_tl } +\tl_gset:Nn \g_@@_tmpa_tl { \c_sys_jobname_str .aux } +\file_if_exist:nT { \g_@@_tmpa_tl } { % \end{macrocode} % Retrieve the information from the \file{.aux} file, and store it in a % property list, so that the sequence can be retrieved in key-value fashion. % \begin{macrocode} - \ior_open:Nn \g_tmpa_ior { \g_tmpa_tl } + \ior_open:Nn \g_@@_tmpa_ior { \g_@@_tmpa_tl } \group_begin: - \int_zero:N \l_tmpa_int - \tl_clear:N \l_tmpa_tl - \tl_clear:N \l_tmpb_tl - \bool_set_false:N \l_tmpa_bool - \ior_map_variable:NNn \g_tmpa_ior \l_tmpa_tl + \int_zero:N \l_@@_tmpa_int + \tl_clear:N \l_@@_tmpa_tl + \tl_clear:N \l_@@_tmpb_tl + \bool_set_false:N \l_@@_tmpa_bool + \ior_map_variable:NNn \g_@@_tmpa_ior \l_@@_tmpa_tl { - \tl_map_variable:NNn \l_tmpa_tl \l_tmpb_tl + \tl_map_variable:NNn \l_@@_tmpa_tl \l_@@_tmpb_tl { - \tl_if_eq:NnTF \l_tmpb_tl { \zref@newlabel } + \tl_if_eq:NnTF \l_@@_tmpb_tl { \zref@newlabel } { % \end{macrocode} % Found a \cs{zref@label}, signal it. % \begin{macrocode} - \bool_set_true:N \l_tmpa_bool + \bool_set_true:N \l_@@_tmpa_bool } { - \bool_if:NTF \l_tmpa_bool + \bool_if:NTF \l_@@_tmpa_bool { - \bool_set_false:N \l_tmpa_bool - \int_incr:N \l_tmpa_int - \prop_gput:Nxx \g_@@_auxfile_lblseq_prop - { \l_tmpb_tl } { \int_use:N \l_tmpa_int } + \bool_set_false:N \l_@@_tmpa_bool + \int_incr:N \l_@@_tmpa_int + \prop_gput:Nee \g_@@_auxfile_lblseq_prop + { \l_@@_tmpb_tl } + { \int_use:N \l_@@_tmpa_int } } { % \end{macrocode} @@ -632,7 +656,8 @@ % the loop and discard the rest of the line, to ensure no babel calls to % \cs{catcode} in the \file{.aux} file get expanded. This also breaks the % loop and discards the rest of the \cs{zref@newlabel} lines after we got the -% label we wanted, since we reset \cs{l_tmpa_bool} in the \texttt{T} branch. +% label we wanted, since we reset \cs{l_@@_tmpa_bool} in the \texttt{T} +% branch. % \begin{macrocode} \tl_map_break: } @@ -640,7 +665,7 @@ } } \group_end: - \ior_close:N \g_tmpa_ior + \ior_close:N \g_@@_tmpa_ior } % \end{macrocode} % @@ -778,7 +803,7 @@ { \zref@ifrefcontainsprop {#1} {#2} { - \tl_set:Nx #3 + \tl_set:Ne #3 { \zref@extractdefault {#1} {#2} { \c_empty_tl } } } { @@ -924,7 +949,7 @@ % Names of the labels for this zcheck call. % \begin{macrocode} \int_gincr:N \g_@@_id_int - \tl_set:Nx \l_@@_checkbeg_tl + \tl_set:Ne \l_@@_checkbeg_tl { \@@_check_lblfmt:n { \g_@@_id_int } } % \end{macrocode} % Set checkbeg label. @@ -950,7 +975,7 @@ ! \l_@@_link_star_bool } { - \exp_args:Nx \zrefcheck_get_astl:nnn + \exp_args:Ne \zrefcheck_get_astl:nnn { \l_@@_link_label_tl } { anchor } { \l_@@_link_anchor_tl } \hyperlink { \l_@@_link_anchor_tl } {#4} @@ -974,7 +999,7 @@ % \end{macrocode} % Run the checks. % \begin{macrocode} - \@@_run_checks:nnx { \l_@@_zcheck_checks_seq } + \@@_run_checks:nne { \l_@@_zcheck_checks_seq } { \l_@@_zcheck_labels_seq } { \l_@@_checkbeg_tl } \group_end: } @@ -1187,7 +1212,7 @@ } \group_end: } -\cs_generate_variant:Nn \@@_run_checks:nnn { nnx } +\cs_generate_variant:Nn \@@_run_checks:nnn { nne } % \end{macrocode} % \end{macro} % @@ -1331,7 +1356,7 @@ \l_@@_onpage_bool } { - \@@_message:nnnx { double-check } {#1} {#2} + \@@_message:nnne { double-check } {#1} {#2} { \zref@extractdefault {#3} {page} {'unknown'} } } } @@ -1339,7 +1364,7 @@ \bool_if:NTF \l_@@_empty_label_bool { \@@_message:nnnn { empty-label } {#1} { } { } } { - \@@_message:nnnx { check-failed } {#1} {#2} + \@@_message:nnne { check-failed } {#1} {#2} { \zref@extractdefault {#3} {page} {'unknown'} } } } @@ -1929,7 +1954,7 @@ \cs_new_protected:Npn \zrefcheck_zcref_beg_label: { \int_gincr:N \g_@@_id_int - \tl_set:Nx \l_@@_checkbeg_tl + \tl_set:Ne \l_@@_checkbeg_tl { \@@_check_lblfmt:n { \g_@@_id_int } } \zref@labelbylist { \l_@@_checkbeg_tl } { zrefcheck-check } } @@ -1944,7 +1969,7 @@ } \cs_new_protected:Npn \zrefcheck_zcref_run_checks_on_labels:n #1 { - \@@_run_checks:nnx + \@@_run_checks:nne { \l_@@_zcheck_checks_seq } {#1} { \l_@@_checkbeg_tl } } % \end{macrocode} @@ -1964,7 +1989,7 @@ \cs_new_protected:Npn \zrefcheck_zrefvario_label: { \int_gincr:N \g_@@_id_int - \tl_set:Nx \l_@@_checkbeg_tl + \tl_set:Ne \l_@@_checkbeg_tl { \@@_check_lblfmt:n { \g_@@_id_int } } \zref@labelbylist { \l_@@_checkbeg_tl } { zrefcheck-zrefvario } } -- cgit v1.2.3