summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty')
-rw-r--r--Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty47
1 files changed, 44 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty b/Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty
index 3100822f7e6..9ccbc2133d3 100644
--- a/Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty
+++ b/Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty
@@ -42,11 +42,52 @@
%%
%% -----------------------------------------------------------------------
%%
-\ProvidesExplPackage {zref-vario} {2022-04-24} {0.1.4}
+\ProvidesExplPackage {zref-vario} {2022-07-08} {0.1.5}
{Extended LaTeX page cross-references with varioref and zref-clever}
\RequirePackage { zref-clever } [ 2022-01-28 ] % v0.2.0-alpha
\AddToHook { begindocument/before }
{ \RequirePackage { varioref } }
+\NewDocumentCommand \zvsetup { m }
+ { \keys_set:nn { zref-vario/setup } {#1} }
+\tl_new:N \l__zrefvario_pageprop_tl
+\keys_define:nn { zref-vario/setup }
+ {
+ pageprop .code:n =
+ {
+ \zref@ifpropundefined {#1}
+ { \msg_warning:nnn { zref-vario } { pageprop-not-declared } {#1} }
+ {
+ \zref@iflistcontainsprop { \ZREF@mainlist } {#1}
+ { \tl_set:Nn \l__zrefvario_pageprop_tl {#1} }
+ { \msg_warning:nnn { zref-vario } { pageprop-not-in-main } {#1} }
+ }
+ } ,
+ pageprop .value_required:n = true ,
+ pageprop .initial:n = { page } ,
+ }
+\AddToHook { begindocument }
+ {
+ \keys_define:nn { zref-vario/setup }
+ {
+ pageprop .code:n =
+ {
+ \msg_warning:nnn { zref-vario }
+ { option-preamble-only } { pageprop }
+ }
+ }
+ }
+\msg_new:nnn { zref-vario } { option-preamble-only }
+ { Option~'#1'~only~available~in~the~preamble~\msg_line_context:. }
+\msg_new:nnn { zref-vario } { pageprop-not-declared }
+ {
+ Property~'#1'~not~declared~\msg_line_context:.~
+ Using~default~'page'~property.
+ }
+\msg_new:nnn { zref-vario } { pageprop-not-in-main }
+ {
+ Property~'#1'~not~in~main~list~\msg_line_context:.~
+ Using~default~'page'~property.
+ }
\cs_new:Npn \__zrefvario_ref_opt_default_cs:nn #1#2
{ __zrefvario_ref_opt_default_ #1 : #2 }
\cs_new:Npn \__zrefvario_base_lang:n #1
@@ -384,7 +425,7 @@
\cs_new_protected:Npn \__zrefvario_vref_pagenum:Nn #1#2
{
\exp_args:NNNo \exp_args:NNo \cs_set_nopar:Npn #1
- { \zref@extractdefault {#2} { page } { ?? } }
+ { \zref@extractdefault {#2} { \l__zrefvario_pageprop_tl } { ?? } }
}
\cs_new_protected:Npn \__zrefvario_vrefpagenum:Nn #1#2
{
@@ -392,7 +433,7 @@
\__zrefvario_vref_pagenum:Nn #1 {#2}
}
\cs_new_protected:Npn \__zrefvario_vref_label:n #1
- { \zref@labelbyprops {#1} { page } }
+ { \zref@labelbyprops {#1} { \l__zrefvario_pageprop_tl } }
\bool_new:N \l__zrefvario_varioref_setup_bool
\cs_new_protected:Npn \__zrefvario_varioref_setup:
{