From 1289605ec141e7ea09909ac31c112ef4a07ebe29 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 20 Sep 2012 21:35:15 +0000 Subject: hyperxmp (20sep12) git-svn-id: svn://tug.org/texlive/trunk@27753 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/hyperxmp/hyperxmp.pdf | Bin 548015 -> 542746 bytes .../texmf-dist/source/latex/hyperxmp/hyperxmp.dtx | 69 ++++++++++++++++----- Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty | 14 ++++- 3 files changed, 63 insertions(+), 20 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/hyperxmp/hyperxmp.pdf b/Master/texmf-dist/doc/latex/hyperxmp/hyperxmp.pdf index 47a254ae78b..bd92af0b95c 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 f1aa01b724e..6858ba47772 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> - [2012/09/10 v2.0 Store hyperref metadata in XMP format] + [2012/09/16 v2.1 Store hyperref metadata in XMP format] % % %<*driver> @@ -56,7 +56,7 @@ % % \fi % -% \CheckSum{1200} +% \CheckSum{1210} % % \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 @@ -285,9 +285,11 @@ % % \pkgname{hyperxmp} works by postprocessing some of the package options % honored by \pkgname{hyperref}. To use \pkgname{hyperxmp}, merely put -% a |\usepackage{hyperxmp}| somewhere in your document's preamble. -% \pkgname{hyperxmp} will construct its \acro{XMP} data using the -% following \pkgname{hyperref} options: +% a |\usepackage{hyperxmp}| in your document's preamble. That line can +% appear anywhere before the \pkgname{hyperref} \acro{PDF} options are +% specified (i.e.,~with either |\usepackage[|\dots|]{hyperref}| or +% |\hypersetup{|\dots|}|). \pkgname{hyperxmp} will construct its +% \acro{XMP} data using the following \pkgname{hyperref} options: % % \begin{itemize} % \item \optname{baseurl} @@ -759,10 +761,10 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\hyxmp@ProcessKeyvalOptions} -% \changes{v2.0}{2012/09/05}{Added this macro} -% \begin{macro}{\ProcessKeyvalOptions} -% \changes{v2.0}{2012/09/05}{Added this macro} +% \changes{v2.1}{2012/09/16}{Enabled \pkgname{hyperxmp} and +% \pkgname{hyperref} to be loaded in either order. This addresses a +% bug report by Yury Donskoy} +% % We need to capture list arguments (viz.~\optname{pdfauthor} and % \optname{pdfkeywords}) before \pkgname{hyperref} converts them to % \term{PDFDocEncoding}. Otherwise, |\xmpcomma| is permanently replaced @@ -778,10 +780,17 @@ % \optname{pdfauthor} and \optname{pdfkeywords}. This is somewhat % heavy-handed as it gets executed for \emph{every} subsequently loaded % package that uses |\ProcessKeyvalOptions|, but at least it does what -% we need. +% we need. \pkgname{hyperxmp} also redefines |\hypersetup| to do the +% same thing. This is required in case \pkgname{hyperref} is loaded +% before \pkgname{hyperxmp}. +% +% \begin{macro}{\hyxmp@redefine@Hyp} +% If not already redefined, redefine \pkgname{hyperref}'s +% \optname{pdfauthor} and \optname{pdfkeywords} options to properly +% handle |\xmpcomma| and |\xmpquote|. +% \changes{v2.1}{2012/09/16}{Added this macro} % \begin{macrocode} -\let\hyxmp@ProcessKeyvalOptions=\ProcessKeyvalOptions -\renewcommand*{\ProcessKeyvalOptions}{% +\newcommand*{\hyxmp@redefine@Hyp}{% % \end{macrocode} % \begin{macro}{\hyxmp@Hyp@pdfauthor} % Store the old definition of |\KV@Hyp@pdfauthor| in @@ -862,11 +871,6 @@ \let\xmpcomma=\relax \let\xmpquote=\relax }% -% \end{macrocode} -% Process the calling package's options as normal but with the preceding -% substitutions. -% \begin{macrocode} - \hyxmp@ProcessKeyvalOptions } % \end{macrocode} % \end{macro} @@ -882,6 +886,37 @@ % \end{macro} % \end{macro} % \end{macro} +% +% \begin{macro}{\hyxmp@ProcessKeyvalOptions} +% \changes{v2.0}{2012/09/05}{Added this macro} +% \begin{macro}{\ProcessKeyvalOptions} +% \changes{v2.0}{2012/09/05}{Added this macro} +% Redefine \pkgname{kvoptions}'s |\ProcessOptions| command to invoke +% |\hyxmp@redefine@Hyp| before performing its normal option processing. +% \begin{macrocode} +\let\hyxmp@ProcessKeyvalOptions=\ProcessKeyvalOptions +\renewcommand*{\ProcessKeyvalOptions}{% + \hyxmp@redefine@Hyp + \hyxmp@ProcessKeyvalOptions +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\hyxmp@hypersetup} +% \changes{v2.1}{2012/09/16}{Added this macro} +% \begin{macro}{\hypersetup} +% \changes{v2.1}{2012/09/16}{Added this macro} +% Redefine \pkgname{hyperref}'s |\hypersetup| command to invoke +% |\hyxmp@redefine@Hyp| before performing its normal option processing. +% \begin{macrocode} +\let\hyxmp@hypersetup=\hypersetup +\def\hypersetup{% + \hyxmp@redefine@Hyp + \hyxmp@hypersetup +} +% \end{macrocode} +% \end{macro} % \end{macro} % % \begin{macro}{\hyxmp@find@metadata} diff --git a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty index bf84fefeed5..548b92fff4b 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} - [2012/09/10 v2.0 Store hyperref metadata in XMP format] + [2012/09/16 v2.1 Store hyperref metadata in XMP format] \edef\hyxmp@dq@code{\the\catcode`\"} \catcode`\"=12 \def\hyxmp@driver{hpdftex} @@ -47,8 +47,7 @@ \define@key{Hyp}{pdfcaptionwriter}{\pdfstringdef\@pdfcaptionwriter{#1}} \def\@pdfmetalang{} \define@key{Hyp}{pdfmetalang}{\pdfstringdef\@pdfmetalang{#1}} -\let\hyxmp@ProcessKeyvalOptions=\ProcessKeyvalOptions -\renewcommand*{\ProcessKeyvalOptions}{% +\newcommand*{\hyxmp@redefine@Hyp}{% \@ifundefined{KV@Hyp@pdfauthor}{}{% \@ifundefined{hyxmp@Hyp@pdfauthor}{% \expandafter\let\expandafter\hyxmp@Hyp@pdfauthor @@ -83,8 +82,17 @@ \let\xmpcomma=\relax \let\xmpquote=\relax }% +} +\let\hyxmp@ProcessKeyvalOptions=\ProcessKeyvalOptions +\renewcommand*{\ProcessKeyvalOptions}{% + \hyxmp@redefine@Hyp \hyxmp@ProcessKeyvalOptions } +\let\hyxmp@hypersetup=\hypersetup +\def\hypersetup{% + \hyxmp@redefine@Hyp + \hyxmp@hypersetup +} \newcommand*{\hyxmp@find@metadata}{% \edef\hyxmp@concated@metadata{% \@baseurl -- cgit v1.2.3