%% %% This is file `hyperxmp.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% hyperxmp.dtx (with options: `package') %% %% This is a generated file. %% %% Copyright (C) 2011 by Scott Pakin %% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3c of this license %% or (at your option) any later version. The latest version of this %% license is in: %% %% http://www.latex-project.org/lppl.txt %% %% and version 1.3c or later is part of all distributions of LaTeX %% version 2008/05/04 or later. %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{hyperxmp} [2011/06/12 v1.4 Store hyperref metadata in XMP format] \edef\hyxmp@dq@code{\the\catcode`\"} \catcode`\"=12 \RequirePackage{keyval} \RequirePackage{pdfescape} \RequirePackage{stringenc} \def\@pdfcopyright{} \define@key{Hyp}{pdfcopyright}{\pdfstringdef\@pdfcopyright{#1}} \def\@pdflicenseurl{} \define@key{Hyp}{pdflicenseurl}{\pdfstringdef\@pdflicenseurl{#1}} \def\@pdfauthortitle{} \define@key{Hyp}{pdfauthortitle}{\pdfstringdef\@pdfauthortitle{#1}} \def\@pdfcaptionwriter{} \define@key{Hyp}{pdfcaptionwriter}{\pdfstringdef\@pdfcaptionwriter{#1}} \def\@pdfmetalang{} \define@key{Hyp}{pdfmetalang}{\pdfstringdef\@pdfmetalang{#1}} \newcommand*{\hyxmp@find@metadata}{% \edef\hyxmp@concated@metadata{% \@pdfauthor \@pdfauthortitle \@pdfcaptionwriter \@pdfcopyright \@pdfkeywords \@pdflicenseurl \@pdfsubject \@pdftitle }% \ifx\hyxmp@concated@metadata\@empty \PackageWarningNoLine{hyperxmp}{% \jobname.tex did not specify any metadata to\MessageBreak include in the XMP packet.\space\space Please see the hyperxmp\MessageBreak documentation for instructions on how to provide\MessageBreak metadata values to hyperxmp}% \fi } \AtBeginDocument{% \@ifpackageloaded{hyperref}% {% \ifx\@pdfmetalang\@empty \ifx\@pdflang\@empty \let\@pdfmetalang=\hyxmp@x@default \else \edef\@pdfmetalang{\@pdflang}% \fi \fi \ifHy@unicode \hyxmp@reencode\@pdfmetalang \fi \AtEndDocument{% \hyxmp@find@metadata \hyxmp@embed@packet }% }% {\PackageWarningNoLine{hyperxmp}{% \jobname.tex failed to include a\MessageBreak \string\usepackage\string{hyperref\string} in the preamble.\MessageBreak Consequently, all hyperxmp functionality will be\MessageBreak disabled}% }% } \newcommand*{\hyxmp@commas@to@list}[2]{% \gdef#1{}% \expandafter\hyxmp@commas@to@list@i\expandafter#1#2,,% } \def\hyxmp@commas@to@list@i#1#2,{% \gdef\hyxmp@sublist{#2}% \ifx\hyxmp@sublist\@empty \let\next=\relax \else \hyxmp@trimspaces\hyxmp@sublist \@cons{#1}{{\hyxmp@sublist}}% \def\next{\hyxmp@commas@to@list@i{#1}}% \fi \next } \bgroup \catcode`\&=11 \gdef\hyxmp@xml@amp{&} \global\let\hyxmp@other@amp=& \gdef\hyxmp@amp{&} \catcode`\<=11 \gdef\hyxmp@xml@lt{<} \global\let\hyxmp@other@lt=< \catcode`\>=11 \gdef\hyxmp@xml@gt{>} \global\let\hyxmp@other@gt=> \def\next#1{#1} \next{\global\let\hyxmp@other@space= } % \catcode`\|=0 \catcode`\\=11 |global|let|hyxmp@other@bs=\ |egroup \catcode`\Q=3 \newcommand{\hyxmp@trimspaces}[1]{% \begingroup \aftergroup\toks\aftergroup0\aftergroup{% \expandafter\hyxmp@trimb\expandafter\noexpand#1Q Q}% \edef#1{\the\toks0}% } \def\hyxmp@trimb#1 Q{\hyxmp@trimc#1Q} \def\hyxmp@trimc#1Q#2{\afterassignment\endgroup \vfuzz\the\vfuzz#1} \catcode`\Q=11 \newcommand*{\hyxmp@reencode}[1]{% \EdefUnescapeString\hyxmp@reencoded{#1}% \StringEncodingConvert\hyxmp@reencoded\hyxmp@reencoded{utf16be}{pdfdoc}% \StringEncodingSuccessFailure{% \global\let\hyxmp@reencoded=\hyxmp@reencoded }{% \gdef\hyxmp@reencoded{#1}% }% \edef#1{\hyxmp@reencoded}% } \newcommand*{\hyxmp@xmlify}[1]{% \gdef\hyxmp@xmlified{}% \edef\hyxmp@text{#1}% \ifHy@unicode \hyxmp@reencode\hyxmp@text \fi \expandafter\hyxmp@xmlify@i\hyxmp@text\@empty \@ifundefined{pdfmark}{}{% \expandafter\hyxmp@obscure@spaces\expandafter{\hyxmp@xmlified}% }% } \def\hyxmp@xmlify@i{\futurelet\hyxmp@one@token\hyxmp@xmlify@ii} \def\hyxmp@xmlify@ii{% \if\hyxmp@one@token\hyxmp@other@lt \def\next##1{% \xdef\hyxmp@xmlified{\hyxmp@xmlified\hyxmp@xml@lt}% \hyxmp@xmlify@i }% \else \if\hyxmp@one@token\hyxmp@other@gt \def\next##1{% \xdef\hyxmp@xmlified{\hyxmp@xmlified\hyxmp@xml@gt}% \hyxmp@xmlify@i }% \else \if\hyxmp@one@token\hyxmp@other@amp \def\next##1{% \xdef\hyxmp@xmlified{\hyxmp@xmlified\hyxmp@xml@amp}% \hyxmp@xmlify@i }% \else \ifx\hyxmp@one@token\hyxmp@other@space \def\next##1{% \g@addto@macro\hyxmp@xmlified{ }% \hyxmp@xmlify@i##1% }% \else \if\hyxmp@one@token\hyxmp@other@bs \def\next##1{\futurelet\hyxmp@one@token\hyxmp@xmlify@iii} \else \ifx\hyxmp@one@token\@empty \def\next##1{}% \else \def\next##1{% \g@addto@macro\hyxmp@xmlified{##1}% \hyxmp@xmlify@i }% \fi \fi \fi \fi \fi \fi \next } \def\hyxmp@xmlify@iii{% \def\next##1##2##3{% \@tempcnta='##1##2##3 \xdef\hyxmp@xmlified{\hyxmp@xmlified \hyxmp@amp\hyxmp@hash\the\@tempcnta;% }% \hyxmp@xmlify@i }% \if\hyxmp@one@token( \let\next=\hyxmp@xmlify@i \else \if\hyxmp@one@token) \let\next=\hyxmp@xmlify@i \fi \fi \next } \newcommand*{\hyxmp@obscure@spaces}[1]{% \gdef\hyxmp@xmlified{}% \expandafter\hyxmp@obscure@spaces@i#1 {} % } \def\hyxmp@obscure@spaces@i #1 #2 {% \def\hyxmp@one@token{#2}% \ifx\hyxmp@one@token\@empty \xdef\hyxmp@xmlified{\hyxmp@xmlified#1}% \let\next=\relax \else \xdef\hyxmp@xmlified{\hyxmp@xmlified#1\hyxmp@amp\hyxmp@hash32;}% \def\next{\expandafter\hyxmp@obscure@spaces@i\expandafter#2 }% \fi \next } \def\hyxmp@modulo@a#1{% \@tempcntb=\@tempcnta \divide\@tempcntb by #1 \multiply\@tempcntb by #1 \advance\@tempcnta by -\@tempcntb } \def\hyxmp@big@prime{536870923} \def\hyxmp@big@prime@ii{536870027} \def\hyxmp@seed@rng#1{% \@tempcnta=\hyxmp@big@prime \futurelet\hyxmp@one@token\hyxmp@seed@rng@i#1\@empty } \def\hyxmp@seed@rng@i{% \ifx\hyxmp@one@token\@empty \let\next=\relax \else \def\next##1{% \multiply\@tempcnta by 3 \advance\@tempcnta by `##1 \hyxmp@modulo@a{\hyxmp@big@prime}% \futurelet\hyxmp@one@token\hyxmp@seed@rng@i }% \fi \next } \def\hyxmp@set@rand@num{% \@tempcnta=\hyxmp@rand@num \multiply\@tempcnta by 3 \advance\@tempcnta by \hyxmp@big@prime@ii \hyxmp@modulo@a{\hyxmp@big@prime}% \xdef\hyxmp@rand@num{\the\@tempcnta}% } \def\hyxmp@append@hex#1{% \hyxmp@set@rand@num \@tempcnta=\hyxmp@rand@num \hyxmp@modulo@a{16}% \ifnum\@tempcnta<10 \xdef#1{#1\the\@tempcnta}% \else \advance\@tempcnta by -10 \ifcase\@tempcnta \xdef#1{#1a}% \or\xdef#1{#1b}% \or\xdef#1{#1c}% \or\xdef#1{#1d}% \or\xdef#1{#1e}% \or\xdef#1{#1f}% \fi \fi } \def\hyxmp@append@hex@iv#1{% \hyxmp@append@hex#1% \hyxmp@append@hex#1% \hyxmp@append@hex#1% \hyxmp@append@hex#1% } \def\hyxmp@create@uuid#1{% \def#1{uuid:}% \hyxmp@append@hex@iv#1% \hyxmp@append@hex@iv#1% \g@addto@macro#1{-}% \hyxmp@append@hex@iv#1% \g@addto@macro#1{-}% \hyxmp@append@hex@iv#1% \g@addto@macro#1{-}% \hyxmp@append@hex@iv#1% \hyxmp@append@hex@iv#1% \hyxmp@append@hex@iv#1% } \newcommand*{\hyxmp@def@DocumentID}{% \edef\hyxmp@seed@string{\jobname:\@pdftitle:\@pdfauthor}% \expandafter\hyxmp@seed@rng\expandafter{\hyxmp@seed@string}% \edef\hyxmp@rand@num{\the\@tempcnta}% \hyxmp@create@uuid\hyxmp@DocumentID } \newcommand*{\hyxmp@def@InstanceID}{% \edef\hyxmp@seed@string{% \jobname:\@pdftitle:\@pdfauthor:% \the\year/\the\month/\the\day:% \the\time }% \expandafter\hyxmp@seed@rng\expandafter{\hyxmp@seed@string}% \edef\hyxmp@rand@num{\the\@tempcnta}% \hyxmp@create@uuid\hyxmp@InstanceID } \newcommand*{\hyxmp@add@to@xml}[1]{% \bgroup \@tempcnta=0 \loop \lccode\@tempcnta=\@tempcnta \advance\@tempcnta by 1 \ifnum\@tempcnta<256 \repeat \lccode`\_=`\ \relax \lowercase{\xdef\hyxmp@xml{\hyxmp@xml#1}}% \egroup } \bgroup \catcode`\#=11 \gdef\hyxmp@hash{#} \egroup \bgroup \xdef\hyxmp@xml{}% \hyxmp@add@to@xml{% __________________________________________________^^J% } \xdef\hyxmp@padding{\hyxmp@xml}% \egroup \xdef\hyxmp@padding{\hyxmp@padding\hyxmp@padding} \xdef\hyxmp@padding{\hyxmp@padding\hyxmp@padding} \xdef\hyxmp@padding{\hyxmp@padding\hyxmp@padding} \xdef\hyxmp@padding{\hyxmp@padding\hyxmp@padding} \xdef\hyxmp@padding{\hyxmp@padding\hyxmp@padding} \xdef\hyxmp@today{\the\year}% \ifnum\month<10 \xdef\hyxmp@today{\hyxmp@today-0\the\month}% \else \xdef\hyxmp@today{\hyxmp@today-\the\month}% \fi \ifnum\day<10 \xdef\hyxmp@today{\hyxmp@today-0\the\day}% \else \xdef\hyxmp@today{\hyxmp@today-\the\day}% \fi \newcommand*{\hyxmp@x@default}{x-default} \newcommand*{\hyxmp@pdf@schema}{% \let\hyxmp@have@any=!% \ifx\@pdfkeywords\@empty \ifx\@pdfproducer\@empty \let\hyxmp@have@any=\@empty \fi \fi \ifx\hyxmp@have@any\@empty \else \hyxmp@add@to@xml{% ______^^J% }% \ifx\@pdfkeywords\@empty \else \hyxmp@xmlify{\@pdfkeywords}% \hyxmp@add@to@xml{% ___________\hyxmp@xmlified^^J% }% \fi \ifx\@pdfproducer\@empty \else \hyxmp@xmlify{\@pdfproducer}% \hyxmp@add@to@xml{% ___________\hyxmp@xmlified^^J% }% \fi \hyxmp@add@to@xml{% ______^^J% }% \fi } \newcommand*{\hyxmp@rdf@dc}[2]{% \ifx#2\@empty \else \hyxmp@xmlify{#2}% \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% }% \fi% }% \newcommand*{\hyxmp@list@to@xml}[3]{% \ifx#3\@empty \else \hyxmp@add@to@xml{% _________^^J% ____________^^J% }% \bgroup \edef\hyxmp@text{#3}% \ifHy@unicode \hyxmp@reencode\hyxmp@text \fi \hyxmp@commas@to@list\hyxmp@list{\hyxmp@text}% \def\@elt##1{% \hyxmp@xmlify{##1}% \hyxmp@add@to@xml{% _______________\hyxmp@xmlified^^J% }% }% \hyxmp@list \egroup \hyxmp@add@to@xml{% ____________^^J% _________^^J% }% \fi } \newcommand*{\hyxmp@dc@schema}{% \hyxmp@add@to@xml{% ______^^J% _________application/pdf^^J% }% \hyxmp@rdf@dc{title}{\@pdftitle}% \hyxmp@rdf@dc{description}{\@pdfsubject}% \hyxmp@rdf@dc{rights}{\@pdfcopyright}% \hyxmp@list@to@xml{creator}{Seq}{\@pdfauthor}% \hyxmp@list@to@xml{subject}{Bag}{\@pdfkeywords}% \hyxmp@list@to@xml{date}{Seq}{\hyxmp@today}% \hyxmp@add@to@xml{% ______^^J% }% } \newcommand*{\hyxmp@xmpRights@schema}{% \ifx\@pdflicenseurl\@empty \else \hyxmp@xmlify{\@pdflicenseurl}% \hyxmp@add@to@xml{% ______^^J% _________True^^J% _________\hyxmp@xmlified^^J% ______^^J% }% \fi } \gdef\hyxmp@mm@schema{% \hyxmp@def@DocumentID \hyxmp@def@InstanceID \hyxmp@add@to@xml{% ______^^J% _________\hyxmp@DocumentID^^J% _________\hyxmp@InstanceID^^J% ______^^J% }% } \gdef\hyxmp@photoshop@schema{% \edef\hyxmp@photoshop@data{\@pdfauthortitle\@pdfcaptionwriter}% \ifx\hyxmp@photoshop@data\@empty \else \hyxmp@add@to@xml{% ______^^J% }% \fi \ifx\@pdfauthortitle\@empty \else \hyxmp@xmlify{\@pdfauthortitle}% \hyxmp@add@to@xml{% _________\hyxmp@xmlified^^J% }% \fi \ifx\@pdfcaptionwriter\@empty \else \hyxmp@xmlify{\@pdfcaptionwriter}% \hyxmp@add@to@xml{% _________\hyxmp@xmlified^^J% }% \fi \ifx\hyxmp@photoshop@data\@empty \else \hyxmp@add@to@xml{% ______^^J% }% \fi } \bgroup \catcode`\^^ef=12 \catcode`\^^bb=12 \catcode`\^^bf=12 \gdef\hyxmp@construct@packet{% \gdef\hyxmp@xml{}% \hyxmp@add@to@xml{% ^^J% ^^J% ___^^J% }% \hyxmp@pdf@schema \hyxmp@xmpRights@schema \hyxmp@dc@schema \hyxmp@photoshop@schema \hyxmp@mm@schema \hyxmp@add@to@xml{% ___^^J% ^^J% \hyxmp@padding ^^J% }% } \egroup \newcommand*{\hyxmp@embed@packet}{% \hyxmp@construct@packet \def\hyxmp@driver{hpdftex}% \ifx\hyxmp@driver\Hy@driver \hyxmp@embed@packet@pdftex \else \def\hyxmp@driver{hdvipdfm}% \ifx\hyxmp@driver\Hy@driver \hyxmp@embed@packet@dvipdfm \else \def\hyxmp@driver{hxetex}% \ifx\hyxmp@driver\Hy@driver \hyxmp@embed@packet@xetex \else \@ifundefined{pdfmark}{% \PackageWarningNoLine{hyperxmp}{% Unrecognized hyperref driver `\Hy@driver'.\MessageBreak \jobname.tex's XMP metadata will *not* be\MessageBreak embedded in the resulting file}% }{% \hyxmp@embed@packet@pdfmark }% \fi \fi \fi } \newcommand*{\hyxmp@embed@packet@pdftex}{% \bgroup \pdfcompresslevel=0 \immediate\pdfobj stream attr {% /Type /Metadata /Subtype /XML }{\hyxmp@xml}% \pdfcatalog {/Metadata \the\pdflastobj\space 0 R}% \egroup } \newcommand*{\hyxmp@embed@packet@pdfmark}{% \pdfmark{% pdfmark=/OBJ, Raw={/_objdef \string{hyxmp@Metadata\string} /type /stream}% }% \pdfmark{% pdfmark=/PUT, Raw={\string{hyxmp@Metadata\string}% << /Type /Metadata /Subtype /XML >> }% }% \pdfmark{% pdfmark=/PUT, Raw={\string{hyxmp@Metadata\string} (\hyxmp@xml)}% }% \pdfmark{% pdfmark=/CLOSE, Raw={\string{hyxmp@Metadata\string}}% }% \pdfmark{% pdfmark=/Metadata, Raw={\string{Catalog\string}% << /Metadata \string{hyxmp@Metadata\string}% >> }% }% } \newcommand*{\hyxmp@embed@packet@dvipdfm}{% \hyxmp@string@len{\hyxmp@xml}% \special{pdf: object @hyxmp@Metadata << /Type /Metadata /Subtype /XML /Length \the\@tempcnta >> stream^^J\hyxmp@xml endstream% }% \special{pdf: docview << /Metadata @hyxmp@Metadata >> }% } \newcommand*{\hyxmp@string@len}[1]{% \@tempcnta=0 \expandafter\hyxmp@count@spaces#1 {} % \expandafter\hyxmp@count@non@spaces#1{}% } \def\hyxmp@count@spaces#1 {% \def\hyxmp@one@token{#1}% \ifx\hyxmp@one@token\@empty \advance\@tempcnta by -1 \else \advance\@tempcnta by 1 \expandafter\hyxmp@count@spaces \fi } \newcommand*{\hyxmp@count@non@spaces}[1]{% \def\hyxmp@one@token{#1}% \ifx\hyxmp@one@token\@empty \else \advance\@tempcnta by 1 \expandafter\hyxmp@count@non@spaces \fi } \newcommand*{\hyxmp@embed@packet@xetex}{% \special{pdf:stream @hyxmp@Metadata (\hyxmp@xml) << /Type /Metadata /Subtype /XML >> }% \special{pdf:put @catalog << /Metadata @hyxmp@Metadata >> }% } \catcode`\"=\hyxmp@dq@code \endinput %% %% End of file `hyperxmp.sty'.