diff options
author | Karl Berry <karl@freefriends.org> | 2022-02-08 21:52:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-02-08 21:52:17 +0000 |
commit | 52f867b578332875678567cd90f15d2a9e9420b7 (patch) | |
tree | 6445cb17b9a37ecc4d4a9b008e8393c4f84ba727 /Master/texmf-dist/tex | |
parent | 35e83165817085cc1bdbbf9d5b7ba8e05a1bb8da (diff) |
zref-vario (8feb22)
git-svn-id: svn://tug.org/texlive/trunk@61951 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty | 79 |
1 files changed, 77 insertions, 2 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 c082b423948..65aa65d4cf7 100644 --- a/Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty +++ b/Master/texmf-dist/tex/latex/zref-vario/zref-vario.sty @@ -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@pagenum \l_tmpa_tl { \the\c@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@pagenum \l_tmpa_tl { \the\c@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} , |