[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: working on disabling links (438f6d4)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Jan 28 18:31:38 CET 2021


Repository : https://github.com/latex3/pdfresources
On branch  : reworking-annot
Link       : https://github.com/latex3/pdfresources/commit/438f6d444312df711c2f313c25478dbdb50dd642

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

commit 438f6d444312df711c2f313c25478dbdb50dd642
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu Jan 28 18:31:38 2021 +0100

    working on disabling links


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

438f6d444312df711c2f313c25478dbdb50dd642
 hyperref-generic.dtx | 41 ++++++++++++++++++++++++++++++++---------
 1 file changed, 32 insertions(+), 9 deletions(-)

diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index 175fb5d..2c72400 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -304,8 +304,10 @@
 %  \pkg{hyperref} knows like many packages the options |draft| and |final|.
 %  With \pkg{hyperref} they can be used as package options or in the preamble
 %  in \cs{hypersetup} and disable linking completely. The new driver passes the
-%  options also to the \pkg{bookmark} package---this naturally only works if
-%  \pkg{bookmark} hasn't been loaded yet when the option is used.
+%  options also to the \pkg{bookmark} package if
+%  \pkg{bookmark} hasn't been loaded yet as bookmarks can't work properly if
+%  the anchors from hyperref are missing.
+%
 %
 %
 %  \section{Draftmode}
@@ -1061,6 +1063,23 @@
   }
 %    \end{macrocode}
 % \end{variable}
+% \begin{variable}
+%  {
+%    \l_@@_annot_GoTo_bool
+%    \l_@@_annot_URI_bool
+%    \l_@@_annot_GoToR_bool
+%    \l_@@_annot_Named_bool
+%    \l_@@_annot_Launch_bool
+%  }
+%  This booleans are used to disable some link types
+%  while keeping others.
+%    \begin{macrocode}
+\seq_map_inline:Nn \c_pdfannot_link_types_seq
+  {
+    \bool_new:c {l_@@_annot_#1_bool}
+  }
+%    \end{macrocode}
+% \end{variable}
 %
 % \subsection{Boxes}
 % \begin{variable}{\l_@@_dest_box}
@@ -1433,15 +1452,19 @@
 % \pkg{hyperref} adds a group with \cs{Hy at colorlink}, we move this outside the link
 % so that it groups the context hook too.
 %    \begin{macrocode}
+
 \cs_new_protected:Npn \hyper at link #1 #2 #3 %#1 context, #2=destination name, #3 content
   {
-    \Hy at VerboseLinkStart{#1}{#2}
-    \group_begin:
-    \hook_use:n {hyp/link/#1}
-    \@@_link_goto_begin:nw {#2}#3\Hy at xspace@end
-    \__hyp_link_goto_end:
-    \group_end:
-    \Hy at VerboseLinkStop
+    \bool_if:NTF \l_@@_annot_GoTo_bool
+      {
+        \Hy at VerboseLinkStart{#1}{#2}
+        \group_begin:
+        \hook_use:n {hyp/link/#1}
+        \@@_link_goto_begin:nw {#2}#3\Hy at xspace@end
+        \__hyp_link_goto_end:
+        \group_end:
+        \Hy at VerboseLinkStop
+      }{#3}  
   }
 
 \cs_new_protected:Npn \hyper at linkstart #1 #2 %#1 context, #2=destination name





More information about the latex3-commits mailing list.