[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: extension key (c138bfc)

Ulrike Fischer fischer at troubleshooting-tex.de
Fri Jan 29 18:28:28 CET 2021


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

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

commit c138bfc95357e89cb7964caea2c159afd9c043d1
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Fri Jan 29 18:28:28 2021 +0100

    extension key


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

c138bfc95357e89cb7964caea2c159afd9c043d1
 hyperref-generic.dtx | 29 ++++++++++++++++++++++++-----
 info/key-list.tex    |  2 +-
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index f4d2d3e..f02ce18 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -510,6 +510,25 @@
 % The next compilation can then make use of it.
 % The two-pass could be avoided in the future with a better labeling system,
 % where the name if set earlier.
+% 
+% \DescribeHypkey{extension} This key sets an variable that has two purposes:
+% It is used if file name has not extension, and it decides if the annotation
+% is a URI or GoToR annotation. So
+% \begin{verbatim}
+% \hypersetup{extension=dvi}
+% \href{mwe1.pdf}{pdf}
+% \href{mwe2.dvi}{dvi}
+% \href{mwe3}{no ext}
+% \end{verbatim}
+% will create
+% \begin{verbatim}
+% /Subtype/Link/A<</S/URI   /URI(mwe1.pdf)>>
+% /Subtype/Link/A<</S/GoToR /F  (mwe2.dvi)>>
+% /Subtype/Link/A<</S/GoToR /F  (mwe3.dvi)>>
+% \end{verbatim}
+% Typically PDF viewer can handle only GoToR annotions pointing to a PDF.
+% So normally the default value |pdf| of this key should not be changed.
+%
 
 %^^A %% This is an adapted version of hluatex.def
 %^^A %% meant to test the use of the commands
@@ -779,10 +798,6 @@
 \cs_set_eq:NN \hypercalcbp \dim_to_decimal_in_bp:n
 %    \end{macrocode}
 % \end{macro}
-% This is used as default file extension, should probably go into hyperref.
-%    \begin{macrocode}
-\providecommand*{\XR at ext}{pdf} %
-%    \end{macrocode}
 %
 % This command must be provided for now, but they are unused by the driver:
 %    \begin{macrocode}
@@ -1966,7 +1981,11 @@
    ,pageanchor .default:n = {true}
  }
 
-
+\keys_define:nn { hyp / setup }
+ {
+   ,extension .tl_set:N = \XR at ext
+   ,extension .initial:n= pdf
+ }
 \keys_define:nn { hyp / setup }
  {
    ,linktoc .choices:nn = { none, section, all, page }
diff --git a/info/key-list.tex b/info/key-list.tex
index daeb97d..2bed6e6 100644
--- a/info/key-list.tex
+++ b/info/key-list.tex
@@ -30,7 +30,7 @@ done   & draft              & \textit{false}         & do not do any hyperlinkin
 --     & dvipsone           &                        & use \textsf{dvipsone} backend \\
 --     & dviwindo           &                        & use \textsf{dviwindo} backend \\
 ??   &encap              &                        & to set encap character for hyperindex \\
-??   &extension          & \textit{dvi}           & suffix of linked files \\
+done  &extension          & \textit{dvi}           & suffix of linked files \\
 done &filebordercolor    & \textit{0 .5 .5}       & color of border around file links \\
 done &filecolor          & \textit{cyan}          & color of file links \\
 done   &final              & \textit{true}          & opposite of option draft \\





More information about the latex3-commits mailing list.