[latex3-commits] [git/LaTeX3-latex3-hyperref] testnewkeyval: WIP colorlinks (992e693)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed Jul 6 19:58:38 CEST 2022


Repository : https://github.com/latex3/hyperref
On branch  : testnewkeyval
Link       : https://github.com/latex3/hyperref/commit/992e69355c9b9b1f038cb0cc2220fe99c9af5555

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

commit 992e69355c9b9b1f038cb0cc2220fe99c9af5555
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Jul 6 19:58:38 2022 +0200

    WIP colorlinks


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

992e69355c9b9b1f038cb0cc2220fe99c9af5555
 hyperref.dtx | 43 ++++++++++++++++++++++++++-----------------
 1 file changed, 26 insertions(+), 17 deletions(-)

diff --git a/hyperref.dtx b/hyperref.dtx
index 35c0843..48aea56 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -6327,21 +6327,25 @@
 % We assume for now that the generic driver is used if |\DocumentMetadata| has been
 % used; this is perhaps not true.
 %    \begin{macrocode}
-\newcommand \Hy at set@colorlinks
+\newcommand \Hy at activate@colorlinks
   {%
-    \def\Hy at colorlink#1{\begingroup\HyColor at UseColor#1}%
+    \def\Hy at colorlink##1{\begingroup\HyColor at UseColor##1}%
     \def\Hy at endcolorlink{\endgroup}%
     \def\@pdfborder{0 0 0}%
     \let\@pdfborderstyle\@empty
   }
-\newcommand \Hy at set@hidelinks
+\newcommand \Hy at activate@plainlinks
   {%
-    \def\Hy at colorlink#1{\begingroup#1}%
+    \def\Hy at colorlink##1{\begingroup##1}%
     \def\Hy at endcolorlink{\endgroup}%
+  }
+\newcommand \Hy at activate@hidelinks
+  {%
+    \Hy at activate@plainlinks
     \def\@pdfborder{0 0 0}%
     \let\@pdfborderstyle\ltx at empty
   }
-\newcommand \Hy at set@frenchlinks
+\newcommand \Hy at activate@frenchlinks
  {%
    \def\Hy at colorlink#1{\begingroup\fontshape{\scdefault}\selectfont}%
    \def\Hy at endcolorlink{\endgroup}%
@@ -6349,7 +6353,15 @@
 \define at key{Hyp}{colorlinks}[true]{%
   \Hy at boolkey{colorlinks}{#1}%
 }
-
+\DeclareVoidOption{hidelinks}{%
+  \Hy at colorlinksfalse
+  \Hy at ocgcolorlinksfalse
+  \Hy at frenchlinksfalse
+  \def\Hy at colorlink##1{\begingroup}%
+  \def\Hy at endcolorlink{\endgroup}%
+  \def\@pdfborder{0 0 0}%
+  \let\@pdfborderstyle\ltx at empty
+}
 \ExplSyntaxOn
 \IfDocumentMetadataTF
  {
@@ -6370,22 +6382,19 @@
  {
    \DeclareKeys
     {
-      colorlinks .code:n =
+      ,colorlinks .choice:
+      ,colorlinks /true .code:n =
        {
-
+         \Hy at activate@colorlinks
+       }
+      ,colorlinks / false .code:n =
+       {
+         \Hy at activate@plainlinks
        }
     }
  }
 \ExplSyntaxOff
-\DeclareVoidOption{hidelinks}{%
-  \Hy at colorlinksfalse
-  \Hy at ocgcolorlinksfalse
-  \Hy at frenchlinksfalse
-  \def\Hy at colorlink##1{\begingroup}%
-  \def\Hy at endcolorlink{\endgroup}%
-  \def\@pdfborder{0 0 0}%
-  \let\@pdfborderstyle\ltx at empty
-}
+
 \define at key{Hyp}{ocgcolorlinks}[true]{%
   \Hy at boolkey{ocgcolorlinks}{#1}%
 }





More information about the latex3-commits mailing list.