From 45623da68203ac8d7aa04b779a6ed65c92c3f866 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Fri, 14 Jan 2022 03:01:14 +0000
Subject: CTAN sync 202201140301

---
 macros/latex-dev/base/ltmeta.dtx | 189 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 189 insertions(+)
 create mode 100644 macros/latex-dev/base/ltmeta.dtx

(limited to 'macros/latex-dev/base/ltmeta.dtx')

diff --git a/macros/latex-dev/base/ltmeta.dtx b/macros/latex-dev/base/ltmeta.dtx
new file mode 100644
index 0000000000..e1c296ae1d
--- /dev/null
+++ b/macros/latex-dev/base/ltmeta.dtx
@@ -0,0 +1,189 @@
+% \iffalse meta-comment
+%
+%% File: ltmeta.dtx (C) Copyright 2021
+%       Frank Mittelbach, LaTeX Team
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version.  The latest version
+% of this license is in the file
+%
+%    https://www.latex-project.org/lppl.txt
+%
+%
+%%% From File: ltmeta.dtx
+%
+%    \begin{macrocode}
+\def\ltmetaversion{v1.0a}
+\def\ltmetadate{2021/12/07}
+%    \end{macrocode}
+%<*driver>
+\documentclass{l3doc}
+
+%\usepackage{ltmeta}
+
+% Fixing footnotes in  functions and variables: this should be in l3doc!
+
+\newcommand\fixfootnote[2]{\footnotemark
+  \AddToHookNext{env/#1/after}{\footnotetext{#2}}}
+\AddToHook{env/function/begin}{\def\footnote{\fixfootnote{function}}}
+\AddToHook{env/variable/begin}{\def\footnote{\fixfootnote{variable}}}
+
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+  \DocInput{ltmeta.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \providecommand\hook[1]{\texttt{#1}}
+% \providecommand\env[1]{\texttt{#1}}
+%
+%
+%
+% \title{The \texttt{ltmeta.dtx} code\thanks{This file has version
+%    \ltmetaversion\ dated \ltmetadate, \copyright\ \LaTeX\
+%    Project.}}
+% \author{Frank Mittelbach}
+%
+% \maketitle
+%
+%
+% \begin{abstract}
+%    This code defines the \cs{DocumentMetadata} interface.
+% \end{abstract}
+%
+% \tableofcontents
+%
+%
+% \section{Introduction}
+%
+%
+%    In the past there was no dedicated location to declare settings
+%    concerning a document as a whole. Settings are placed somewhere
+%    in the preamble or with the class options or even with some
+%    package options.  For some settings this can be too late, for
+%    example the pdf version can no longer be changed if a package has
+%    used code which already opened the PDF.
+%
+%    \cs{DocumentMetadata} as a new command unifies such settings in
+%    one place.  It must be used before \cs{documentclass} but can be
+%    issued more than once there.
+%
+%    At the moment most of the code run by \cs{DocumentMetadata} is
+%    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}
+% \begin{syntax}
+%  \cs{DocumentMetadata}\Arg{key-value list}
+% \end{syntax}
+% \end{function}
+%
+%
+%
+%    The keys defined for \cs{DocumentMetadata}
+%    currently allow to set the PDF version, to set the PDF \texttt{/Lang},
+%    to uncompress a PDF, to set the language and to declare a few PDF standards
+%    and some color profiles.
+%
+%    \cs{DocumentMetadata} is also used to
+%    activate the new PDF management code and it loads
+%    a number of required files for the PDF management code.
+%    As this forces the loading of the backend files, a backend
+%    which can't be detected automatically like |dvipdfmx|,
+%    must be set in the first \cs{DocumentMetadata} call (if there is more than one).
+%
+%    The full set of keys currently supported is documented in \texttt{documentmetadata-support.pdf}
+%    for now.
+%
+%
+% \StopEventually{\setlength\IndexMin{200pt}  \PrintIndex  }
+%
+%
+% \section{The Implementation}
+%
+%
+%
+%    \begin{macrocode}
+%<*2ekernel|latexrelease>
+%    \end{macrocode}
+%    Not needed yet but \ldots
+%    \begin{macrocode}
+%\ExplSyntaxOn
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%<latexrelease>\NewModuleRelease{2021/06/01}{ltmeta}
+%<latexrelease>                 {Document Metadata handling}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\protected\def\DocumentMetadata{%
+  \InputIfFileExists{documentmetadata-support.ltx}%
+     {}%
+%    \end{macrocode}
+%    The above file is changing \cs{DocumentMetadata} to a suitable
+%    definition (or so we hope), so that we can try again --- if not
+%    tough.
+%
+%    If the file can't be found we say so and carry on without it.
+%    \begin{macrocode}
+     {%
+       \@latex@error{No support files for
+                    \noexpand\DocumentMetadata found}
+         {Is the 'LaTeX-lab' bundle installed?%
+         \MessageBreak
+         Without it, 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}
+%
+%
+%
+%
+%
+%    \begin{macrocode}
+%
+%<latexrelease>\IncludeInRelease{0000/00/00}{ltmeta}%
+%<latexrelease>                 {Undo Document Metadata handling}
+%<latexrelease>
+%<latexrelease>\let\DocumentMetadata\@undefined
+%<latexrelease>
+%<latexrelease>\EndModuleRelease
+%    \end{macrocode}
+%    Again for the future \ldots
+%    \begin{macrocode}
+%\ExplSyntaxOff
+%    \end{macrocode}
+%    \begin{macrocode}
+%</2ekernel|latexrelease>
+%    \end{macrocode}
+%
+%    Restore module prefix (if any):
+%    \begin{macrocode}
+%<@@=>
+%    \end{macrocode}
+%
+%
+%
+%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\endinput
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
-- 
cgit v1.2.3

