From 4798e2b9e23049090bc67662a48f3baf71cb39d4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 24 Jun 2014 17:38:31 +0000 Subject: hyperxmp (24jun14) git-svn-id: svn://tug.org/texlive/trunk@34376 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/hyperxmp/hyperxmp.pdf | Bin 537806 -> 542014 bytes .../texmf-dist/source/latex/hyperxmp/hyperxmp.dtx | 97 +++++++++++++++++---- Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty | 47 ++++++---- 3 files changed, 108 insertions(+), 36 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/hyperxmp/hyperxmp.pdf b/Master/texmf-dist/doc/latex/hyperxmp/hyperxmp.pdf index 863488c66eb..527c09aa76e 100644 Binary files a/Master/texmf-dist/doc/latex/hyperxmp/hyperxmp.pdf and b/Master/texmf-dist/doc/latex/hyperxmp/hyperxmp.pdf differ diff --git a/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx b/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx index 43a3102b9c6..0a67e81be5c 100644 --- a/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx +++ b/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx @@ -22,7 +22,7 @@ %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{hyperxmp} %<*package> - [2014/01/02 v2.4 Store hyperref metadata in XMP format] + [2014/06/19 v2.5 Store hyperref metadata in XMP format] % % %<*driver> @@ -81,7 +81,7 @@ % % \fi % -% \CheckSum{1432} +% \CheckSum{1461} % % \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 @@ -112,6 +112,8 @@ % \changes{v2.2}{2010/12/06}{Added support for the \protect\acro{IPTC} Photo Metadata schema} % \changes{v2.4}{2013/12/21}{Added support for the \protect\acro{PDF/A} % Identification schema, as requested by Florian Breitwieser} +% \changes{v2.5}{2014/06/19}{Enabled ``\texttt{\string\string\string\_}'' +% to work within email addresses, as requested by Leonid Sinev} % % \GetFileInfo{hyperxmp.dtx} % @@ -610,6 +612,12 @@ % |scott/|'') in options such as \optname{baseurl}, % \optname{pdfcontacturl} and \optname{pdflicenseurl}. % +% \paragraph{Note~5: Unicode support} +% \term{Unicode} support is provided via the \pkgname{hyperref} package. +% If you specify \optname{unicode}|=true| either as a \pkgname{hyperref} +% option or as an argument to the |\hypersetup| command, the document +% can include \term{Unicode} characters in its \acro{XMP} fields. +% % % \StopEventually{^^A % \section{Future Work} @@ -791,11 +799,33 @@ \RequirePackage{ifxetex} % \end{macrocode} % +% \begin{macro}{\hyxmp@pdfstringdef} +% \begin{macro}{\hyxmp@textunderscore} +% Because \pkgname{hyperxmp} uses underscores to represent hard spaces, +% we need ``|\_|'' to map initially to something other than an +% underscore, in particular the \acro{ASCII} \acro{NAK}~(|^^U|) +% character. To accomplish this, we wrap \pkgname{hyperref}'s +% |\pdfstringdef| macro with our own version that temporarily does the +% proper substitution. Later in the execution, after underscores have +% been replaced with spaces, we replace \acro{NAK} characters with +% underscores. +% \changes{v2.5}{2014/06/19}{Added this macro} +% \begin{macrocode} +\newcommand{\hyxmp@pdfstringdef}[2]{% + \let\hyxmp@textunderscore=\textunderscore + \let\textunderscore=\hyxmp@uscore + \pdfstringdef{#1}{#2}% + \let\textunderscore=\hyxmp@textunderscore +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \begin{macro}{\@pdfcopyright} % Prepare to store the document's copyright statement. % \begin{macrocode} \def\@pdfcopyright{} -\define@key{Hyp}{pdfcopyright}{\pdfstringdef\@pdfcopyright{#1}} +\define@key{Hyp}{pdfcopyright}{\hyxmp@pdfstringdef\@pdfcopyright{#1}} % \end{macrocode} % \end{macro} % @@ -804,7 +834,7 @@ % agreement. % \begin{macrocode} \def\@pdflicenseurl{} -\define@key{Hyp}{pdflicenseurl}{\pdfstringdef\@pdflicenseurl{#1}} +\define@key{Hyp}{pdflicenseurl}{\hyxmp@pdfstringdef\@pdflicenseurl{#1}} % \end{macrocode} % \end{macro} % @@ -812,7 +842,7 @@ % Prepare to store the author's position/title (e.g.,~Staff Writer). % \begin{macrocode} \def\@pdfauthortitle{} -\define@key{Hyp}{pdfauthortitle}{\pdfstringdef\@pdfauthortitle{#1}} +\define@key{Hyp}{pdfauthortitle}{\hyxmp@pdfstringdef\@pdfauthortitle{#1}} % \end{macrocode} % \end{macro} % @@ -821,7 +851,7 @@ % \pkgname{hyperxmp} metadata. % \begin{macrocode} \def\@pdfcaptionwriter{} -\define@key{Hyp}{pdfcaptionwriter}{\pdfstringdef\@pdfcaptionwriter{#1}} +\define@key{Hyp}{pdfcaptionwriter}{\hyxmp@pdfstringdef\@pdfcaptionwriter{#1}} % \end{macrocode} % \end{macro} % @@ -830,7 +860,7 @@ % typically as an \acro{ISO}~\mbox{639-1} two-letter abbreviation. % \begin{macrocode} \def\@pdfmetalang{} -\define@key{Hyp}{pdfmetalang}{\pdfstringdef\@pdfmetalang{#1}} +\define@key{Hyp}{pdfmetalang}{\hyxmp@pdfstringdef\@pdfmetalang{#1}} % \end{macrocode} % \end{macro} % @@ -860,7 +890,7 @@ \define@key{Hyp}{pdfcontactaddress}{% \let\xmpcomma=\hyxmp@comma \def\xmpquote##1{##1}% - \pdfstringdef\@pdfcontactaddress{#1}% + \hyxmp@pdfstringdef\@pdfcontactaddress{#1}% \def\xmpcomma{,}% \let\xmpquote=\relax } @@ -872,7 +902,7 @@ % institution. % \begin{macrocode} \def\@pdfcontactcity{} -\define@key{Hyp}{pdfcontactcity}{\pdfstringdef\@pdfcontactcity{#1}} +\define@key{Hyp}{pdfcontactcity}{\hyxmp@pdfstringdef\@pdfcontactcity{#1}} % \end{macrocode} % \end{macro} % @@ -881,7 +911,7 @@ % person\slash institution. % \begin{macrocode} \def\@pdfcontactregion{} -\define@key{Hyp}{pdfcontactregion}{\pdfstringdef\@pdfcontactregion{#1}} +\define@key{Hyp}{pdfcontactregion}{\hyxmp@pdfstringdef\@pdfcontactregion{#1}} % \end{macrocode} % \end{macro} % @@ -890,7 +920,7 @@ % person\slash institution. % \begin{macrocode} \def\@pdfcontactpostcode{} -\define@key{Hyp}{pdfcontactpostcode}{\pdfstringdef\@pdfcontactpostcode{#1}} +\define@key{Hyp}{pdfcontactpostcode}{\hyxmp@pdfstringdef\@pdfcontactpostcode{#1}} % \end{macrocode} % \end{macro} % @@ -899,7 +929,7 @@ % institution. % \begin{macrocode} \def\@pdfcontactcountry{} -\define@key{Hyp}{pdfcontactcountry}{\pdfstringdef\@pdfcontactcountry{#1}} +\define@key{Hyp}{pdfcontactcountry}{\hyxmp@pdfstringdef\@pdfcontactcountry{#1}} % \end{macrocode} % \end{macro} % @@ -908,7 +938,7 @@ % person\slash institution. % \begin{macrocode} \def\@pdfcontactphone{} -\define@key{Hyp}{pdfcontactphone}{\pdfstringdef\@pdfcontactphone{#1}} +\define@key{Hyp}{pdfcontactphone}{\hyxmp@pdfstringdef\@pdfcontactphone{#1}} % \end{macrocode} % \end{macro} % @@ -917,7 +947,7 @@ % person\slash institution. % \begin{macrocode} \def\@pdfcontactemail{} -\define@key{Hyp}{pdfcontactemail}{\pdfstringdef\@pdfcontactemail{#1}} +\define@key{Hyp}{pdfcontactemail}{\hyxmp@pdfstringdef\@pdfcontactemail{#1}} % \end{macrocode} % \end{macro} % @@ -926,7 +956,7 @@ % institution. % \begin{macrocode} \def\@pdfcontacturl{} -\define@key{Hyp}{pdfcontacturl}{\pdfstringdef\@pdfcontacturl{#1}} +\define@key{Hyp}{pdfcontacturl}{\hyxmp@pdfstringdef\@pdfcontacturl{#1}} % \end{macrocode} % \end{macro} % @@ -1280,8 +1310,23 @@ disabled}% % \changes{v2.0}{2012/08/25}{Added this macro} % \begin{macrocode} \bgroup -\catcode`\^^C=11 -\gdef\hyxmp@comma{^^C} + \catcode`\^^C=11 + \gdef\hyxmp@comma{^^C} +\egroup +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\hyxmp@uscore} +% This is what |\_| temporarily maps to during packet construction. +% Because underscores are replaced by spaces, we need a mechanism to +% preserve user-specified underscores (e.g.,~in email addresses). We +% assume that documents will never otherwise use an \acro{NAK} (|^^U|) +% character in their \acro{XMP} metadata. +% \changes{v2.5}{2014/06/19}{Added this macro} +% \begin{macrocode} +\bgroup + \catcode`\^^U=11 + \gdef\hyxmp@uscore{^^U} \egroup % \end{macrocode} % \end{macro} @@ -1461,6 +1506,16 @@ disabled}% % \end{macrocode} % \end{macro} % +% \begin{macro}{\SE->pdfdoc@15} +% Preserve \acro{NAK} (|^^U|), which is normally an invalid character in +% \term{PDFDocEncoding}. We use it in \pkgname{hyperxmp} (and +% specifically in |\hyxmp@xmlify| below) as a placeholder for an +% underscore character. +% \begin{macrocode} +\expandafter\def\csname SE->pdfdoc@15\endcsname{0015} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\hyxmp@xmlify} % \changes{v2.0}{2012/08/02}{Completely rewritten by Heiko Oberdiek to % better support Unicode-enabled \tex\ programs} @@ -2055,6 +2110,8 @@ disabled}% % (``other'') spaces and all |^C| characters with commas, then append % the result to the |\hyxmp@xml| macro. % \changes{v2.0}{2012/08/24}{Updated also to replace commas} +% \changes{v2.5}{2014/06/19}{Updated also to replace underscores and to +% modify only the text being added, not the already-modified text} % \begin{macrocode} \newcommand*{\hyxmp@add@to@xml}[1]{% \bgroup @@ -2066,7 +2123,9 @@ disabled}% \repeat \lccode`\_=`\ \relax \lccode`\^^C=`\,\relax - \lowercase{\xdef\hyxmp@xml{\hyxmp@xml#1}}% + \lccode`\^^U=`\_\relax + \lowercase{\xdef\hyxmp@new@xml{#1}}% + \xdef\hyxmp@xml{\hyxmp@xml\hyxmp@new@xml}% \egroup } % \end{macrocode} @@ -2709,7 +2768,7 @@ _______^^J% % \end{macrocode} % \begin{macro}{\xmplinesep} % The \acro{IPTC} standard states that sets of telephone numbers, email -% address, and \acro{URL}s for the contact person or institution, +% addresses, and \acro{URL}s for the contact person or institution, % ``[m]ay have to be separated by a comma in the user % interface''~\cite{IPTC2010:photo-meta}. This is rather ambiguous: % Does the comma appear \emph{only} in the user interface or also in the diff --git a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty index b92791d4308..fc1e808e8bb 100644 --- a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty +++ b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty @@ -22,7 +22,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{hyperxmp} - [2014/01/02 v2.4 Store hyperref metadata in XMP format] + [2014/06/19 v2.5 Store hyperref metadata in XMP format] \edef\hyxmp@dq@code{\the\catcode`\"} \catcode`\"=12 \def\hyxmp@driver{hpdftex} @@ -37,38 +37,44 @@ \RequirePackage{stringenc} \RequirePackage{intcalc} \RequirePackage{ifxetex} +\newcommand{\hyxmp@pdfstringdef}[2]{% + \let\hyxmp@textunderscore=\textunderscore + \let\textunderscore=\hyxmp@uscore + \pdfstringdef{#1}{#2}% + \let\textunderscore=\hyxmp@textunderscore +} \def\@pdfcopyright{} -\define@key{Hyp}{pdfcopyright}{\pdfstringdef\@pdfcopyright{#1}} +\define@key{Hyp}{pdfcopyright}{\hyxmp@pdfstringdef\@pdfcopyright{#1}} \def\@pdflicenseurl{} -\define@key{Hyp}{pdflicenseurl}{\pdfstringdef\@pdflicenseurl{#1}} +\define@key{Hyp}{pdflicenseurl}{\hyxmp@pdfstringdef\@pdflicenseurl{#1}} \def\@pdfauthortitle{} -\define@key{Hyp}{pdfauthortitle}{\pdfstringdef\@pdfauthortitle{#1}} +\define@key{Hyp}{pdfauthortitle}{\hyxmp@pdfstringdef\@pdfauthortitle{#1}} \def\@pdfcaptionwriter{} -\define@key{Hyp}{pdfcaptionwriter}{\pdfstringdef\@pdfcaptionwriter{#1}} +\define@key{Hyp}{pdfcaptionwriter}{\hyxmp@pdfstringdef\@pdfcaptionwriter{#1}} \def\@pdfmetalang{} -\define@key{Hyp}{pdfmetalang}{\pdfstringdef\@pdfmetalang{#1}} +\define@key{Hyp}{pdfmetalang}{\hyxmp@pdfstringdef\@pdfmetalang{#1}} \def\@pdfcontactaddress{} \define@key{Hyp}{pdfcontactaddress}{% \let\xmpcomma=\hyxmp@comma \def\xmpquote##1{##1}% - \pdfstringdef\@pdfcontactaddress{#1}% + \hyxmp@pdfstringdef\@pdfcontactaddress{#1}% \def\xmpcomma{,}% \let\xmpquote=\relax } \def\@pdfcontactcity{} -\define@key{Hyp}{pdfcontactcity}{\pdfstringdef\@pdfcontactcity{#1}} +\define@key{Hyp}{pdfcontactcity}{\hyxmp@pdfstringdef\@pdfcontactcity{#1}} \def\@pdfcontactregion{} -\define@key{Hyp}{pdfcontactregion}{\pdfstringdef\@pdfcontactregion{#1}} +\define@key{Hyp}{pdfcontactregion}{\hyxmp@pdfstringdef\@pdfcontactregion{#1}} \def\@pdfcontactpostcode{} -\define@key{Hyp}{pdfcontactpostcode}{\pdfstringdef\@pdfcontactpostcode{#1}} +\define@key{Hyp}{pdfcontactpostcode}{\hyxmp@pdfstringdef\@pdfcontactpostcode{#1}} \def\@pdfcontactcountry{} -\define@key{Hyp}{pdfcontactcountry}{\pdfstringdef\@pdfcontactcountry{#1}} +\define@key{Hyp}{pdfcontactcountry}{\hyxmp@pdfstringdef\@pdfcontactcountry{#1}} \def\@pdfcontactphone{} -\define@key{Hyp}{pdfcontactphone}{\pdfstringdef\@pdfcontactphone{#1}} +\define@key{Hyp}{pdfcontactphone}{\hyxmp@pdfstringdef\@pdfcontactphone{#1}} \def\@pdfcontactemail{} -\define@key{Hyp}{pdfcontactemail}{\pdfstringdef\@pdfcontactemail{#1}} +\define@key{Hyp}{pdfcontactemail}{\hyxmp@pdfstringdef\@pdfcontactemail{#1}} \def\@pdfcontacturl{} -\define@key{Hyp}{pdfcontacturl}{\pdfstringdef\@pdfcontacturl{#1}} +\define@key{Hyp}{pdfcontacturl}{\hyxmp@pdfstringdef\@pdfcontacturl{#1}} \def\hyxmp@pdfauthor{} \def\hyxmp@pdfkeywords{} @@ -188,8 +194,12 @@ disabled}% } \def\xmpcomma{,}% \bgroup -\catcode`\^^C=11 -\gdef\hyxmp@comma{^^C} + \catcode`\^^C=11 + \gdef\hyxmp@comma{^^C} +\egroup +\bgroup + \catcode`\^^U=11 + \gdef\hyxmp@uscore{^^U} \egroup \let\xmpquote=\relax \bgroup @@ -223,6 +233,7 @@ disabled}% \fi \newcommand*{\hyxmp@reencode}[1]{} \expandafter\def\csname SE->pdfdoc@03\endcsname{0003} +\expandafter\def\csname SE->pdfdoc@15\endcsname{0015} \newcommand*{\hyxmp@xmlify}[1]{% \gdef\hyxmp@xmlified{}% \EdefUnescapeString\hyxmp@text{#1}% @@ -518,7 +529,9 @@ disabled}% \repeat \lccode`\_=`\ \relax \lccode`\^^C=`\,\relax - \lowercase{\xdef\hyxmp@xml{\hyxmp@xml#1}}% + \lccode`\^^U=`\_\relax + \lowercase{\xdef\hyxmp@new@xml{#1}}% + \xdef\hyxmp@xml{\hyxmp@xml\hyxmp@new@xml}% \egroup } \bgroup -- cgit v1.2.3