[latex3-commits] [git/LaTeX3-latex3-latex2e] testmetadata: update keys to state in pdfresources (8df3f0b2)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Dec 30 16:59:10 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : testmetadata
Link       : https://github.com/latex3/latex2e/commit/8df3f0b22c0c9f7f0e7eee72bce6057a9b99131a

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

commit 8df3f0b22c0c9f7f0e7eee72bce6057a9b99131a
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu Dec 30 16:59:10 2021 +0100

    update keys to state in pdfresources


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

8df3f0b22c0c9f7f0e7eee72bce6057a9b99131a
 required/latex-lab/documentmetadata-support.dtx | 202 ++++++++++++------------
 1 file changed, 98 insertions(+), 104 deletions(-)

diff --git a/required/latex-lab/documentmetadata-support.dtx b/required/latex-lab/documentmetadata-support.dtx
index da78199f..f41ff746 100644
--- a/required/latex-lab/documentmetadata-support.dtx
+++ b/required/latex-lab/documentmetadata-support.dtx
@@ -41,57 +41,52 @@
 %
 %    Currently the following keys are implemented:
 %
-%    \begin{description}
-%       \item[\texttt{backend}] to specify the backend to use; this is
-%          usually determined automatically.
-%          A backend which can't be detected automatically like |dvipdfmx|,
-%          must be set in the first \cs{DocumentMetadata}.
-%^^A       This will probably be extended to  pass the value also to packages.
-%
-%       \item[\texttt{pdfversion}] e.g. \texttt{pdfversion=1.7}
-%
-%       \item[\texttt{uncompress}] no value. Forces an uncompressed pdf.
-%
-%       \item[\texttt{lang}] to set the Lang entry in the Catalog.
-%          E.g. \texttt{lang=de-DE}. The initial value is |en-US|
-%
-%       \item[\texttt{pdfstandard}] Choice key to set the pdf standard.
-%         Currently |A-1b|, |A-2a|, |A-2b|, |A-2u|, |A-3a|, |A-3b| and |A-3u| are accepted as
-%         values. The casing is irrelevant, |a-1b| works too.
-%         The underlying code to ensure the requirements (as far as they
-%         can be ensured) is incomplete, but a color profile is included and the
-%         /OutputIntent is set. The |u| variants for example do not force unicode,
-%         but they will pass the information to hyperref and hyperxmp. The |a| variants
-%         do \emph{not} enforce (or even test) a tagged pdf yet.
-%         More information can be found in the documentation
-%         of \pkg{l3pdfmeta}.
-%
-%       \item[\texttt{colorprofiles}] This allows to load icc-colorprofiles. Details
-%       are described in the documentation of \pkg{l3pdfmeta}.
-%
-%       \item[\texttt{pdfmanagement}] Boolean. This activates/deactivates
-%         the core management code. By default the value is true.
-%
-%       \item[\texttt{firstaidoff}] This accepts a comma lists of keywords and disables the patches
-%       related to them. More information can be found in the documentation of
-%       \pkg{pdfmanagement-firstaid}.
-%
-%       \item[\texttt{testphase}] This key is used to load testphase code. The values it accepts
-%       and their effect will change over time, when testphase packages are added or
-%       removed when the code is moved into the kernel. Currently the accepted values are
-%       \texttt{tagpdf} (this loads the tagpdf package), \texttt{headings} (this loads
-%       code which reimplements heading commands), and \texttt{ptagging}, which loads code
-%       to allow paragraph tagging to work with engines other than luatex.
-%       \item[\texttt{activate}] This key is used to enable some document wide functions. It is
-%       currently in an experimental state. The values and their behaviour are subject to change.
-%       Currently the only value is |tagging|,
-%       which will do |\tagpdfsetup{activate,paratagging,interwordspace}|. It requires that
-%       \pkg{tagpdf} has been loaded first with the |testphase| key.
-%       \item[\texttt{debug}] This key activates some debug options. Currently only the
-%       keys |para| (with the default and only value |show|),
-%       and |log| (with the values of \pkg{tagpdf}) and |uncompress| (which does the same
-%       as |uncompress| as main key)  are known.
-%    \end{description}
+% Currently the following keys are implemented
+%
+% \begin{description}
+%    \item[\texttt{backend}] passes the backend name to expl3.
+%^^A    This will probably be extended to  pass the value also to packages.
+%    \item[\texttt{pdfversion}] e.g. \texttt{pdfversion=1.7}
+%    \item[\texttt{uncompress}] no value. Forces an uncompressed pdf.
+%    \item[\texttt{lang}] to set the Lang entry in the Catalog.
+%    E.g. \texttt{lang=de-DE}. The initial value is |en-US|
+%    \item[\texttt{pdfstandard}] Choice key to set the pdf standard.
+%      Currently |A-1b|, |A-2a|, |A-2b|, |A-2u|, |A-3a|, |A-3b| and |A-3u| are accepted as
+%      values. The casing is irrelevant, |a-1b| works too.
+%      The underlying code to ensure the requirements (as far as they
+%      can be ensured) is incomplete, but a color profile is included and the
+%      /OutputIntent is set. The |u| variants for example do not force unicode,
+%      but they will pass the information to hyperref and hyperxmp. The |a| variants
+%      do \emph{not} enforce (or even test) a tagged pdf yet.
+%      More information can be found in the documentation
+%      of \pkg{l3pdfmeta}.
+%    \item[\texttt{colorprofiles}] This allows to load icc-colorprofiles. Details
+%    are described in the documentation of \pkg{l3pdfmeta}.
+%    \item[\texttt{testphase}] This key is used to load testphase code. The values it accepts
+%    and their effect will change over time, when testphase packages are added or
+%    removed when the code is moved into the kernel. The value
+%    \texttt{tagpdf} will load the tagpdf package. It will also issue
+%    |\tagpdfsetup{activate,paratagging,interwordspace}| and so activate tagging.
+%    Other values will be added later.
+%    The |testphase| key can only be used in the first \cs{DocumentMetadata}.
+%    \item[\texttt{activate}] This key is used to enable some document wide functions. It is
+%    currently in an experimental state. The values and their behaviour are subject to change.
+%    Currently the only value is |tagging|,
+%    which will do |\tagpdfsetup{activate,paratagging,interwordspace}|. It requires that
+%    \pkg{tagpdf} has been loaded first with the |testphase| key.
+%    \item[\texttt{debug}] This key activates some debug options. It takes a list of key-values
+%    as value. Currently the following keys are known:
+%     \begin{description}
+%     \item[\texttt{para}] with the default and only value |show|. It will activate the |paratagging-show|
+%     option of \pkg{tagpdf},
+%     \item[\texttt{log}]  with the values as described in the documentation \pkg{tagpdf},
+%     \item[\texttt{uncompress}] which does the same as |uncompress| as main key
+%     \item[\texttt{pdfmanagement}] a boolean which allows to deactivate the pdfmanagement.
+%    \item[\texttt{firstaidoff}] This accepts a comma lists of keywords and disables the patches
+%    related to them. More information can be found in the documentation of
+%    \pkg{pdfmanagement-firstaid}.%
+% \end{description}
+%
 %
 %
 %
@@ -148,10 +143,10 @@
           \file_input:n {l3backend-testphase-\c_sys_backend_str.def}
         \ExplSyntaxOff\makeatother
 %    \end{macrocode}
-%    Set the default language, process the rest of the keys,
+%    Set the default language (this requires that the backend has been loaded),
+%    process the rest of the keys,
 %    and setup the generic driver.
 %    \begin{macrocode}
-%FMi wouldn't it be cleaner to set the default when declaring the key?
         \keys_set_filter:nnn  { document / metadata } { init } { lang=en-US, #1 }
         \bool_if:NT \g__pdfmanagement_active_bool
           {
@@ -191,7 +186,7 @@
         \g__pdfmanagement_testphase_tl
         \RequirePackage{pdfmanagement-firstaid}
       }
-}
+  }
 %    \end{macrocode}
 %  \end{macro}
 
@@ -199,20 +194,22 @@
 
 
 %    \begin{macrocode}
-
 %FMi defined elsewhere
 %FMi
 %FMi \clist_new:N \g__pdfmanagement_firstaidoff_clist
 %FMi \tl_new:N \g__pdfmanagement_testphase_tl
-
 \keys_define:nn { document / metadata }
   {
-     backend .choices:nn =
-       { dvipdfmx , dvips , dvisvgm , luatex , pdftex , pdfmode , xdvipdfmx , xetex }
-       {
+    backend .choices:nn =
+      { dvipdfmx , dvips , dvisvgm , luatex , pdftex , pdfmode , xdvipdfmx , xetex }
+      {
         \sys_load_backend:n {#1}
       },
-    ,backend .groups:n = { init }
+    backend .groups:n = { init } ,
+  }
+
+\keys_define:nn { document / metadata }
+  {
     ,pdfversion .code:n =
       {
         \pdf_version_gset:n { #1 }
@@ -248,57 +245,38 @@
       {
         \msg_warning:nnn{pdf}{unknown-standard}{#1}
       }
-    ,pdfmanagement .bool_gset:N = \g__pdfmanagement_active_bool
-    ,firstaidoff .clist_gset:N = \g__pdfmanagement_firstaidoff_clist
     ,testphase .multichoice:
     ,testphase / tagpdf .code:n =
       {
-        \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
+        \tl_gput_right:Nn\g_@@_testphase_tl
           {
-            \RequirePackage{tagpdf}
-            \AddToDocumentProperties [document]{testphase/tagpdf}{loaded}
-          }
-      }
-    ,testphase / headings .code:n =
-      {
-        \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
-          {
-            \RequirePackage{headings-testphase}
-            \AddToDocumentProperties [document]{testphase/headings}{loaded}
-          }
-      }
-    ,testphase / ptagging .code:n =
-      {
-        \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
-          {
-            \AddToHook{class/after}
+            \file_if_exist_input:nF {tagpdf-latex-lab-testphase.ltx}
               {
-                \RequirePackage{ptagging-testphase}
-                \AddToDocumentProperties [document]{testphase/ptagging}{loaded}
+                \RequirePackage{tagpdf}
+                \AddToDocumentProperties [document]{testphase/tagpdf}{loaded}
+                \tagpdfsetup{activate,paratagging,interwordspace}
+                \AddToDocumentProperties [document]{tagging}{active}
+                \AddToDocumentProperties [document]{tagging/para}{active}
+                \AddToDocumentProperties [document]{tagging/interwordspace}{active}
               }
           }
       }
     ,testphase / unknown .code:n =
       {
-        \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
+        \tl_gput_right:Nn\g_@@_testphase_tl
            {
-             \AddToHook{class/after}
-               {
-                 \RequirePackage{#1-testphase}
-                 \AddToDocumentProperties [document]{testphase/#1}{loaded}
-               }
+             \file_if_exist_input:nF {#1-latex-lab-testphase.ltx}
+              {
+                 \msg_warning:nnn{meta}{latex-lab-pkg-missing}{#1}
+              }
            }
       }
     ,activate .multichoice:
     ,activate / tagging .code:n =
       {
-        \AddToHook{package/after/tagpdf}
-          {
-            \tagpdfsetup{activate,paratagging,interwordspace}
-            \AddToDocumentProperties [document]{tagging}{active}
-            \AddToDocumentProperties [document]{tagging/para}{active}
-            \AddToDocumentProperties [document]{tagging/interwordspace}{active}
-          }
+        \PackageWarning{pdfmanagement-testphase}
+         {The~activate~key~is~deprecated.\MessageBreak
+          Tagging~is~activated~with~'testphase=tagpdf'~directly}{}
       }
     ,debug .code:n =
       {
@@ -306,30 +284,48 @@
       }
     ,debug / para .code:n =
       {
-        \AddToHook{package/after/tagpdf}
+        \AddToHook
+          {
+            package/tagpdf/after
+          }
           {
-            \tagpdfsetup{paratagging-show}
+             \tagpdfsetup{paratagging-show}
           }
       }
     ,debug / log .code:n =
       {
-        \AddToHook{package/after/tagpdf}
+        \AddToHook
           {
-            \tagpdfsetup{log=#1}
+           package/tagpdf/after
+          }
+          {
+             \tagpdfsetup{log=#1}
           }
       }
     ,debug / uncompress .code:n =
       {
         \pdf_uncompress:
       }
+    ,debug / pdfmanagement .bool_gset:N = \g_@@_active_bool
+    ,debug / firstaidoff .clist_gset:N = \g_@@_firstaidoff_clist
   }
+
+
 %    \end{macrocode}
-%
+% \subsection{Messages}
 %    \begin{macrocode}
-\msg_new:nnn  { meta } { after-class }
-              {
+%UFi is meta the right module name here?
+\prop_gput:Nnn \g_msg_module_type_prop { meta } { LaTeX }
+\prop_gput:Nnn \g_msg_module_name_prop { meta } { DocumentMetadata }
+
+\msg_new:nnn { meta } { after-class }
+             {
                 \token_to_str:N \DocumentMetadata \c_space_tl
                 should~be~used~only~before~\token_to_str:N\documentclass
+             }
+\msg_new:nnn { meta } { latex-lab-pkg-missing }
+             {
+               LaTeX-lab~package~'#1'~not~found.
               }
 %    \end{macrocode}
 %
@@ -345,8 +341,6 @@
 % \Finale
 %
 
-
-
 \endinput
 
 \prop_new:N \g__pdfmanagement_documentproperties_prop %





More information about the latex3-commits mailing list.