[latex3-commits] [git/LaTeX3-latex3-hyperref] testnewkeyval: driver keys (c5af551)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed Jul 6 11:57:37 CEST 2022


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

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

commit c5af551fc61eb4362f924a90e20cfd6cc2ffe54b
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Jul 6 11:57:37 2022 +0200

    driver keys


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

c5af551fc61eb4362f924a90e20cfd6cc2ffe54b
 hyperref.dtx | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 121 insertions(+), 1 deletion(-)

diff --git a/hyperref.dtx b/hyperref.dtx
index 2a166ea..5ba04eb 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -5403,6 +5403,63 @@
     }\@ehc
   \fi
 }
+
+\DeclareKeys
+  {
+    ,vtex .code:n =
+     {
+       \ifvtex
+         \ifnum 0\ifnum\OpMode<1 1\fi \ifnum\OpMode>3 1\fi =0 %
+           \def\Hy at driver{hvtex}%
+         \else
+           \ifnum\OpMode=10\relax
+             \def\Hy at driver{hvtexhtm}%
+             \def\MaybeStopEarly{%
+                \Hy at Message{Stopped early}%
+                \Hy at AtBeginDocument{%
+                  \PDF at FinishDoc
+                  \gdef\PDF at FinishDoc{}%
+                }%
+                \endinput
+             }%
+           \else
+             \Hy at Error{%
+               Wrong driver option `vtex',\MessageBreak
+               because of wrong OpMode (\the\OpMode)%
+             }\@ehc
+           \fi
+         \fi
+       \else
+         \Hy at Error{%
+           Wrong driver option `vtex',\MessageBreak
+           because VTeX is not running%
+         }\@ehc
+       \fi
+     }
+    ,vtex .usage:n = load
+    ,vtexpdfmark .code:n =
+     {
+       \ifvtex
+         \ifnum 0\ifnum\OpMode<1 1\fi \ifnum\OpMode>3 1\fi =0 %
+           \def\Hy at driver{hvtexmrk}%
+         \else
+           \Hy at Error{%
+             Wrong driver option `vtexpdfmark',\MessageBreak
+             because of wrong OpMode (\the\OpMode)%
+           }\@ehc
+         \fi
+       \else
+         \Hy at Error{%
+           Wrong driver option `vtexpdfmark,\MessageBreak
+           because VTeX is not running%
+         }\@ehc
+       \fi
+     }
+    ,vtexpdfmark .usage:n = load
+  }
+%    \end{macrocode}
+% Option \texttt{latex2html} is dropped.
+%    \begin{macrocode}
 \DeclareVoidOption{dviwindo}{%
   \HyOpt at CheckDvi{dviwindo}{%
     \def\Hy at driver{hdviwind}%
@@ -5426,6 +5483,33 @@
    A current html.sty will do all necessary (re)definitions%
   }%
 }
+\DeclareKeys
+  {
+    ,dviwindo .code:n =
+      {
+        \HyOpt at CheckDvi{dviwindo}
+         {
+          \def\Hy at driver{hdviwind}
+          \SetKeys[hyperref]{colorlinks}
+          \PassOptionsToPackage{dviwindo}{color}
+         }
+      }
+    ,dviwindo .usage:n = load
+    ,dvipsone .code:n =
+      {
+        \HyOpt at CheckDvi{dvipsone}
+         {
+          \def\Hy at driver{hdvipson}
+          \PassOptionsToPackage{dvipsone}{color}
+         }
+      }
+    ,dvipsone .usage:n = load
+    ,textures .code:n =
+      {
+        \HyOpt at CheckDvi{textures}{\def\Hy at driver{htexture}}%
+      }
+    ,textures .usage:n = load
+  }
 %    \end{macrocode}
 % No more special treatment for ps2pdf. Let it sink or swim.
 %    \begin{macrocode}
@@ -5435,8 +5519,17 @@
     \PassOptionsToPackage{dvips}{color}%
   }%
 }
+\DeclareKeys
+ {
+  ,ps2pdf .code:n =
+    {
+      \HyOpt at CheckDvi{dvips}{\def\Hy at driver{hdvips}}%
+    }
+  ,ps2pdf .usage:n = load
+ }
 %    \end{macrocode}
-%
+% The code for driverfallback has been simplified. No warning but simple error
+% if a wrong choice is used.
 %    \begin{macrocode}
 \let\HyOpt at DriverFallback\ltx at empty
 \define at key{Hyp}{driverfallback}{%
@@ -5454,6 +5547,17 @@
     }%
   \fi
 }
+\DeclareKeys
+ {
+   ,driverfallback .choices:nn =
+     {dvipdfmx,dvipdfmx,dvips,dvipsone,dviwindo,hypertex,ps2pdf,tex4ht}
+     {
+       \ifHy at DviMode
+         \edef\HyOpt at DriverFallback{\l_keys_choice_tl}%
+       \fi
+     }
+   ,driverfallback .usage:n = load
+ }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -5468,6 +5572,22 @@
     }%
   }%
 }
+
+\DeclareKeys
+ {
+   ,customdriver .code:n =
+     {
+       \IfFileExists{#1.def}{%
+         \def\HyOpt at CustomDriver{#1}%
+       }{%
+         \Hy at Warning{%
+           Missing driver file `#1.def',\MessageBreak
+           ignoring custom driver%
+         }%
+       }%
+     }
+   ,customdriver .usage:n = load
+ }
 %    \end{macrocode}
 %
 % \section{Options to add extra features}\label{features}





More information about the latex3-commits mailing list.