summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-03-02 03:04:21 +0000
committerNorbert Preining <norbert@preining.info>2024-03-02 03:04:21 +0000
commitb7323fe884f378851ee661babaa5bd644271f348 (patch)
tree8891732393826e5c5893d00fa39cf9a5eb0a3a90 /macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.dtx
parent19a826b6e3a0d2ea6bbd1bf733a8e590463275ed (diff)
CTAN sync 202403020304
Diffstat (limited to 'macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.dtx')
-rw-r--r--macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.dtx43
1 files changed, 40 insertions, 3 deletions
diff --git a/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.dtx b/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.dtx
index 95b10a0f43..8fbfda14ef 100644
--- a/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.dtx
+++ b/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.dtx
@@ -82,7 +82,7 @@
% }^^A
% }
%
-% \date{Version 0.96e, released 2024-02-22}
+% \date{Version 0.96f, released 2024-03-01}
%
% \maketitle
% \begin{documentation}
@@ -964,7 +964,7 @@
%<@@=hyp>
% \end{macrocode}
% \begin{macrocode}
-\ProvidesFile{hgeneric-testphase.def}[2024-02-22 v0.96e %
+\ProvidesFile{hgeneric-testphase.def}[2024-03-01 v0.96f %
generic Hyperref driver for the LaTeX PDF management testphase bundle]
\RequirePackage{etoolbox} %why?
@@ -1695,6 +1695,32 @@
\tl_set:Nn \l_@@_text_enc_para_print_tl {utf8/string}
% \end{macrocode}
% \end{variable}
+%
+% It is also unclear how the /Contents entry would look at best.
+% So we use sockets. The first argument is the target (url or destination),
+% For GoTo we also pass the text as argument.
+% The sockets should define \cs{l_@@_link_Contents_tl}
+% % \begin{macrocode}
+\tl_new:N\l_@@_link_Contents_tl
+\socket_new:nn {hyp/link/GoTo/Contents}{2}
+\socket_new:nn {hyp/link/URI/Contents}{1}
+\socket_new_plug:nnn {hyp/link/GoTo/Contents}{default}
+ {
+ \@@_text_pdfstring:eoN
+ { Go~to~destination~#1 }
+ { \l_@@_text_enc_info_print_tl }
+ \l_@@_link_Contents_tl
+ }
+\socket_new_plug:nnn {hyp/link/URI/Contents}{default}
+ {
+ \@@_text_pdfstring:eoN
+ { #1 }
+ { \l_@@_text_enc_info_print_tl }
+ \l_@@_link_Contents_tl
+ }
+\socket_assign_plug:nn{hyp/link/GoTo/Contents}{default}
+\socket_assign_plug:nn{hyp/link/URI/Contents}{default}
+% \end{macrocode}
% \begin{variable}{\l_@@_dest_pdfview_tl}
% This hold the destination instructions in a format suitable for
% \cs{pdf_destination:nn}. The special value |fitrbox| indicates a boxed destination.
@@ -2210,6 +2236,12 @@
\Hy@VerboseLinkStart{#1}{#2}
\group_begin:
\tl_set:Nn \l_hyp_current_dest_name_tl {#2}
+% \end{macrocode}
+% this socket defines \cs{l_@@_link_Contents_tl}
+% \begin{macrocode}
+ \socket_use:nnn{hyp/link/GoTo/Contents}{#2}{#3}
+ \pdfannot_dict_put:nne {link/GoTo}{Contents}
+ {\l_@@_link_Contents_tl}
\hook_use:n {hyp/link/#1}
\@@_link_goto_begin:nw {#2}#3\Hy@xspace@end
\@@_link_goto_end:
@@ -2284,11 +2316,16 @@
{
\pdfdict_put:nnn{l_hyp/annot/A/URI}{IsMap}{true}
}
+% \end{macrocode}
+% This socket defines \cs{l_@@_link_Contents_tl}
+% \begin{macrocode}
+ \socket_use:nn{hyp/link/URI/Contents}{#2}
+ \pdfannot_dict_put:nne {link/URI}{Contents}{\l_@@_link_Contents_tl}
\cs_set_eq:NN \# \c_hash_str
\cs_set_eq:NN \% \c_percent_str
\Hy@safe@activestrue
\mode_leave_vertical:
- \pdfannot_dict_put:nne {link/URI}{A}{<<\pdfdict_use:n {l_hyp/annot/A/URI}>>}
+ \pdfannot_dict_put:nne {link/URI}{A}{<<\pdfdict_use:n {l_hyp/annot/A/URI}>>}
\pdfannot_link:nen { URI }
{
}