texlive[46073] Master/texmf-dist: hyperxmp (15dec17)

commits+karl at tug.org commits+karl at tug.org
Fri Dec 15 23:18:15 CET 2017


Revision: 46073
          http://tug.org/svn/texlive?view=revision&revision=46073
Author:   karl
Date:     2017-12-15 23:18:14 +0100 (Fri, 15 Dec 2017)
Log Message:
-----------
hyperxmp (15dec17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/hyperxmp/hyperxmp.pdf
    trunk/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx
    trunk/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty

Modified: trunk/Master/texmf-dist/doc/latex/hyperxmp/hyperxmp.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx	2017-12-15 22:18:01 UTC (rev 46072)
+++ trunk/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx	2017-12-15 22:18:14 UTC (rev 46073)
@@ -22,7 +22,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{hyperxmp}
 %<*package>
-    [2017/07/25 v3.3 Store hyperref metadata in XMP format]
+    [2017/11/26 v3.4 Store hyperref metadata in XMP format]
 %</package>
 %
 %<*driver>
@@ -82,7 +82,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{1833}
+% \CheckSum{1825}
 %
 % \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
@@ -128,6 +128,8 @@
 %   Thanks to Robert Schlicht, Leonid Sinev, and David Carlisle for bug
 %   reports and to Leonid Sinev for helping test the new
 %   \protect\pkgname{hyperxmp} code}
+% \changes{v3.4}{2017/11/04}{Use \protect\pkgname{ifmtarg} to test for
+%   empty arguments, including non-empty but all spaces}
 %
 % \GetFileInfo{hyperxmp.dtx}
 %
@@ -995,9 +997,9 @@
 % We load a bunch of helper packages: \pkgname{kvoptions} for
 % package-option processing, \pkgname{pdfescape} and \pkgname{stringenc}
 % for re-encoding \term{Unicode} strings, \pkgname{intcalc} for
-% performing integer calculations (division and modulo), and
-% \pkgname{ifxetex} for detecting \XeTeX.
-%
+% performing integer calculations (division and modulo),
+% \pkgname{ifxetex} for detecting \XeTeX, and \pkgname{ifmtarg} for
+% testing if a macro argument is empty or all spaces.
 %    \begin{macrocode}
 \RequirePackage{kvoptions}
 \RequirePackage{pdfescape}
@@ -1004,8 +1006,21 @@
 \RequirePackage{stringenc}
 \RequirePackage{intcalc}
 \RequirePackage{ifxetex}
+\RequirePackage{ifmtarg}
 %    \end{macrocode}
 %
+% \begin{macro}{\@ifmtargexp}
+% \begin{macro}{\@ifnotmtargexp}
+% |\@ifmtarg| and |\@ifnotmtarg| do not expand their first argument.
+% Define |\@ifmtargexp| and |\@ifnotmtargexp| as expanding versions of
+% those macros.
+%    \begin{macrocode}
+\def\@ifmtargexp#1{\expandafter\@ifmtarg\expandafter{#1}}
+\def\@ifnotmtargexp#1{\expandafter\@ifnotmtarg\expandafter{#1}}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
 % \begin{macro}{\hyxmp at pdfstringdef}
 % \begin{macro}{\hyxmp at textunderscore}
 % Because \pkgname{hyperxmp} uses underscores to represent hard spaces,
@@ -1544,18 +1559,18 @@
 %   if \protect\optname{pdftitle} and \protect\optname{pdfauthor} are left
 %   unspecified.   Thanks to Maciej Radziejewski for the suggestion}
 %    \begin{macrocode}
-    \ifx\@pdftitle\@empty
-      \ifx\@title\@empty
-      \else
+    \@ifmtargexp{\@pdftitle}{%
+      \@ifnotmtargexp{\@title}{%
         \hypersetup{pdftitle={\@title}}%
-      \fi
-    \fi
-    \ifx\@pdfauthor\@empty
-      \ifx\@author\@empty
-      \else
+      }%
+    }%
+    {}%
+    \@ifmtargexp{\@pdfauthor}{%
+      \@ifnotmtargexp{\@author}{%
         \hypersetup{pdfauthor={\@author}}%
-      \fi
-    \fi
+      }%
+    }%
+    {}%
 %    \end{macrocode}
 % We wait until the end of the document to construct the \acro{XMP}
 % packet and write it to the \acro{PDF} document catalog.  This gives
@@ -2822,12 +2837,15 @@
 %
 % \begin{macro}{\hyxmp at def@DocumentID}
 % \begin{macro}{\hyxmp at DocumentID}
+% \begin{macro}{\hyxmp at seed@string}
 % Seed the random-number generator with a function of the current
 % filename, \acro{PDF} document title, and \acro{PDF} author, then invoke
 % |\hyxmp at create@uuid| to define |\hyxmp at DocumentID| as a random \acro{UUID}.
+% \changes{v3.4}{2017/11/04}{Correctly handle an author field of all spaces.
+%   Bug reported by Ga\"etan Leurent}
 %    \begin{macrocode}
 \newcommand*{\hyxmp at def@DocumentID}{%
-  \edef\hyxmp at seed@string{\jobname:\@pdftitle:\@pdfauthor}%
+  \edef\hyxmp at seed@string{\jobname:\@pdftitle:\@pdfauthor:}%
   \expandafter\hyxmp at seed@rng\expandafter{\hyxmp at seed@string}%
   \edef\hyxmp at rand@num{\the\@tempcnta}%
   \hyxmp at create@uuid\hyxmp at DocumentID
@@ -2835,9 +2853,11 @@
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\hyxmp at def@InstanceID}
 % \begin{macro}{\hyxmp at InstanceID}
+% \begin{macro}{\hyxmp at seed@string}
 % Seed the random-number generator with a function of the current
 % filename, \acro{PDF} document title, \acro{PDF} author, and the
 % current timestamp, then invoke |\hyxmp at create@uuid| to define
@@ -2852,6 +2872,7 @@
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 %
 % \subsection{Constructing the XMP packet}
@@ -3079,11 +3100,7 @@
 % Set |\@tempswatrue| only if the given text is nonempty or the provided
 % conditional evaluates to \textsc{true}.
 %    \begin{macrocode}
-  \@tempswafalse
-  \ifx#3\@empty
-  \else
-    \@tempswatrue
-  \fi
+  \@ifmtargexp{#3}{\@tempswafalse}{\@tempswatrue}%
   #1
     \@tempswatrue
   \fi
@@ -3149,11 +3166,7 @@
 % Set |\@tempswatrue| only if the given list is nonempty or the provided
 % conditional evaluates to \textsc{true}.
 %    \begin{macrocode}
-  \@tempswafalse
-  \ifx#4\@empty
-  \else
-    \@tempswatrue
-  \fi
+  \@ifmtargexp{#4}{\@tempswafalse}{\@tempswatrue}%
   #1
     \@tempswatrue
   \fi
@@ -3508,8 +3521,7 @@
 % \changes{v2.2}{2012/12/07}{Added this macro}
 %    \begin{macrocode}
 \newcommand*{\hyxmp at list@to at lines}[2]{%
-  \ifx#2\@empty
-  \else
+  \@ifnotmtargexp{#2}{%
     \bgroup
       \hyxmp at add@to at xml{%
 _________<#1>%
@@ -3541,7 +3553,7 @@
       \hyxmp at list
       \hyxmp at add@to at xml{</#1>^^J}%
     \egroup
-  \fi
+  }%
 }
 %    \end{macrocode}
 % \end{macro}

Modified: trunk/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty	2017-12-15 22:18:01 UTC (rev 46072)
+++ trunk/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty	2017-12-15 22:18:14 UTC (rev 46073)
@@ -22,7 +22,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{hyperxmp}
-    [2017/07/25 v3.3 Store hyperref metadata in XMP format]
+    [2017/11/26 v3.4 Store hyperref metadata in XMP format]
 \edef\hyxmp at dq@code{\the\catcode`\"}
 \catcode`\"=12
 \def\hyxmp at driver{hpdftex}
@@ -37,6 +37,9 @@
 \RequirePackage{stringenc}
 \RequirePackage{intcalc}
 \RequirePackage{ifxetex}
+\RequirePackage{ifmtarg}
+\def\@ifmtargexp#1{\expandafter\@ifmtarg\expandafter{#1}}
+\def\@ifnotmtargexp#1{\expandafter\@ifnotmtarg\expandafter{#1}}
 \newcommand{\hyxmp at pdfstringdef}[2]{%
   \let\hyxmp at textunderscore=\textunderscore
   \let\textunderscore=\hyxmp at uscore
@@ -208,18 +211,18 @@
     \else
       \edef\hyxmp at today{\@pdfdatetime}%
     \fi
-    \ifx\@pdftitle\@empty
-      \ifx\@title\@empty
-      \else
+    \@ifmtargexp{\@pdftitle}{%
+      \@ifnotmtargexp{\@title}{%
         \hypersetup{pdftitle={\@title}}%
-      \fi
-    \fi
-    \ifx\@pdfauthor\@empty
-      \ifx\@author\@empty
-      \else
+      }%
+    }%
+    {}%
+    \@ifmtargexp{\@pdfauthor}{%
+      \@ifnotmtargexp{\@author}{%
         \hypersetup{pdfauthor={\@author}}%
-      \fi
-    \fi
+      }%
+    }%
+    {}%
     \hyxmp at at@end{%
       \hyxmp at find@metadata
       \hyxmp at embed@packet
@@ -713,7 +716,7 @@
   \hyxmp at append@hex at iv#1%
 }
 \newcommand*{\hyxmp at def@DocumentID}{%
-  \edef\hyxmp at seed@string{\jobname:\@pdftitle:\@pdfauthor}%
+  \edef\hyxmp at seed@string{\jobname:\@pdftitle:\@pdfauthor:}%
   \expandafter\hyxmp at seed@rng\expandafter{\hyxmp at seed@string}%
   \edef\hyxmp at rand@num{\the\@tempcnta}%
   \hyxmp at create@uuid\hyxmp at DocumentID
@@ -800,11 +803,7 @@
   \fi
 }
 \newcommand*{\hyxmp at rdf@dc}[3][\iffalse]{%
-  \@tempswafalse
-  \ifx#3\@empty
-  \else
-    \@tempswatrue
-  \fi
+  \@ifmtargexp{#3}{\@tempswafalse}{\@tempswatrue}%
   #1
     \@tempswatrue
   \fi
@@ -839,11 +838,7 @@
   \fi
 }%
 \newcommand*{\hyxmp at list@to at xml}[4][\iffalse]{%
-  \@tempswafalse
-  \ifx#4\@empty
-  \else
-    \@tempswatrue
-  \fi
+  \@ifmtargexp{#4}{\@tempswafalse}{\@tempswatrue}%
   #1
     \@tempswatrue
   \fi
@@ -1001,8 +996,7 @@
   \gdef\xmplinesep{&#xA;}
 \endgroup
 \newcommand*{\hyxmp at list@to at lines}[2]{%
-  \ifx#2\@empty
-  \else
+  \@ifnotmtargexp{#2}{%
     \bgroup
       \hyxmp at add@to at xml{%
 _________<#1>%
@@ -1020,7 +1014,7 @@
       \hyxmp at list
       \hyxmp at add@to at xml{</#1>^^J}%
     \egroup
-  \fi
+  }%
 }
 \gdef\hyxmp at photometa@schema{%
   \edef\hyxmp at photometa@data{%



More information about the tex-live-commits mailing list