[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: working on the key list and documentation. Use new doc sty (4c2ab34)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon Jan 25 19:40:25 CET 2021


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

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

commit 4c2ab34c83264279d999b62b6fbe24175427585d
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon Jan 25 19:40:25 2021 +0100

    working on the key list and documentation. Use new doc sty


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

4c2ab34c83264279d999b62b6fbe24175427585d
 hyperref-generic.dtx | 76 +++++++++++++++++++++++++++++++++++++++++++++-------
 info/key-list.tex    | 60 ++++++++++++++++++++---------------------
 2 files changed, 96 insertions(+), 40 deletions(-)

diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index 860778c..64473df 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -31,6 +31,16 @@
 \end{document}
 %</driver>
 % \fi
+% \NewDocElement[
+%   idxgroup=hypersetup keys\actualchar\cs{hypersetup} keys,
+%   idxtype = {hypersetup key},
+%   printtype= \textit{\cs[no-index]{hypersetup key}}
+%    ]{Hypkey}{hypkey}
+% \NewDocElement[
+%   idxgroup=Hooks,
+%   printtype= \textit{hook}
+%    ]{Hook}{hook}
+%
 % \title{^^A
 %   The \pkg{hyperref-generic} package  \\ A generic driver for hyperref ^^A
 % }
@@ -91,6 +101,29 @@
 %  so if commands from \pkg{bookmark} are needed in the preamble the document
 %  still has to load it manually but this is subject to change.
 %
+%  \subsection{PDF page size (mediabox)}
+%  The other \pkg{hyperref} driver contains code to set the PDF page size.
+%  There is no real justification why this is done by \pkg{hyperref} apart from the
+%  fact that \LaTeX{} itself doesn't do it and that the needed special code could
+%  be added to the backend drivers.
+%
+%  In the new driver this code is gone. The problem is not to set the MediaBox,
+%  actually it could be done with one line of code:
+%  \begin{verbatim}
+%  \pdfmanagement_add:nnn{Page}{MediaBox}
+%    {[0~0~\dim_to_decimal_in_bp:n{\paperwidth}~
+%          \dim_to_decimal_in_bp:n{\paperheight}]}
+%  \end{verbatim}
+%
+%  The problem is to know which value to use (with the memoir class \cs{stockwidth}
+%  should be used), and that there are to many actors here: color/graphicx, geometry,
+%  the KOMA-classes, memoir, \ldots\ all try to set this.
+%
+%  So if the PDF page size is wrong load one of the other packages setting it
+%  e.g. the \pkg{color} or the \pkg{graphicx} package.
+%  At some time this function should then be provided by \pkg{l3backend}.
+%
+%
 %  \subsection{Link decorations: border, color, OCG-color, \ldots}
 %  Some main changes are
 %  \begin{itemize}
@@ -249,6 +282,8 @@
 %  A number of options are ignored by this driver
 %  \begin{description}
 %  \item[pdfversion] The pdfversion should be set in \cs{DeclareDocumentMetadata}
+%  \item[setpagesize] The key is ignored and the PDF page size is not
+%  set. Load \pkg{color} or \pkg{graphicx} or use a class which sets the PDF page size.
 %  \item[breaklinks] The option does nothing sensible anyway (apart from triggering
 %  a warning). Currently with latex+dvips links can't be broken. But there is work
 %  in progress to change this.
@@ -515,6 +550,16 @@
      }
   }
 %    \end{macrocode}
+% A generic message for ignored keys.
+%    \begin{macrocode}
+\msg_new:nnn
+  { hyp }
+  { key-dropped }
+  {
+    This~hyperref~driver~ignores~the~key~#1!\\
+    Please~check~the~documentation.
+  }
+%    \end{macrocode}
 % pdf/A messages for fields, this will probably be moved to an external package
 %    \begin{macrocode}
 \msg_new:nnn
@@ -929,11 +974,13 @@
 %   {
 %     \l_@@_annot_ocgcolorlinks_bool
 %   }
+%    \begin{macrocode}
 \bool_new:N \l_@@_annot_ocgcolorlinks_bool
 \seq_map_inline:Nn \c_@@_annot_types_seq
   {
     \bool_new:c {l_@@_annot_ocgcolor#1_bool}
   }
+%    \end{macrocode}
 % \end{variable}
 %
 % \subsection{Boxes}
@@ -1276,7 +1323,7 @@
 % \end{syntax}
 % This creates a complete GoTo link around the \meta{link text}
 % pointing to \meta{destination name}.
-% The hook |hyp/link/|\meta{context}| is executed at the begin if it exists.
+% The hook |hyp/link/|\meta{context} is executed at the begin if it exists.
 %
 % The only \meta{context} for which a hook is predefined is |cite|.
 % Packages which want to use another \meta{context} should initialize the hook like
@@ -1295,7 +1342,7 @@
 % \end{syntax}
 % This creates the start and end commands for a GoTo link around the text
 % between both pointing to \meta{destination name}.
-% The hook |hyp/link/|\meta{context}| is executed at the begin if it exists
+% The hook |hyp/link/|\meta{context} is executed at the begin if it exists
 % as with \cs{hyper at link}
 %
 % The commands open and close a group, so should be placed carefully. .
@@ -1679,7 +1726,6 @@
       }
   }
 
-
 \keys_define:nn { hyp / setup }
  {
    ,baseurl       .code:n =
@@ -2417,9 +2463,13 @@
 \cs_generate_variant:Nn \@@_color_select:n {e}
 %    \end{macrocode}
 % \end{macro}
-% \begin{variable}{}
-% \cmd[module=hyperref keys,index=colormodel]{colormodel}
-% \end{variable}
+% \DescribeHypkey{colormodel} With |colormodel| the colormodel used in the |/C|
+% key of the annotation array and in similar keys is set. It does not affect
+% the text and graphics colors in the page stream.
+% Possible choices are |rgb| (three numbers in the array) and |cmyk| (four numbers).
+% While the PDF reference allows four numbers, PDF readers don't necessarly handle
+% this correctly, so the value can be wrong.
+% \begin{hypkey}{colormodel}
 %    \begin{macrocode}
 \keys_define:nn { hyp / setup }
   {
@@ -2428,6 +2478,9 @@
      { \str_gset:Nn \g_@@_colormodel_str {space-sep-#1}}
     ,colormodel .initial:n ={rgb}
   }
+%    \end{macrocode}
+% \end{hypkey}
+%    \begin{macrocode}
 \prop_map_inline:Nn \c_@@_map_hyp_annot_prop
   {
     \keys_define:nn { hyp / setup }
@@ -2653,8 +2706,10 @@
   {
     hidelinks .meta:n =
       {
-        ,colorlinks  = false
+        ,colorlinks    = false
         ,ocgcolorlinks = false
+        ,pdfborder     = { 0~0~0 }
+        ,pdfborderstyle=
       }
   }
 
@@ -2664,9 +2719,10 @@
       {
         hide#1 .meta:n =
           {
-             color#1=false,
-             ocgcolor#1 = false,
-             % 
+             ,color#1       = false
+             ,ocgcolor#1    = false
+             ,#1border      = { 0~0~0 }
+             ,#1borderstyle =
           }
       }
   }
diff --git a/info/key-list.tex b/info/key-list.tex
index 71a6550..4752150 100644
--- a/info/key-list.tex
+++ b/info/key-list.tex
@@ -8,7 +8,7 @@ done    & allbordercolors    &                        & Set all border color opt
 done    & allcolors          &                        & Set all color options (without border and field options)\\
 dropped & anchorcolor        & \textit{black}         & set color of anchors, ignored by most drivers. \\
 ??      & backref            & \textit{false}         & do bibliographical back references \\
-??      & baseurl            & \textit{empty}         & set base URL for document \\
+done    & baseurl            & \textit{empty}         & set base URL for document \\
 ??      & bookmarks          & \textit{true}          & make bookmarks \\
 ??      & bookmarksnumbered  & \textit{false}         & put section numbers in bookmarks \\
 ?? & bookmarksopen      & \textit{false}         & open up bookmark tree \\
@@ -34,30 +34,30 @@ done &filebordercolor    & \textit{0 .5 .5}       & color of border around file
 done &filecolor          & \textit{cyan}          & color of file links \\
 ??   &final              & \textit{true}          & opposite of option draft \\
 dropped &frenchlinks        & \textit{false}         & use small caps instead of color for links \\
-hidelinks          &                        & Hide links (removing color and border) \\
-hyperfigures       & \textit{false}         & make figures hyper links \\
-hyperfootnotes     & \textit{true}          & set up hyperlinked footnotes \\
-hyperindex         & \textit{true}          & set up hyperlinked indices \\
-hypertex           &                        & use \textsf{Hyper\TeX} backend \\
-hypertexnames      & \textit{true}          & use guessable names for links \\
-implicit           & \textit{true}          & redefine \LaTeX\ internals \\
-latex2html         &                        & use \textsf{\LaTeX2HTML} backend \\
-linkbordercolor    & \textit{1 0 0}         & color of border around links \\
-linkcolor          & \textit{red}           & color of links \\
-linktoc            & \textit{section}       & make text be link on TOC, LOF and LOT \\
-linktocpage        & \textit{false}         & make page number, not text, be link on TOC, LOF and LOT \\
-menubordercolor    & \textit{1 0 0}         & color of border around menu links \\
-menucolor          & \textit{red}           & color for menu links \\
-nativepdf          & \textit{false}         & an alias for \textsf{dvips} \\
-naturalnames       & \textit{false}         & use \LaTeX-computed names for links \\
-nesting            & \textit{false}         & allow nesting of links \\
-pageanchor         & \textit{true}          & put an anchor on every page \\
-pagebackref        & \textit{false}         & backreference by page number \\
-pdfauthor          & \textit{empty}         & text for PDF Author field \\
-pdfborder          & \textit{0 0 1}         & width of PDF link border \\
+done (ext) & hidelinks          &                        & Hide links (removing color and border) \\
+?? hyperfigures       & \textit{false}         & make figures hyper links \\
+?? hyperfootnotes     & \textit{true}          & set up hyperlinked footnotes \\
+?? hyperindex         & \textit{true}          & set up hyperlinked indices \\
+-- & hypertex           &                        & use \textsf{Hyper\TeX} backend \\
+?? & hypertexnames      & \textit{true}          & use guessable names for links \\
+?? & implicit           & \textit{true}          & redefine \LaTeX\ internals \\
+-- & latex2html         &                        & use \textsf{\LaTeX2HTML} backend \\
+done & linkbordercolor    & \textit{1 0 0}         & color of border around links \\
+done & linkcolor          & \textit{red}           & color of links \\
+??   &linktoc            & \textit{section}       & make text be link on TOC, LOF and LOT \\
+?? & linktocpage        & \textit{false}         & make page number, not text, be link on TOC, LOF and LOT \\
+done & menubordercolor    & \textit{1 0 0}         & color of border around menu links \\
+done & menucolor          & \textit{red}           & color for menu links \\
+-- & nativepdf          & \textit{false}         & an alias for \textsf{dvips} \\
+?? & naturalnames       & \textit{false}         & use \LaTeX-computed names for links \\
+?? drop? & nesting            & \textit{false}         & allow nesting of links \\
+?? & pageanchor         & \textit{true}          & put an anchor on every page \\
+?? & pagebackref        & \textit{false}         & backreference by page number \\
+?? hyperxmp? & pdfauthor          & \textit{empty}         & text for PDF Author field \\
+done (ext) & pdfborder          & \textit{0 0 1}         & width of PDF link border \\
                    & \textit{0 0 0}         & (\texttt{colorlinks)} \\
-pdfborderstyle     &                        & border style for links \\
-pdfcenterwindow    & \textit{false}         & position the document window in the center of the screen \\
+done (ext) & pdfborderstyle     &                        & border style for links \\
+done & pdfcenterwindow    & \textit{false}         & position the document window in the center of the screen \\
 pdfcreator         & \textit{LaTeX with}    & text for PDF Creator field \\
                    & \textit{hyperref}      & \\
 pdfdirection       & \textit{empty}         & direction setting \\
@@ -111,12 +111,12 @@ raiselinks         & \textit{false}         & raise up links (for \textsf{Hyper\
 runbordercolor     & \textit{0 .7 .7}       & color of border around `run' links \\
 runcolor           & \textit{filecolor}     & color of `run' links\\
 setpagesize        & \textit{true}          & set page size by special driver commands \\
-tex4ht             &                        & use \textsf{\TeX4ht} backend \\
-textures           &                        & use \textsf{Textures} backend \\
+???? & tex4ht             &                        & use \textsf{\TeX4ht} backend \\
+-- & textures           &                        & use \textsf{Textures} backend \\
 unicode            & \textit{true}          & Unicode encoded pdf strings, starting with version  2020-08-14 v7.00f set by default to true for all engines. \\
-urlbordercolor     & \textit{0 1 1}         & color of border around URL links \\
-urlcolor           & \textit{magenta}       & color of URL links \\
+done & urlbordercolor     & \textit{0 1 1}         & color of border around URL links \\
+done & urlcolor           & \textit{magenta}       & color of URL links \\
 verbose            & \textit{false}         & be chatty \\
-vtex               &                        & use \textsf{VTeX} backend\\
-xetex              &                        & use \textsf{Xe\TeX} backend\\
+-- & vtex               &                        & use \textsf{VTeX} backend\\
+-- & xetex              &                        & use \textsf{Xe\TeX} backend\\
 \end{longtable} 
\ No newline at end of file





More information about the latex3-commits mailing list.