[latex3-commits] [git/LaTeX3-latex3-pdfresources] master: changed link_goto command, it should always use the GoTo hooks (fb2b139)
Ulrike Fischer
fischer at troubleshooting-tex.de
Mon Mar 30 14:47:51 CEST 2020
Repository : https://github.com/latex3/pdfresources
On branch : master
Link : https://github.com/latex3/pdfresources/commit/fb2b13987da4d46b8e3dc3f90d3b9777fd9ad888
>---------------------------------------------------------------
commit fb2b13987da4d46b8e3dc3f90d3b9777fd9ad888
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Mon Mar 30 14:47:51 2020 +0200
changed link_goto command, it should always use the GoTo hooks
>---------------------------------------------------------------
fb2b13987da4d46b8e3dc3f90d3b9777fd9ad888
hgeneric-experimental.def | 6 +++---
pdfresources.dtx | 49 +++++++++++++++++++++++++++--------------------
2 files changed, 31 insertions(+), 24 deletions(-)
diff --git a/hgeneric-experimental.def b/hgeneric-experimental.def
index c7f4700..ee03854 100644
--- a/hgeneric-experimental.def
+++ b/hgeneric-experimental.def
@@ -584,15 +584,15 @@
\exp_args:No \HyperDestNameFilter { \l__hyp_destname_tmpa_tl }
}
}
- \exp_args:Nno
- \pdf_link_begin_goto:nnw { GoTo } { \l__hyp_destname_tmpa_tl }
+ \exp_args:No
+ \pdf_link_goto_begin:nw { \l__hyp_destname_tmpa_tl }
\Hy at colorlink\@linkcolor
}
\cs_new_protected:Npn \__hyp_link_dest_end:
{
\Hy at endcolorlink
- \pdf_link_end:n { GoTo }
+ \pdf_link_goto_end:
}
%% hyperref commands for destinations (anchor) and links to destinations
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 3b38747..1d78f0e 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -2726,7 +2726,9 @@
% \Arg{user action spec}\footnote{The wording follows the pdftex documentation}.
% If the type is one of the known types the attributes stored in the attribute
% hook of type \Arg{type} are inserted as \emph{attr spec} and the code in
-% the begin and end hook is executed before and after the link. As example
+% the begin and end hook is executed before and after the link. \Arg{type} should
+% normally be identical to the value of the |/S| key in the action dictionary.
+% As example
% \begin{verbatim}
% \pdf_link_user:nnn { URI }
% {
@@ -2771,13 +2773,10 @@
}
}
% \end{macrocode}
-% \begin{function}[added = 2020-03-12]{ \pdf_link_begin_user:nnw, \pdf_link_begin_goto:nnw, \pdf_link_end:n }
+% \begin{function}[added = 2020-03-12]{ \pdf_link_begin_user:nnw, \pdf_link_end:n }
% \begin{syntax}
% \cs{pdf_link_begin_user:nnw} \Arg{type} \Arg{user action spec} \meta{content}
% \cs{pdf_link_end:n} \Arg{type}
-%
-% \cs{pdf_link_begin_goto:nnw} \Arg{type} \Arg{destination} \meta{content}
-% \cs{pdf_link_end:n} \Arg{type}
% \end{syntax}
% This creates a link around the \meta{content} with the specified
% \meta{user action spec} (e.g. an /A dictionary with an URI) or
@@ -2824,33 +2823,41 @@
{ #2 }
}
-% At second one with the \texttt{goto name} argument:
-\cs_new_protected:Npn \pdf_link_begin_goto:nnw #1 #2 %#1 type, #2 destination
+\cs_new_protected:Nn \pdf_link_end:n %#1 type, e.g. url
{
- \seq_if_exist:cT { l_@@_hook_link_begin_#1_seq }
+ \@@_backend_link_end:
+ \seq_if_exist:cT {l_@@_hook_link_end_#1_seq}
{
- \seq_use:cn { l_@@_hook_link_begin_#1_seq }{}
+ \seq_use:cn { l_@@_hook_link_end_#1_seq }{}
}
+ }
+% \end{macrocode}
+% \begin{function}[updated = 2020-03-30]{ \pdf_link_goto_begin:nw, \pdf_link_goto_end: }
+% \begin{syntax}
+% \cs{pdf_link_goto_begin:nw} \Arg{destination} \meta{content}
+% \cs{pdf_link_goto_end:}
+% \end{syntax}
+% This is a special, shorter version for links to internal destinations. It always
+% uses the hooks of the |GoTo| link type.
+% \end{function}
+% \begin{macrocode}
+\cs_new_protected:Npn \pdf_link_goto_begin:nw #1 %#1 destination
+ {
+ \seq_use:cn { l_@@_hook_link_begin_GoTo_seq }{}
\exp_args:Nxx %xetex needs expansion
\@@_backend_link_begin_goto:nnw
{
- \prop_if_exist:cT { l_@@_hook_link_begin_#1_attr_prop }
- {
- \prop_map_function:cN
- { l_@@_hook_link_begin_#1_attr_prop }
- \@@_dict_item:nn
- }
+ \prop_map_function:cN
+ { l_@@_hook_link_begin_GoTo_attr_prop }
+ \@@_dict_item:nn
}
- { #2 }
+ { #1 }
}
-\cs_new_protected:Nn \pdf_link_end:n %#1 type, e.g. url
+\cs_new_protected:Nn \pdf_link_goto_end:
{
\@@_backend_link_end:
- \seq_if_exist:cT {l_@@_hook_link_end_#1_seq}
- {
- \seq_use:cn { l_@@_hook_link_end_#1_seq }{}
- }
+ \seq_use:cn { l_@@_hook_link_end_GoTo_seq }{}
}
% \end{macrocode}
More information about the latex3-commits
mailing list.