summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty')
-rw-r--r--Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty145
1 files changed, 77 insertions, 68 deletions
diff --git a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty
index 0c4ca2de09d..6f7c7756b9a 100644
--- a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty
+++ b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2011-2020 by Scott Pakin <scott+hyxmp@pakin.org>
+%% Copyright (C) 2011-2023 by Scott Pakin <scott+hyxmp@pakin.org>
%%
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3c of this license
@@ -22,14 +22,24 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{hyperxmp}
- [2020/11/22 v5.9 Store hyperref metadata in XMP format]
+ [2022/10/16 v5.11 Store hyperref metadata in XMP format]
+\IfDocumentMetadataTF{%
+ \PackageWarning
+ {hyperxmp}
+ {Disabling hyperxmp because it is incompatible with PDF management}
+}{}
+\IfDocumentMetadataTF{\endinput}{}
\edef\hyxmp@dq@code{\the\catcode`\"}
\catcode`\"=12
-\@ifundefined{AtEndDocument}{%
- \RequirePackage{atenddvi}
- \let\hyxmp@at@end=\AtEndDvi
+\@ifundefined{AddToHook}{%
+ \@ifundefined{AtEndDocument}{%
+ \RequirePackage{atenddvi}
+ \let\hyxmp@at@end=\AtEndDvi
+ }{%
+ \let\hyxmp@at@end=\AtEndDocument
+ }
}{%
- \let\hyxmp@at@end=\AtEndDocument
+ \def\hyxmp@at@end{\AddToHook{shipout/lastpage}}
}
\def\hyxmp@set@jobname#1\relax{%
\@ifnextchar"{\hyxmp@set@jobname@dbl}{\hyxmp@set@jobname@plain}#1\relax
@@ -101,10 +111,11 @@
\PackageWarning{hyperxmp}{pdfapart and pdfuapart must be numeric}%
}%
}
+\newcount\@hyxmp@count
\def\@pdfapart{}
\define@key{Hyp}{pdfapart}{%
- \afterassignment\hyxmp@no@bad@parts\@tempcnta=0#1\relax
- \hyxmp@pdfstringdef\@pdfapart{\the\@tempcnta}%
+ \afterassignment\hyxmp@no@bad@parts\@hyxmp@count=0#1\relax
+ \hyxmp@pdfstringdef\@pdfapart{\the\@hyxmp@count}%
}
\def\@pdfaconformance{}
\define@key{Hyp}{pdfaconformance}{%
@@ -112,16 +123,16 @@
}
\def\@pdfuapart{}
\define@key{Hyp}{pdfuapart}{%
- \afterassignment\hyxmp@no@bad@parts\@tempcnta=0#1\relax
- \hyxmp@pdfstringdef\@pdfuapart{\the\@tempcnta}%
+ \afterassignment\hyxmp@no@bad@parts\@hyxmp@count=0#1\relax
+ \hyxmp@pdfstringdef\@pdfuapart{\the\@hyxmp@count}%
}
\newcommand*{\hyxmp@set@pdfx@major}[1]{\hyxmp@set@pdfx@major@i#1!}
\def\hyxmp@set@pdfx@major@i PDF/X-{%
\afterassignment\hyxmp@set@pdfx@major@ii
- \@tempcnta=%
+ \@hyxmp@count=%
}
\def\hyxmp@set@pdfx@major@ii#1!{%
- \edef\hyxmp@pdfx@major{\the\@tempcnta}%
+ \edef\hyxmp@pdfx@major{\the\@hyxmp@count}%
}
\newcommand*\hyxmp@check@std[2]{%
\ifthenelse{\equal{#1}{#2}}%
@@ -299,6 +310,7 @@
}
\let\hyxmp@ProcessKeyvalOptions=\ProcessKeyvalOptions
\renewcommand*{\ProcessKeyvalOptions}{%
+ \global\let\ProcessKeyvalOptions=\hyxmp@ProcessKeyvalOptions
\hyxmp@redefine@Hyp
\hyxmp@ProcessKeyvalOptions
}
@@ -501,10 +513,6 @@
\hyxmp@query@self
}
\ifLuaTeX
-\else
- \RequirePackage{totpages}
-\fi
-\ifLuaTeX
\begin{luacode*}
function get_pdf_size (bname)
local odir = ""
@@ -537,15 +545,10 @@ end
}%
\fi
\newcommand*{\hyxmp@query@self}{%
- \ifLuaTeX
- \@if@def@and@nonempty{@pdfnumpages}{%
- }{%
- \clearpage
- \xdef\@pdfnumpages{\luadirect{tex.print(status.total_pages)}}%
- }%
- \else
- \pdfstringdef\@pdfnumpages{\ref*{TotPages}}%
- \fi
+ \@if@def@and@nonempty{@pdfnumpages}{%
+ }{%
+ \xdef\@pdfnumpages{\thetotalpages}%
+ }%
\hyxmp@use@first@valid{pdfbytes}{\@pdfbytes}{%
\hyxmp@prev@pdf@size
}%
@@ -820,19 +823,19 @@ end
\else
\xdef#1{#1-\the\day}%
\fi
- \@tempcnta=\time
- \divide\@tempcnta by 60
- \ifnum\@tempcnta<10
- \xdef#1{#1T0\the\@tempcnta}%
+ \@hyxmp@count=\time
+ \divide\@hyxmp@count by 60
+ \ifnum\@hyxmp@count<10
+ \xdef#1{#1T0\the\@hyxmp@count}%
\else
- \xdef#1{#1T\the\@tempcnta}%
+ \xdef#1{#1T\the\@hyxmp@count}%
\fi
- \multiply\@tempcnta by -60
- \advance\@tempcnta by \time
- \ifnum\@tempcnta<10
- \xdef#1{#1:0\the\@tempcnta}%
+ \multiply\@hyxmp@count by -60
+ \advance\@hyxmp@count by \time
+ \ifnum\@hyxmp@count<10
+ \xdef#1{#1:0\the\@hyxmp@count}%
\else
- \xdef#1{#1:\the\@tempcnta}%
+ \xdef#1{#1:\the\@hyxmp@count}%
\fi
\xdef#1{#1Z}%
}
@@ -1142,15 +1145,15 @@ ______<#3 xml:lang="#1">\hyxmp@xmlified</#3>^^J%
\setkeys{hyxmp@LA}{#2}%
}
\def\hyxmp@modulo@a#1{%
- \@tempcntb=\@tempcnta
+ \@tempcntb=\@hyxmp@count
\divide\@tempcntb by #1
\multiply\@tempcntb by #1
- \advance\@tempcnta by -\@tempcntb
+ \advance\@hyxmp@count by -\@tempcntb
}
\def\hyxmp@big@prime{536870923}
\def\hyxmp@big@prime@ii{536870027}
\def\hyxmp@seed@rng#1{%
- \@tempcnta=\hyxmp@big@prime
+ \@hyxmp@count=\hyxmp@big@prime
\futurelet\hyxmp@one@token\hyxmp@seed@rng@i#1\@empty
}
\def\hyxmp@seed@rng@i{%
@@ -1158,8 +1161,8 @@ ______<#3 xml:lang="#1">\hyxmp@xmlified</#3>^^J%
\let\next=\relax
\else
\def\next##1{%
- \multiply\@tempcnta by 3
- \advance\@tempcnta by `##1
+ \multiply\@hyxmp@count by 3
+ \advance\@hyxmp@count by `##1
\hyxmp@modulo@a{\hyxmp@big@prime}%
\futurelet\hyxmp@one@token\hyxmp@seed@rng@i
}%
@@ -1167,21 +1170,21 @@ ______<#3 xml:lang="#1">\hyxmp@xmlified</#3>^^J%
\next
}
\def\hyxmp@set@rand@num{%
- \@tempcnta=\hyxmp@rand@num
- \multiply\@tempcnta by 3
- \advance\@tempcnta by \hyxmp@big@prime@ii
+ \@hyxmp@count=\hyxmp@rand@num
+ \multiply\@hyxmp@count by 3
+ \advance\@hyxmp@count by \hyxmp@big@prime@ii
\hyxmp@modulo@a{\hyxmp@big@prime}%
- \xdef\hyxmp@rand@num{\the\@tempcnta}%
+ \xdef\hyxmp@rand@num{\the\@hyxmp@count}%
}
\def\hyxmp@append@hex#1{%
\hyxmp@set@rand@num
- \@tempcnta=\hyxmp@rand@num
+ \@hyxmp@count=\hyxmp@rand@num
\hyxmp@modulo@a{16}%
- \ifnum\@tempcnta<10
- \xdef#1{#1\the\@tempcnta}%
+ \ifnum\@hyxmp@count<10
+ \xdef#1{#1\the\@hyxmp@count}%
\else
- \advance\@tempcnta by -10
- \ifcase\@tempcnta
+ \advance\@hyxmp@count by -10
+ \ifcase\@hyxmp@count
\xdef#1{#1a}%
\or\xdef#1{#1b}%
\or\xdef#1{#1c}%
@@ -1210,9 +1213,9 @@ ______<#3 xml:lang="#1">\hyxmp@xmlified</#3>^^J%
\hyxmp@append@hex@iii#1%
\g@addto@macro#1{-}%
\hyxmp@set@rand@num
- \@tempcnta=\hyxmp@rand@num
+ \@hyxmp@count=\hyxmp@rand@num
\hyxmp@modulo@a{4}%
- \ifcase\@tempcnta
+ \ifcase\@hyxmp@count
\g@addto@macro#1{8}%
\or\g@addto@macro#1{9}%
\or\g@addto@macro#1{a}%
@@ -1227,7 +1230,7 @@ ______<#3 xml:lang="#1">\hyxmp@xmlified</#3>^^J%
\newcommand*{\hyxmp@def@DocumentID}{%
\edef\hyxmp@seed@string{\hyxmp@jobname:\@pdftitle:\@pdfauthor:}%
\expandafter\hyxmp@seed@rng\expandafter{\hyxmp@seed@string}%
- \edef\hyxmp@rand@num{\the\@tempcnta}%
+ \edef\hyxmp@rand@num{\the\@hyxmp@count}%
\hyxmp@create@uuid\hyxmp@DocumentID
}
\newcommand*{\hyxmp@def@InstanceID}{%
@@ -1236,21 +1239,21 @@ ______<#3 xml:lang="#1">\hyxmp@xmlified</#3>^^J%
\hyxmp@jobname:\@pdftitle:\@pdfauthor:\hyxmp@today@xmp:\hyxmp@seed@string
}%
\expandafter\hyxmp@seed@rng\expandafter{\hyxmp@seed@string}%
- \edef\hyxmp@rand@num{\the\@tempcnta}%
+ \edef\hyxmp@rand@num{\the\@hyxmp@count}%
\hyxmp@create@uuid\hyxmp@InstanceID
}
\newcommand*{\hyxmp@add@to@xml}[1]{%
\bgroup
- \@tempcnta=0
+ \@hyxmp@count=0
\ifhyxmp@unicodetex
\@tempcntb=65536%
\else
\@tempcntb=256%
\fi
\loop
- \lccode\@tempcnta=\@tempcnta
- \advance\@tempcnta by 1
- \ifnum\@tempcnta<\@tempcntb
+ \lccode\@hyxmp@count=\@hyxmp@count
+ \advance\@hyxmp@count by 1
+ \ifnum\@hyxmp@count<\@tempcntb
\repeat
\lccode`\_=`\ \relax
\lccode`\^^C=`\,\relax
@@ -1527,14 +1530,14 @@ ______</dc:#2>^^J%
\hyxmp@add@simple{pdfuaid:part}{\@pdfuapart}%
}
\newcommand*{\hyxmp@pdfx@id@schema}{%
- \@tempcnta=0\hyxmp@pdfx@major\relax
- \ifnum\@tempcnta=0
+ \@hyxmp@count=0\hyxmp@pdfx@major\relax
+ \ifnum\@hyxmp@count=0
\else
- \ifnum\@tempcnta=1
+ \ifnum\@hyxmp@count=1
\hyxmp@add@simple{pdfx:GTS_PDFXVersion}{PDF/X-1:2001}%
\hyxmp@add@simple{pdfx:GTS_PDFXConformance}{\@pdfxstandard}%
\else
- \ifnum\@tempcnta<4
+ \ifnum\@hyxmp@count<4
\hyxmp@add@simple{pdfx:GTS_PDFXVersion}{\@pdfxstandard}%
\else
\hyxmp@add@simple{pdfxid:GTS_PDFXVersion}{\@pdfxstandard}%
@@ -1842,8 +1845,8 @@ ______________________</rdf:li>^^J%
{Conformance level of PDF/X standard}%
\hyxmp@end@ext@decl
\fi
- \@tempcnta=0\hyxmp@pdfx@major\relax
- \ifnum\@tempcnta>3
+ \@hyxmp@count=0\hyxmp@pdfx@major\relax
+ \ifnum\@hyxmp@count>3
\hyxmp@begin@ext@decl
{PDF/X ID Schema}%
{pdfxid}%
@@ -2055,7 +2058,13 @@ _____________________xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEven
_____________________xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/"^^J%
_____________________xmlns:pdfuaid="http://www.aiim.org/pdfua/ns/id/"^^J%
_____________________xmlns:pdfx="http://ns.adobe.com/pdfx/1.3/"^^J%
+ }%
+ \ifnum0\hyxmp@pdfx@major>3
+ \hyxmp@add@to@xml{%
_____________________xmlns:pdfxid="http://www.npes.org/pdfx/ns/id/"^^J%
+ }%
+ \fi
+ \hyxmp@add@to@xml{%
_____________________xmlns:prism="http://prismstandard.org/namespaces/basic/3.0/"^^J%
_____________________xmlns:jav="http://www.niso.org/schemas/jav/1.0/"^^J%
_____________________xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/"^^J%
@@ -2180,7 +2189,7 @@ __</rdf:RDF>^^J%
<<
/Type /Metadata
/Subtype /XML
- /Length \the\@tempcnta
+ /Length \the\@hyxmp@count
>>
stream^^J\hyxmp@xml endstream%
}%
@@ -2191,16 +2200,16 @@ __</rdf:RDF>^^J%
}%
}
\newcommand*{\hyxmp@string@len}[1]{%
- \@tempcnta=0
+ \@hyxmp@count=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
+ \advance\@hyxmp@count by -1
\else
- \advance\@tempcnta by 1
+ \advance\@hyxmp@count by 1
\expandafter\hyxmp@count@spaces
\fi
}
@@ -2208,7 +2217,7 @@ __</rdf:RDF>^^J%
\def\hyxmp@one@token{#1}%
\ifx\hyxmp@one@token\@empty
\else
- \advance\@tempcnta by 1
+ \advance\@hyxmp@count by 1
\expandafter\hyxmp@count@non@spaces
\fi
}