From 163883bed154d373386a4ec682c67a89c10dd75e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 27 Jul 2017 21:26:51 +0000 Subject: hyperxmp (27jul17) git-svn-id: svn://tug.org/texlive/trunk@44902 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty | 51 +++++++++++++++++++---- 1 file changed, 43 insertions(+), 8 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty index d5ed768c567..282bebe5177 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} - [2017/02/23 v3.2 Store hyperref metadata in XMP format] + [2017/07/25 v3.3 Store hyperref metadata in XMP format] \edef\hyxmp@dq@code{\the\catcode`\"} \catcode`\"=12 \def\hyxmp@driver{hpdftex} @@ -81,6 +81,8 @@ \define@key{Hyp}{pdfapart}{\hyxmp@pdfstringdef\@pdfapart{#1}} \def\@pdfaconformance{B} \define@key{Hyp}{pdfaconformance}{\hyxmp@pdfstringdef\@pdfaconformance{#1}} +\edef\@pdfsource{\jobname.tex} +\define@key{Hyp}{pdfsource}{\hyxmp@pdfstringdef\@pdfsource{#1}} \def\@pdfcontactaddress{} \define@key{Hyp}{pdfcontactaddress}{% \let\xmpcomma=\hyxmp@comma @@ -194,10 +196,12 @@ provide metadata values to hyperxmp}% \ifx\@pdflang\relax \let\@pdflang=\@empty \fi - \ifx\@pdflang\@empty - \let\@pdfmetalang=\hyxmp@x@default - \else - \edef\@pdfmetalang{\@pdflang}% + \ifx\@pdfmetalang\@empty + \ifx\@pdflang\@empty + \let\@pdfmetalang=\hyxmp@x@default + \else + \edef\@pdfmetalang{\@pdflang}% + \fi \fi \hyxmp@xmlify\@pdfmetalang \ifx\@pdfdatetime\@empty @@ -608,6 +612,23 @@ disabled}% \catcode0=12 % \gdef\hyxmp@zero{^^00}% \endgroup +\def\hyxmp@alt@title{} +\def\hyxmp@alt@description{} +\def\hyxmp@alt@rights{} +\newcommand{\hyxmp@LA@accept}[2]{% + \define@key{hyxmp@LA}{#1}{% + \hyxmp@pdfstringdef\hyxmp@value{##1}% + \xdef#2{#2\noexpand\do {\hyxmp@cur@lang} {\hyxmp@value}}% + } +} +\hyxmp@LA@accept{pdftitle}{\hyxmp@alt@title} +\hyxmp@LA@accept{pdfsubject}{\hyxmp@alt@description} +\hyxmp@LA@accept{pdfcopyright}{\hyxmp@alt@rights} +\newcommand{\XMPLangAlt}[2]{% + \let\do=\relax + \edef\hyxmp@cur@lang{#1}% + \setkeys{hyxmp@LA}{#2}% +} \def\hyxmp@modulo@a#1{% \@tempcntb=\@tempcnta \divide\@tempcntb by #1 @@ -789,18 +810,29 @@ _________<#1>\hyxmp@xmlified^^J% \fi \if@tempswa \hyxmp@xmlify{#3}% + \let\hyxmp@value=\hyxmp@xmlified \hyxmp@add@to@xml{% _________^^J% ____________^^J% }% \ifx\@pdfmetalang\hyxmp@x@default \else + \hyxmp@xmlify{\@pdfmetalang}% \hyxmp@add@to@xml{% -_______________\hyxmp@xmlified^^J% +_______________\hyxmp@value^^J% }% \fi \hyxmp@add@to@xml{% -_______________\hyxmp@xmlified^^J% +_______________\hyxmp@value^^J% + }% + \def\do##1##2{ + \hyxmp@xmlify{##2}% + \hyxmp@add@to@xml{% +_______________\hyxmp@xmlified^^J% + }% + }% + \csname hyxmp@alt@#2\endcsname + \hyxmp@add@to@xml{% ____________^^J% _________^^J% }% @@ -850,7 +882,10 @@ _________application/pdf^^J% \hyxmp@list@to@xml{date}{Seq}{\hyxmp@today}% \hyxmp@list@to@xml{language}{Bag}{\@pdflang}% \hyxmp@list@to@xml{type}{Bag}{\@pdftype}% - \hyxmp@add@simple{dc:source}{\jobname.tex}% + \ifx\@pdfsource\@empty + \else + \hyxmp@add@simple{dc:source}{\@pdfsource}% + \fi \hyxmp@add@to@xml{% ______^^J% }% -- cgit v1.2.3