diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty | 140 |
1 files changed, 101 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty b/Master/texmf-dist/tex/latex/hyperxmp/hyperxmp.sty index 2293be810c9..33e7335e848 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} - [2020/06/13 v5.3 Store hyperref metadata in XMP format] + [2020/06/19 v5.4 Store hyperref metadata in XMP format] \edef\hyxmp@dq@code{\the\catcode`\"} \catcode`\"=12 \@ifundefined{AtEndDocument}{% @@ -287,8 +287,20 @@ \hyxmp@redefine@Hyp \hyxmp@hypersetup } +\edef\hyxmp@concated@metadata{} +\AtEndPreamble{% + \@ifpackageloaded{babel}{% + \edef\hyxmp@concated@metadata{babel}% + }{% + \@ifpackageloaded{polyglossia}{% + \edef\hyxmp@concated@metadata{polyglossia}% + }{% + }% + }% +} \newcommand*{\hyxmp@find@metadata}{% \edef\hyxmp@concated@metadata{% + \hyxmp@concated@metadata \@baseurl \@pdfauthor \@pdfauthortitle @@ -365,6 +377,46 @@ {}% }% } +\AtEndPreamble{% + \@ifpackageloaded{hyperref}{% + \@if@def@and@nonempty{@pdflang}{% + }{% + \hyxmp@detect@langs + }% + \hyxmp@auto@assign@data + \@ifundefined{XeTeXversion}{}{% + \@ifmtargexp{\@pdfcreationdate}{% + \let\@pdfcreationdate=\hyxmp@today@pdf + }% + {}% + }% + \hyxmp@check@standards + \hyxmp@no@info@lists + \hyxmp@at@end{% + \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}% + }% +} +\hyxmp@at@end{% + \hyxmp@set@dc@lang + \ifx\@pdfmetalang\@empty + \ifx\@pdflang\@empty + \let\@pdfmetalang=\hyxmp@x@default + \else + \edef\@pdfmetalang{\@pdflang}% + \fi + \fi + \hyxmp@xmlify\@pdfmetalang + \hyxmp@auto@assign@data +} \newcommand*{\hyxmp@set@koma@phones}{% \@if@def@and@nonempty{scr@frommobilephone@var}{% \@if@def@and@nonempty{scr@fromphone@var}{% @@ -401,14 +453,6 @@ \next } \newcommand*{\hyxmp@auto@assign@data}{% - \ifx\@pdfmetalang\@empty - \ifx\@pdflang\@empty - \let\@pdfmetalang=\hyxmp@x@default - \else - \edef\@pdfmetalang{\@pdflang}% - \fi - \fi - \hyxmp@xmlify\@pdfmetalang \hyxmp@use@first@valid{pdftitle}{\@pdftitle}{% \scr@subject@var,% \@title @@ -489,6 +533,7 @@ }% }% }% + {}% \@if@def@and@nonempty{@acmISBN}{% \IfSubStr{\@acmISBN}{XXXX}{}{% \IfSubStr{\@acmISBN}{xxxx}{}{% @@ -502,6 +547,7 @@ }% }% }% + {}% \def\hyxmp@acm@publisher{Association for Computing Machinery}% \hyxmp@use@first@valid{pdfpublisher}{\@pdfpublisher}{% \hyxmp@acm@publisher @@ -530,41 +576,54 @@ \newcommand*{\hyxmp@set@dc@lang}{% \let\hyxmp@dc@lang=\@pdflang } -\AtEndPreamble{% - \@ifpackageloaded{hyperref}{% - \ifx\@pdflang\relax - \@ifundefined{mainbcp47id}{% - \let\@pdflang=\@empty - }{% - \xdef\@pdflang{\csname mainbcp47id\endcsname}% - \renewcommand*{\hyxmp@set@dc@lang}{% - \edef\hyxmp@dc@lang{\xpg@bcp@loaded}% +\newcommand*{\hyxmp@detect@langs}{% + \@ifundefined{mainbcp47id}{% + \@ifundefined{LocaleForEach}{% + \let\@pdflang=\@empty + }{% + \BabelEnsureInfo + \renewcommand*{\hyxmp@set@dc@lang}{% + \getlocaleproperty\@pdflang{\bbl@main@language}{identification/tag.bcp47}% + \hyxmp@write@pdflang + \let\hyxmp@dc@lang=\relax + \LocaleForEach{% + \getlocaleproperty\hyxmp@lang@tag{####1}{identification/tag.bcp47}% + \ifx\hyxmp@dc@lang\relax + \edef\hyxmp@dc@lang{\hyxmp@lang@tag}% + \else + \edef\hyxmp@dc@lang{\hyxmp@dc@lang,\hyxmp@lang@tag}% + \fi }% }% - \fi - \hyxmp@auto@assign@data - \@ifundefined{XeTeXversion}{}{% - \@ifmtargexp{\@pdfcreationdate}{% - \let\@pdfcreationdate=\hyxmp@today@pdf + }% + }{% + \xdef\@pdflang{\csname mainbcp47id\endcsname}% + \renewcommand*{\hyxmp@set@dc@lang}{% + \edef\hyxmp@dc@lang{\xpg@bcp@loaded}% + }% + }% +} +\newcommand*{\hyxmp@write@pdflang}{% + \@ifundefined{pdfmark}{% + \@ifundefined{@pdfm@mark}{% + \@ifundefined{pdfcatalog}{% + \PackageWarning{hyperxmp}{Unknown PDF generator; not setting the language (\@pdflang) in the PDF catalog}% + }{% + \pdfcatalog{/Lang (\@pdflang)}% }% - {}% + }{% + \@pdfm@mark{docview << /Lang (\@pdflang) >>}% }% - \hyxmp@check@standards - \hyxmp@no@info@lists - \hyxmp@at@end{% - \hyxmp@find@metadata - \hyxmp@embed@packet +}{% + \pdfmark{% + pdfmark=/PUT,Raw={% + \string{Catalog\string} << + /Lang (\@pdflang) + >> + }% }% - }{% - \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}% }% } -\hyxmp@at@end{\hyxmp@auto@assign@data} \newcommand*{\hyxmp@commas@to@list}[2]{% \gdef#1{}% \expandafter\hyxmp@commas@to@list@i\expandafter#1#2,,% @@ -1307,7 +1366,11 @@ ______</dc:#2>^^J% \hyxmp@rdf@dc[\ifHy@pdfa]{description}{\@pdfsubject}% \hyxmp@rdf@dc{rights}{\@pdfcopyright}% \hyxmp@singleton@dc{publisher}{\@pdfpublisher}% - \hyxmp@singleton@dc[Seq]{date}{\hyxmp@today@xmp}% + \@ifmtargexp{\@pdfdatetime}{% + \hyxmp@singleton@dc[Seq]{date}{\hyxmp@today@xmp}% + }{% + \hyxmp@singleton@dc[Seq]{date}{\@pdfdatetime}% + }% \hyxmp@singleton@dc{type}{\@pdftype}% \hyxmp@list@to@xml[\ifHy@pdfa]{creator}{Seq}{\hyxmp@pdfauthor}% \hyxmp@list@to@xml{subject}{Bag}{\hyxmp@pdfkeywords}% @@ -1315,7 +1378,6 @@ ______</dc:#2>^^J% \else \hyxmp@add@simple{dc:source}{\@pdfsource}% \fi - \hyxmp@set@dc@lang \hyxmp@list@to@xml{language}{Bag}{\hyxmp@dc@lang}% \@ifmtargexp{\@pdfidentifier}{% \let\hyxmp@xmlified=\@empty |