texlive[61951] Master/texmf-dist: zref-vario (8feb22)

commits+karl at tug.org commits+karl at tug.org
Tue Feb 8 22:52:18 CET 2022


Revision: 61951
          http://tug.org/svn/texlive?view=revision&revision=61951
Author:   karl
Date:     2022-02-08 22:52:17 +0100 (Tue, 08 Feb 2022)
Log Message:
-----------
zref-vario (8feb22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/zref-vario/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/zref-vario/MANIFEST.md
    trunk/Master/texmf-dist/doc/latex/zref-vario/zref-vario-code.pdf
    trunk/Master/texmf-dist/doc/latex/zref-vario/zref-vario.pdf
    trunk/Master/texmf-dist/doc/latex/zref-vario/zref-vario.tex
    trunk/Master/texmf-dist/source/latex/zref-vario/zref-vario.dtx
    trunk/Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty

Modified: trunk/Master/texmf-dist/doc/latex/zref-vario/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/zref-vario/CHANGELOG.md	2022-02-08 21:51:11 UTC (rev 61950)
+++ trunk/Master/texmf-dist/doc/latex/zref-vario/CHANGELOG.md	2022-02-08 21:52:17 UTC (rev 61951)
@@ -1,7 +1,12 @@
 # Changelog
 
-## [Unreleased](https://github.com/gusbrs/zref-vario/compare/v0.1.1-alpha...HEAD)
+## [Unreleased](https://github.com/gusbrs/zref-vario/compare/v0.1.2-alpha...HEAD)
 
+## [v0.1.2-alpha](https://github.com/gusbrs/zref-vario/compare/v0.1.1-alpha...v0.1.2-alpha) (2022-02-08)
+
+### Added
+- Integration with `zref-check` and new corresponding option `vcheck`.
+
 ## [v0.1.1-alpha](https://github.com/gusbrs/zref-vario/compare/v0.1.0-alpha...v0.1.1-alpha) (2022-02-01)
 
 ### Changed

Modified: trunk/Master/texmf-dist/doc/latex/zref-vario/MANIFEST.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/zref-vario/MANIFEST.md	2022-02-08 21:51:11 UTC (rev 61950)
+++ trunk/Master/texmf-dist/doc/latex/zref-vario/MANIFEST.md	2022-02-08 21:52:17 UTC (rev 61951)
@@ -64,6 +64,7 @@
 * zv-basic04.lvt 
 * zv-hyperref01.lvt 
 * zv-languages01.lvt 
+* zv-vcheck01.lvt 
 * zv-zcref-options01.lvt 
 * zv-basic01.luatex.tlg 
 * zv-basic01.luatexdev.tlg 
@@ -91,6 +92,7 @@
 * zv-hyperref01.xetex.tlg 
 * zv-hyperref01.xetexdev.tlg 
 * zv-languages01.tlg 
+* zv-vcheck01.tlg 
 * zv-zcref-options01.luatex.tlg 
 * zv-zcref-options01.luatexdev.tlg 
 * zv-zcref-options01.tlg 

Modified: trunk/Master/texmf-dist/doc/latex/zref-vario/zref-vario-code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/zref-vario/zref-vario.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/zref-vario/zref-vario.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/zref-vario/zref-vario.tex	2022-02-08 21:51:11 UTC (rev 61950)
+++ trunk/Master/texmf-dist/doc/latex/zref-vario/zref-vario.tex	2022-02-08 21:52:17 UTC (rev 61951)
@@ -236,7 +236,7 @@
 support, you should set at least the whole set of ``\texttt{reftext}\dots{}''
 options.  Language independent default values are provided for the
 ``\dots{}\texttt{format}'' options (equivalent to the ones from
-\pkg{varioref}, which are adequate to most use cases), so you may omit them.
+\pkg{varioref}, which are adequate for most use cases), so you may omit them.
 But, if you need to adjust them, the default values can be overridden by
 setting the corresponding options in \cs{zvLanguageSetup}.
 
@@ -249,6 +249,35 @@
 \pkg{varioref}'s.
 
 
+\section{Integration with \pkg{zref-check}}
+
+When package \pkg{zref-check} is loaded, \pkg{zref-vario} provides one further
+option to its user commands: \opt{vcheck}.  The purpose of this option is to
+check the relative position of label and reference within the same page.  It
+can receive two values: \texttt{above} and \texttt{below}, being those the
+names of the \pkg{zref-check}'s checks which are meaningful for the use case
+at hand.  Of course, these could also be performed with \cs{zcref}'s
+\opt{check} option, which is available for \pkg{zref-vario}'s commands as
+well.  The difference here is that the check specified in \opt{vcheck} is only
+performed when the referenced label -- or labels, in the case of a range --
+fall on the same page as the reference itself.\footnote{There's another
+  technical difference between them.  \pkg{zref-check}'s checks, and hence
+  those of the \opt{check} option, make sure the whole reference passes each
+  check by setting labels both at the start and the end of the reference, and
+  verifying if each one of them passes the checks.  But, since \pkg{varioref}
+  already has it's own mechanism to handle references which cross page
+  boundaries, \opt{vcheck}'s checks set only one label, at the end of the
+  reference, the same position \pkg{varioref} uses to check whether label and
+  reference are on the same page.}  In other words, when \opt{vcurrent} would
+be used (if provided).  For this reason, only the commands which support
+\opt{vcurrent} offer \pkg{vcheck}.  Also, \opt{vcheck} cannot receive
+\pkg{zref-check}'s options, as \opt{check} is able to, but the latter can be
+used for the purpose of locally controlling the behavior of the checks
+performed by \opt{vcheck}.  Consult \pkg{zref-check}'s documentation for
+details and limitations of these checks and envisaged workflows for their
+reliable use.
+
+
 % \section{Acknowledgments}
 %
 % A number of people have contributed to \pkg{zref-vario}.  Suggestions,

Modified: trunk/Master/texmf-dist/source/latex/zref-vario/zref-vario.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/zref-vario/zref-vario.dtx	2022-02-08 21:51:11 UTC (rev 61950)
+++ trunk/Master/texmf-dist/source/latex/zref-vario/zref-vario.dtx	2022-02-08 21:52:17 UTC (rev 61951)
@@ -128,7 +128,7 @@
 %
 % Identify the package.
 %    \begin{macrocode}
-\ProvidesExplPackage {zref-vario} {2022-02-01} {0.1.1-alpha}
+\ProvidesExplPackage {zref-vario} {2022-02-08} {0.1.2-alpha}
   {Extended LaTeX page cross-references with varioref and zref-clever}
 %    \end{macrocode}
 %
@@ -574,7 +574,7 @@
         \seq_if_in:NxF \g_@@_setup_languages_seq
           { \@@_base_lang:e { \l_@@_ref_language_tl } }
           {
-            \msg_warning:nnx  { zref-vario } { language-not-setup }
+            \msg_warning:nnx { zref-vario } { language-not-setup }
               { \l_@@_ref_language_tl }
           }
       }
@@ -731,6 +731,19 @@
     \@@_varioref_setup:
     \@@_vpageref:VVn \l_@@_reftextcurrent_tl
       \l_@@_reftextother_tl {#1}
+    \bool_lazy_and:nnT
+      { \g_@@_zrefcheck_available_bool }
+      { \l_@@_with_vcheck_bool }
+      {
+        \zrefcheck_zrefvario_label:
+        \vref at pagenum \l_tmpa_tl { \the\c at vrcnt @vr }
+        \vrefpagenum \l_tmpb_tl {#1}
+        \tl_if_eq:NNT \l_tmpa_tl \l_tmpb_tl
+          {
+            \zrefcheck_zrefvario_run_check_on_label:Vn
+              \l_@@_vcheck_tl {#1}
+          }
+      }
     \group_end:
   }
 \cs_new_protected:Npn \@@_vpageref:nnn #1#2#3
@@ -787,6 +800,25 @@
       { \keys_set:nn { zref-vario/ref } { nohyperref } }
     \@@_varioref_setup:
     \@@_vpagerefrange:Vnn \l_@@_reftextcurrent_tl {#1} {#2}
+    \bool_lazy_and:nnT
+      { \g_@@_zrefcheck_available_bool }
+      { \l_@@_with_vcheck_bool }
+      {
+        \zrefcheck_zrefvario_label:
+        \vrefpagenum \l_tmpa_tl {#1}
+        \vrefpagenum \l_tmpb_tl {#2}
+        \tl_if_eq:NNT \l_tmpa_tl \l_tmpb_tl
+          {
+            \vref at pagenum \l_tmpa_tl { \the\c at vrcnt @vr }
+            \tl_if_eq:NNT \l_tmpa_tl \l_tmpb_tl
+              {
+                \zrefcheck_zrefvario_run_check_on_label:Vn
+                  \l_@@_vcheck_tl {#1}
+                \zrefcheck_zrefvario_run_check_on_label:Vn
+                  \l_@@_vcheck_tl {#2}
+              }
+          }
+      }
     \group_end:
   }
 \cs_new_protected:Npn \@@_vpagerefrange:nnn #1#2#3
@@ -818,6 +850,67 @@
 %
 %
 %
+% \section{\pkg{zref-check} integration}
+%
+% Integration with \pkg{zref-check}.  \opt{vcheck}, differently from
+% \opt{check}, receives only two values \texttt{above} and \texttt{below},
+% since these are the only two checks which make sense for \pkg{zref-vario}.
+% This means that it also does not take \cs{zcheck}'s options, but these can
+% always be passed to \opt{check}.  Besides this, \opt{vcheck}'s check should
+% only be done when label(s) and reference are in the same page, that is, when
+% \opt{vcurrent} is used.  Furthermore, since \pkg{varioref} handles the case
+% where the reference crosses page boundaries, we only set one label for the
+% purpose, and this is done at the end of the reference, because that's the
+% point \pkg{varioref} itself uses to check if label and reference are in the
+% same page.
+%
+%    \begin{macrocode}
+\bool_new:N \g_@@_zrefcheck_available_bool
+\bool_new:N \l_@@_with_vcheck_bool
+\tl_new:N \l_@@_vcheck_tl
+\AddToHook { begindocument/before }
+  {
+    \IfPackageLoadedTF { zref-check }
+      {
+        \IfPackageAtLeastTF { zref-check } { 2022-02-08 }
+          {
+            \bool_gset_true:N \g_@@_zrefcheck_available_bool
+            \keys_define:nn { zref-vario/current }
+              {
+                vcheck .choices:nn =
+                  { above , below }
+                  {
+                    \bool_set_true:N \l_@@_with_vcheck_bool
+                    \tl_set:NV \l_@@_vcheck_tl \l_keys_choice_tl
+                  } ,
+              }
+          }
+          {
+            \bool_gset_false:N \g_@@_zrefcheck_available_bool
+            \keys_define:nn { zref-vario/current }
+              {
+                vcheck .code:n =
+                  { \msg_warning:nn { zref-vario } { zref-check-unavailable } } ,
+              }
+          }
+      }
+      {
+        \bool_gset_false:N \g_@@_zrefcheck_available_bool
+        \keys_define:nn { zref-vario/current }
+          {
+            vcheck .code:n =
+              { \msg_warning:nn { zref-vario } { zref-check-unavailable } } ,
+          }
+      }
+  }
+\msg_new:nnn { zref-vario } { zref-check-unavailable }
+  {
+    Option~'vcheck'~is~only~available~when~'zref-check'~is~loaded~
+    and~newer~than~'2022-02-08~v0.2.4'.
+  }
+%    \end{macrocode}
+%
+%
 % \section{Languages}
 %
 %

Modified: trunk/Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty	2022-02-08 21:51:11 UTC (rev 61950)
+++ trunk/Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty	2022-02-08 21:52:17 UTC (rev 61951)
@@ -42,7 +42,7 @@
 %% 
 %% -----------------------------------------------------------------------
 %% 
-\ProvidesExplPackage {zref-vario} {2022-02-01} {0.1.1-alpha}
+\ProvidesExplPackage {zref-vario} {2022-02-08} {0.1.2-alpha}
   {Extended LaTeX page cross-references with varioref and zref-clever}
 \AddToHook { begindocument/before }
   {
@@ -366,7 +366,7 @@
         \seq_if_in:NxF \g__zrefvario_setup_languages_seq
           { \__zrefvario_base_lang:e { \l__zrefvario_ref_language_tl } }
           {
-            \msg_warning:nnx  { zref-vario } { language-not-setup }
+            \msg_warning:nnx { zref-vario } { language-not-setup }
               { \l__zrefvario_ref_language_tl }
           }
       }
@@ -470,6 +470,19 @@
     \__zrefvario_varioref_setup:
     \__zrefvario_vpageref:VVn \l__zrefvario_reftextcurrent_tl
       \l__zrefvario_reftextother_tl {#1}
+    \bool_lazy_and:nnT
+      { \g__zrefvario_zrefcheck_available_bool }
+      { \l__zrefvario_with_vcheck_bool }
+      {
+        \zrefcheck_zrefvario_label:
+        \vref at pagenum \l_tmpa_tl { \the\c at vrcnt @vr }
+        \vrefpagenum \l_tmpb_tl {#1}
+        \tl_if_eq:NNT \l_tmpa_tl \l_tmpb_tl
+          {
+            \zrefcheck_zrefvario_run_check_on_label:Vn
+              \l__zrefvario_vcheck_tl {#1}
+          }
+      }
     \group_end:
   }
 \cs_new_protected:Npn \__zrefvario_vpageref:nnn #1#2#3
@@ -508,6 +521,25 @@
       { \keys_set:nn { zref-vario/ref } { nohyperref } }
     \__zrefvario_varioref_setup:
     \__zrefvario_vpagerefrange:Vnn \l__zrefvario_reftextcurrent_tl {#1} {#2}
+    \bool_lazy_and:nnT
+      { \g__zrefvario_zrefcheck_available_bool }
+      { \l__zrefvario_with_vcheck_bool }
+      {
+        \zrefcheck_zrefvario_label:
+        \vrefpagenum \l_tmpa_tl {#1}
+        \vrefpagenum \l_tmpb_tl {#2}
+        \tl_if_eq:NNT \l_tmpa_tl \l_tmpb_tl
+          {
+            \vref at pagenum \l_tmpa_tl { \the\c at vrcnt @vr }
+            \tl_if_eq:NNT \l_tmpa_tl \l_tmpb_tl
+              {
+                \zrefcheck_zrefvario_run_check_on_label:Vn
+                  \l__zrefvario_vcheck_tl {#1}
+                \zrefcheck_zrefvario_run_check_on_label:Vn
+                  \l__zrefvario_vcheck_tl {#2}
+              }
+          }
+      }
     \group_end:
   }
 \cs_new_protected:Npn \__zrefvario_vpagerefrange:nnn #1#2#3
@@ -525,6 +557,49 @@
     \fullref {#1}
     \group_end:
   }
+\bool_new:N \g__zrefvario_zrefcheck_available_bool
+\bool_new:N \l__zrefvario_with_vcheck_bool
+\tl_new:N \l__zrefvario_vcheck_tl
+\AddToHook { begindocument/before }
+  {
+    \IfPackageLoadedTF { zref-check }
+      {
+        \IfPackageAtLeastTF { zref-check } { 2022-02-08 }
+          {
+            \bool_gset_true:N \g__zrefvario_zrefcheck_available_bool
+            \keys_define:nn { zref-vario/current }
+              {
+                vcheck .choices:nn =
+                  { above , below }
+                  {
+                    \bool_set_true:N \l__zrefvario_with_vcheck_bool
+                    \tl_set:NV \l__zrefvario_vcheck_tl \l_keys_choice_tl
+                  } ,
+              }
+          }
+          {
+            \bool_gset_false:N \g__zrefvario_zrefcheck_available_bool
+            \keys_define:nn { zref-vario/current }
+              {
+                vcheck .code:n =
+                  { \msg_warning:nn { zref-vario } { zref-check-unavailable } } ,
+              }
+          }
+      }
+      {
+        \bool_gset_false:N \g__zrefvario_zrefcheck_available_bool
+        \keys_define:nn { zref-vario/current }
+          {
+            vcheck .code:n =
+              { \msg_warning:nn { zref-vario } { zref-check-unavailable } } ,
+          }
+      }
+  }
+\msg_new:nnn { zref-vario } { zref-check-unavailable }
+  {
+    Option~'vcheck'~is~only~available~when~'zref-check'~is~loaded~
+    and~newer~than~'2022-02-08~v0.2.4'.
+  }
 \zvLanguageSetup { english }
   {
     reftextfaceafter = {on~the~\reftextvario{facing}{next}~page} ,



More information about the tex-live-commits mailing list.