summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/zref-check/CHANGELOG.md13
-rw-r--r--Master/texmf-dist/doc/latex/zref-check/MANIFEST.md10
-rw-r--r--Master/texmf-dist/doc/latex/zref-check/zref-check-code.pdfbin739886 -> 741719 bytes
-rw-r--r--Master/texmf-dist/doc/latex/zref-check/zref-check-code.tex2
-rw-r--r--Master/texmf-dist/doc/latex/zref-check/zref-check.pdfbin456837 -> 451899 bytes
-rw-r--r--Master/texmf-dist/doc/latex/zref-check/zref-check.tex2
-rw-r--r--Master/texmf-dist/source/latex/zref-check/zref-check.dtx248
-rw-r--r--Master/texmf-dist/source/latex/zref-check/zref-check.ins4
-rw-r--r--Master/texmf-dist/tex/latex/zref-check/zref-check.sty123
9 files changed, 190 insertions, 212 deletions
diff --git a/Master/texmf-dist/doc/latex/zref-check/CHANGELOG.md b/Master/texmf-dist/doc/latex/zref-check/CHANGELOG.md
index 2538c91c1de..17895758faf 100644
--- a/Master/texmf-dist/doc/latex/zref-check/CHANGELOG.md
+++ b/Master/texmf-dist/doc/latex/zref-check/CHANGELOG.md
@@ -1,6 +1,17 @@
# Changelog
-## [Unreleased](https://github.com/gusbrs/zref-check/compare/v0.2.3...HEAD)
+## [Unreleased](https://github.com/gusbrs/zref-check/compare/v0.2.4...HEAD)
+
+## [v0.2.4](https://github.com/gusbrs/zref-check/compare/v0.2.3...v0.2.4) (2022-02-08)
+
+### Added
+- New `otherpage` check.
+- Infrastructure support provided for integration with `zref-vario`.
+
+### Deprecated
+- Option `labelcmd` has been deprecated with no replacement. The originally
+ intended use for this option has been made obsolete by package
+ `zref-clever`.
## [v0.2.3](https://github.com/gusbrs/zref-check/compare/v0.2.2...v0.2.3) (2021-12-20)
diff --git a/Master/texmf-dist/doc/latex/zref-check/MANIFEST.md b/Master/texmf-dist/doc/latex/zref-check/MANIFEST.md
index 3da3e909109..7a204e97823 100644
--- a/Master/texmf-dist/doc/latex/zref-check/MANIFEST.md
+++ b/Master/texmf-dist/doc/latex/zref-check/MANIFEST.md
@@ -78,6 +78,8 @@ different engines (pdfTeX, XeTeX, LuaTeX, etc.).
* zc-check-nextpage01.lvt
* zc-check-nextpage02.lvt
* zc-check-nextsec01.lvt
+* zc-check-otherpage01.lvt
+* zc-check-otherpage02.lvt
* zc-check-pagegap01.lvt
* zc-check-pagesafter01.lvt
* zc-check-pagesafter02.lvt
@@ -106,9 +108,6 @@ different engines (pdfTeX, XeTeX, LuaTeX, etc.).
* zc-opt-hyperref05.lvt
* zc-opt-ignore01.lvt
* zc-opt-ignore02.lvt
-* zc-opt-labelcmd01.lvt
-* zc-opt-labelcmd02.lvt
-* zc-opt-labelcmd03.lvt
* zc-opt-msglevel01.lvt
* zc-opt-msglevel02.lvt
* zc-opt-msglevel03.lvt
@@ -164,6 +163,8 @@ different engines (pdfTeX, XeTeX, LuaTeX, etc.).
* zc-check-nextpage01.tlg
* zc-check-nextpage02.tlg
* zc-check-nextsec01.tlg
+* zc-check-otherpage01.tlg
+* zc-check-otherpage02.tlg
* zc-check-pagegap01.tlg
* zc-check-pagesafter01.tlg
* zc-check-pagesafter02.tlg
@@ -212,9 +213,6 @@ different engines (pdfTeX, XeTeX, LuaTeX, etc.).
* zc-opt-hyperref05.xetexdev.tlg
* zc-opt-ignore01.tlg
* zc-opt-ignore02.tlg
-* zc-opt-labelcmd01.tlg
-* zc-opt-labelcmd02.tlg
-* zc-opt-labelcmd03.tlg
* zc-opt-msglevel01.tlg
* zc-opt-msglevel02.tlg
* zc-opt-msglevel03.tlg
diff --git a/Master/texmf-dist/doc/latex/zref-check/zref-check-code.pdf b/Master/texmf-dist/doc/latex/zref-check/zref-check-code.pdf
index b1341849688..92dafc7ae11 100644
--- a/Master/texmf-dist/doc/latex/zref-check/zref-check-code.pdf
+++ b/Master/texmf-dist/doc/latex/zref-check/zref-check-code.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/zref-check/zref-check-code.tex b/Master/texmf-dist/doc/latex/zref-check/zref-check-code.tex
index eb649833cd9..81efd7f4ec5 100644
--- a/Master/texmf-dist/doc/latex/zref-check/zref-check-code.tex
+++ b/Master/texmf-dist/doc/latex/zref-check/zref-check-code.tex
@@ -4,7 +4,7 @@
%
% This file is part of the LaTeX package "zref-check".
%
-% Copyright (C) 2021 Gustavo Barros
+% Copyright (C) 2021-2022 Gustavo Barros
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
diff --git a/Master/texmf-dist/doc/latex/zref-check/zref-check.pdf b/Master/texmf-dist/doc/latex/zref-check/zref-check.pdf
index 18d89eb2d9e..3c20e85536e 100644
--- a/Master/texmf-dist/doc/latex/zref-check/zref-check.pdf
+++ b/Master/texmf-dist/doc/latex/zref-check/zref-check.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/zref-check/zref-check.tex b/Master/texmf-dist/doc/latex/zref-check/zref-check.tex
index 6f223187823..140d22bfd45 100644
--- a/Master/texmf-dist/doc/latex/zref-check/zref-check.tex
+++ b/Master/texmf-dist/doc/latex/zref-check/zref-check.tex
@@ -4,7 +4,7 @@
%
% This file is part of the LaTeX package "zref-check".
%
-% Copyright (C) 2021 Gustavo Barros
+% Copyright (C) 2021-2022 Gustavo Barros
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
diff --git a/Master/texmf-dist/source/latex/zref-check/zref-check.dtx b/Master/texmf-dist/source/latex/zref-check/zref-check.dtx
index 57f5e26ca4f..6392f43c43d 100644
--- a/Master/texmf-dist/source/latex/zref-check/zref-check.dtx
+++ b/Master/texmf-dist/source/latex/zref-check/zref-check.dtx
@@ -4,7 +4,7 @@
%
% This file is part of the LaTeX package "zref-check".
%
-% Copyright (C) 2021 Gustavo Barros
+% Copyright (C) 2021-2022 Gustavo Barros
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -121,7 +121,6 @@
% allowing for them to be consistently verified.
%
%
-%
% \section{Loading the package}
% \label{sec:loading-package}
%
@@ -190,6 +189,16 @@
% Sets \pkg{zref-check}'s options (see Section~\ref{sec:options}).
% \end{function}
%
+% \bigskip{}
+%
+% All user commands of \pkg{zref-check} have their \marg{label} arguments
+% protected for \pkg{babel} active characters using \pkg{zref}'s
+% \cs{zref@wrapper@babel}, so that we should have equivalent support in that
+% regard, as \pkg{zref} itself does. \pkg{zref-check} depends on \pkg{zref},
+% as the name entails, which means it is able to work with \pkg{zref} labels,
+% in general created by \cs{zlabel}, but also with \cs{zctarget} and the
+% \texttt{zcregion} environment provided by this package.
+%
%
% \section{Checks}
% \label{sec:checks}
@@ -229,6 +238,9 @@
% \item[nextpage] \meta{label} occurs on the next page relative to
% \cs{zcheck}.
%
+% \item[otherpage] \meta{label} occurs on a page different from that of
+% \cs{zcheck}, that is, it does \emph{not} occur on \opt{thispage}.
+%
% \item[pagegap] There is a page gap between \meta{label} and \cs{zcheck}, in
% other words, \meta{label} does \emph{not} occur on \opt{thispage},
% \opt{prevpage} or \opt{nextpage}.
@@ -357,69 +369,6 @@
% value, with default 5.
%
%
-% \DescribeOption{labelcmd} %
-% Defines the command used to set the user labels in \cs{zctarget} and
-% \texttt{zcregion}. Takes a control sequence \emph{name} as value, and the
-% default sets labels with the minimal required properties, those of the
-% \texttt{zrefcheck} property list. This is a preamble only option. The
-% specified control sequence must receive one mandatory argument (the
-% \marg{label}) and must generate a \texttt{zref label} with at least the
-% properties in the \texttt{zrefcheck} property list. The intended use case
-% is that of the user creating a convenience macro which calls both \cs{label}
-% and \cs{zlabel}, as suggested in Section~\ref{sec:labels}, so that the same
-% labels are accessible either from the standard reference system or from
-% \pkg{zref}. For example:
-%
-% \begin{verbatim}
-% \NewDocumentCommand\mybothlabels{m}{\label{#1}\zlabel{#1}}
-% \zrefchecksetup{labelcmd=mybothlabels}
-% \end{verbatim}
-%
-% Note that the value of the underlying counter used for labels in
-% \cs{zctarget} and \texttt{zcregion} -- what you'd get with a plain \cs{ref}
-% here -- is not really meaningful. But you get to use
-% \cs{pageref}\marg{label}, or \pkg{hyperref}'s
-% \cs{hyperref}\oarg{label}\marg{text} on the labels used in \cs{zctarget} and
-% \texttt{zcregion} with this procedure.
-%
-%
-% \section{Labels}
-% \label{sec:labels}
-%
-% \pkg{zref-check} depends on \pkg{zref}, as the name entails, which means it
-% is able to work with \pkg{zref} labels, in general created by \cs{zlabel},
-% but also with \cs{zctarget} and the \texttt{zcregion} environment provided
-% by this package. This has some advantages, particularly the data
-% flexibility of \pkg{zref}, and the absence of the ubiquitous ``load-order''
-% and compatibility problems which are well known to afflict \LaTeX{} packages
-% of this area of functionality. On the other hand, the reliance on
-% \pkg{zref} labels may be seen as an inconvenience, since users of the
-% standard cross-reference infrastructure may need to add extra labels for
-% this. That's true. But \pkg{zref-check} is not meant to replace the
-% existing functionality of the kernel or of the traditional packages in this
-% area (to my knowledge, it only intersects directly with \pkg{varioref} and,
-% even so, it is quite different in scope). Indeed, it is easy to see the use
-% in tandem with standard references, for example:
-%
-% \begin{verbatim}
-% ... Figure~\ref{fig:figure-1}, \zcheck*[nextpage]{fig:figure-1}{on
-% the next page}.
-% \end{verbatim}
-%
-% Besides, \pkg{zref} does not share the label name-space with the standard
-% labels, so that you can call both \cs{label} and \cs{zlabel} with the same
-% label name (manually, or through a convenience macro), to ease the label set
-% administration. The example above presumes that was the case.
-%
-% All user commands of \pkg{zref-check} have their \marg{label} arguments
-% protected for \pkg{babel} active characters using \pkg{zref}'s
-% \cs{zref@wrapper@babel}, so that we should have equivalent support in that
-% regard, as \pkg{zref} itself does. However, \pkg{zref-check} sets labels
-% which either start with \texttt{zrefcheck@} or end with \texttt{@zrefcheck},
-% for internal use. Label names with either of those are considered reserved
-% by the package.
-%
-%
% \section{Limitations}
%
% There are three qualitatively different kinds of checks being used by
@@ -561,7 +510,7 @@
%
% Identify the package.
% \begin{macrocode}
-\ProvidesExplPackage {zref-check} {2021-12-20} {0.2.3}
+\ProvidesExplPackage {zref-check} {2022-02-08} {0.2.4}
{Flexible cross-references with contextual checks based on zref}
% \end{macrocode}
%
@@ -614,9 +563,9 @@
% These are the lists of properties to be used by \pkg{zref-check}, that is,
% the list of properties the references and targets store. This is the
% minimum set required, more properties may be added according to options.
-% For labels set with \cs{@@_target_label:n}, that is, user facing labels, we
-% must use the \texttt{main} property list, so that \pkg{zref-clever} can also
-% retrieve the properties it needs to refer to them.
+% For user facing labels, we must use the \texttt{main} property list, so that
+% \pkg{zref-clever} can also retrieve the properties it needs to refer to
+% them.
% \begin{macrocode}
\zref@newlist { zrefcheck-check }
\zref@addprops { zrefcheck-check }
@@ -634,6 +583,16 @@
zc@abssec
}
% \end{macrocode}
+% For \pkg{zref-vario} we only need page information, since we only perform
+% \opt{above} and \opt{below} checks there.
+% \begin{macrocode}
+\zref@newlist { zrefcheck-zrefvario }
+\zref@addprops { zrefcheck-zrefvario }
+ {
+ page , % for messages
+ abspage ,
+ }
+% \end{macrocode}
%
%
% \section{Plumbing}
@@ -694,11 +653,13 @@
Control~sequence~named~'#1'~used~in~option~'labelcmd'~is~not~defined.~
Using~default~value.
}
-\msg_new:nnn { zref-check } { option-deprecated }
+\msg_new:nnn { zref-check } { option-deprecated-with-alternative }
{
- Option~'#1'~has~been~deprecated.\iow_newline:
- Use~'#2'~as~a~replacement.
+ Option~'#1'~has~been~deprecated~\msg_line_context:.\iow_newline:
+ Use~'#2'~instead.
}
+\msg_new:nnn { zref-check } { option-deprecated }
+ { Option~'#1'~has~been~deprecated~\msg_line_context:. }
% \end{macrocode}
%
%
@@ -838,13 +799,13 @@
msglevel / obeydraft .code:n =
{
% NOTE Option value deprecated in 2021-12-07 for v0.2.2.
- \msg_warning:nnnn { zref-check }{ option-deprecated }
+ \msg_warning:nnnn { zref-check }{ option-deprecated-with-alternative }
{ msglevel=obeydraft } { msglevel=infoifdraft }
} ,
msglevel / obeyfinal .code:n =
{
% NOTE Option value deprecated in 2021-12-07 for v0.2.2.
- \msg_warning:nnnn { zref-check }{ option-deprecated }
+ \msg_warning:nnnn { zref-check }{ option-deprecated-with-alternative }
{ msglevel=obeyfinal } { msglevel=warniffinal }
} ,
msglevel .value_required:n = true ,
@@ -900,13 +861,13 @@
onpage / obeydraft .code:n =
{
% NOTE Option value deprecated in 2021-12-07 for v0.2.2.
- \msg_warning:nnnn { zref-check }{ option-deprecated }
+ \msg_warning:nnnn { zref-check }{ option-deprecated-with-alternative }
{ onpage=obeydraft } { onpage=labelseqifdraft }
} ,
onpage / obeyfinal .code:n =
{
% NOTE Option value deprecated in 2021-12-07 for v0.2.2.
- \msg_warning:nnnn { zref-check }{ option-deprecated }
+ \msg_warning:nnnn { zref-check }{ option-deprecated-with-alternative }
{ onpage=obeyfinal } { onpage=msgiffinal }
} ,
onpage .value_required:n = true ,
@@ -941,66 +902,18 @@
%
% \subsubsection*{\opt{labelcmd} option}
%
-% \begin{variable}{\l_@@_target_label_tl}
-% I'd love to receive the macro itself rather than it's name, but this would
-% bring unwarranted complications:
-% \url{https://tex.stackexchange.com/a/489570}.
% \begin{macrocode}
-\tl_new:N \l_@@_target_label_tl
-\bool_new:N \l_@@_target_label_bool
\keys_define:nn { zref-check }
{
labelcmd .code:n =
{
- \tl_set:Nn \l_@@_target_label_tl {#1}
- \bool_set_true:N \l_@@_target_label_bool
+ % NOTE Option value deprecated in 2022-02-08 for v0.2.4.
+ \msg_warning:nnn { zref-check }{ option-deprecated }
+ { labelcmd }
} ,
- labelcmd .value_required:n = true ,
}
% \end{macrocode}
-% \end{variable}
-%
-% \begin{macro}{\@@_target_label:n}
-% Default definition of the function for user label setting in \cs{zctarget}
-% and \texttt{zcregion}. It may be redefined at \texttt{begindocument}
-% according to option \opt{labelcmd}.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_target_label:n #1
- { \zref@label {#1} }
-% \end{macrocode}
-% \end{macro}
%
-% \begin{macrocode}
-\AddToHook { begindocument }
- {
- \bool_if:NT \l_@@_target_label_bool
- {
- \tl_if_blank:VT \l_@@_target_label_tl
- { \tl_clear:N \l_@@_target_label_tl }
- \cs_if_exist:cTF { \l_@@_target_label_tl }
- {
- \cs_set_protected:Npx \@@_target_label:n #1
- {
- \exp_not:o
- { \cs:w \l_@@_target_label_tl \cs_end: }
- {#1}
- }
- }
- {
- \exp_args:Nnno \msg_warning:nnn { zref-check }
- { labelcmd-undefined } { \l_@@_target_label_tl }
- }
- }
- \keys_define:nn { zref-check }
- {
- labelcmd .code:n =
- {
- \msg_warning:nnn { zref-check }
- { option-preamble-only } { labelcmd }
- }
- }
- }
-% \end{macrocode}
%
%
% \subsubsection*{Package options}
@@ -1191,6 +1104,11 @@
% complications it brings, this check was a slippery slope. All in all, I've
% decided to drop it.
%
+% There's an interesting answer by David Carlisle at
+% \url{https://tex.stackexchange.com/a/419189} to decide whether to typeset
+% ``above'' or ``below'' using a method which essentially boils down to
+% ``position in the \file{.aux} file''.
+%
%
%
% \subsection{Counter}
@@ -1516,7 +1434,7 @@
% \begin{macrocode}
\group_begin:
\refstepcounter { zrefcheck }
- \zref@wrapper@babel \@@_target_label:n {#1}
+ \zref@wrapper@babel \zref@label {#1}
#2
\tl_if_empty:nF {#2}
{
@@ -1538,7 +1456,7 @@
\NewDocumentEnvironment {zcregion} { m }
{
\refstepcounter { zrefcheck }
- \zref@wrapper@babel \@@_target_label:n {#1}
+ \zref@wrapper@babel \zref@label {#1}
}
{
\zref@wrapper@babel
@@ -1643,6 +1561,7 @@
prevpage ,
nextpage ,
facing ,
+ otherpage ,
pagegap ,
above ,
below ,
@@ -1799,19 +1718,31 @@
\@@_check_thispage:nnT
{#2} {#3}
{ \bool_set_true:N \l_@@_onpage_bool }
- \@@_check_thispage:nnT
- {#2} { \@@_end_lblfmt:n {#3} }
- { \bool_set_true:N \l_@@_onpage_bool }
- \zref@ifrefundefined { \@@_end_lblfmt:n {#2} }
- {}
+ \zref@ifrefundefined { \@@_end_lblfmt:n {#3} }
+ {
+ \zref@ifrefundefined { \@@_end_lblfmt:n {#2} }
+ {}
+ {
+ \@@_check_thispage:nnT
+ { \@@_end_lblfmt:n {#2} } {#3}
+ { \bool_set_true:N \l_@@_onpage_bool }
+ }
+ }
{
\@@_check_thispage:nnT
- { \@@_end_lblfmt:n {#2} } {#3}
- { \bool_set_true:N \l_@@_onpage_bool }
- \@@_check_thispage:nnT
- { \@@_end_lblfmt:n {#2} }
- { \@@_end_lblfmt:n {#3} }
+ {#2} { \@@_end_lblfmt:n {#3} }
{ \bool_set_true:N \l_@@_onpage_bool }
+ \zref@ifrefundefined { \@@_end_lblfmt:n {#2} }
+ {}
+ {
+ \@@_check_thispage:nnT
+ { \@@_end_lblfmt:n {#2} } {#3}
+ { \bool_set_true:N \l_@@_onpage_bool }
+ \@@_check_thispage:nnT
+ { \@@_end_lblfmt:n {#2} }
+ { \@@_end_lblfmt:n {#3} }
+ { \bool_set_true:N \l_@@_onpage_bool }
+ }
}
}
\bool_if:NTF \l_@@_passedcheck_bool
@@ -1836,6 +1767,7 @@
}
\group_end:
}
+\cs_generate_variant:Nn \@@_do_check:nnn { nnV }
% \end{macrocode}
% \end{macro}
%
@@ -1861,7 +1793,7 @@
%
% \subsubsection{This page}
%
-% \begin{macro}{\@@_check_thispage:nn}
+% \begin{macro}{\@@_check_thispage:nn, \@@_check_otherpage:nn}
% \begin{macrocode}
\prg_new_protected_conditional:Npnn \@@_check_thispage:nn #1#2 { T , F , TF }
{
@@ -1880,13 +1812,19 @@
% shipped out, will receive value `1'. So, if we do find `0' here, better
% signal something is wrong. This comment extends to all page number checks.
% \begin{macrocode}
- ! \int_compare_p:nNn { \l_@@_lbl_int } = { 0 } &&
- ! \int_compare_p:nNn { \l_@@_ref_int } = { 0 }
+ ! \int_compare_p:nNn { \l_@@_lbl_int } = { 0 } &&
+ ! \int_compare_p:nNn { \l_@@_ref_int } = { 0 }
}
{ \group_insert_after:N \prg_return_true: }
{ \group_insert_after:N \prg_return_false: }
\group_end:
}
+\prg_new_protected_conditional:Npnn \@@_check_otherpage:nn #1#2 { T , F , TF }
+ {
+ \@@_check_thispage:nnTF {#1} {#2}
+ { \prg_return_false: }
+ { \prg_return_true: }
+ }
% \end{macrocode}
% \end{macro}
%
@@ -2424,6 +2362,32 @@
% \end{macro}
%
%
+%
+% \section{\pkg{zref-vario} integration}
+%
+%
+% \begin{macro}
+% {
+% \zrefcheck_zrefvario_label: ,
+% \zrefcheck_zrefvario_run_check_on_label:n
+% }
+% \begin{macrocode}
+\cs_new_protected:Npn \zrefcheck_zrefvario_label:
+ {
+ \int_gincr:N \g_@@_id_int
+ \tl_set:Nx \l_@@_checkbeg_tl
+ { \@@_check_lblfmt:n { \g_@@_id_int } }
+ \zref@labelbylist { \l_@@_checkbeg_tl } { zrefcheck-zrefvario }
+ }
+\cs_new_protected:Npn \zrefcheck_zrefvario_run_check_on_label:nn #1#2
+ { \@@_do_check:nnV {#1} {#2} \l_@@_checkbeg_tl }
+\cs_generate_variant:Nn \zrefcheck_zrefvario_run_check_on_label:nn { Vn }
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
% \begin{macrocode}
%</package>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/zref-check/zref-check.ins b/Master/texmf-dist/source/latex/zref-check/zref-check.ins
index 6d3a14b1ccd..312a34c124a 100644
--- a/Master/texmf-dist/source/latex/zref-check/zref-check.ins
+++ b/Master/texmf-dist/source/latex/zref-check/zref-check.ins
@@ -4,7 +4,7 @@
%
% This file is part of the LaTeX package "zref-check".
%
-% Copyright (C) 2021 Gustavo Barros
+% Copyright (C) 2021-2022 Gustavo Barros
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -50,7 +50,7 @@
This file was generated from file(s) of the LaTeX package "zref-check".
-Copyright (C) 2021 Gustavo Barros
+Copyright (C) 2021-2022 Gustavo Barros
It may be distributed and/or modified under the conditions of the
LaTeX Project Public License (LPPL), either version 1.3c of this
diff --git a/Master/texmf-dist/tex/latex/zref-check/zref-check.sty b/Master/texmf-dist/tex/latex/zref-check/zref-check.sty
index 4fc4cf20659..b510378bd2b 100644
--- a/Master/texmf-dist/tex/latex/zref-check/zref-check.sty
+++ b/Master/texmf-dist/tex/latex/zref-check/zref-check.sty
@@ -8,7 +8,7 @@
%%
%% This file was generated from file(s) of the LaTeX package "zref-check".
%%
-%% Copyright (C) 2021 Gustavo Barros
+%% Copyright (C) 2021-2022 Gustavo Barros
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -53,7 +53,7 @@
}%
\endinput
}%
-\ProvidesExplPackage {zref-check} {2021-12-20} {0.2.3}
+\ProvidesExplPackage {zref-check} {2022-02-08} {0.2.4}
{Flexible cross-references with contextual checks based on zref}
\RequirePackage { zref-user }
\RequirePackage { zref-abspage }
@@ -86,6 +86,12 @@
zc@abschap ,
zc@abssec
}
+\zref@newlist { zrefcheck-zrefvario }
+\zref@addprops { zrefcheck-zrefvario }
+ {
+ page , % for messages
+ abspage ,
+ }
\cs_new_protected:Npn \__zrefcheck_message:nnnn #1#2#3#4
{
\use:c { msg_ \l__zrefcheck_msglevel_tl :nnnnn }
@@ -128,11 +134,13 @@
Control~sequence~named~'#1'~used~in~option~'labelcmd'~is~not~defined.~
Using~default~value.
}
-\msg_new:nnn { zref-check } { option-deprecated }
+\msg_new:nnn { zref-check } { option-deprecated-with-alternative }
{
- Option~'#1'~has~been~deprecated.\iow_newline:
- Use~'#2'~as~a~replacement.
+ Option~'#1'~has~been~deprecated~\msg_line_context:.\iow_newline:
+ Use~'#2'~instead.
}
+\msg_new:nnn { zref-check } { option-deprecated }
+ { Option~'#1'~has~been~deprecated~\msg_line_context:. }
\cs_new_eq:NN \__zrefcheck_int_to_roman:w \__int_to_roman:w
\prg_new_conditional:Npnn \__zrefcheck_is_integer:n #1 { p, T , F , TF }
{
@@ -216,13 +224,13 @@
msglevel / obeydraft .code:n =
{
% NOTE Option value deprecated in 2021-12-07 for v0.2.2.
- \msg_warning:nnnn { zref-check }{ option-deprecated }
+ \msg_warning:nnnn { zref-check }{ option-deprecated-with-alternative }
{ msglevel=obeydraft } { msglevel=infoifdraft }
} ,
msglevel / obeyfinal .code:n =
{
% NOTE Option value deprecated in 2021-12-07 for v0.2.2.
- \msg_warning:nnnn { zref-check }{ option-deprecated }
+ \msg_warning:nnnn { zref-check }{ option-deprecated-with-alternative }
{ msglevel=obeyfinal } { msglevel=warniffinal }
} ,
msglevel .value_required:n = true ,
@@ -263,13 +271,13 @@
onpage / obeydraft .code:n =
{
% NOTE Option value deprecated in 2021-12-07 for v0.2.2.
- \msg_warning:nnnn { zref-check }{ option-deprecated }
+ \msg_warning:nnnn { zref-check }{ option-deprecated-with-alternative }
{ onpage=obeydraft } { onpage=labelseqifdraft }
} ,
onpage / obeyfinal .code:n =
{
% NOTE Option value deprecated in 2021-12-07 for v0.2.2.
- \msg_warning:nnnn { zref-check }{ option-deprecated }
+ \msg_warning:nnnn { zref-check }{ option-deprecated-with-alternative }
{ onpage=obeyfinal } { onpage=msgiffinal }
} ,
onpage .value_required:n = true ,
@@ -290,47 +298,14 @@
closerange .value_required:n = true ,
closerange .initial:n = 5
}
-\tl_new:N \l__zrefcheck_target_label_tl
-\bool_new:N \l__zrefcheck_target_label_bool
\keys_define:nn { zref-check }
{
labelcmd .code:n =
{
- \tl_set:Nn \l__zrefcheck_target_label_tl {#1}
- \bool_set_true:N \l__zrefcheck_target_label_bool
+ % NOTE Option value deprecated in 2022-02-08 for v0.2.4.
+ \msg_warning:nnn { zref-check }{ option-deprecated }
+ { labelcmd }
} ,
- labelcmd .value_required:n = true ,
- }
-\cs_new_protected:Npn \__zrefcheck_target_label:n #1
- { \zref@label {#1} }
-\AddToHook { begindocument }
- {
- \bool_if:NT \l__zrefcheck_target_label_bool
- {
- \tl_if_blank:VT \l__zrefcheck_target_label_tl
- { \tl_clear:N \l__zrefcheck_target_label_tl }
- \cs_if_exist:cTF { \l__zrefcheck_target_label_tl }
- {
- \cs_set_protected:Npx \__zrefcheck_target_label:n #1
- {
- \exp_not:o
- { \cs:w \l__zrefcheck_target_label_tl \cs_end: }
- {#1}
- }
- }
- {
- \exp_args:Nnno \msg_warning:nnn { zref-check }
- { labelcmd-undefined } { \l__zrefcheck_target_label_tl }
- }
- }
- \keys_define:nn { zref-check }
- {
- labelcmd .code:n =
- {
- \msg_warning:nnn { zref-check }
- { option-preamble-only } { labelcmd }
- }
- }
}
\RequirePackage { l3keys2e }
\ProcessKeysOptions { zref-check }
@@ -478,7 +453,7 @@
{
\group_begin:
\refstepcounter { zrefcheck }
- \zref@wrapper@babel \__zrefcheck_target_label:n {#1}
+ \zref@wrapper@babel \zref@label {#1}
#2
\tl_if_empty:nF {#2}
{
@@ -490,7 +465,7 @@
\NewDocumentEnvironment {zcregion} { m }
{
\refstepcounter { zrefcheck }
- \zref@wrapper@babel \__zrefcheck_target_label:n {#1}
+ \zref@wrapper@babel \zref@label {#1}
}
{
\zref@wrapper@babel
@@ -519,6 +494,7 @@
prevpage ,
nextpage ,
facing ,
+ otherpage ,
pagegap ,
above ,
below ,
@@ -627,19 +603,31 @@
\__zrefcheck_check_thispage:nnT
{#2} {#3}
{ \bool_set_true:N \l__zrefcheck_onpage_bool }
- \__zrefcheck_check_thispage:nnT
- {#2} { \__zrefcheck_end_lblfmt:n {#3} }
- { \bool_set_true:N \l__zrefcheck_onpage_bool }
- \zref@ifrefundefined { \__zrefcheck_end_lblfmt:n {#2} }
- {}
+ \zref@ifrefundefined { \__zrefcheck_end_lblfmt:n {#3} }
+ {
+ \zref@ifrefundefined { \__zrefcheck_end_lblfmt:n {#2} }
+ {}
+ {
+ \__zrefcheck_check_thispage:nnT
+ { \__zrefcheck_end_lblfmt:n {#2} } {#3}
+ { \bool_set_true:N \l__zrefcheck_onpage_bool }
+ }
+ }
{
\__zrefcheck_check_thispage:nnT
- { \__zrefcheck_end_lblfmt:n {#2} } {#3}
- { \bool_set_true:N \l__zrefcheck_onpage_bool }
- \__zrefcheck_check_thispage:nnT
- { \__zrefcheck_end_lblfmt:n {#2} }
- { \__zrefcheck_end_lblfmt:n {#3} }
+ {#2} { \__zrefcheck_end_lblfmt:n {#3} }
{ \bool_set_true:N \l__zrefcheck_onpage_bool }
+ \zref@ifrefundefined { \__zrefcheck_end_lblfmt:n {#2} }
+ {}
+ {
+ \__zrefcheck_check_thispage:nnT
+ { \__zrefcheck_end_lblfmt:n {#2} } {#3}
+ { \bool_set_true:N \l__zrefcheck_onpage_bool }
+ \__zrefcheck_check_thispage:nnT
+ { \__zrefcheck_end_lblfmt:n {#2} }
+ { \__zrefcheck_end_lblfmt:n {#3} }
+ { \bool_set_true:N \l__zrefcheck_onpage_bool }
+ }
}
}
\bool_if:NTF \l__zrefcheck_passedcheck_bool
@@ -664,6 +652,7 @@
}
\group_end:
}
+\cs_generate_variant:Nn \__zrefcheck_do_check:nnn { nnV }
\int_new:N \l__zrefcheck_lbl_int
\int_new:N \l__zrefcheck_ref_int
\int_new:N \l__zrefcheck_lbl_b_int
@@ -679,13 +668,19 @@
{
\int_compare_p:nNn
{ \l__zrefcheck_lbl_int } = { \l__zrefcheck_ref_int } &&
- ! \int_compare_p:nNn { \l__zrefcheck_lbl_int } = { 0 } &&
- ! \int_compare_p:nNn { \l__zrefcheck_ref_int } = { 0 }
+ ! \int_compare_p:nNn { \l__zrefcheck_lbl_int } = { 0 } &&
+ ! \int_compare_p:nNn { \l__zrefcheck_ref_int } = { 0 }
}
{ \group_insert_after:N \prg_return_true: }
{ \group_insert_after:N \prg_return_false: }
\group_end:
}
+\prg_new_protected_conditional:Npnn \__zrefcheck_check_otherpage:nn #1#2 { T , F , TF }
+ {
+ \__zrefcheck_check_thispage:nnTF {#1} {#2}
+ { \prg_return_false: }
+ { \prg_return_true: }
+ }
\prg_new_protected_conditional:Npnn \__zrefcheck_check_above:nn #1#2 { F , TF }
{
\group_begin:
@@ -1102,6 +1097,16 @@
\__zrefcheck_run_checks:nnx
{ \l__zrefcheck_zcheck_checks_seq } {#1} { \l__zrefcheck_checkbeg_tl }
}
+\cs_new_protected:Npn \zrefcheck_zrefvario_label:
+ {
+ \int_gincr:N \g__zrefcheck_id_int
+ \tl_set:Nx \l__zrefcheck_checkbeg_tl
+ { \__zrefcheck_check_lblfmt:n { \g__zrefcheck_id_int } }
+ \zref@labelbylist { \l__zrefcheck_checkbeg_tl } { zrefcheck-zrefvario }
+ }
+\cs_new_protected:Npn \zrefcheck_zrefvario_run_check_on_label:nn #1#2
+ { \__zrefcheck_do_check:nnV {#1} {#2} \l__zrefcheck_checkbeg_tl }
+\cs_generate_variant:Nn \zrefcheck_zrefvario_run_check_on_label:nn { Vn }
%%
%%
%% End of file `zref-check.sty'.