[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: working on disable link code (ccae453)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Jan 28 19:19:02 CET 2021


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

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

commit ccae453f9fa10795c6f83a1090d4a2962b68c36b
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu Jan 28 19:19:02 2021 +0100

    working on disable link code


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

ccae453f9fa10795c6f83a1090d4a2962b68c36b
 hyperref-generic.dtx        | 21 ++++++++++++++-------
 testfiles/disable-links.pvt | 28 ++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index 2c72400..191071b 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -1077,6 +1077,7 @@
 \seq_map_inline:Nn \c_pdfannot_link_types_seq
   {
     \bool_new:c {l_@@_annot_#1_bool}
+    \bool_set_true:c {l_@@_annot_#1_bool}
   }
 %    \end{macrocode}
 % \end{variable}
@@ -1469,17 +1470,23 @@
 
 \cs_new_protected:Npn \hyper at linkstart #1 #2 %#1 context, #2=destination name
   {
-    \Hy at VerboseLinkStart{#1}{#2}% only for debug
-    \group_begin:
-    \hook_use:n {hyp/link/#1}
-    \@@_link_goto_begin:nw {#2}
+    \bool_if:NT \l_@@_annot_GoTo_bool
+      {
+        \Hy at VerboseLinkStart{#1}{#2}% only for debug
+        \group_begin:
+        \hook_use:n {hyp/link/#1}
+        \@@_link_goto_begin:nw {#2}
+      }
   }
 
 \cs_new_protected:Npn \hyper at linkend
   {
-    \@@_link_goto_end:
-    \group_end:
-    \Hy at VerboseLinkStop
+    \bool_if:NT \l_@@_annot_GoTo_bool
+      {
+        \@@_link_goto_end:
+        \group_end:
+        \Hy at VerboseLinkStop
+      }
   }
 %    \end{macrocode}
 %
diff --git a/testfiles/disable-links.pvt b/testfiles/disable-links.pvt
new file mode 100644
index 0000000..87655f5
--- /dev/null
+++ b/testfiles/disable-links.pvt
@@ -0,0 +1,28 @@
+\documentclass{article}
+\usepackage[colorlinks]{hyperref}
+%\hypersetup{draft}
+\begin{document}
+\ExplSyntaxOn
+\bool_set_false:N \l__hyp_annot_GoTo_bool
+\ExplSyntaxOff
+
+\tableofcontents
+
+\newpage
+\ExplSyntaxOn
+\bool_set_true:N \l__hyp_annot_GoTo_bool
+\ExplSyntaxOff
+
+\section{abc}\label{x}
+
+\ref{x},
+
+\ExplSyntaxOn
+\bool_set_false:N \l__hyp_annot_GoTo_bool
+\ExplSyntaxOff
+
+\ref{x}
+
+%\url{https://github.com/latex3/luaotfload/issues/154}
+
+\end{document}
\ No newline at end of file





More information about the latex3-commits mailing list.