From f53d41771bd380e3a5c63ff43cc0350764e62b13 Mon Sep 17 00:00:00 2001 From: Manuel Pégourié-Gonnard Date: Wed, 3 Aug 2011 13:03:25 +0000 Subject: hyperxmp 2011/06/12 v1.4 git-svn-id: svn://tug.org/texlive/trunk@23378 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/hyperxmp/hyperxmp.dtx | 114 +++++++++++++-------- 1 file changed, 73 insertions(+), 41 deletions(-) (limited to 'Master/texmf-dist/source/latex/hyperxmp') diff --git a/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx b/Master/texmf-dist/source/latex/hyperxmp/hyperxmp.dtx index 2cc3ff17731..4bfa8d7b474 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> - [2011/04/30 v1.3 Store hyperref metadata in XMP format] + [2011/06/12 v1.4 Store hyperref metadata in XMP format] % % %<*driver> @@ -42,7 +42,7 @@ % % \fi % -% \CheckSum{872} +% \CheckSum{884} % % \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 @@ -194,11 +194,11 @@ % \item authors (\xmpterm{dc:creator}) % \item copyright (\xmpterm{dc:rights}) % \item date (\xmpterm{dc:date}) -% \item document identifier (\xmpterm{xapMM:DocumentID}) -% \item document instance identifier (\xmpterm{xapMM:InstanceID}) +% \item document identifier (\xmpterm{xmpMM:DocumentID}) +% \item document instance identifier (\xmpterm{xmpMM:InstanceID}) % \item format (\xmpterm{dc:format}) % \item keywords (\xmpterm{pdf:Keyword} and \xmpterm{dc:subject}) -% \item license \acro{URL} (\xmpterm{xapRights:WebStatement}) +% \item license \acro{URL} (\xmpterm{xmpRights:WebStatement}) % \item metadata writer (\xmpterm{photoshop:CaptionWriter}) % \item \acro{PDF}-generating tool (\xmpterm{pdf:Producer}) % \item primary author's position/title (\xmpterm{photoshop:AuthorsPosition}) @@ -262,7 +262,7 @@ % \noindent % |pdfauthortitle| indicates the primary author's position or title. % |pdfcaptionwriter| specifies the name of the person who added -% the metadata to the document. |\pdfcopyright| defines the copyright +% the metadata to the document. |pdfcopyright| defines the copyright % text. |pdflicenseurl| identifies a \acro{URL} that points to the % document's license agreement. |pdfmetalang| indicates the natural % language in which the metadata is written, typically as an \acro{IETF} @@ -271,13 +271,16 @@ % for German, and so forth. If |pdfmetalang| is not specified, % \pkgname{hyperxmp} assumes the metadata language is the same as the % document language (\pkgname{hyperref}'s |pdflang| option). If neither -% |pdfmetalang| nor |pdflang| is specified, \pkgname{hyperxmp} uses -% ``|x-default|'' as the metadata language. +% |pdfmetalang| nor |pdflang| is specified, \pkgname{hyperxmp} uses only +% ``|x-default|'' as the metadata language. Note that ``|x-default|'' +% metadata is always included in addition to the specified metadata +% language, as the user reading the document may not have specified a +% language preference. % -% It's usually more convenient to provide values for those options using +% It is usually more convenient to provide values for those options using % \pkgname{hyperref}'s |\hypersetup| command than on the |\usepackage| % command line. See -% \href{ftp://tug.ctan.org/pub/tex-archive/macros/latex/contrib/hyperref/doc/manual.pdf}{the +% \href{http://mirrors.ctan.org/macros/latex/contrib/hyperref/hyperref.pdf}{the % \pkgname{hyperref} manual} for more information. The following is a % sample \LaTeX\ document that provides values for most of the metadata % options that \pkgname{hyperxmp} recognizes: @@ -349,19 +352,25 @@ % % % On a heuristic viewpoint -% concerning the production and transformation of -% light +% concerning the production and transformation of +% light +% On a heuristic viewpoint +% concerning the production and transformation of +% light % % % % % photoelectric effect +% photoelectric effect % % % % % Copyright (C) 1905, -% Albert Einstein +% Albert Einstein +% Copyright (C) 1905, +% Albert Einstein % % % @@ -383,9 +392,9 @@ % % % -% uuid:c4188820-aef2-0a82-626ce4182b62 -% uuid:9b62b67f-d754-626c-4c959595fd75 +% xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"> +% uuid:c4188820-aef2-0a82-626ce4182b62 +% uuid:9b62b67f-d754-626c-4c959595fd75 % % % @@ -540,15 +549,16 @@ % % An important design decision underlying \pkgname{hyperxmp} is that the % package should integrate seamlessly with \pkgname{hyperref}. To that -% end, \pkgname{hyperxmp} takes its \acro{XMP} metadata from the -% \pkgname{hyperref} |pdftitle|, |pdfauthor|, |pdfsubject|, and -% |pdfkeywords| options plus two new options, |pdfcopyright| and -% |pdflicenseurl|, introduced by \pkgname{hyperxmp}. For consistency -% with \pkgname{hyperref}'s document-metadata naming conventions (which -% are in turn based on \LaTeX's document-metadata naming conventions), -% we do not prefix metadata-related macro names with our -% package-specific |\hyxmp@| prefix. That is, we use names like -% |\@pdfcopyright| instead of |\hyxmp@pdfcopyright|. +% end, \pkgname{hyperxmp} takes its \acro{XMP} metadata from +% \pkgname{hyperref}'s |pdftitle|, |pdfauthor|, |pdfsubject|, +% |pdfkeywords|, and |pdflang| options. It also introduces five new +% options: |pdfcopyright|, |pdflicenseurl|, |pdfauthortitle|, +% |pdfcaptionwriter|, and |pdfmetalang|. For consistency with +% \pkgname{hyperref}'s document-metadata naming conventions (which are +% in turn based on \LaTeX's document-metadata naming conventions), we do +% not prefix metadata-related macro names with our package-specific +% |\hyxmp@| prefix. That is, we use names like |\@pdfcopyright| instead +% of |\hyxmp@pdfcopyright|. % % \bigskip % @@ -656,7 +666,7 @@ metadata values to hyperxmp}% % \begin{macrocode} \ifx\@pdfmetalang\@empty \ifx\@pdflang\@empty - \def\@pdfmetalang{x-default}% + \let\@pdfmetalang=\hyxmp@x@default \else \edef\@pdfmetalang{\@pdflang}% \fi @@ -1110,7 +1120,7 @@ disabled}% % We use a linear congruential generator to produce pseudorandom % \acro{UUID}s. True, this method has its flaws but it's simple to % implement in \TeX\ and is good enough for producing the \acro{XMP} -% \xmpterm{xapMM:DocumentID} and \xmpterm{xapMM:InstanceID} fields. +% \xmpterm{xmpMM:DocumentID} and \xmpterm{xmpMM:InstanceID} fields. % % \begin{macro}{\hyxmp@modulo@a} % Replace the contents of |\@tempcnta| with the contents modulo~|#1|. @@ -1370,7 +1380,6 @@ __________________________________________________^^J% % \end{macro} % \end{macro} % -% % \begin{macro}{\hyxmp@today} % Define today's date in \textit{YYYY}-\textit{MM}-\textit{DD} format. % \begin{macrocode} @@ -1388,6 +1397,15 @@ __________________________________________________^^J% % \end{macrocode} % \end{macro} % +% \begin{macro}{\hyxmp@x@default} +% Define an |x-default| string that we can use in comparisons with +% |\@pdfmetalang|. +% \begin{macrocode} +\newcommand*{\hyxmp@x@default}{x-default} +% \end{macrocode} +% \end{macro} +% +% % \subsubsection{The Adobe PDF schema} % \label{sec:adobe-pdf} % @@ -1448,6 +1466,8 @@ ______^^J% % Given a Dublin Core property~(|#1|) and a macro containing some % |\pdfstringdef|-defined text~(|#2|), append the appropriate block of % \acro{XML} to the |\hyxmp@xml| macro but only if |#2| is non-empty. +% \changes{v1.4}{2011/06/12}{Included metadata in the \texttt{x-default} +% language regardless of the specified metadata language} % \begin{macrocode} \newcommand*{\hyxmp@rdf@dc}[2]{% \ifx#2\@empty @@ -1456,7 +1476,15 @@ ______^^J% \hyxmp@add@to@xml{% _________^^J% ____________^^J% + }% + \ifx\@pdfmetalang\hyxmp@x@default + \else + \hyxmp@add@to@xml{% _______________\hyxmp@xmlified^^J% + }% + \fi + \hyxmp@add@to@xml{% +_______________\hyxmp@xmlified^^J% ____________^^J% _________^^J% }% @@ -1543,22 +1571,24 @@ ______^^J% % \subsubsection{The XMP Rights Management schema} % \label{sec:xmp-rights} % -% \begin{macro}{\hyxmp@xapRights@schema} +% \begin{macro}{\hyxmp@xmpRights@schema} % Add properties defined by the XMP Rights Management schema to the % |\hyxmp@xml| macro. Currently, these are only the -% \xmpterm{xapRights:Marked} property and the -% \xmpterm{xapRights:WebStatement} property and only if the author +% \xmpterm{xmpRights:Marked} property and the +% \xmpterm{xmpRights:WebStatement} property and only if the author % defined a |pdflicenseurl|. +% \changes{v1.4}{2011/05/29}{Renamed the \texttt{xapRights} namespace +% prefix to \texttt{xmpRights}} % \begin{macrocode} -\newcommand*{\hyxmp@xapRights@schema}{% +\newcommand*{\hyxmp@xmpRights@schema}{% \ifx\@pdflicenseurl\@empty \else \hyxmp@xmlify{\@pdflicenseurl}% \hyxmp@add@to@xml{% ______^^J% -_________True^^J% -_________\hyxmp@xmlified^^J% +___________xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/">^^J% +_________True^^J% +_________\hyxmp@xmlified^^J% ______^^J% }% \fi @@ -1572,20 +1602,22 @@ ______^^J% % \begin{macro}{\hyxmp@mm@schema} % Add properties defined by the XMP Media Management schema to the % |\hyxmp@xml| macro. According to the \acro{XMP} specification, the -% \xmpterm{xapMM:DocumentID} property is supposed to uniquely identify a -% document, and the \xmpterm{xapMM:InstanceID} property is supposed to +% \xmpterm{xmpMM:DocumentID} property is supposed to uniquely identify a +% document, and the \xmpterm{xmpMM:InstanceID} property is supposed to % change with each save operation~\cite{Adobe2010:XMP}. As seen in % Section~\ref{sec:uuid-gen}, we do what we can to honor this intention % from within a \TeX-based workflow. +% \changes{v1.4}{2011/05/29}{Renamed the \texttt{xapMM} namespace +% prefix to \texttt{xmpMM}} % \begin{macrocode} \gdef\hyxmp@mm@schema{% \hyxmp@def@DocumentID \hyxmp@def@InstanceID \hyxmp@add@to@xml{% ______^^J% -_________\hyxmp@DocumentID^^J% -_________\hyxmp@InstanceID^^J% +____________xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">^^J% +_________\hyxmp@DocumentID^^J% +_________\hyxmp@InstanceID^^J% ______^^J% }% } @@ -1675,7 +1707,7 @@ ______^^J% ___^^J% }% \hyxmp@pdf@schema - \hyxmp@xapRights@schema + \hyxmp@xmpRights@schema \hyxmp@dc@schema \hyxmp@photoshop@schema \hyxmp@mm@schema -- cgit v1.2.3