[latex3-commits] [git/LaTeX3-latex3-pdfresources] develop: add hook for structured destination (112e480)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Jul 8 19:34:12 CEST 2021


Repository : https://github.com/latex3/pdfresources
On branch  : develop
Link       : https://github.com/latex3/pdfresources/commit/112e480a23b6b59c286470cea2b447ce0bc1709b

>---------------------------------------------------------------

commit 112e480a23b6b59c286470cea2b447ce0bc1709b
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu Jul 8 19:34:12 2021 +0200

    add hook for structured destination


>---------------------------------------------------------------

112e480a23b6b59c286470cea2b447ce0bc1709b
 hyperref-generic.dtx | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index 906dd58..dd82953 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -1959,17 +1959,26 @@
 % xetex version. It is not quite clear if really all three
 % are needed for the backends supported by this driver, but changing the hyperref
 % code would be difficult.
+% We add a hook. This allows e.g. the tagging code
+% to create also a structured destination.
+% We don't use the cmd hook, as we want the same hook for both start commands.
+% We make the current dest name available so that the hook code can use it.
 %  \begin{macro}
 %    {
 %      \hyper at anchor,
 %      \hyper at anchorstart,
-%      \hyper at anchorend
+%      \hyper at anchorend,
+%      hyp/anchor,
+%      \l_hyp_current_dest_name_tl
 %    }
 %    \begin{macrocode}
+\hook_new:n{hyp/anchor}
 \cs_new_protected:Npn \hyper at anchor #1
   {
     \exp_args:NnV
       \@@_destination:nn {#1} \l_@@_dest_pdfview_tl
+    \tl_set:Nn \l_hyp_current_dest_name_tl {#1}
+    \hook_use:n{hyp/anchor}
   }
 
 \cs_new_protected:Npn \hyper at anchorstart #1
@@ -1977,6 +1986,8 @@
     \Hy at activeanchortrue
     \exp_args:NnV
       \@@_destination:nn {#1} \l_@@_dest_pdfview_tl
+    \tl_set:Nn \l_hyp_current_dest_name_tl {#1}
+    \hook_use:n{hyp/anchor}
   }
 
 \cs_new_protected:Npn \hyper at anchorend





More information about the latex3-commits mailing list.