summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-07-11 20:31:00 +0000
committerKarl Berry <karl@freefriends.org>2022-07-11 20:31:00 +0000
commit7b74f7eb81fc3a17c34773731dd15345ba02617e (patch)
treed8659131c8ef1f496ffba6a7f6d3c45fac6c933a /Master/texmf-dist/source
parentaf16fcfe5e156c58567fd2cb9eae9ca981265db0 (diff)
zref-vario (11jul22)
git-svn-id: svn://tug.org/texlive/trunk@63874 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/zref-vario/zref-vario.dtx70
1 files changed, 66 insertions, 4 deletions
diff --git a/Master/texmf-dist/source/latex/zref-vario/zref-vario.dtx b/Master/texmf-dist/source/latex/zref-vario/zref-vario.dtx
index c9db0a0f8a2..81d9dec5d18 100644
--- a/Master/texmf-dist/source/latex/zref-vario/zref-vario.dtx
+++ b/Master/texmf-dist/source/latex/zref-vario/zref-vario.dtx
@@ -128,7 +128,7 @@
%
% Identify the package.
% \begin{macrocode}
-\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}
% \end{macrocode}
%
@@ -146,7 +146,69 @@
% \end{macrocode}
%
%
-% \section{Customization}
+% \section{Options}
+%
+% \subsection*{\cs{zvsetup}}
+%
+%
+% \begin{macro}[int]{\zvsetup}
+% Provide \cs{zvsetup}.
+% \begin{syntax}
+% \cs{zvsetup}\marg{options}
+% \end{syntax}
+% \begin{macrocode}
+\NewDocumentCommand \zvsetup { m }
+ { \keys_set:nn { zref-vario/setup } {#1} }
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection*{\opt{pageprop}}
+%
+% \begin{macrocode}
+\tl_new:N \l_@@_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_@@_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.
+ }
+% \end{macrocode}
+%
+%
+% \section{Reference format}
%
% Provide some functions to define options names in a standard form.
%
@@ -616,7 +678,7 @@
\cs_new_protected:Npn \@@_vref_pagenum:Nn #1#2
{
\exp_args:NNNo \exp_args:NNo \cs_set_nopar:Npn #1
- { \zref@extractdefault {#2} { page } { ?? } }
+ { \zref@extractdefault {#2} { \l_@@_pageprop_tl } { ?? } }
}
\cs_new_protected:Npn \@@_vrefpagenum:Nn #1#2
{
@@ -624,7 +686,7 @@
\@@_vref_pagenum:Nn #1 {#2}
}
\cs_new_protected:Npn \@@_vref_label:n #1
- { \zref@labelbyprops {#1} { page } }
+ { \zref@labelbyprops {#1} { \l_@@_pageprop_tl } }
% \end{macrocode}
% \end{macro}
%