[latex3-commits] [git/LaTeX3-latex3-hyperref] testnewkeyval: convert driver keys (82e0041)

Ulrike Fischer fischer at troubleshooting-tex.de
Tue Jul 5 11:28:49 CEST 2022


Repository : https://github.com/latex3/hyperref
On branch  : testnewkeyval
Link       : https://github.com/latex3/hyperref/commit/82e0041359064d3ab05b5435199bfc99f30b75bc

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

commit 82e0041359064d3ab05b5435199bfc99f30b75bc
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Jul 5 11:28:49 2022 +0200

    convert driver keys


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

82e0041359064d3ab05b5435199bfc99f30b75bc
 hyperref.dtx | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 92 insertions(+), 2 deletions(-)

diff --git a/hyperref.dtx b/hyperref.dtx
index 954be0c..1f58369 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -5156,7 +5156,7 @@
 }
 \DeclareKeys
  {
-   tex4ht .code:n =
+   ,tex4ht .code:n =
     {
       \Hy at texhttrue
       \SetKeys[hyperref]{colorlinks=true}%
@@ -5171,6 +5171,7 @@
        \endinput
        }%
     }
+   ,tex4ht .usage:n = load
  }
 \DeclareVoidOption{pdftex}{%
   \ifpdf
@@ -5197,8 +5198,12 @@
        }\@ehc
       \fi
     }
+  ,pdftex .usage:n = load
  }
-
+%    \end{macrocode}
+% The new luatex key no longer pass the option to color
+% (color can guess on its own).
+%    \begin{macrocode}
 \DeclareVoidOption{luatex}{%
   \ifpdf
     \ifx\pdfextension\@undefined
@@ -5215,6 +5220,26 @@
     }\@ehc
   \fi
 }
+
+\DeclareKeys
+ {
+   ,luatex .code:n =
+     {
+      \ifpdf
+       \ifluatex
+         \def\Hy at driver{hluatex}%
+       \else
+         \def\Hy at driver{hpdftex}%
+       \fi
+     \else
+       \Hy at Error{%
+        Wrong driver option `luatex',\MessageBreak
+        because luaTeX in PDF mode is not detected%
+       }\@ehc
+     \fi
+    }
+   ,luatex .usage:n = load
+ }
 \DeclareVoidOption{nativepdf}{%
   \HyOpt at CheckDvi{nativepdf}{%
     \def\Hy at driver{hdvips}%
@@ -5232,6 +5257,34 @@
     \PassOptionsToPackage{dvipdfmx}{color}%
   }%
 }
+
+\DeclareKeys
+ {
+   ,nativepdf .code:n =
+     {
+       \HyOpt at CheckDvi{nativepdf}{%
+        \def\Hy at driver{hdvips}%
+        \PassOptionsToPackage{dvips}{color}}%
+     }
+  ,nativepdf .usage:n = load
+  ,dvipdfm .code:n =
+    {
+      \HyOpt at CheckDvi{dvipdfm}{\def\Hy at driver{hdvipdfm}}
+    }
+  ,dvipdfm .usage:n = load
+  ,dvipdfmx .code:n =
+    {
+      \HyOpt at CheckDvi{dvipdfmx}{%
+        \def\Hy at driver{hdvipdfm}
+        \PassOptionsToPackage{dvipdfmx}{color}}
+    }
+  ,dvipdfmx .usage:n = load
+ }
+
+%    \end{macrocode}
+% The key dvipdfmx-outline-open has been removed as it was only
+% needed for rather old xetex versions.
+%    \begin{macrocode}
 \define at key{Hyp}{dvipdfmx-outline-open}[true]{%
   \expandafter\ifx\csname if#1\expandafter\endcsname
                   \csname iftrue\endcsname
@@ -5240,6 +5293,8 @@
     \chardef\SpecialDvipdfmxOutlineOpen\z@
   \fi
 }
+%    \end{macrocode}
+%    \begin{macrocode}
 \DeclareVoidOption{xetex}{%
   \ifxetex
     \def\Hy at driver{hxetex}%
@@ -5266,6 +5321,41 @@
     \def\Hy at driver{hypertex}%
   }%
 }
+
+\DeclareKeys
+ {
+   ,xetex .code:n =
+     {
+       \ifxetex
+        \def\Hy at driver{hxetex}%
+       \else
+       \Hy at Error{%
+         Wrong driver option `xetex',\MessageBreak
+         because XeTeX is not detected%
+        }\@ehc
+      \fi
+     }
+  ,xetex .usage:n = load
+  ,pdfmark .code:n =
+    {
+      \HyOpt at CheckDvi{pdfmark}{\def\Hy at driver{hdvips}}%
+    }
+  ,pdfmark .usage:n = load
+  ,dvips .code:n =
+    {
+      \HyOpt at CheckDvi{dvips}{\def\Hy at driver{hdvips}}%
+    }
+  ,dvips .usage:n = load
+  ,hypertex .code:n =
+    {
+      \HyOpt at CheckDvi{hypertex}{\def\Hy at driver{hypertex}}%
+    }
+  ,hypertex .usage:n = load
+ }
+
+%    \end{macrocode}
+% vtex is rather special.
+%    \begin{macrocode}
 \let\Hy at MaybeStopNow\relax
 \DeclareVoidOption{vtex}{%
   \ifvtex





More information about the latex3-commits mailing list.