[latex3-commits] [git/LaTeX3-latex3-latex2e] metadata: Basic integration of \DocumentMetadata (8fd5e41c)

Frank Mittelbach frank.mittelbach at latex-project.org
Mon Dec 13 16:25:41 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : metadata
Link       : https://github.com/latex3/latex2e/commit/8fd5e41c9e5184bb54d2bd0b80648688f4c72930

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

commit 8fd5e41c9e5184bb54d2bd0b80648688f4c72930
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Mon Dec 13 16:25:41 2021 +0100

    Basic integration of \DocumentMetadata


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

8fd5e41c9e5184bb54d2bd0b80648688f4c72930
 base/latexrelease.ins                              |   1 +
 base/ltmeta.dtx                                    | 112 ++++++++-------------
 base/testfiles/github-0479-often.luatex.tlg        |   5 +
 base/testfiles/github-0479-often.tlg               |   5 +
 base/testfiles/github-0479-often.xetex.tlg         |   5 +
 .../tlb-latexrelease-rollback-003-often.luatex.tlg |  10 ++
 .../tlb-latexrelease-rollback-003-often.tlg        |  10 ++
 .../tlb-latexrelease-rollback-003-often.xetex.tlg  |  10 ++
 base/testfiles/tlb-metadata-000.lvt                |  14 +++
 base/testfiles/tlb-metadata-000.tlg                |   5 +
 base/testfiles/tlb-rollback-004-often.luatex.tlg   |   5 +
 base/testfiles/tlb-rollback-004-often.tlg          |   5 +
 base/testfiles/tlb-rollback-004-often.xetex.tlg    |   5 +
 base/testfiles/tlb-rollback-005.luatex.tlg         |   5 +
 base/testfiles/tlb-rollback-005.tlg                |   5 +
 base/testfiles/tlb-rollback-005.xetex.tlg          |   5 +
 16 files changed, 139 insertions(+), 68 deletions(-)

diff --git a/base/latexrelease.ins b/base/latexrelease.ins
index 0b65114a..a68f8ae3 100644
--- a/base/latexrelease.ins
+++ b/base/latexrelease.ins
@@ -101,6 +101,7 @@ extension .ins) which are part of the distribution.
   \from{lterror.dtx}     {latexrelease}% empty
   \from{ltpar.dtx}       {latexrelease}% empty
   \from{ltpara.dtx}      {latexrelease}% empty
+  \from{ltmeta.dtx}      {latexrelease}% L3 layer module
   \from{ltspace.dtx}     {latexrelease}%
   \from{ltlogos.dtx}     {latexrelease}% L3 layer module
   \from{ltfiles.dtx}     {latexrelease}%
diff --git a/base/ltmeta.dtx b/base/ltmeta.dtx
index 6cfcbd25..614d8862 100644
--- a/base/ltmeta.dtx
+++ b/base/ltmeta.dtx
@@ -76,6 +76,10 @@
 %    external to the format and subject to change. This includes the
 %    supported key/values.
 %
+%    For that reason all that happens right now in the format is to
+%    look for suitable support files and if found, to redirect the
+%    processing to them.
+%
 % \subsection{\cs{DocumentMetadata}}
 %
 % \begin{function}{\DocumentMetadata}
@@ -98,59 +102,8 @@
 %    which can't be detected automatically like |dvipdfmx|,
 %    must be set in the first \cs{DocumentMetadata} call (if there is more than one).
 %
-%    Currently the following keys are implemented:
-%
-%    \begin{description}
-%       \item[\texttt{backend}] to specify the backend to use; this is
-%           usually determined automatically.
-%^^C       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 keysword and disable 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 load the tagpdf package, \texttt{headings}, this loads
-%       code which reimplements heading commands, and \texttt{ptagging} this loads code
-%       to allow paragraph tagging to work with engine 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}
-%
-%
+%    The full set of keys currently supported is documented elsewhere
+%    for now.
 %
 %
 % \StopEventually{\setlength\IndexMin{200pt}  \PrintIndex  }
@@ -162,23 +115,41 @@
 %
 %    \begin{macrocode}
 %<*2ekernel|latexrelease>
-\ExplSyntaxOn
+%    \end{macrocode}
+%    Not needed yet but \ldots
+%    \begin{macrocode}
+%\ExplSyntaxOn
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 %<latexrelease>\NewModuleRelease{2021/06/01}{ltmeta}
-%<latexrelease>                 {Document~Metadata~handling}
+%<latexrelease>                 {Document Metadata handling}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\newcommand\DocumentMetadata{
-  \IfFileExists{pdfmanagement-testphase}
+\newcommand\DocumentMetadata{%
+  \IfFileExists{documentmetadata-support.ltx}%
      {
-      \RequirePackage{pdfmanagement-testphase}
-      \let\DocumentMetadata\DeclareDocumentMetadata
-      \DeclareDocumentMetadata
-     }
-     {
-       \ErrorNecessarySupportFilesMissing
-       \@gobble
+      \input{documentmetadata-support.ltx}%
+%    \end{macrocode}
+%    The above file is changing \cs{DocumentMetadata} to a suitable
+%    definition (or so we hope), so now we can try again --- if not
+%    tough.
+%    \begin{macrocode}
      }
+     {%
+       \@latex at warning@no at line{No support files for
+         \noexpand\DocumentMetadata found.\MessageBreak
+         Is the 'documentmetadata-support' bundle installed?%
+         \MessageBreak\MessageBreak
+         The declaration is ignored}%
+%    \end{macrocode}
+%    No point in trying this more than once if there are several calls
+%    in the document.
+%    \begin{macrocode}
+      \let\DocumentMetadata\@gobble
+     }%
+  \DocumentMetadata
 }
 %    \end{macrocode}
 %
@@ -188,13 +159,18 @@
 %
 %    \begin{macrocode}
 %
-%<latexrelease>\IncludeInRelease{0000/00/00}%
-%<latexrelease>                 {Document~Metadata~handling}
-%<latexrelease>
+%<latexrelease>\IncludeInRelease{0000/00/00}{ltmeta}%
+%<latexrelease>                 {Undo Document Metadata handling}
 %<latexrelease>
+%<latexrelease>\let\DocumentMetadata\@undefined
 %<latexrelease>
 %<latexrelease>\EndModuleRelease
-\ExplSyntaxOff
+%    \end{macrocode}
+%    Again for the future \ldots
+%    \begin{macrocode}
+%\ExplSyntaxOff
+%    \end{macrocode}
+%    \begin{macrocode}
 %</2ekernel|latexrelease>
 %    \end{macrocode}
 %
diff --git a/base/testfiles/github-0479-often.luatex.tlg b/base/testfiles/github-0479-often.luatex.tlg
index 7d561984..5a64cb63 100644
--- a/base/testfiles/github-0479-often.luatex.tlg
+++ b/base/testfiles/github-0479-often.luatex.tlg
@@ -149,6 +149,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \pagebreak on input line ....
 LaTeX Info: Redefining \nopagebreak on input line ....
diff --git a/base/testfiles/github-0479-often.tlg b/base/testfiles/github-0479-often.tlg
index 696384e7..7b0fecdf 100644
--- a/base/testfiles/github-0479-often.tlg
+++ b/base/testfiles/github-0479-often.tlg
@@ -139,6 +139,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \pagebreak on input line ....
 LaTeX Info: Redefining \nopagebreak on input line ....
diff --git a/base/testfiles/github-0479-often.xetex.tlg b/base/testfiles/github-0479-often.xetex.tlg
index d55c3286..46354f30 100644
--- a/base/testfiles/github-0479-often.xetex.tlg
+++ b/base/testfiles/github-0479-often.xetex.tlg
@@ -139,6 +139,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \pagebreak on input line ....
 LaTeX Info: Redefining \nopagebreak on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
index 12eb31e1..e6a7eadc 100644
--- a/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
@@ -130,6 +130,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Skipping: [....-..-..] Make commands robust on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 Skipping: [....-..-..] Make robust on input line ....
@@ -713,6 +718,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \pagebreak on input line ....
 LaTeX Info: Redefining \nopagebreak on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
index d993f95d..fd30ebd0 100644
--- a/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
@@ -124,6 +124,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Skipping: [....-..-..] Make commands robust on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 Skipping: [....-..-..] Make robust on input line ....
@@ -697,6 +702,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \pagebreak on input line ....
 LaTeX Info: Redefining \nopagebreak on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg
index 5749d356..5cdf0302 100644
--- a/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg
@@ -124,6 +124,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Skipping: [....-..-..] Make commands robust on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 Skipping: [....-..-..] Make robust on input line ....
@@ -706,6 +711,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \pagebreak on input line ....
 LaTeX Info: Redefining \nopagebreak on input line ....
diff --git a/base/testfiles/tlb-metadata-000.lvt b/base/testfiles/tlb-metadata-000.lvt
new file mode 100644
index 00000000..d6ca9cdd
--- /dev/null
+++ b/base/testfiles/tlb-metadata-000.lvt
@@ -0,0 +1,14 @@
+% just load and see what happens
+%
+
+\input{test2e}
+
+\START
+\DocumentMetadata{}   % --- what happens?
+\DocumentMetadata{}   % --- and now?
+
+\OMIT
+
+\documentclass{article}
+
+\END
diff --git a/base/testfiles/tlb-metadata-000.tlg b/base/testfiles/tlb-metadata-000.tlg
new file mode 100644
index 00000000..8f87c474
--- /dev/null
+++ b/base/testfiles/tlb-metadata-000.tlg
@@ -0,0 +1,5 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+LaTeX Warning: No support files for \DocumentMetadata found.
+               Is the 'documentmetadata-support' bundle installed?
+               The declaration is ignored.
diff --git a/base/testfiles/tlb-rollback-004-often.luatex.tlg b/base/testfiles/tlb-rollback-004-often.luatex.tlg
index 2136fa74..650c0364 100644
--- a/base/testfiles/tlb-rollback-004-often.luatex.tlg
+++ b/base/testfiles/tlb-rollback-004-often.luatex.tlg
@@ -150,6 +150,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \pagebreak on input line ....
 LaTeX Info: Redefining \nopagebreak on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.tlg b/base/testfiles/tlb-rollback-004-often.tlg
index 3c8dbb15..e84c4998 100644
--- a/base/testfiles/tlb-rollback-004-often.tlg
+++ b/base/testfiles/tlb-rollback-004-often.tlg
@@ -139,6 +139,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \pagebreak on input line ....
 LaTeX Info: Redefining \nopagebreak on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.xetex.tlg b/base/testfiles/tlb-rollback-004-often.xetex.tlg
index 21b6178f..fbacf53b 100644
--- a/base/testfiles/tlb-rollback-004-often.xetex.tlg
+++ b/base/testfiles/tlb-rollback-004-often.xetex.tlg
@@ -139,6 +139,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \pagebreak on input line ....
 LaTeX Info: Redefining \nopagebreak on input line ....
diff --git a/base/testfiles/tlb-rollback-005.luatex.tlg b/base/testfiles/tlb-rollback-005.luatex.tlg
index bdcc80a9..fabc2823 100644
--- a/base/testfiles/tlb-rollback-005.luatex.tlg
+++ b/base/testfiles/tlb-rollback-005.luatex.tlg
@@ -153,6 +153,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \pagebreak on input line ....
 LaTeX Info: Redefining \nopagebreak on input line ....
diff --git a/base/testfiles/tlb-rollback-005.tlg b/base/testfiles/tlb-rollback-005.tlg
index 448d0e1b..e05001ad 100644
--- a/base/testfiles/tlb-rollback-005.tlg
+++ b/base/testfiles/tlb-rollback-005.tlg
@@ -143,6 +143,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \pagebreak on input line ....
 LaTeX Info: Redefining \nopagebreak on input line ....
diff --git a/base/testfiles/tlb-rollback-005.xetex.tlg b/base/testfiles/tlb-rollback-005.xetex.tlg
index bb3f4135..46c2015f 100644
--- a/base/testfiles/tlb-rollback-005.xetex.tlg
+++ b/base/testfiles/tlb-rollback-005.xetex.tlg
@@ -143,6 +143,11 @@ BEGIN module: ltpara (....-..-..) on input line ....
 Skipping module ltpara on input line ....
 Applying: [....-..-..] Undo hooks for paragraphs on input line ....
 END module: ltpara (....-..-..) on input line ....
+BEGIN module: ltmeta (....-..-..) on input line ....
+              Document Metadata handling.
+Skipping module ltmeta on input line ....
+Applying: [....-..-..] Undo Document Metadata handling on input line ....
+END module: ltmeta (....-..-..) on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \pagebreak on input line ....
 LaTeX Info: Redefining \nopagebreak on input line ....





More information about the latex3-commits mailing list.