From 9ba05f7c343e9c9ef750fc1cc4a49049e29de19c Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sat, 11 Apr 2020 22:20:53 +0000
Subject: hyperxmp (11apr20)

git-svn-id: svn://tug.org/texlive/trunk@54652 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/source/latex/hyperxmp/hyperxmp.dtx  | 68 ++++++++++++++++------
 1 file changed, 51 insertions(+), 17 deletions(-)

(limited to 'Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx')

diff --git a/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx b/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx
index bad62e4b981..a2cc59e97f8 100644
--- a/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx
+++ b/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx
@@ -22,7 +22,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{hyperxmp}
 %<*package>
-    [2020/03/20 v5.0 Store hyperref metadata in XMP format]
+    [2020/04/08 v5.1 Store hyperref metadata in XMP format]
 %</package>
 %
 %<*driver>
@@ -111,7 +111,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{2342}
+% \CheckSum{2354}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -1612,9 +1612,10 @@
 % \end{macro}
 %
 % \begin{macro}{\@pdfapart}
-% Prepare to store the \acro{PDF/A} part ID, which defaults to~``1''.
+% Prepare to store the \acro{PDF/A} part ID, which defaults to~``1''
+% if \optname{pdfa} is passed to \pkgname{hyperref}.
 %    \begin{macrocode}
-\def\@pdfapart{1}
+\def\@pdfapart{}
 \define@key{Hyp}{pdfapart}{%
   \afterassignment\hyxmp@no@bad@parts\@tempcnta=0#1\relax
   \hyxmp@pdfstringdef\@pdfapart{\the\@tempcnta}%
@@ -1623,9 +1624,11 @@
 % \end{macro}
 %
 % \begin{macro}{\@pdfaconformance}
-% Prepare to store the \acro{PDF/A} conformance ID, which defaults to~``B''.
+% Prepare to store the \acro{PDF/A} conformance ID, which defaults to~``b''
+% if \optname{pdfa} is passed to \pkgname{hyperref} and |\@pdfapart| is
+% empty.
 %    \begin{macrocode}
-\def\@pdfaconformance{B}
+\def\@pdfaconformance{}
 \define@key{Hyp}{pdfaconformance}{%
   \uppercase{\hyxmp@pdfstringdef\@pdfaconformance{#1}}%
 }
@@ -2328,12 +2331,28 @@
 %    \begin{macrocode}
 \newcommand*{\hyxmp@check@standards}{%
 %    \end{macrocode}
+% If the \optname{pdfa} option was passed to \pkgname{hyperref} but
+% |\@pdfapart| is not set, set it to~|1| and |\@pdfaconformance| to~|B|.
+%    \begin{macrocode}
+  \ifHy@pdfa
+    \@ifmtargexp{\@pdfapart}{%
+      \PackageWarningNoLine{hyperxmp}{%
+        `pdfa' was passed to hyperref, but `pdfapart' was\MessageBreak
+        not specified.\space\space  Setting pdfapart to `1' and\MessageBreak
+        pdfaconformance to `B'%
+      }%
+      \gdef\@pdfapart{1}%
+      \gdef\@pdfaconformance{B}%
+    }%
+  \fi
+%    \end{macrocode}
+%
 % \begin{macro}{\hyxmp@standards}
 % We define |\hyxmp@standards| to be non-empty if \emph{any} \acro{PDF}
 % standard is claimed (currently, \acro{PDF/A}, \acro{PDF/X}, or
 % \acro{PDF/UA}.
 %    \begin{macrocode}
-  \def\hyxmp@standards{%
+  \edef\hyxmp@standards{%
     \@pdfapart
     \@pdfxstandard
     \@pdfuapart
@@ -2343,7 +2362,7 @@
 %    \begin{macrocode}
   \@ifnotmtargexp{\hyxmp@standards}{%
     \@ifmtargexp{\@pdftitle}{%
-      \PackageWarning{hyperxmp}{%
+      \PackageWarningNoLine{hyperxmp}{%
         Missing pdftitle (required for PDF standards\MessageBreak
         compliance)%
       }%
@@ -3001,12 +3020,18 @@
   \edef\hyxmp@today@xmp{\expandafter\hyxmp@pdf@to@xmp@date\pdffeedback creationdate}%
 }
 %    \end{macrocode}
+% \begin{macro}{\hyxmp@timestamp}
 % Case 3: |\filemoddate| is defined (\XeLaTeX).
-% In this case, we treat the timestamp of the job's |.aux| file as the
+% In this case, we treat the timestamp of the job's |.log| file as the
 % current date/time.
+% \changes{v5.1}{2020/04/08}{Don't rely on
+%   \string\cs{jobname}\string\texttt{.aux} existing to query the
+%   current time under \string\XeLaTeX\string\@.  Instead, use
+%   \string\cs{jobname}\string\texttt{.log}.  Thanks to Ulrike Fischer
+%   for the bug report and for her suggestion to use the log file.}
 %    \begin{macrocode}
 \hyxmp@try@today{filemoddate}{%
-  \edef\hyxmp@today@xmp{\filemoddate{\jobname.aux}}%
+  \edef\hyxmp@today@xmp{\filemoddate{\jobname.log}}%
   \edef\next{%
     \edef\noexpand\hyxmp@today@xmp{\noexpand\hyxmp@as@xmp@date{\hyxmp@today@xmp}}%
   }%
@@ -3022,6 +3047,7 @@
 }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\hyxmp@today@pdf}
 % Define |\hyxmp@today@pdf| as the current date and (if available) time
@@ -4047,17 +4073,21 @@ _______________________________________________________________^^J%
 % Define |\@pdfproducer| using the banner string if available or the
 % \tex\ engine's version number if not.
 % \changes{v5.0}{2020/03/01}{Added this macro}
+% \changes{v5.1}{2020/04/06}{Check for \string\LuaTeX\ before checking for
+%   \string\pdfTeX\ to work around \string\pkgname{luatex85}'s confusing
+%   \string\pkgname{iftex} by defining \string\cs{pdftexversion}.  Thanks
+%   to Robin Schwab for the bug report}
 %    \begin{macrocode}
 \newcommand*{\hyxmp@define@pdfproducer}{%
   \gdef\@pdfproducer{TeX}
-  \ifPDFTeX
-    \expandafter\hyxmp@banner@to@producer\expandafter{\pdftexbanner}
+  \ifLuaTeX
+    \expandafter\hyxmp@banner@to@producer\expandafter{\luatexbanner}%
   \else
-    \ifLuaTeX
-      \expandafter\hyxmp@banner@to@producer\expandafter{\luatexbanner}
+    \ifPDFTeX
+      \expandafter\hyxmp@banner@to@producer\expandafter{\pdftexbanner}%
     \else
       \ifXeTeX
-        \edef\@pdfproducer{XeTeX version \the\XeTeXversion\XeTeXrevision}
+        \edef\@pdfproducer{XeTeX version \the\XeTeXversion\XeTeXrevision}%
       \fi
     \fi
   \fi
@@ -4082,12 +4112,16 @@ _______________________________________________________________^^J%
 % removing the initial ``\texttt{This is}'' if possible (specifically,
 % when $\varepsilon$-\TeX's\index{e-TeX=$\varepsilon$-\TeX}
 % |\scantokens| primitive is available).
+% \changes{v5.1}{2020/04/03}{Prevent the category code of ``@'' from
+%   propagating past the \cs{begin}\string\texttt{\{document\}}.
+%   Thanks to Robert Schlicht for noticing this catcode ``leak'' and
+%   providing a correction}
 %    \begin{macrocode}
 \def\hyxmp@banner@to@producer#1{%
   \ifx\scantokens\relax
     \gdef\@pdfproducer{#1}%
   \else
-    \scantokens{\makeatletter\hyxmp@remove@this#1\relax\makeatother}%
+    {\scantokens{\makeatletter\hyxmp@remove@this#1\relax}}%
   \fi
 }
 %    \end{macrocode}
@@ -4535,7 +4569,7 @@ ______</dc:#2>^^J%
 % properties identify a document as conforming to a particular
 % \acro{PDF/A} standard.  We default to \PDFstd{A}{1}{b}{} if any
 % \acro{PDF/A} compliance is detected but let the author override the
-% ``1'' with \optname{pdfapart} and the ``B'' with
+% ``1'' with \optname{pdfapart} and the ``b'' with
 % \optname{pdfaconformance}.
 % \changes{v2.4}{2013/12/21}{Added this macro}
 % \changes{v2.9}{2016/04/12}{Let the author specify the \protect\acro{PDF/A}
-- 
cgit v1.2.3

