[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: highlight key reworked/added (e302a0e)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed Jan 13 19:00:57 CET 2021


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

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

commit e302a0e36e6649db0a863af73ef181e201883368
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Jan 13 19:00:57 2021 +0100

    highlight key reworked/added


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

e302a0e36e6649db0a863af73ef181e201883368
 hyperref-generic.dtx | 87 +++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 65 insertions(+), 22 deletions(-)

diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index 00c4467..e425b70 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -322,8 +322,6 @@
 %^^A
 %^^A %% \l_@@_dest_pdfview_tl
 %^^A %% list of commands which probably will have to change
-%^^A %%   \Hy at EXPsetpdfborder
-%^^A %%   \Hy at EXPsetpdfhighlight
 %^^A %%   \Hy at EXPsetbordercolor
 %^^A % %   \hypupdateattribute
 
@@ -1057,25 +1055,6 @@
 \pdfannot_link_margin:n { 1pt }
 
 
-% highlight
-\cs_new_protected:Npn \Hy at EXPsetpdfhighlight
-  {
-    \seq_map_inline:Nn \c_pdfannot_link_types_seq
-      {
-        \tl_if_empty:NTF \@pdfhighlight
-          {
-            \pdfannot_dict_remove:nn {link/##1}{ H }
-          }
-          {
-            \exp_args:Nnnx
-             \pdfannot_dict_put:nnn
-              {link/##1}
-              { H }
-              { \@pdfhighlight }
-         }
-     }
-  }
-
 % bordercolor
 \cs_new_protected:Npn \Hy at EXPsetbordercolor
   {
@@ -1100,7 +1079,7 @@
 \NewDocumentCommand\hypupdateattribute { }
  {
    %\Hy at EXPsetpdfborder
-   \Hy at EXPsetpdfhighlight
+   %\Hy at EXPsetpdfhighlight
    \Hy at EXPsetbordercolor
  }
 
@@ -2183,6 +2162,69 @@
     ,pdfborderstyle .initial:n = {},
   }
 
+\prop_map_inline:Nn \c_@@_map_hyp_annot_prop
+  {
+    \keys_define:nn { hyp / setup }
+      {
+        ,#1highlight .choices:nn =
+          { /I, /N, /O, /P}
+          {
+                \pdfannot_dict_put:nnn
+                  {link/#2}
+                  { H }
+                  { ##1 }
+
+          }
+        ,#1highlight / .code:n =
+         {
+           \pdfannot_dict_remove:nn
+             {link/#2}
+             { H }
+
+          }
+        ,#1highlight / unknown .code:n =
+          {
+           \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+             { pdfhighlight }
+             { /I~(inverse), /N~(no effect), /O~(outline), /P~(inset) }
+             { \exp_not:n {##1} }
+          }
+      }
+  }
+
+
+\keys_define:nn { hyp / setup }
+  {
+    ,pdfhighlight .choices:nn =
+      { /I, /N, /O, /P}
+      {
+        \prop_map_inline:Nn \c_@@_map_hyp_annot_prop
+          {
+            \pdfannot_dict_put:nnn
+              {link/####2}
+              { H }
+              { #1  }
+          }
+      }
+    ,pdfhighlight / .code:n =
+     {
+        \prop_map_inline:Nn \c_@@_map_hyp_annot_prop
+          {
+            \pdfannot_dict_remove:nn
+              {link/##2}
+              { H }
+          }
+      }
+    ,pdfhighlight .initial:n = {/I},
+    ,pdfhighlight / unknown .code:n =
+      {
+       \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+         { pdfhighlight }
+         { /I~(inverse), /N~(no effect), /O~(outline), /P~(inset) }
+         { \exp_not:n {#1} }
+      }
+  }
+
 \keys_define:nn { hyp / setup }
   {
     ,colorlinks .meta:n = {pdfborder={0~0~0},pdfborderstyle={}}
@@ -2466,6 +2508,7 @@
   {
     \define at key{Hyp}{#1border}{}
     \define at key{Hyp}{#1borderstyle}{}
+    \define at key{Hyp}{#1highlight}{}
   }
 %%%%%%%%%%%%%%%%%
 \NewDocumentCommand \MakeFieldObject { m m }





More information about the latex3-commits mailing list.