texlive[49487] Master/texmf-dist: pdfx (23dec18)

commits+karl at tug.org commits+karl at tug.org
Mon Dec 24 00:04:19 CET 2018


Revision: 49487
          http://tug.org/svn/texlive?view=revision&revision=49487
Author:   karl
Date:     2018-12-24 00:04:18 +0100 (Mon, 24 Dec 2018)
Log Message:
-----------
pdfx (23dec18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/pdfx/README
    trunk/Master/texmf-dist/doc/latex/pdfx/pdfx.pdf
    trunk/Master/texmf-dist/doc/latex/pdfx/sample.tex
    trunk/Master/texmf-dist/source/latex/pdfx/pdfx.dtx
    trunk/Master/texmf-dist/tex/latex/pdfx/pdfx.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/pdfx/pdfx-16.sty

Modified: trunk/Master/texmf-dist/doc/latex/pdfx/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pdfx/README	2018-12-23 23:03:56 UTC (rev 49486)
+++ trunk/Master/texmf-dist/doc/latex/pdfx/README	2018-12-23 23:04:18 UTC (rev 49487)
@@ -17,7 +17,7 @@
 documentation.
 
 A Makefile is provided in the src directory. Following steps will
-create the documentation GNU/Linux or similar operating system:
+create the documentation on GNU/Linux or similar operating system:
 
  make pdf
  make out
@@ -25,6 +25,8 @@
  make changes
  make pdf
 
+'make all' does all the above, as a single command-line call.
+
 'make out' is for manipulating the bookmarks file to create QUICK
 LINKS in the pdf document.
 

Added: trunk/Master/texmf-dist/doc/latex/pdfx/pdfx-16.sty
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pdfx/pdfx-16.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/pdfx/pdfx-16.sty	2018-12-23 23:04:18 UTC (rev 49487)
@@ -0,0 +1,2978 @@
+%%
+%% This is file `pdfx.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pdfx.dtx  (with options: `package')
+%% 
+%%  Copyright (c) 2018, CV Radhakrishnan <cvr at river-valley.org>,
+%%    Han The Thanh <thanh at river-valley.org>,
+%%    Ross Moore <ross.moore at mq.edu.au>,
+%%    Peter Selinger <selinger at mathstat.dal.ca>
+%% 
+%%  This file may be distributed and/or modified under the conditions
+%%  of the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX
+%%  version 1999/12/01 or later.
+%% 
+\@ifpackageloaded{pdfxmult}{%
+ \PackageError{pdfx}%
+  {^^JThis package may not be used in conjunction with the \space
+   pdfxmult \space package}%
+  {Type \space x <return> \space to exit; or just \space <return> \space
+   to continue without this package.}%
+ \expandafter\let\csname opt at pdfx.sty\endcsname\@empty\endinput
+}{}%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{pdfx}
+  [2018/11/29 v1.6 PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
+
+\newif\ifpdfx at noBOM \pdfx at noBOMfalse   % use a BOM in the XMP packet
+\newif\ifpdfx at x \pdfx at xfalse   % PDF/X mode
+\newif\ifpdfx at e \pdfx at efalse   % PDF/E mode; not fully implemented yet
+\newif\ifpdfx at ua\pdfx at uafalse   % PDF/UA mode; not fully implemented yet
+\newif\ifpdfx at vt \pdfx at vtfalse   % PDF/VT mode, extension of  PDF/X
+\newif\ifno at iccprofile   % used with PDF/X-4p and PDF/X-5pg
+\newif\ifpdfx at noerr   % error messages become just warnings
+
+\DeclareOption{noerr}{\pdfx at noerrtrue}
+
+%% Not all combinations of the following parameters are meaningful.
+\def\xmp at Part{1}               % PDF/A part: 1, 2, or 3
+\def\xmp at Conformance{B}        % Conformance level: A, B, or U
+\def\xmp at ReleaseDate{2005}     % 2001 for PDF/X-1, 2005 for PDF/A-1,
+                               % 2010 for PDF/A-2, 2012 for PDF/A-3.
+
+\newcount\pdfx at minorversion
+\expandafter\ifx\csname pdfminorversion\endcsname\relax
+\else
+ \global\pdfx at minorversion=\the\pdfminorversion
+\fi
+
+\def\pdfx at ErrorWarning#1#2#3#4{%
+ \ifpdfx at noerr \PackageWarning{pdfx}{#1.^^J  #2#3.^^J}%
+ \else \PackageError{pdfx}{#1}{#2#4.^^J
+    Use option 'noerr' to avoid this message.^^J}%
+ \fi}
+
+\def\pdfx at Xvn@message{%
+ \pdfx at ErrorWarning{PDF/X-5n has no default profile}%
+   {Provide your own}{; continuing to build a non-valid document}%
+   {, else continue to build a non-valid document}%
+}
+
+%% PDF/A options
+%%  default is to create  PDF/A-1b
+%%  options can change this for PDF/X or higher levels of PDF/A
+\DeclareOption{a-1a}{\global\pdfx at xfalse\def\xmp at Part{1}%
+ \def\xmp at Conformance{A}\def\xmp at ReleaseDate{2005}}
+\DeclareOption{a-1b}{\global\pdfx at xfalse\def\xmp at Part{1}%
+ \def\xmp at Conformance{B}\def\xmp at ReleaseDate{2005}}
+\DeclareOption{a-2a}{\global\pdfx at xfalse\def\xmp at Part{2}%
+ \def\xmp at Conformance{A}\def\xmp at ReleaseDate{2010}}
+\DeclareOption{a-2b}{\global\pdfx at xfalse\def\xmp at Part{2}%
+ \def\xmp at Conformance{B}\def\xmp at ReleaseDate{2010}}
+\DeclareOption{a-2u}{\global\pdfx at xfalse\def\xmp at Part{2}%
+ \def\xmp at Conformance{U}\def\xmp at ReleaseDate{2010}}
+\DeclareOption{a-3a}{\global\pdfx at xfalse\def\xmp at Part{3}%
+ \def\xmp at Conformance{A}\def\xmp at ReleaseDate{2012}}
+\DeclareOption{a-3b}{\global\pdfx at xfalse\def\xmp at Part{3}%
+ \def\xmp at Conformance{B}\def\xmp at ReleaseDate{2012}}
+\DeclareOption{a-3u}{\global\pdfx at xfalse\def\xmp at Part{3}%
+ \def\xmp at Conformance{U}\def\xmp at ReleaseDate{2012}}
+%%
+%% PDF/X options
+%% comments added, using
+%% https://www.eci.org/_media/downloads/pdfx/pdfx_faq_english_nov05.pdf
+%% https://en.wikipedia.org/wiki/PDF/X#List_of_the_PDF.2FX_standards
+%%
+\DeclareOption{x-1}{\global\pdfx at xtrue\def\xmp at Part{1}%  obsolete
+ \def\xmp at Conformance{a}\def\xmp at ReleaseDate{1999}% CMYK only
+ \global\pdfx at minorversion=2\relax
+ \pdfx at ErrorWarning{PDF/X-1:1999 is no longer an accepted standard}%
+    {Use option  x-1a1 or  x-1a3 }{; continuing to build a non-valid document}%
+    {, else continue to build a non-valid document.}%
+ }%  effectively same as  x-1a1
+\DeclareOption{x-1a}{\global\pdfx at xtrue\def\xmp at Part{1}% CMYK only
+ \def\xmp at Conformance{a}\def\xmp at ReleaseDate{2003}%
+ \global\pdfx at minorversion=3 }%  same as  x-1a3
+\DeclareOption{x-1a1}{\global\pdfx at xtrue\def\xmp at Part{1}%
+ \def\xmp at Conformance{a}\def\xmp at ReleaseDate{2001}%  ISO 15930-1:2001
+ \global\pdfx at minorversion=3 }
+\DeclareOption{x-1a3}{\global\pdfx at xtrue\def\xmp at Part{1}%
+ \def\xmp at Conformance{a}\def\xmp at ReleaseDate{2003}%  ISO 15930-4:2003
+ \global\pdfx at minorversion=3 }
+\DeclareOption{x-2}{\global\pdfx at xtrue\def\xmp at Part{2}%  XMP Metadata
+%% \def\xmp at Conformance{}\def\xmp at ReleaseDate{2002}%  ISO 15930-2:2003
+ \def\xmp at Conformance{}\def\xmp at ReleaseDate{2003}%   ISO 15930-5, withdrawn 2011
+ \global\pdfx at minorversion=4\relax
+ \pdfx at ErrorWarning{PDF/X-2:2003 was never published as a standard}%
+   {Use option  x-1a or  x-3 }{; continuing to build a non-valid document}%
+   {, else continue to build a non-valid document}%
+ }%  external OPI workflow, i.e. multiple files involved
+\DeclareOption{x-3}{\global\pdfx at xtrue\def\xmp at Part{3}% RGB allowed, but rare!
+ \def\xmp at Conformance{}\def\xmp at ReleaseDate{2003}%
+ \global\pdfminorversion=4 }%  same as x-303
+\DeclareOption{x-302}{\global\pdfx at xtrue\def\xmp at Part{3}%
+ \def\xmp at Conformance{}\def\xmp at ReleaseDate{2002}%   ISO 15930-3:2002
+ \global\pdfx at minorversion=3 }
+\DeclareOption{x-303}{\global\pdfx at xtrue\def\xmp at Part{3}%
+ \def\xmp at Conformance{}\def\xmp at ReleaseDate{2003}%  ISO 15930-6:2003
+ \global\pdfx at minorversion=4 }
+%%%  Later versions, yet to be fully implemented
+\DeclareOption{x-4}{\global\pdfx at xtrue\def\xmp at Part{4}%
+ \def\xmp at Conformance{}\def\xmp at ReleaseDate{2010}%  ISO 15930-7:2010
+ \global\pdfx at minorversion=6 }%  same as  x-410
+\DeclareOption{x-4p}{\global\pdfx at xtrue\global\no at iccprofiletrue
+  \def\xmp at Part{4}\def\xmp at Conformance{p}\def\xmp at ReleaseDate{2010}%
+  \global\pdfx at minorversion=6 }%  same as  x-4p10
+\DeclareOption{x-408}{\global\pdfx at xtrue\def\xmp at Part{4}%
+ \def\xmp at Conformance{}\def\xmp at ReleaseDate{2008}%  ISO 15930-7:2008
+ \global\pdfx at minorversion=6 }
+\DeclareOption{x-410}{\global\pdfx at xtrue\def\xmp at Part{4}%
+ \def\xmp at Conformance{}\def\xmp at ReleaseDate{2010}%  ISO 15930-7:2010
+ \global\pdfx at minorversion=6 }
+\DeclareOption{x-4p08}{\global\pdfx at xtrue\global\no at iccprofiletrue
+  \def\xmp at Part{4}\def\xmp at Conformance{p}\def\xmp at ReleaseDate{2008}%
+  \global\pdfx at minorversion=6 }%   ISO 15930-7:2010
+\DeclareOption{x-4p10}{\global\pdfx at xtrue\global\no at iccprofiletrue
+  \def\xmp at Part{4}\def\xmp at Conformance{p}\def\xmp at ReleaseDate{2010}%
+  \global\pdfx at minorversion=6 }%   ISO 15930-7:2010
+\DeclareOption{x-5}{\global\pdfx at xtrue\def\xmp at Part{5}%
+ \def\xmp at Conformance{g}\def\xmp at ReleaseDate{2008}%
+ \global\pdfx at minorversion=6 }%   ISO 15930-8:2010
+\DeclareOption{x-5g}{\global\pdfx at xtrue\def\xmp at Part{5}%
+ \def\xmp at Conformance{g}\def\xmp at ReleaseDate{2008}%
+ \global\pdfx at minorversion=6 }%   ISO 15930-8:2010
+\DeclareOption{x-5n}{\global\pdfx at xtrue %\global\no at iccprofiletrue
+ \def\xmp at Part{5}\def\xmp at Conformance{n}\def\xmp at ReleaseDate{2010}%
+ \global\pdfx at minorversion=6 \pdfx at Xvn@message}%   ISO 15930-8:2010
+\DeclareOption{x-5pg}{\global\pdfx at xtrue\global\no at iccprofiletrue
+  \def\xmp at Part{5}\def\xmp at Conformance{pg}\def\xmp at ReleaseDate{2010}%
+  \global\pdfx at minorversion=6 }%  ISO 15930-8:2010
+\DeclareOption{x-508}{\global\pdfx at xtrue\def\xmp at Part{5}%
+ \def\xmp at Conformance{g}\def\xmp at ReleaseDate{2008}%
+ \global\pdfx at minorversion=6 }%   ISO 15930-8:2008
+\DeclareOption{x-5g08}{\global\pdfx at xtrue\def\xmp at Part{5}%
+ \def\xmp at Conformance{g}\def\xmp at ReleaseDate{2008}%
+ \global\pdfx at minorversion=6 }%   ISO 15930-8:2008
+\DeclareOption{x-5n08}{\global\pdfx at xtrue %\global\no at iccprofiletrue
+ \def\xmp at Part{5}\def\xmp at Conformance{n}\def\xmp at ReleaseDate{2008}%
+ \global\pdfx at minorversion=6 \pdfx at Xvn@message}%   ISO 15930-8:2008
+\DeclareOption{x-5pg08}{\global\pdfx at xtrue\global\no at iccprofiletrue
+  \def\xmp at Part{5}\def\xmp at Conformance{pg}\def\xmp at ReleaseDate{2008}%
+  \global\pdfx at minorversion=6 }%  ISO 15930-8:2008
+\DeclareOption{x-510}{\global\pdfx at xtrue\def\xmp at Part{5}%
+ \def\xmp at Conformance{g}\def\xmp at ReleaseDate{2010}%
+ \global\pdfx at minorversion=6 }%  ISO 15930-8:2010
+\DeclareOption{x-5g10}{\global\pdfx at xtrue\def\xmp at Part{5}%
+ \def\xmp at Conformance{g}\def\xmp at ReleaseDate{2010}%
+ \global\pdfx at minorversion=6 }%  ISO 15930-8:2010
+\DeclareOption{x-5n10}{\global\pdfx at xtrue %\global\no at iccprofiletrue
+ \def\xmp at Part{5}\def\xmp at Conformance{n}\def\xmp at ReleaseDate{2010}%
+ \global\pdfx at minorversion=6 \pdfx at Xvn@message}%  ISO 15930-8:2010
+\DeclareOption{x-5pg10}{\global\pdfx at xtrue\global\no at iccprofiletrue
+  \def\xmp at Part{5}\def\xmp at Conformance{pg}\def\xmp at ReleaseDate{2010}%
+  \global\pdfx at minorversion=6 }%  ISO 15930-8:2010
+%%
+%% PDF/E options
+%%
+\DeclareOption{e}{\global\pdfx at xfalse\global\pdfx at etrue
+  \def\xmp at Part{1}\def\xmp at Conformance{}\def\xmp at ReleaseDate{2008}%
+  \gdef\thepdfminorversion{6}%   same as  e-1
+  }
+\DeclareOption{e-1}{\global\pdfx at xfalse\global\pdfx at etrue
+  \def\xmp at Part{1}\def\xmp at Conformance{}\def\xmp at ReleaseDate{2008}%
+  \gdef\thepdfminorversion{6}%  ISO 24517-1:2008
+  }
+%% PDF/UA options
+%%
+\let\xmp at PDFUA\@empty
+\DeclareOption{ua}{\global\pdfx at uatrue % ISO 14289-1:2012, 2014
+  \def\xmp at UAlevel{1}\let\xmp at PDFUA\relax}%   same as  ua-1
+\DeclareOption{ua-1}{\global\pdfx at uatrue % ISO 14289-1:2012, 2014
+  \def\xmp at UAlevel{1}\let\xmp at PDFUA\relax}
+%%
+%% PDF/VT options
+%%
+\DeclareOption{vt-1}{\global\pdfx at xtrue\global\pdfx at vttrue
+  \def\xmp at Part{4}\def\xmp at vtPart{1}\def\xmp at Conformance{}%
+  \def\xmp at vtConformance{}\def\xmp at ReleaseDate{2010}%
+  \gdef\xmpMM at VersionID{1}%
+  \global\pdfx at minorversion=6 }
+\DeclareOption{vt-2}{\global\pdfx at xtrue\global\pdfx at vttrue
+  \global\no at iccprofiletrue   \gdef\xmpMM at VersionID{1}%
+  \def\xmp at Part{5}\def\xmp at vtPart{2}\def\xmp at Conformance{pg}%
+  \def\xmp at vtConformance{}\def\xmp at ReleaseDate{2010}%
+  \global\pdfx at minorversion=6 }
+\DeclareOption{vt-2s}{\global\pdfx at xtrue\global\pdfx at vttrue
+  \global\no at iccprofiletrue   \gdef\xmpMM at VersionID{1}%
+  \def\xmp at Part{5}\def\xmp at vtPart{2}\def\xmp at Conformance{pg}%
+  \def\xmp at vtConformance{s}\def\xmp at ReleaseDate{2010}%
+  \global\pdfx at minorversion=6 }
+
+%% options to alter PDF minor version, in case needed in special circumstances
+\DeclareOption{pdf12}{\global\pdfx at minorversion=2 }%  1999
+\DeclareOption{pdf13}{\global\pdfx at minorversion=3 }%  2001  Acrobat 4 (ISBN 0-201-61588-6)
+\DeclareOption{pdf14}{\global\pdfx at minorversion=4 }%  2003  Acrobat 5 (ISBN 0-201-75839-3)
+\DeclareOption{pdf15}{\global\pdfx at minorversion=5 }%  2005  Acrobat 6
+\DeclareOption{pdf16}{\global\pdfx at minorversion=6 }%  2006  Acrobat 7 (ISBN 0-321-30474-8)
+\DeclareOption{pdf17}{\global\pdfx at minorversion=7 }%  2008  ISO 32000-1:2008
+
+%% inhibits writing the XMP byte-order marker
+\DeclareOption{noBOM}{\pdfx at noBOMtrue}
+\DeclareOption{useBOM}{\pdfx at noBOMfalse}
+
+%% options for language character macros in XMP metadata
+\newif\ifcyrxmp
+\newif\ifcyrKOIxmp
+\newif\ifgrkxmp
+\newif\ifgrkLGRxmp
+\newif\ifhebxmp
+\newif\ifhebHEBxmp
+\newif\ifarbxmp
+\newif\ifarmxmp
+\newif\ifarmSCIxmp
+\newif\ifdevxmp
+\newif\ifvnmxmp
+\newif\iflatEXTxmp
+\newif\iflatLATxmp
+\newif\ifipaxmp
+\newif\ifmathxmp
+
+\DeclareOption{latxmp}{\global\latEXTxmptrue}
+\DeclareOption{LATxmp}{\global\latLATxmptrue\global\latEXTxmptrue}
+\DeclareOption{cyrxmp}{\global\cyrxmptrue}
+\DeclareOption{KOIxmp}{\global\cyrKOIxmptrue\global\cyrxmptrue}
+\DeclareOption{grkxmp}{\global\grkxmptrue}
+\DeclareOption{LGRxmp}{\global\grkLGRxmptrue\global\grkxmptrue}
+\DeclareOption{hebxmp}{\global\hebxmptrue}
+\DeclareOption{HEBxmp}{\global\hebHEBxmptrue\global\hebxmptrue}
+\DeclareOption{arbxmp}{\global\arbxmptrue}
+\DeclareOption{armxmp}{\global\armxmptrue}
+\DeclareOption{AR8xmp}{\global\armSCIxmptrue\global\armxmptrue}
+\DeclareOption{devxmp}{\global\devxmptrue}
+\DeclareOption{vnmxmp}{\global\vnmxmptrue}
+\DeclareOption{ipaxmp}{\global\ipaxmptrue\global\latEXTxmptrue}
+\DeclareOption{mathxmp}{\global\mathxmptrue\global\grkxmptrue}
+
+%% all the above
+\DeclareOption{allxmp}{%
+ \global\cyrxmptrue
+ \global\cyrKOIxmptrue
+ \global\grkxmptrue
+ \global\grkLGRxmptrue
+ \global\hebxmptrue
+ \global\hebHEBxmptrue
+ \global\arbxmptrue
+ \global\armxmptrue
+ \global\armSCIxmptrue
+ \global\devxmptrue
+ \global\vnmxmptrue
+ \global\latEXTxmptrue
+ \global\latLATxmptrue
+ \global\vnmxmptrue
+ \global\ipaxmptrue
+ \global\mathxmptrue
+ \global\let\pdfx at useactivespacestrue\pdfx at useactivespacesfalse
+}
+
+\newif\ifpdfx at useactivespaces
+
+\ExecuteOptions{noBOM,a-1b}
+\ProcessOptions
+
+\ifpdfx at ua\ifpdfx at x\else
+ \expandafter\if\xmp at Conformance A\else
+ \pdfx at ErrorWarning{PDF/UA requires 'Tagged PDF' for any structure.^^J
+  Then PDF/A Conformance must be 'a'}%
+  {Use option 'a-\xmp at Part a'}%
+  {; continuing with a likely invalid document}%
+  {, or continue for a likely invalid document}%
+%%%  \gdef\xmp at Conformance{A}%   do we want this?
+\fi\fi\fi
+
+\expandafter\ifx\csname pdflastobj\endcsname\relax
+\else
+ \ifnum\pdflastobj >\z@ % pdftex  has already written objects
+  \ifnum\pdfx at minorversion=\pdfminorversion\else
+   \PackageError{pdfx}%
+    {^^J(pdfx)    Cannot change the \string\pdfminorversion^^J%
+     (pdfx)   PDF version remains at 1.\the\pdfminorversion.^^J%
+     (pdfx)   Use \string\pdfminorversion=\the\pdfx at minorversion\space
+      before \string\documentclass}%
+    {(pdfx)   Another package or document-class has written objects into the PDF.^^J%
+     (pdfx)   Hit return to continue with PDF version 1.\the\pdfminorversion.%
+    }%
+   \global\pdfx at minorversion=\the\pdfminorversion
+  \fi
+ \else
+  \global\pdfminorversion\pdfx at minorversion
+ \fi
+\fi
+
+\expandafter\ifx\csname thepdfminorversion\endcsname\relax
+ \expandafter\ifx\csname pdfminorversion\endcsname\relax
+ \else
+  \xdef\thepdfminorversion{\the\pdfminorversion}
+\fi\fi
+
+\expandafter\ifx\csname pdfminorversion\endcsname\relax
+ \gdef\thepdfminorversion{4}% assumed with XeTeX
+ \def\pdf at minorversion@xetex=#1{\gdef\thepdfminorversion{#1}}%
+ \let\pdfminorversion\pdf at minorversion@xetex
+\else
+ \ifnum\pdfminorversion < 4\relax
+  \ifpdfx at x
+    % more testing needed with PDF/X
+  \else
+   \pdfminorversion=4\relax %  assumed for PDF/A ;  options may change this for  PDF/X
+   \gdef\thepdfminorversion{4}%
+  \fi
+ \else
+  \ifnum\pdfminorversion<\thepdfminorversion\relax
+   \global\pdfminorversion=\thepdfminorversion\relax
+  \fi
+ \fi
+\fi
+\expandafter\ifx\csname pdfresetpageorigin\endcsname\relax\else
+ \pdfresetpageorigin=0
+\fi
+
+\newif\ifpdfx at nopdfinfo
+\ifmathxmp\pdfx at nopdfinfotrue
+\else
+ \iflatLATxmp\pdfx at nopdfinfotrue
+\else
+ \ifgrkLGRxmp\pdfx at nopdfinfotrue
+\else
+ \ifhebHEBxmp\pdfx at nopdfinfotrue
+\else
+ \ifcyrKOIxmp\pdfx at nopdfinfotrue
+\else
+ \ifarmSCIxmp\pdfx at nopdfinfotrue
+\fi\fi\fi\fi\fi\fi
+
+\iflatLATxmp\pdfx at useactivespacestrue\fi
+\ifgrkLGRxmp\pdfx at useactivespacestrue\fi
+\ifhebHEBxmp\pdfx at useactivespacestrue\fi
+\ifcyrKOIxmp\pdfx at useactivespacestrue\fi
+\ifarmSCIxmp\pdfx at useactivespacestrue\fi
+
+\newif\ifpdfx at transliterated
+\ifgrkLGRxmp\pdfx at transliteratedtrue\fi
+\ifhebHEBxmp\pdfx at transliteratedtrue\fi
+\ifarmSCIxmp\pdfx at transliteratedtrue\fi
+
+\RequirePackage{iftex}
+\RequirePackage{ifpdf}
+%% Support for pdfTeX primitives when using XeTeX:
+\RequirePackage{ifxetex}
+\ifxetex
+ \def\pdfx at pages@xetex#1{\special{pdf:put @pages <<#1>>}}
+ \def\pdfx at docinfo@xetex#1{\special{pdf:put @docinfo <<#1>>}}
+ \def\pdfx at catalog@xetex#1{\special{pdf:put @catalog <<#1>>}}
+ \def\pdfx at mapline@xetex#1{}
+ \def\pdf at compress@xetex=#1{}
+%%
+ \let\pdfpageattr\pdfx at pages@xetex
+ \let\pdfinfo\pdfx at docinfo@xetex
+ \let\pdfcatalog\pdfx at catalog@xetex
+ \let\pdfmapline\pdfx at mapline@xetex
+ \let\pdfcompresslevel\pdf at compress@xetex
+ \let\pdfobjcompresslevel\pdf at compress@xetex
+\fi
+
+%%\newif\ifpdfx at pdfmark  %  control future support for  dvips
+
+\RequirePackage{ifluatex}
+\ifluatex
+ \IfFileExists{luatex85.sty}{% 2016+
+  \RequirePackage{luatex85}%
+  \edef\pdfcreationdate{\pdfcreationdate}%
+ }{%  earlier versions
+ }%
+ \RequirePackage{pdftexcmds}%
+ \let\pdfx at mdfivesum\pdf at mdfivesum
+ \let\pdfescapestring\pdf at escapestring
+\else
+ \ifxetex
+  \usepackage{everyshi}%
+  \expandafter\ifx\csname mdfivesum\endcsname\relax
+   %  too early a version of  XeTeX
+   \let\pdfx at mdfivesum\relax
+  \else
+   %  since mid-2015
+   \let\pdfx at mdfivesum\mdfivesum
+  \fi
+ \else
+  \let\pdfx at mdfivesum\pdfmdfivesum
+ \fi
+\fi
+\def\pdfx at encodingfile{l8u-penc.def}
+
+\expandafter\ifx\csname pdftexbanner\endcsname\relax
+ \expandafter\ifx\csname luatexbanner\endcsname\relax
+ \else %  luatex85
+  \let\pdftexbanner\luatexbanner
+ \fi
+\else %  pdfTeX, but which version ???
+ {\endlinechar=-1
+  \everyeof{\noexpand}%
+  \xdef\pdfx at bannerstring{\expandafter\scantokens\expandafter{\pdftexbanner}}
+ }%
+ \def\pdfx at testbannerstr{%
+  This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014/dev)
+  kpathsea version 6.2.0dev}%
+ \ifx\pdfx at bannerstring\pdfx at testbannerstr
+  \typeout{This version of pdfTeX cannot write out upper-range character bytes,
+   128-255.}%
+  \typeout{Any UTF-8 Unicode characters in the Metadata will not be written
+   correctly.}%
+  \typeout{Please update to a more stable version of pdfTeX.^^J}%
+ \fi
+\fi
+
+%% How to support XeTeX here ?
+\ifpdfx at x
+ \pdfobjcompresslevel=0 \relax
+ \expandafter\ifx\csname pdfinterwordspaceoff\endcsname\relax\else
+  \pdfinterwordspaceoff
+  \let\pdfinterwordspaceon\pdfinterwordspaceoff
+  \let\pdfinterwordspace\relax
+ \fi
+ \expandafter\ifx\csname pdfgeninterwordspace\endcsname\relax\else
+  \pdfgeninterwordspace=0 \relax
+ \fi
+ \begingroup
+  \dimen0=0.996264009963\paperwidth\relax
+  \edef\pdfx at mwidth{\strip at pt\dimen0}%
+  \advance\dimen0 -25\p@
+  \edef\pdfx at twidth{\strip at pt\dimen0}%
+  \dimen0=0.996264009963\paperheight\relax
+  \edef\pdfx at mheight{\strip at pt\dimen0}%
+  \advance\dimen0 -20\p@
+  \edef\pdfx at theight{\strip at pt\dimen0}%
+  \ifxetex
+   \xdef\pdfx at everypage@xetex{%
+    /MediaBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
+    /TrimBox[25 20 \pdfx at twidth\space \pdfx at theight]%
+   }%
+  \fi
+  \edef\next{\endgroup\global\pdfpagesattr{%
+    /MediaBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
+%%    /ArtBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
+    /BleedBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
+    /CropBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
+    /TrimBox[25 20 \pdfx at twidth\space \pdfx at theight]}
+  }\next \relax
+ \ifxetex
+  \AtBeginDvi{%
+   \immediate\special{pdf:put @thispage <<\pdfx at everypage@xetex>>}}%
+  \EveryShipout{%
+   \immediate\special{pdf:put @thispage <<\pdfx at everypage@xetex>>}}%
+ \else
+  \expandafter\pdfpageattr\expandafter{\the\pdfpagesattr}%
+ \fi
+\else
+%%  PDF/A-1b  doesn't allow object compression
+ \ifnum\xmp at ReleaseDate=2005\relax
+  \expandafter\ifx\csname pdfobjcompresslevel\endcsname\relax
+  \else
+   \pdfobjcompresslevel=0\relax
+ \fi \fi
+\fi
+\ifxetex
+%% How to support XeTeX here ?
+\else
+ \ifnum\thepdfminorversion >3 \relax
+  \expandafter\ifx\csname pdfsuppresswarningdupmap\endcsname\relax
+   \expandafter\ifx\csname pdfmapline\endcsname\relax\else
+    \pdfmapline{+dummy-space <dummy-space.pfb}
+   \fi
+  \else
+   \advance\pdfsuppresswarningdupmap 1
+   \pdfmapline{+dummy-space <dummy-space.pfb}
+   \advance\pdfsuppresswarningdupmap -1
+  \fi
+  \expandafter\ifx\csname pdfgeninterwordspace\endcsname\relax\else
+   \pdfgeninterwordspace=1 \relax
+  \fi
+ \fi
+\fi
+
+\ifluatex\else\ifxetex\else
+ \@ifpackageloaded{inputenc}{%
+ }{%
+  \RequirePackage{inputenc}
+ % allow this to be loaded again cleanly
+ \expandafter\let\csname ver at inputenc.sty\endcsname\relax
+ }
+\fi\fi
+
+%% pseudo-declare the L8U encoding
+\expandafter\let\csname L8U-cmd\expandafter\endcsname\csname OT1-cmd\endcsname
+\@namedef{T at L8U}{}%
+\@namedef{D at L8U}{}%
+\@namedef{M at L8U}{}%
+
+%% adjust to LaTeX's 2018 change to the default encoding
+\expandafter\ifx\csname inputencodingname\endcsname\relax
+\else
+ \def\pdfx at restoreencoding#1{%
+  \@tempcnta=128
+  \loop
+   \catcode\@tempcnta=13
+   \advance\@tempcnta\@ne
+  \ifnum\@tempcnta<256
+  \repeat
+  \inputencoding{#1}%
+  }%
+  \AtEndOfPackage{\pdfx at restoreencoding\pdfx at inputencodingname}%
+  \let\pdfx at inputencodingname\inputencodingname
+  \let\pdfx at DeclareUnicodeCharacter\DeclareUnicodeCharacter
+  \UseRawInputEncoding
+\fi
+\InputIfFileExists{\pdfx at encodingfile}{}{}
+\expandafter\ifx\csname pdfx at inputencodingname\endcsname\relax
+\else
+  \let\inputencodingname\pdfx at inputencodingname
+  \let\DeclareUnicodeCharacter\pdfx at DeclareUnicodeCharacter
+  \let\DeclareFontEncoding@\DeclareFontEncoding at saved
+  \inputencoding{\inputencodingname}%
+\fi
+
+%%----------------------------------------------------------------------
+%% Macros for reading XMP data with special catcodes. Usage:
+%%
+%% \xmp at parse{continuation}{data}
+%%
+%% The effect is to read the data with special catcodes: '<', '>', and
+%% '&' are "active", and '^', '_', '#', '$', '~' are "other". The data
+%% is then bound to the locally scoped name \@this, and the
+%% continuation is called.
+\def\xmp at parse#1{%
+ \begingroup
+ \catcode`\<=13\catcode`\>=13\catcode`\&=13\catcode`\^=12
+ \catcode`\_=12\catcode`\#=12\catcode`\$=12\catcode`\~=12
+ \ifpdfx at useactivespaces\obeyspaces\fi % capture spaces as active characters
+ \xmp at doparse{#1}%
+}
+\def\afterxmp at parse{}% methods may change this
+\def\xmp at doparse#1#2{%
+ \def\@this{#2}#1
+ \endgroup
+ % do any post-processing
+ \afterxmp at parse
+ \def\afterxmp at parse{}%
+}
+
+%%----------------------------------------------------------------------
+%% Local commands. They are only brought into scope during the reading
+%% of xmpdata. Some fields can have a 'xml:lang' attribute; others must have.
+%%  LANG values as in:  (BCP 47)  https://tools.ietf.org/html/rfc5646#appendix-A
+%%
+\def\xmp at lang@Default{x-default}
+\let\xmp at lang@Title\xmp at lang@Default
+\let\xmp at lang@Author\xmp at lang@Default
+\let\xmp at lang@Keywords\xmp at lang@Default
+\let\xmp at lang@Subject\xmp at lang@Default
+%%\def\xmp at lang@CreatorTool{\xmp at lang@Default}
+\let\xmp at lang@Producer\xmp at lang@Default
+%%\def\xmp at lang@Volume{\xmp at lang@Default}
+%%\def\xmp at lang@Issue{\xmp at lang@Default}
+\let\xmp at lang@Copyright\xmp at lang@Default
+\let\xmp at lang@PublicationType\xmp at lang@Default
+\let\xmp at lang@Publisher\xmp at lang@Default
+\let\xmp at lang@Coverage\xmp at lang@Default
+\let\xmp at lang@Contributor\xmp at lang@Default
+\let\xmp at lang@Relation\xmp at lang@Default
+%%%  PRISM fields
+\let\xmp at lang@CoverDisplayDate\xmp at lang@Default
+\let\xmp at lang@JournalTitle\xmp at lang@Default
+%%\def\xmp at lang@JournalNumber{\xmp at lang@Default}
+%%%  xmp:  &  xmpRights:  fields
+\let\xmp at lang@Advisory\xmp at lang@Default
+\let\xmp at lang@Identifier\xmp at lang@Default
+\let\xmp at lang@Nickname\xmp at lang@Default
+\let\xmp at lang@Owner\xmp at lang@Default
+
+%% some validators require a language attribute for
+%%   dc:title                 set via  \Title
+%%   dc:description   set via  \Subject
+%%   dc:rights              set via  \Copyright
+%%   xmpRights:UsageTerms   set via \Copyright
+%%
+{\catcode `\" 12 \catcode`\: 12 \catcode`\= 12
+ \gdef\pdfx at xmp@checklang#1{%
+  \ifx #1\xmp at lang@Default\else\space xml:lang="#1"\fi}
+ \gdef\pdfx at xmp@strictlang#1{\space xml:lang="#1"}
+}%  end of  \catcodes
+\let\xmp at checklang\pdfx at xmp@checklang
+\let\xmp at strictlang\pdfx at xmp@strictlang
+
+\newcommand{\pdfx at Title}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Title{#1}\fi
+ \xmp at parse{\global\let\xmp at Title\@this}}
+
+%% allow for multiple authors, keywords and languages
+%%  also:  contributor, date, relation, type, thumbnails
+%%  and  AuthoritativeDomain, Advisory, Identifier, Owner
+\newcommand{\pdfx at Author}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Author{#1}\fi
+ \def\afterxmp at parse{\let\Author\pdfx at extraAuthor}%
+ \xmp at parse{\global\let\xmp at Author\@this}}
+\newcommand{\pdfx at Keywords}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Keywords{#1}\fi
+ \def\afterxmp at parse{\let\Keywords\pdfx at extraKeywords}%
+ \xmp at parse{\global\let\xmp at Keywords\@this}}
+\newcommand{\pdfx at Language}{%
+ \def\afterxmp at parse{\let\Language\pdfx at extraLanguages}%
+ \xmp at parse{\global\let\xmp at Language\@this}}
+
+\newcommand{\pdfx at AuthoritativeDomain}{%
+ \def\afterxmp at parse{\let\AuthoritativeDomain\pdfx at extraAuthoritativeDomain}%
+ \xmp at parse{\global\let\xmp at AuthoritativeDomain\@this}}
+\newcommand{\pdfx at Date}{%
+ \def\afterxmp at parse{\let\Date\pdfx at extraDate}%
+ \xmp at parse{\global\let\xmp at Date\@this}}
+\newcommand{\pdfx at Contributor}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Contributor{#1}\fi
+ \def\afterxmp at parse{\let\Contributor\pdfx at extraContributor}%
+ \xmp at parse{\global\let\xmp at Contributor\@this}}
+\newcommand{\pdfx at Relation}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Relation{#1}\fi
+ \def\afterxmp at parse{\let\Relation\pdfx at extraRelation}%
+ \xmp at parse{\global\let\xmp at Relation\@this}}
+%%\newcommand{\pdfx at Type}[1][]{%
+%% \ifx\relax#1\relax\else\gdef\xmp at lang@Type{#1}\fi
+%% \def\afterxmp at parse{\let\Type\pdfx at extraType}%
+%% \xmp at parse{\global\let\xmp at Type\@this}}
+
+\newcommand{\pdfx at Advisory}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Advisory{#1}\fi
+ \def\afterxmp at parse{\let\Advisory\pdfx at extraAdvisory}%
+ \xmp at parse{\global\let\xmp at Advisory\@this}}
+\newcommand{\pdfx at Identifier}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Identifier{#1}\fi
+ \def\afterxmp at parse{\let\Identifier\pdfx at extraIdentifier}%
+ \xmp at parse{\global\let\xmp at Identifier\@this}}
+\newcommand{\pdfx at Thumbnails}{%
+ \def\afterxmp at parse{\let\Thumbnails\pdfx at extraThumbnails}%
+ \xmp at parse{\global\let\xmp at Thumbnails\@this}}
+
+\newcommand{\pdfx at Owner}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Owner{#1}\fi
+ \def\afterxmp at parse{\let\Owner\pdfx at extraOwner}%
+ \xmp at parse{\global\let\xmp at Owner\@this}}
+
+{\obeyspaces%
+ \ifpdfx at useactivespaces\gdef\pdfx at insert@sep{\sep }%
+ \else\gdef\pdfx at insert@sep{\sep}\fi%
+}
+\newcommand{\pdfx at extraAuthor}[1][]{%
+ \ifx\relax#1\relax
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Author
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Author\pdfx at insert@sep}%
+ \else
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Author
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Author\pdfx at insert@sep[#1]}%
+ \fi
+ \def\afterxmp at parse{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Author
+   \expandafter\expandafter\expandafter{%
+    \expandafter\xmp at Author\xmp at extraAuthor}%
+   }%
+ \xmp at parse{\global\let\xmp at extraAuthor\@this}%
+ }%
+\newcommand{\pdfx at extraKeywords}[1][]{%
+ \ifx\relax#1\relax
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Keywords
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Keywords\pdfx at insert@sep}%
+ \else%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Keywords
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Keywords\pdfx at insert@sep[#1]}%
+ \fi%
+ \def\afterxmp at parse{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Keywords
+   \expandafter\expandafter\expandafter{%
+    \expandafter\xmp at Keywords\xmp at extraKeywords}}%
+ \xmp at parse{\global\let\xmp at extraKeywords\@this}%
+ }%
+\newcommand{\pdfx at extraLanguages}{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Language
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Language\pdfx at insert@sep}%
+ \def\afterxmp at parse{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Language
+   \expandafter\expandafter\expandafter{%
+    \expandafter\xmp at Language\xmp at extraLanguages}}%
+ \xmp at parse{\global\let\xmp at extraLanguages\@this}%
+ }%
+
+\newcommand{\pdfx at extraContributor}[1][]{%
+ \ifx\relax#1\relax
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Contributor
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Contributor\pdfx at insert@sep}%
+ \else
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Contributor
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Contributor\pdfx at insert@sep[#1]}%
+ \fi
+ \def\afterxmp at parse{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Contributor
+   \expandafter\expandafter\expandafter{%
+    \expandafter\xmp at Contributor\xmp at extraContributor}%
+   }%
+ \xmp at parse{\global\let\xmp at extraContributor\@this}%
+ }%
+
+\newcommand{\pdfx at extraAuthoritativeDomain}{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at AuthoritativeDomain
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at AuthoritativeDomain\pdfx at insert@sep}%
+ \def\afterxmp at parse{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at AuthoritativeDomain
+   \expandafter\expandafter\expandafter{%
+    \expandafter\xmp at AuthoritativeDomain\xmp at extraAuthoritativeDomain}%
+   }%
+ \xmp at parse{\global\let\xmp at extraAuthoritativeDomain\@this}%
+ }%
+
+\newcommand{\pdfx at extraDate}{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Date
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Date\pdfx at insert@sep}%
+ \def\afterxmp at parse{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Date
+   \expandafter\expandafter\expandafter{%
+    \expandafter\xmp at Date\xmp at extraDate}%
+   }%
+ \xmp at parse{\global\let\xmp at extraDate\@this}%
+ }%
+
+\newcommand{\pdfx at extraRelation}[1][]{%
+ \ifx\relax#1\relax
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Relation
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Relation\pdfx at insert@sep}%
+ \else
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Relation
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Relation\pdfx at insert@sep[#1]}%
+ \fi
+ \def\afterxmp at parse{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Relation
+   \expandafter\expandafter\expandafter{%
+    \expandafter\xmp at Relation\xmp at extraRelation}%
+   }%
+ \xmp at parse{\global\let\xmp at extraRelation\@this}%
+ }%
+
+%%\newcommand{\pdfx at extraType}[1][]{%
+%%% \show\xmp at Type
+%% \ifx\relax#1\relax
+%%  \expandafter\expandafter\expandafter\gdef
+%%   \expandafter\expandafter\expandafter\xmp at Type
+%%    \expandafter\expandafter\expandafter{%
+%%     \expandafter\xmp at Type\pdfx at insert@sep}%
+%% \else
+%%  \expandafter\expandafter\expandafter\gdef
+%%   \expandafter\expandafter\expandafter\xmp at Type
+%%    \expandafter\expandafter\expandafter{%
+%%     \expandafter\xmp at Type\pdfx at insert@sep[#1]}%
+%% \fi
+%% \def\afterxmp at parse{%
+%%  \expandafter\expandafter\expandafter\gdef
+%%   \expandafter\expandafter\expandafter\xmp at Type
+%%   \expandafter\expandafter\expandafter{%
+%%    \expandafter\xmp at Type\xmp at extraType}%
+%%   %\show\xmp at Type
+%%   }%
+%% \xmp at parse{\global\let\xmp at extraType\@this}%
+%% }%
+
+\newcommand{\pdfx at extraAdvisory}[1][]{%
+ \ifx\relax#1\relax
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Advisory
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Advisory\pdfx at insert@sep}%
+ \else
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Advisory
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Advisory\pdfx at insert@sep[#1]}%
+ \fi
+ \def\afterxmp at parse{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Advisory
+   \expandafter\expandafter\expandafter{%
+    \expandafter\xmp at Advisory\xmp at extraAdvisory}%
+   }%
+ \xmp at parse{\global\let\xmp at extraAdvisory\@this}%
+ }%
+
+\newcommand{\pdfx at extraIdentifier}[1][]{%
+ \ifx\relax#1\relax
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Identifier
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Identifier\pdfx at insert@sep}%
+ \else
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Identifier
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Identifier\pdfx at insert@sep[#1]}%
+ \fi
+ \def\afterxmp at parse{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Identifier
+   \expandafter\expandafter\expandafter{%
+    \expandafter\xmp at Identifier\xmp at extraIdentifier}%
+   }%
+ \xmp at parse{\global\let\xmp at extraIdentifier\@this}%
+ }%
+
+\newcommand{\pdfx at extraThumbnails}[1][]{%
+ \ifx\relax#1\relax
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Thumbnails
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Thumbnails\pdfx at insert@sep}%
+ \else
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Thumbnails
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Thumbnails\pdfx at insert@sep[#1]}%
+ \fi
+ \def\afterxmp at parse{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Thumbnails
+   \expandafter\expandafter\expandafter{%
+    \expandafter\xmp at Thumbnails\xmp at extraThumbnails}%
+   }%
+ \xmp at parse{\global\let\xmp at extraThumbnails\@this}%
+ }%
+
+\newcommand{\pdfx at extraOwner}[1][]{%
+ \ifx\relax#1\relax
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Owner
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Owner\pdfx at insert@sep}%
+ \else
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Owner
+    \expandafter\expandafter\expandafter{%
+     \expandafter\xmp at Owner\pdfx at insert@sep[#1]}%
+ \fi
+ \def\afterxmp at parse{%
+  \expandafter\expandafter\expandafter\gdef
+   \expandafter\expandafter\expandafter\xmp at Owner
+   \expandafter\expandafter\expandafter{%
+    \expandafter\xmp at Owner\xmp at extraOwner}%
+   }%
+ \xmp at parse{\global\let\xmp at extraOwner\@this}%
+ }%
+
+\newcommand{\pdfx at Subject}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Subject{#1}\fi
+ \xmp at parse{\global\let\xmp at Subject\@this}}
+\newcommand{\pdfx at Producer}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Producer{#1}\fi
+ \xmp at parse{\global\let\xmp at Producer\@this}}
+\newcommand{\pdfx at Publisher}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Publisher{#1}\fi
+ \xmp at parse{\global\let\xmp at Publisher\@this}}
+\newcommand{\pdfx at Copyright}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Copyright{#1}\fi
+ \xmp at parse{\global\let\xmp at Copyright\@this%
+  \ifx\xmp at Copyrighted\@empty\gdef\xmp at Copyrighted{True}\fi}}
+
+\newcommand{\pdfx at Coverage}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@Coverage{#1}\fi
+ \xmp at parse{\global\let\xmp at Coverage\@this}}
+
+%%  PRISM Text fields
+\newcommand{\pdfx at CoverDisplayDate}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@CoverDisplayDate{#1}\fi
+ \xmp at parse{\global\let\xmp at CoverDisplayDate\@this}}
+\newcommand{\pdfx at JournalTitle}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@JournalTitle{#1}\fi
+ \ifx\xmp at PublicationType\@empty\gdef\xmp at PublicationType{journal}\fi
+ \xmp at parse{\global\let\xmp at JournalTitle\@this}}
+
+%%  Uses PRISM Controlled Vocabulary:
+%%    http://prismstandard.org/vocabularies/3.0/aggregationtype.xml
+%%  blog, book, bookazine, catalog, feed, journal, magazine, manual
+%%  newsletter, newspaper, other, report, pamphlet, vook, whitepaper
+%%
+\newcommand{\pdfx at PublicationType}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp at lang@PublicationType{#1}\fi
+ \xmp at parse{\global\let\xmp at PublicationType\@this}}
+
+\def\pdfx at localcommands{
+ \let\Title\pdfx at Title
+ \let\Author\pdfx at Author
+ \let\Keywords\pdfx at Keywords
+ \let\Subject\pdfx at Subject
+ \let\Language\pdfx at Language
+ \def\CreatorTool{\xmp at parse{\global\let\xmp at CreatorTool\@this}}
+ \let\Producer\pdfx at Producer
+ \def\Volume{\xmp at parse{\global\let\xmp at Volume\@this}}
+ \def\Issue{\xmp at parse{\global\let\xmp at Issue\@this}}
+ \let\CoverDisplayDate\pdfx at CoverDisplayDate
+ \def\CoverDate{\xmp at parse{\global\let\xmp at CoverDate\@this}}
+ \let\Copyright\pdfx at Copyright
+ \def\CopyrightURL{\xmp at parse{\global\let\xmp at CopyrightURL\@this%
+   \ifx\xmp at Copyrighted\@empty\gdef\xmp at Copyrighted{True}\fi}}
+ \def\Copyrighted{\xmp at parse{\global\let\xmp at Copyrighted\@this}}
+ \def\Doi{\xmp at parse{\global\let\xmp at Doi\@this}}
+ \def\ISBN{\xmp at parse{\global\let\xmp at ISBN\@this}}
+ \def\URLlink{\xmp at parse{\global\let\xmp at URL\@this}}
+ \def\Lastpage{\xmp at parse{\global\let\xmp at Lastpage\@this}}
+ \def\Firstpage{\xmp at parse{\global\let\xmp at Firstpage\@this}}
+ \let\PublicationType\pdfx at PublicationType
+ \let\Journaltitle\pdfx at JournalTitle
+ \def\Journalnumber{\xmp at parse{\global\let\xmp at Journalnumber\@this}}
+ \let\Publisher\pdfx at Publisher
+ \let\Coverage\pdfx at Coverage
+ \def\Source{\xmp at parse{\global\let\xmp at Source\@this}}
+ \let\Contributor\pdfx at Contributor
+ \let\Date\pdfx at Date
+ \let\Relation\pdfx at Relation
+ \let\Advisory\pdfx at Advisory
+ \def\BaseURL{\xmp at parse{\global\let\xmp at BaseURL\@this}}
+ \let\Identifier\pdfx at Identifier
+ \let\Nickname\pdfx at Nickname
+ \let\Thumbnails\pdfx at Thumbnails
+ \let\Owner\pdfx at Owner
+ \def\CertificateURL{\xmp at parse{\global\let\xmp at CertificateURL\@this}}
+ \def\MMversionID{\xmp at parse{\global\let\xmpMM at versionID\@this}}
+%% \let\Type\pdfx at Type
+%%
+%% currently unused; for backward compatibility only
+ \let\AuthoritativeDomain\pdfx at AuthoritativeDomain
+ \let\Creator\CreatorTool  % for backward compatibility
+ \let\Org\Publisher        % for backward compatibility
+ \let\WebStatement\CopyrightURL  % for backward compatibility
+}
+
+%%----------------------------------------------------------------------
+%% The following characters and markup can be used within the XMP data
+%% defined by \Author, \Title, and so on.
+%%
+%% * All printable non-whitespace ASCII characters except
+%%   '%', '{', '}', '\' can be used as themselves.
+%%
+%% * All printable non-whitespace UTF-8 encoded Unicode characters
+%%   from the basic multilingual plane can be used as themselves.
+%%
+%% * As usual, consecutive whitespace characters are contracted to a
+%%   single space. Whitespace after a macro such as \copyright is
+%%   ignored. Blank lines are not permitted.
+%%
+%% * The following markup can be used:
+%%   '\ '        - a literal space  (for example after a macro)
+%%   \%          - a literal '%'
+%%   \{          - a literal '{'
+%%   \}          - a literal '}'
+%%   \backslash  - a literal '\'
+%%   \copyright  - the (c) copyright symbol
+%%
+%%   \sep        - only permitted within \Author, \Keywords, \Publisher.
+%%
+%% * For backward compatibility, \& and \TextCopyright are also
+%%   provided. Their use is deprecated.
+
+%%----------------------------------------------------------------------
+%% The macro \pdfx at actives binds the active characters
+%% '&', '<', and '>' to \pdfx at amp, \pdfx at lt, and \pdfx at gt,
+%% respectively, without actually making them active.
+\begingroup
+ \catcode`\<=13
+ \catcode`\>=13
+ \catcode`\&=13
+ \gdef\pdfx at actives{
+  \def&{\pdfx at amp}
+  \def<{\pdfx at lt}
+  \def>{\pdfx at gt}
+ }
+\endgroup
+
+%%----------------------------------------------------------------------
+%% Markup bindings to be used during XMP generation.
+
+{%
+ \catcode`\<=12 \catcode`\>=12 \catcode`\/=12 \catcode`\:=12 \catcode`\"=12
+\obeyspaces\ifpdfx at useactivespaces%
+ \gdef\pdfx at sep {\pdfx at check@lang}%
+\else%
+ \gdef\pdfx at sep{\pdfx at check@lang}%
+\fi%
+ \xdef\pdfx at sep@nolang{</rdf:li>^^J     <rdf:li>}%
+ \xdef\pdfx at sep@lang[#1]{</rdf:li>^^J     <rdf:li xml:lang="#1">}%
+}% end of \obeyspaces and \catcode ....
+
+\def\pdfx at check@lang#1{%
+ \ifx[#1\expandafter\@firstoftwo
+ \else\expandafter\@secondoftwo\fi
+ {\pdfx at sep@lang#1}{\pdfx at sep@nolang#1}}
+
+\def\pdfx at xmpmarkup{%
+ \pdfx at actives
+ \edef\@amp{\expandafter\@gobble\string\&}%
+ \edef\@hash{\expandafter\@gobble\string\#}%
+ \edef\ {\expandafter\@gobble\string\ }%
+ \edef\%{\expandafter\@gobble\string\%}%
+ \edef\{{\expandafter\@gobble\string\{}%
+ \edef\}{\expandafter\@gobble\string\}}%
+ \edef\backslash{\expandafter\@gobble\string\\}%
+ \def\@unicode##1{\@amp\@hash x##1;}%
+ \def\pdfx at amp{\@unicode{0026}}%
+ \def\pdfx at lt{\@unicode{003c}}%
+ \def\pdfx at gt{\@unicode{003e}}%
+ \def\copyright{\@unicode{00A9}}%
+ \let\&\pdfx at amp               % for backward compatibility
+ \let\TextCopyright\copyright  % for backward compatibility
+ \let\sep\pdfx at sep
+ \pdfx at xmpunimarkup   % only need this when writing XMP
+ \the\pdfxsafeforxmp at toks
+}
+
+%% cope with active spaces with LGR encoding
+%% and the spaces written out with \IeC in KOI8-r
+%% It's possible to have both together.
+\def\liixu at IeC#1#{\liixu at IeCi}
+\def\liixu at IeCi#1{\liixu at IeCii#1}
+\def\liixu at IeCii#1#2{#1}
+\def\liixu at enableIeC{\ifpdfx at useactivespaces
+ \let\IeC\liixu at IeC\else\def\IeC##1{##1}\fi}
+\def\liixu at numberline#1#{\liixu at numberlinei}
+\def\liixu at numberlinei#1{\liixu at numberlineii#1}
+\def\liixu at numberlineii#1{\textLF #1. }
+\def\liixu at enablenumberline{\ifpdfx at useactivespaces
+ \let\numberline\liixu at numberline
+ \else\def\numberline##1{\textLF ##1. }\fi}
+
+\def\pdfx at xmpunimarkup{%
+ \liixu at enableIeC
+ \liixu at enablenumberline
+ \def\empty{}% used in LICR patterns
+ \LIIXUscriptcommands
+ \LIIXUtipacommands
+ \LIIXUmapTeXnames
+%%  from Hyperref's  psdextra.def
+ \csname psdmapshortnames\endcsname
+ \csname psdaliasnames\endcsname
+%% from  lu8enc.def
+ \csname LIIXUmapmathletterlikes\endcsname
+ \csname LIIXUmapmathspaces\endcsname
+ \iflatLATxmp
+  \LIIXUmaplatinchars
+  \LIIXUcancelfontswitches
+ \fi
+ \ifmathxmp
+  \let\(\textinlinemath
+  \let\[\textdisplaymath
+  \LIIXUmapmathaccents
+  \LIIXUmapisomathgreek
+  \LIIXUmapmatharrowsA
+  \LIIXUmapmathoperatorsA
+  \LIIXUmapmathoperatorsB
+  \LIIXUmapmiscmathsymbolsA
+  \LIIXUmapsupparrowsA
+  \LIIXUmapsupparrowsB
+  \LIIXUmapmiscmathsymbolsB
+  \LIIXUmapsuppmathoperators
+  \LIIXUmapunimathgreek
+  \LIIXUmapmathalphabets
+ \fi
+ \ifarbxmp \LIIXUmaparabicletters\fi
+ \ifarmxmp \LIIXUmaparmenianletters\fi
+ \ifdevxmp\LIIXUmapdevaccents\fi
+ \ifgrkxmp \LIIXUmapgreekletters\fi
+ \ifhebxmp \LIIXUmaphebrewletters\fi
+}
+
+%% In case macros are used in XMP Metadata, need a way to map these
+%% to simple text, rather than specific font characters, or whatever:
+\newtoks\pdfxsafeforxmp at toks
+\def\pdfxEnableCommands{%   user command
+ \begingroup
+  \ifpdfx at useactivespaces\obeyspaces\fi
+  \pdfx at EnableCommands
+}
+\def\pdfx at EnableCommands#1{%   internal command
+ \expandafter\global\expandafter\pdfxsafeforxmp at toks
+  \expandafter{\the\pdfxsafeforxmp at toks#1}%
+ \endgroup
+}
+
+%%----------------------------------------------------------------------
+%% Markup bindings to be used during PDF string generation.
+
+\def\pdfx at pdfmarkup{%
+ \pdfx at actives
+ \edef\%{\expandafter\@gobble\string\%}%
+ \edef\{{\expandafter\@gobble\string\{}%
+ \edef\}{\expandafter\@gobble\string\}}%
+ \edef\pdfx at backslash{\expandafter\@gobble\string\\}%
+ \def\backslash{\pdfx at backslash000\pdfx at backslash134}%
+ \edef\pdfx at amp{\expandafter\@gobble\string\&}%
+ \edef\pdfx at lt{\expandafter\@gobble\string\<}%
+ \edef\pdfx at gt{\expandafter\@gobble\string\>}%
+ \let\TextCopyright\copyright  % for backward compatibility
+ \def\sep{; }%
+ %\let\sep\pdfx at sep
+%% Note: '\ ', \&, \copyright are already predefined by hyperref.
+%% allow LICRs to expand into PDF strings
+ \def\cf at encoding{PU}%
+ \def\9##1{\ifcase##1\string\0\or\string\1\or\string\2\or\string\3\fi}%
+ \def\8{\string\00}%
+ \def\0{\string\0}\def\1{\string\1}\def\2{\string\2}\def\3{\string\3}%
+ \pdfx at xmpunimarkup
+ \the\pdfxsafeforxmp at toks
+}
+
+%%----------------------------------------------------------------------
+%% Defaults
+\ifxetex
+ \def\xmp at Producer{XeTeX}
+\else\ifluatex
+ \def\xmp at Producer{LuaTeX}
+\else
+ \def\xmp at Producer{pdfTeX}
+\fi\fi
+\global\let\pdfxProducer\xmp at Producer
+
+\global\let\xmp at CreatorTool\@empty
+\global\let\xmp at Title\@empty
+\global\let\xmp at Author\@empty
+\global\let\xmp at Keywords\@empty
+\global\let\xmp at Subject\@empty
+\global\let\xmp at Language\@empty
+\global\let\xmp at Volume\@empty
+\global\let\xmp at Issue\@empty
+\global\let\xmp at CoverDisplayDate\@empty
+\global\let\xmp at CoverDate\@empty
+\global\let\xmp at Copyright\@empty
+\global\let\xmp at Copyrighted\@empty
+\global\let\xmp at CopyrightURL\@empty
+\gdef\xmp at WebStatement{\xmp at CopyrightURL}
+\global\let\xmp at Doi\@empty
+\global\let\xmp at ISBN\@empty
+\global\let\xmp at URL\@empty
+\global\let\xmp at Lastpage\@empty
+\global\let\xmp at Firstpage\@empty
+\global\let\xmp at PublicationType\@empty
+\global\let\xmp at Journaltitle\@empty
+\global\let\xmp at Journalnumber\@empty
+%%\global\let\xmp at Type\@empty
+\global\let\xmp at Contributor\@empty
+\global\let\xmp at Coverage\@empty
+\global\let\xmp at Date\@empty
+\global\let\xmp at Relation\@empty
+\global\let\xmp at Source\@empty
+\global\let\xmp at Publisher\@empty
+\gdef\xmp at Org{\xmp at Publisher}
+\global\let\xmp at AuthoritativeDomain\@empty
+\global\let\xmp at Advisory\@empty
+\global\let\xmp at BaseURL\@empty
+\global\let\xmp at Identifier\@empty
+\global\let\xmp at Nickname\@empty
+\global\let\xmp at Thumbnails\@empty
+\global\let\xmp at Owner\@empty
+\global\let\xmp at CertificateURL\@empty
+
+%%----------------------------------------------------------------------
+%%  Alternative way to get the CreationDate using Lua  for XeTeX
+\ifdefined\pdfcreationdate\else
+ \begingroup  %% ensure correct catcodes, not done by \dospecials
+ \catcode`\:=12 \catcode`\.=12
+\begin{filecontents*}{creationdate.lua}
+ os.remove("creationdate.timestamp")
+ io.output("creationdate.timestamp"):write(os.date("\\edef\\tempa{\\string D:%Y%m%d%H%M%S}\n\\def\\tempb{%z}"))
+\end{filecontents*}
+ \endgroup
+ \ifnum\shellescape=1
+  \begingroup  %% ensure correct catcodes when file is read in
+   \catcode`\'=12 \catcode`\.=12 \catcode`\:=12 \catcode`\+=12
+   \immediate\write18{texlua creationdate.lua}
+   \input{creationdate.timestamp}
+   \def\tempc#1#2#3#4#5{#1#2#3'#4#5'}
+   \edef\tempb{\expandafter\tempc\tempb}
+   \edef\x{\endgroup\def\noexpand\pdfcreationdate{\tempa\tempb}}\x
+ \else
+  \begingroup  %% ensure correct catcodes in the error/warning messages
+  \catcode`\<=12 \catcode`\>=12 \catcode`\"=12 \catcode`\-=12
+  \catcode`\: 12 \catcode`\' 12 \catcode`\= 12
+  \ifpdfx at noerr
+   \PackageWarning{pdfx}{%
+    CreationDate is not properly supported;^^J
+    PDF validation may fail. To avoid this problem use:^^J
+     xelatex -shell-escape  -output-driver="xdvipdfmx -z 0" <filename>^^J}
+  \else
+   \PackageError{pdfx}{%
+    CreationDate is not properly supported;^^J
+    PDF validation may fail.}{To avoid this problem use:^^J
+     xelatex -shell-escape  -output-driver="xdvipdfmx -z 0" <filename> }
+  \fi
+  %% Using a constant date, to allow processing to finish smoothly.
+  \edef\x{\endgroup
+   \def\noexpand\pdfcreationdate{\string D:20181028075445+10'00'}}%
+   \x
+ \fi
+\fi
+
+%%----------------------------------------------------------------------
+\def\pdfx at findUUID#1{\edef\pdfx at tmpstring{\pdfx at mdfivesum{#1}}
+     \expandafter\pdfx at eightofnine\pdfx at tmpstring\end}
+\def\pdfx at eightofnine#1#2#3#4#5#6#7#8#9\end{%
+     \xdef\pdfx at eightchars{#1#2#3#4#5#6#7#8}
+     \pdfx at fouroffive#9\end}
+\def\pdfx at fouroffive#1#2#3#4#5\end{\xdef\pdfx at ffourchars{#1#2#3#4}
+     \pdfx at sfouroffive#5\end}
+\def\pdfx at sfouroffive#1#2#3#4#5\end{\xdef\pdfx at sfourchars{#1#2#3#4}
+     \pdfx at tfouroffive#5\end}
+\def\pdfx at tfouroffive#1#2#3#4#5\end{\xdef\pdfx at tfourchars{#1#2#3#4}
+     \xdef\pdfx at laststring{#5}}
+
+\def\pdfx at uuid{\pdfx at eightchars-%
+          \pdfx at ffourchars-%
+          \pdfx at sfourchars-%
+          \pdfx at tfourchars-%
+          \pdfx at laststring}
+
+\expandafter\ifx\csname pdfx at mdfivesum\endcsname\relax
+  \PackageError{pdfx}{%
+    No implementation for \string\pdfx at mdfivesum.^^J
+    \ifxetex XeTeX needs to be 2015 or later\fi
+   }{%
+    Continue without, but the PDF will not validate.
+   }%
+ \def\xmp at docid{}%
+ \def\pdfx at findUUID#1{}%
+ \def\pdfx at uuid{}%
+\else
+ \pdfx at findUUID{\jobname.pdf}
+ \edef\xmp at docid{\pdfx at uuid}
+\fi
+
+\expandafter\ifx\csname pdfcreationdate\endcsname\relax\relax
+  \PackageWarning{pdfx}{%
+   No implementation for \string\pdfxcreation .
+  }%
+ \def\xmp at instid{}%
+%%
+\else   %% use the MD5 sum methods
+%%
+ \pdfx at findUUID{\pdfcreationdate}%
+ \edef\xmp at instid{\pdfx at uuid}
+\fi
+
+%%----------------------------------------------------------------------
+%% load  xcolor  before  hyperref  to get the link colors correct
+%%
+\PassOptionsToPackage{nosetpagesize}{color}
+\PassOptionsToPackage{nosetpagesize}{graphics}
+\@ifpackageloaded{xcolor}{%
+ % Beamer will have already loaded  xcolor
+ % need to understand what options it used
+}{
+\ifpdfx at x
+ \RequirePackage[cmyk,hyperref]{xcolor}
+\else
+ \RequirePackage[rgb,hyperref]{xcolor}
+\fi
+}%
+
+%%  loading  puenc.def  will kill a lot of what  mathtext.sty  established
+\@ifpackageloaded{mathtext}{%
+ \PackageWarningNoLine{pdfx}{pdfx.sty  and hyperref.sty should be loaded^^J
+  before mathtext.sty , otherwise text symbols may not show in math mode.}%
+}{}
+
+\newif\ifpdfx at hluatex
+\IfFileExists{hluatex.def}{\pdfx at hluatextrue}{\pdfx at hluatexfalse}
+
+%% the "pdftex" option seems to work fine with LuaTeX
+\def\pdfx at luatest{\ifpdfx at hluatex luatex\else pdftex \fi}
+
+%% Hyperref options for PDF/X
+\edef\pdfx at pdfX@opts at pdftex{%
+   draft,pdftex,pdfpagemode=UseNone,bookmarks=false,%
+   pdfversion=1.\thepdfminorversion,pdfstartview=}
+\edef\pdfx at pdfX@opts at xetex{%
+   draft,xetex,pdfpagemode=UseNone,bookmarks=false,%
+   pdfversion=1.\thepdfminorversion,pdfstartview=}
+ \edef\pdfx at pdfX@opts at luatex{%
+   draft,\pdfx at luatest,pdfpagemode=UseNone,bookmarks=false,%
+   pdfversion=1.\thepdfminorversion,pdfstartview=}%
+
+\newif\ifpdfx at hyperrefloaded
+\expandafter\ifx\csname ifHy at pdfa\endcsname\relax\else\pdfx at hyperrefloadedtrue\fi
+
+%% Hyperref options for PDF/A and PDF/E
+\newtoks\pdfx at tmptoks
+\pdfx at tmptoks{%
+\ifHy at pdfa
+   \edef\pdfx at pdfAE@opts at pdftex{pdftex}%
+   \edef\pdfx at pdfAE@opts at xetex{xetex,pdfversion=1.\thepdfminorversion}%
+   \edef\pdfx at pdfAE@opts at luatex{\pdfx at luatest,pdfversion=1.\thepdfminorversion}%
+   \edef\pdfx at pdfAE@opts at pdfmark{pdfmark,pdfversion=1.\thepdfminorversion}%
+  \else
+   \edef\pdfx at pdfAE@opts at pdftex{pdftex,pdfa}%
+   \edef\pdfx at pdfAE@opts at xetex{xetex,pdfa,pdfversion=1.\thepdfminorversion}%
+   \edef\pdfx at pdfAE@opts at luatex{\pdfx at luatest,pdfa,pdfversion=1.\thepdfminorversion}%
+   \edef\pdfx at pdfAE@opts at pdfmark{pdfmark,pdfa,pdfversion=1.\thepdfminorversion}%
+  \fi
+}
+\ifpdfx at hyperrefloaded
+ \the\pdfx at tmptoks\relax
+\else
+ \edef\pdfx at pdfAE@opts at pdftex{pdftex,pdfa}%
+ \edef\pdfx at pdfAE@opts at xetex{xetex,pdfa,pdfversion=1.\thepdfminorversion}%
+ \edef\pdfx at pdfAE@opts at luatex{\pdfx at luatest,pdfa,pdfversion=1.\thepdfminorversion}%
+ \edef\pdfx at pdfAE@opts at pdfmark{pdfmark,pdfa,pdfversion=1.\thepdfminorversion}%
+\fi
+\pdfx at tmptoks{}%
+
+\ifpdfx at x
+ \@ifpackageloaded{hyperref}{%
+  \ifxetex
+   \expandafter\hypersetup\expandafter{\pdfx at pdfX@opts at xetex}
+  \else\ifluatex
+   \expandafter\hypersetup\expandafter{\pdfx at pdfX@opts at luatex}
+  \else
+   \expandafter\hypersetup\expandafter{\pdfx at pdfX@opts at pdftex}
+  \fi\fi
+ }{%
+  \ifxetex
+   \expandafter\RequirePackage\expandafter[\pdfx at pdfX@opts at xetex]{hyperref}
+  \else\ifluatex
+   \expandafter\RequirePackage\expandafter[\pdfx at pdfX@opts at luatex]{hyperref}
+  \else
+   \expandafter\RequirePackage\expandafter[\pdfx at pdfX@opts at pdftex]{hyperref}
+  \fi\fi
+ }%
+\else
+ \ifpdfx at e
+  \@ifpackageloaded{hyperref}{%
+   \ifxetex
+    \expandafter\hypersetup\expandafter{\pdfx at pdfAE@opts at xetex}
+   \else\ifluatex
+    \expandafter\hypersetup\expandafter{\pdfx at pdfAE@opts at luatex}
+   \else
+    \expandafter\hypersetup\expandafter{\pdfx at pdfAE@opts at pdftex}
+   \fi\fi
+  }{%
+   \ifxetex
+    \expandafter\RequirePackage\expandafter[\pdfx at pdfAE@opts at xetex]{hyperref}
+   \else\ifluatex
+    \expandafter\RequirePackage\expandafter[\pdfx at pdfAE@opts at luatex]{hyperref}
+   \else
+    \expandafter\RequirePackage\expandafter[\pdfx at pdfAE@opts at pdftex]{hyperref}
+   \fi\fi
+  }%
+ \else % generating PDF/A or ...
+  \@ifpackageloaded{hyperref}{%
+   \ifxetex
+    \expandafter\hypersetup\expandafter{\pdfx at pdfAE@opts at xetex}%
+   \else\ifluatex
+    \expandafter\hypersetup\expandafter{\pdfx at pdfAE@opts at luatex}%
+   \else
+    \expandafter\hypersetup\expandafter{\pdfx at pdfAE@opts at pdftex}%
+   \fi\fi
+  }{%
+   \ifxetex
+    \expandafter\RequirePackage\expandafter[\pdfx at pdfAE@opts at xetex]{hyperref}
+   \else\ifluatex
+    \expandafter\RequirePackage\expandafter[\pdfx at pdfAE@opts at luatex]{hyperref}
+   \else
+    \expandafter\RequirePackage\expandafter[\pdfx at pdfAE@opts at pdftex]{hyperref}
+   \fi\fi
+ }%
+\fi\fi
+\hypersetup{pdfencoding=auto}%  unicode
+\expandafter\ifx\csname KV at Hyp@psdextra\endcsname\relax\else
+ \hypersetup{psdextra}
+\fi
+
+%% hyperref doesn't set the minor version for XeTeX
+\ifxetex
+ \special{pdf:minorversion \thepdfminorversion}
+\fi
+
+\ifx\xmp at CreatorTool\@empty
+ \edef\xmp at CreatorTool{\@pdfcreator}
+\fi
+
+\newif\ifpdfx at cmyk
+\newif\ifpdfx at custom
+\ifpdfx at x   %  PDF/X  normally needs a CMYK color profile for printing
+ \global\pdfx at cmyktrue
+\fi
+%%----------------------------------------------------------------------
+%% -----   Color Profiles  -------
+%% Define how to specify the profile, so the default
+%% can be over-ridden in the  .xmpdata  file.
+%%
+%%   --- user-command ---   RGB profile needed with  PDF/A-??
+%% \setRGBcolorprofile{<filename>}{<identifier>}
+%%    {<info string>}{<registry URL>}
+\def\setRGBcolorprofile{%
+ \begingroup
+  \catcode`\_ 11\relax\catcode`\& 11\relax\catcode`\~ 11\relax
+  \catcode`\% 11\relax
+  \edef\({\string\(}\edef\){\string\)}%
+  \pdfx at setrgbprofile}
+%%
+%%  --- user-command ---   CMYK profile needed with  PDF/X-??
+%% \setCMYKcolorprofile{<filename>}{<output intent>}
+%%    {<identifier>}{<registry URL>}
+\def\setCMYKcolorprofile{%
+ \begingroup
+  \catcode`\_ 11\relax\catcode`\& 11\relax\catcode`\~ 11\relax
+  \catcode`\% 11\relax
+  \edef\({\string\(}\edef\){\string\)}%
+  \pdfx at setcmykprofile}
+%%
+%%  --- user-command ---   DeviceGray profile needed with  PDF/E-1
+%% \setGRAYcolorprofile{<filename>}{<output intent>}
+%%    {<identifier>}{<registry URL>}
+\def\setGRAYcolorprofile{%
+ \begingroup
+  \catcode`\_ 11\relax\catcode`\& 11\relax\catcode`\~ 11\relax
+  \catcode`\% 11\relax
+  \edef\({\string\(}\edef\){\string\)}%
+  \pdfx at setgrayprofile}
+%%
+%%  --- user-command ---  External profile with  PDF/X-4p and PDF/X-5pg
+%% \setEXTERNALprofile{<profilename>}{<output intent>}
+%%    {<identifier>}{<registry URL>}{<color-space>}%
+%%    {<ICC Version>}{<provider URL>}{<extra info>}{<Check Sum>}
+\def\setEXTERNALprofile{%
+ \begingroup
+  \catcode`\_ 11\relax\catcode`\& 11\relax\catcode`\~ 11\relax
+  \catcode`\% 11\relax
+  \edef\({\string\(}\edef\){\string\)}%
+  \ifno at iccprofile
+   \expandafter\pdfx at externalprofile
+   \else
+    \expandafter\pdfx at externalprofile@gobble
+   \fi
+  }
+%%
+%%
+\def\pdfx at setRGBcolorprofiledir#1{%
+ \xdef\pdfx at RGBcolorprofiledir{#1}%
+}
+\def\pdfx at setCMYKcolorprofiledir#1{%
+ \xdef\pdfx at CMYKcolorprofiledir{#1}%
+}
+\pdfx at setRGBcolorprofiledir{}
+\pdfx at setCMYKcolorprofiledir{}
+
+%% This does indeed work!  Use it in  .xmpdata  files
+\providecommand{\MacOSColordir}{/System/Library/ColorSync/Profiles/}
+\providecommand{\MacOSLibraryColordir}{/Library/ColorSync/Profiles/}
+\providecommand{\AdobeMacOSdir}%
+  {/Library/Application Support/Adobe/Color/Profiles/Recommended/}
+\edef\pdfx at tmp{C:\string\Windows\string\System32\string\Spool%
+  \string\Drivers\string\Color\string/}
+\expandafter\providecommand\expandafter
+  {\expandafter\WindowsColordir\expandafter}\expandafter{\pdfx at tmp}
+%%\pdfx at setcolorprofiledir{\AdobeMacOSdir}
+
+%% overide that value using the following commands:
+\let\pdfxSetCMYKcolorProfileDir\pdfx at setCMYKcolorprofiledir
+\let\pdfxSetRGBcolorProfileDir\pdfx at setRGBcolorprofiledir
+%%  for back-compatibility
+\let\pdfxSetColorProfileDir\pdfxSetCMYKcolorProfileDir
+%%
+\def\pdfx at setrgbprofile#1#2#3#4{%
+ \xdef\pdfx at rgb@profile{\pdfx at RGBcolorprofiledir#1}%  valid file path/name
+ \xdef\pdfx at rgb@profilename{#1}%  valid file name
+ \gdef\pdfx at rgb@identifier{#2}%
+ \gdef\pdfx at rgb@info{#3}%
+ \pdfstringdef\pdfx at rgb@registry{#4}%  valid URL
+ \endgroup
+ \global\pdfx at cmykfalse
+ }%  closes-off  \setRGBcolorprofile
+%%
+\def\pdfx at setcmykprofile#1#2#3#4{%
+ \xdef\pdfx at cmyk@profile{\pdfx at CMYKcolorprofiledir#1}%  valid file path/name
+ \xdef\pdfx at cmyk@profilename{#1}%  valid file name
+%% \expandafter\gdef\expandafter\pdfx at cmyk@profile\expandafter
+%%    {\pdfx at colorprofiledir#1}%  valid file name
+ \gdef\pdfx at cmyk@intent{#2}%
+%% \pdfstringdef\pdfx at cmyk@intent{#2}%  color intent
+ \gdef\pdfx at cmyk@identifier{#3}%
+%% \pdfstringdef\pdfx at cmyk@identifier{#3}%  text string identifier
+ \gdef\pdfx at cmyk@registry{#4}%
+%% \pdfstringdef\pdfx at cmyk@registry{#4}%  valid URL
+ \endgroup
+ \global\pdfx at cmyktrue
+ }%  closes-off  \setcmykcolorprofile
+%%
+\def\setCUSTOMcolorprofile{%
+ \begingroup
+  \catcode`\_ 11\relax\catcode`\& 11\relax\catcode`\~ 11\relax
+  \catcode`\% 11\relax
+  \edef\({\string\(}\edef\){\string\)}%
+  \pdfx at setcustomprofile
+}
+\def\pdfx at setcustomprofile#1#2#3#4#5#6#7#8{%
+ \xdef\pdfx at customcolorprofiledir{#2}% valid directory location
+ \xdef\pdfx at custom@profile{#1}%  valid file name
+ \gdef\pdfx at custom@identifier{#3}%
+ \gdef\pdfx at custom@registry{#4}%
+ \gdef\pdfx at custom@numcolors{#5}% num-colors specifier
+ \gdef\pdfx at iccversion{#6}%  Hex string for /ICCVersion < ... >
+ \gdef\pdfx at custom@colornames{#7}%
+ \gdef\pdfx at profile@checksum{#8}%  Hex string for /CheckSum < ... >
+\endgroup
+ \global\pdfx at cmykfalse
+ \global\pdfx at customtrue
+ }%  closes-off  \pdfx at setcustomprofile
+%%
+\def\pdfx at setgrayprofile#1#2#3#4{%
+ \gdef\pdfx at gray@profile{#1}%  valid file name
+ \gdef\pdfx at gray@intent{#2}%
+ \gdef\pdfx at gray@identifier{#3}%
+ \pdfstringdef\pdfx at gray@registry{#4}%  valid URL
+ \endgroup}%  closes-off  \setGRAYcolorprofile
+%%
+\def\pdfx at externalprofile#1#2#3#4#5#6#7#8#9{%
+ \gdef\pdfx at extprofile{#1}% PDF string for /ProfileName
+ \gdef\pdfx at cmyk@intent{#2}% PDF string for /OutputCondition
+ \gdef\pdfx at cmyk@identifier{#3}% PDF string for /OutputConditionIdentifier
+ \gdef\pdfx at cmyk@registry{#4}% {http://www.color.org}%
+ \gdef\pdfx at profileCS{#5}%  4 bytes for /ProfileCS
+ \gdef\pdfx at iccversion{#6}%  Hex string for /ICCVersion < ... >
+ \gdef\pdfx at colorURL{#7}%  URL
+ \gdef\pdfx at cmyk@info{#8}%  for /Info
+ \gdef\pdfx at profile@checksum{#9}%  Hex string for /CheckSum < ... >
+ \endgroup}%  closes-off  \setEXTERNALprofile
+\def\pdfx at externalprofile@gobble#1#2#3#4#5#6#7#8#9{%
+  \PackageError{pdfx}{Wrong option for using an External Color profile}%
+   {Use one of the options: x-4p , x-4p08 , x-4p10 or  x-5pg .}%
+ \endgroup}
+%%
+%% default color profiles
+
+{\catcode`\_ 12 \catcode`\& 12 \catcode`\~ 12
+ \gdef\pdfx at xprofile@cmykdefault{coated_FOGRA39L_argl.icc}
+ \gdef\pdfx at aprofile@rgbdefault{sRGB_IEC61966-2-1_black_scaled.icc}
+ \gdef\pdfx at eprofile@graydefault{Gray_linear.icc}
+ \gdef\pdfx at pprofile@externaldefault{FOGRA39}
+}% end of \catcode
+\xdef\pdfx at rgb@profile{\pdfx at aprofile@rgbdefault}
+\xdef\pdfx at cmyk@profile{\pdfx at xprofile@cmykdefault}
+\xdef\pdfx at gray@profile{\pdfx at eprofile@graydefault}
+\xdef\pdfx at external@profile{\pdfx at pprofile@externaldefault}
+
+%%----------------------------------------------------------------------
+%% License for the file  sRGB_IEC61966-2-1_black_scaled.icc :
+%%
+%% Copyright International Color Consortium, 2009  -- http://www.color.org/
+%%
+%% It is hereby acknowledged that the file "sRGB_IEC61966-2-1_black_scaled.icc"
+%% is provided "AS IS" WITH NO EXPRESS OR IMPLIED WARRANTY.
+%%
+%% Licensing
+%%
+%% This profile is made available by the International Color Consortium,
+%% and may be copied, distributed, embedded, made, used, and sold without
+%% restriction. Altered versions of this profile shall have the original
+%% identification and copyright information removed and shall not be
+%% misrepresented as the original profile.
+%%
+%% Terms of use
+%%
+%% To anyone who acknowledges that the file "sRGB_IEC61966-2-1_black_scaled.icc"
+%% is provided "AS IS" WITH NO EXPRESS OR IMPLIED WARRANTY, permission to use,
+%% copy and distribute these file for any purpose is hereby granted without fee,
+%% provided that the file is not changed including the ICC copyright notice tag,
+%% and that the name of ICC shall not be used in advertising or publicity
+%% pertaining to distribution of the software without specific, written prior
+%% permission. ICC makes no representations about the suitability of this
+%% software for any purpose.
+%%
+%%----------------------------------------------------------------------
+
+\newif\ifpdfx at tryoldprofiles
+
+%%  The  colorprofiles package was added to  TeXLive  in October 2018.
+%%  It allows the default Color Profiles to be maintained independent
+%%  of the  pdfx  package.
+%%  In particular  sRGB_IEC61966-2-1_black_scaled.icc  is no longer
+%%  distributed with TeXLive 2018 and later.
+%%  Older versions still have this file.
+%%
+\IfFileExists{colorprofiles.tex}{%
+  \RequirePackage{colorprofiles}[2018/11/01]%
+  \ifx\colorpro at rgb@profile\relax
+    \expandafter\pdfx at tryoldprofilestrue
+   \else
+    \begingroup %%  \endgroup occurs within the macro expansion
+     \pdfx at setrgbprofile{\colorpro at rgb@profile
+     }{\colorpro at rgb@identifier
+     }{\colorpro at rgb@info
+     }{\colorpro at rgb@registry
+     }%
+    \begingroup %%  \endgroup occurs within the macro expansion
+    \pdfx at setcmykprofile{\colorpro at cmyk@profile
+     }{\colorpro at cmyk@intent
+     }{\colorpro at cmyk@identifier
+     }{\colorpro at cmyk@registry
+     }%
+    \expandafter\pdfx at tryoldprofilesfalse
+   \fi
+}{\pdfx at tryoldprofilestrue}
+
+{\catcode`\| 14 \catcode`\% 12 \catcode`\_ 12 \catcode`\: 12
+ \catcode`\. 12 \catcode`\- 12 \catcode`\/ 12
+ \edef\@bchar{\expandafter\@gobble\string\\}|
+ \edef\({\string\(}\edef\){\string\)}|
+\ifpdfx at tryoldprofiles
+ || this will be used by TeXLive installations up to 2017.
+ \begingroup | \endgroup occurs within the macro expansion
+\expandafter\pdfx at setrgbprofile\expandafter
+ {sRGB_IEC61966-2-1_black_scaled.icc}|
+ {sRGB_IEC61966-2-1_black_scaled}|
+ {sRGB IEC61966 v2.1 with black scaling}|
+ {http://www.color.org}|
+ \begingroup | \endgroup occurs within the macro expansion
+\pdfx at setcmykprofile{coated_FOGRA39L_argl.icc}| coated_FOGRA39L_argl.icc
+ {Coated FOGRA39}|
+ {FOGRA39 \string\(ISO Coated v2 300%\space \string\(ECI\string\)\string\)}|
+ {http://www.argyllcms.com/}|{http://www.color.org}|
+\fi  ||  end of   \ifpdfx at tryoldprofiles
+ \begingroup | \endgroup occurs within the macro expansion
+\pdfx at setgrayprofile{Gray_linear.icc}|
+ {}|
+ {Custom}|
+ {http://www.freedesktop.org/wiki/OpenIcc}|
+\ifno at iccprofile
+ \begingroup | \endgroup occurs within the macro expansion
+  \pdfx at externalprofile{Coated FOGRA39 \(ISO 12647-2:2004\)}|
+   {Offset commercial and specialty printing according to ISO 12647-2:2004 |
+    / Amd 1, paper type 1 or 2 \(gloss or matte coated offset, 115 g/m2\), |
+    screen frequency 60/cm.}|
+   {FOGRA39}{http://www.color.org}{CMYK}{02100000}{http://www.adobe.com}|
+   {Coated FOGRA39 \(ISO 12647-2:2004\)}{74FF62F330BF0DBE4495B5720542D511}|
+\fi
+}% end of \catcode
+
+%%
+%%----------------------------------------------------------------------
+%% License for the file  coated_FOGRA39L_argl.icc :
+%%
+%% The zlib/libpng License
+%%
+%% Copyright (c) 2008 Kai-Uwe Behrmann
+%%
+%% This software is provided 'as-is', without any express or implied
+%% warranty. In no event will the authors be held liable for any damages
+%% arising from the use of this software.
+%%
+%% Permission is granted to anyone to use this software for any purpose,
+%% including commercial applications, and to alter it and redistribute
+%% it freely, subject to the following restrictions:
+%%
+%%    1. The origin of this software must not be misrepresented; you
+%%    must not claim that you wrote the original software. If you use
+%%    this software in a product, an acknowledgment in the product
+%%    documentation would be appreciated but is not required.
+%%
+%%    2. Altered source versions must be plainly marked as such, and
+%%    must not be misrepresented as being the original software.
+%%
+%%    3. This notice may not be removed or altered from any source
+%%    distribution.
+%%----------------------------------------------------------------------
+
+\newif\ifexternalICCprofiles
+\newif\ifpdfx at noXMPdata
+
+\begingroup
+%% override unneeded color-profile specifier
+ \ifpdfx at x
+  \ifno at iccprofile %  PDF/X-4p and PDF/X-5pg  PDF/VT-2
+   \begingroup
+    \def\pdfx at extprofiles@store{AdobeExternalProfiles.tex}%
+    \InputIfFileExists{\pdfx at extprofiles@store}%
+     {\global\externalICCprofilestrue \catcode `\# 12\relax}%
+     {\typeout{** pdfx: No file \pdfx at extprofiles@store\space
+       found for PDF/X-4p or PDF/X-5pg}}%
+   \endgroup
+  \else
+   \begingroup
+    \def\pdfx at profiles@store{AdobeColorProfiles.tex}%
+    \InputIfFileExists{\pdfx at profiles@store}%
+     {\global\externalICCprofilesfalse \catcode `\# 12\relax}%
+     {\typeout{** pdfx: No file \pdfx at profiles@store\space
+       found for PDF/X variants}}%
+   \endgroup
+%%   \def\setRGBcolorprofile#1#2#3#4{%
+%%    \PackageError{pdfx}{PDF/X requires a CMYK color profile}%
+%%     {Just continue using the default CMYK profile.^^J}}%
+  \fi
+ \else
+%% load it, in case the macros are used in .xmpdata
+  \InputIfFileExists{AdobeColorProfiles.tex}{}{}%
+  \ifpdfx at e
+  \else
+   \def\setCMYKcolorprofile#1#2#3#4{}%
+   \def\setGRAYcolorprofile#1#2#3#4{}%
+ \fi\fi
+%%
+ \ifluatex\else\ifxetex\else
+  \inputencoding{8bit}%
+ \fi\fi
+ \makeatletter
+ \pdfx at localcommands
+%% Do this in a box, so any stray characters don't get into TeX's lists.
+\setbox0\hbox{%
+ \InputIfFileExists{\jobname.xmpdata}%
+  {\typeout{** pdfx: Metadata file \jobname.xmpdata  read successfully.}}%
+  {\typeout{** pdfx: No file  \jobname.xmpdata .
+    Metadata will be incomplete!}\aftergroup\pdfx at noXMPdatatrue}}
+\endgroup
+%% ----------------------------------------------------------------------
+
+\def\pdfx at LanguageSpec{}
+\def\pdfx at mainLanguage{en-US}%  absolute default
+\def\pdfx at checkfor@sep#1#2\sep#3\pdfx at endparse{\def#1{#2}}
+\ifx\@empty\xmp at Language\else
+ \expandafter\pdfx at checkfor@sep\expandafter\pdfx at mainLanguage\xmp at Language
+  \sep\pdfx at endparse
+\fi
+\edef\pdfx at LanguageSpec{/Lang (\pdfx at mainLanguage)}
+
+%% ----------------------------------------------------------------------
+\begingroup
+ \catcode`\_ 12 \catcode`\" 12 \catcode`\' 12
+ \catcode`\< 12 \catcode`\> 12 \catcode`\/ 12 \catcode`\[ 12 \catcode`\] 12
+ \edef\@pctchar{\expandafter\@gobble\string\%}
+ \edef\@bchar{\expandafter\@gobble\string\\}
+ \edef\0{\string\0}
+ \edef\({\string\(}
+ \edef\){\string\)}
+%%
+ \def\pdfx at outcatalog@dict{%
+  \pdfx at LanguageSpec
+  /ViewerPreferences <</DisplayDocTitle true >>
+  /OutputIntents \pdfx at outintents % needs appropriate expansion
+ }%
+\ifpdfx at x   %  PDF/X  needs a CMYK or RGB color profile for printing
+ \ifno at iccprofile %  PDF/X-4p and PDF/X-5pg
+%%
+%% URL and metadata for the desired external Color Profile
+%%
+  \edef\pdfx at colorURL@dict{<</FS/URL/F(\pdfx at colorURL)>>}
+  \def\pdfx at colorprofile@dict{<< %
+     /CheckSum <\pdfx at profile@checksum>^^J%
+     /ICCVersion <\pdfx at iccversion>%
+     /ProfileCS (\pdfx at profileCS)^^J%
+     /ProfileName (\pdfx at extprofile)^^J%
+     /URLs [\OBJ at URLs] >>
+  }
+%% How to specify the PDF objects with different drivers
+  \ifxetex
+   \def\OBJ at URLs{ @colorURL }%
+   \def\OBJ at ICC{ @colorprofile }%
+   \immediate\special{pdf:obj \OBJ at URLs \pdfx at colorURL@dict }%
+   \immediate\special{pdf:obj \OBJ at ICC \pdfx at colorprofile@dict }%
+  \else %  pdfTeX & LuaTeX
+   \immediate\pdfobj{\pdfx at colorURL@dict}%
+   \edef\OBJ at URLs{\the\pdflastobj\space 0 R}%
+   \immediate\pdfobj{\pdfx at colorprofile@dict}%
+   \edef\OBJ at ICC{\the\pdflastobj\space 0 R}%
+  \fi
+%%  Output Intent dictionary, with object reference
+  \edef\pdfx at outintent@dict{%
+    /Type/OutputIntent
+    /S/GTS_PDFX^^J
+    /OutputCondition (\pdfx at cmyk@intent)^^J
+    /OutputConditionIdentifier (\pdfx at cmyk@identifier)^^J
+    /Info(\pdfx at cmyk@intent)^^J
+    /RegistryName(\pdfx at cmyk@registry)^^J
+%% extra dictionary required for  PDF/X-4p and PDF/X-5pg
+    /DestOutputProfileRef \OBJ at ICC
+  }%
+%%
+ \else  %  PDF/X-1 , PDF/X-1a , PDF/X-3 , PDF/X-4 , PDF/X-5g
+%%
+  \ifpdfx at cmyk
+   \IfFileExists{"\pdfx at cmyk@profile"}{%
+  %  embedded CMYK color profile
+  %%
+  %%  Output Intent dictionary, with object reference
+  \def\pdfx at outintent@dict{%
+    /Type/OutputIntent
+    /S/GTS_PDFX^^J
+    /OutputCondition (\pdfx at cmyk@intent)^^J
+    /OutputConditionIdentifier (\pdfx at cmyk@identifier)^^J
+    /Info(\pdfx at cmyk@intent)^^J
+    /RegistryName(\pdfx at cmyk@registry)
+    /DestOutputProfile \OBJ at CMYK
+   }%
+  \def\pdfx at numcoords{/N 4}%
+%%
+  \ifxetex
+   \def\OBJ at CMYK{@colorprofile}%
+   \immediate\special{%
+     pdf:fstream \OBJ at CMYK (\pdfx at cmyk@profile) <<\pdfx at numcoords >>}%
+  \else % pdfTeX
+   \immediate\pdfobj stream attr{\pdfx at numcoords} file {\pdfx at cmyk@profile}%
+   \edef\OBJ at CMYK{\the\pdflastobj\space 0 R}%
+  \fi
+  \pdfcatalog{%
+   \pdfx at LanguageSpec
+   /OutputIntents [ <<
+   /Type/OutputIntent
+   /S/GTS_PDFX
+   /OutputCondition (\pdfx at cmyk@intent)%
+   /OutputConditionIdentifier (\pdfx at cmyk@identifier)%
+   /Info(\pdfx at cmyk@intent)%
+   /RegistryName(\pdfx at cmyk@registry)
+   /DestOutputProfile \OBJ at CMYK
+   >> ]}%
+  }{%
+   \PackageError{pdfx}{No color profile \pdfx at cmyk@profilename\space found
+     to use for CMYK printing colors.}%
+     {Is this the correct directory: \pdfx at CMYKcolorprofiledir\space  ?}%
+  }% end of \IfFileExists for CMYK
+  \else\ifpdfx at custom
+%%  allow Custom profile with PDF/X-5n
+   \IfFileExists{"\pdfx at customcolorprofiledir\pdfx at custom@profile"}{%
+%%  embedded Custom color profile
+%%
+  %%  Output Intent dictionary, with object reference
+  \def\pdfx at outintent@dict{%
+    /Type/OutputIntent
+    /S/GTS_PDFX^^J
+    /OutputConditionIdentifier (Custom)^^J
+    /OutputCondition (\pdfx at custom@identifier)^^J
+    /Info(\pdfx at custom@profile)^^J
+    /RegistryName(\pdfx at custom@registry)
+    /Registry(\pdfx at custom@registry)
+    /DestOutputProfileRef \OBJ at CustomDir
+   }%
+ \def\OBJ at CustomDir{<<
+   \pdfx at numcoords^^J
+    /URLs [ << /Type /Filespec ^^J/EF \OBJ at CustomFile^^J
+     /F (\pdfx at custom@profile) /UF (\pdfx at custom@profile)  >>]^^J
+    >>}
+%% need more attributes:
+  \def\pdfx at numcoords{%
+    /CheckSum <\pdfx at profile@checksum>^^J%
+    /ICCVersion <\pdfx at iccversion>%
+    /ProfileName (\pdfx at custom@profile)^^J%
+    /ProfileCS (\pdfx at custom@numcolors)^^J%
+    /ColorantTable [\pdfx at custom@colornames]
+   }%
+  \def\pdfx at custom@filespec{%
+      /Type /EmbeddedFile >>^^J
+      /Subtype (application/vnd.iccprofile )
+  }%
+%%
+  \ifxetex
+   \def\OBJ at CustomFile{@colorprofile}%
+   \immediate\special{pdf:fstream \OBJ at CustomFile
+     (\pdfx at customcolorprofiledir\pdfx at custom@profile) <<\pdfx at custom@filespec >>}%
+  \else % pdfTeX
+   \immediate\pdfobj stream attr{\pdfx at custom@filespec} file %
+     {\pdfx at customcolorprofiledir\pdfx at custom@profile}%
+   \edef\OBJ at CustomFile{\the\pdflastobj\space 0 R}%
+  \fi
+  \pdfcatalog{%
+   \pdfx at LanguageSpec
+   /OutputIntents [ << \pdfx at outintent@dict >>]}%
+  }{%
+    \PackageError{pdfx}%
+     {No color profile \pdfx at custom@profile\space found to use for Custom printing colors.}%
+     {Is this the correct directory: \pdfx at customcolorprofiledir\space  ?}%
+  }% end of \IfFileExists for Custom
+  \global\pdfx at cmyktrue  % for TeX coloring
+%%
+  \else  % allow RGB profile with PDF/X   ???
+   \ifpdfx at noerr
+    \PackageWarning{pdfx}{PDF/X normally requires a CMYK color profile.^^J
+      Assuming RGB profile is of type 'prtr' not 'mntr'.^^J^^J}%
+   \else
+    \PackageError{pdfx}{PDF/X normally requires a CMYK color profile.}%
+      {To use RGB ensure profile is of type 'prtr' not 'mntr'.^^J^^J}%
+   \fi
+   %  embedded RGB color profile
+   %%
+   %%  Output Intent dictionary, with object reference
+   \def\pdfx at outintent@dict{%
+     /Type /OutputIntent
+     /S/GTS_PDFX^^J
+     /OutputConditionIdentifier (\pdfx at rgb@identifier)^^J
+     /DestOutputProfile \OBJ at RGB^^J
+     /Info(\pdfx at rgb@info)^^J
+     /RegistryName(\pdfx at rgb@registry)
+   }%
+   \IfFileExists{"\pdfx at rgb@profile"}{%
+    \def\pdfx at numcoords{/N 3 /Alternate/DeviceRGB}
+    \ifxetex
+     \immediate\special{%
+      pdf:fstream @colorprofile (\pdfx at rgb@profile) << \pdfx at numcoords >>}
+     \def\OBJ at RGB{@colorprofile}%
+    \else
+     \immediate\pdfobj stream attr{\pdfx at numcoords} file{\pdfx at rgb@profile}%
+     \edef\OBJ at RGB{\the\pdflastobj\space 0 R}%
+    \fi
+    \edef\pdfx at outintent@dict{%
+      /Type /OutputIntent
+      /S/GTS_PDFX
+      /OutputConditionIdentifier (\pdfx at rgb@identifier)%
+      /DestOutputProfile \OBJ at RGB
+      /Info(\pdfx at rgb@info)
+      /RegistryName(\pdfx at rgb@registry)
+    }%
+    \ifxetex
+     \def\OBJ at RGB{ @colorprofile }%
+     \immediate\special{%
+       pdf:fstream @colorprofile (\pdfx at rgb@profile) <<\pdfx at numcoords >>}
+    \else  %%     pdfTeX or LuaTeX
+      \immediate\pdfobj stream attr{\pdfx at numcoords} file{\pdfx at rgb@profile}%
+      \edef\OBJ at RGB{\the\pdflastobj\space 0 R}%
+     \fi
+   }{%
+    \PackageError{pdfx}%
+     {No color profile \pdfx at rgb@profilename\space found to use for RGB screen colors.}%
+     {Is this the correct directory: \pdfx at RGBcolorprofiledir\space  ?}%
+   }% end of \IfFileExists for RGB
+   \fi % end of \ifpdfx at custom
+  \fi % end of \ifpdfx at cmyk
+ \fi % end of  \ifno at iccprofile
+%%  end of PDF/X
+\else
+%%  PDF/A and PDF/E  can specify a CMYK profile
+ \expandafter\ifx\expandafter\relax\pdfx at rgb@profile\relax
+  \global\pdfx at cmyktrue
+  \IfFileExists{"\pdfx at cmyk@profile"}{%
+   \def\pdfx at numcoords{/N 4}
+  %  embedded CMYK color profile
+   \ifxetex
+    \def\OBJ at CMYK{@colorprofile}%
+    \special{pdf:fstream @colorprofile (\pdfx at cmyk@profile) <<\pdfx at numcoords >>}
+   \else  %% pdfTeX or LuaTeX
+    \immediate\pdfobj stream attr{\pdfx at numcoords} file{\pdfx at cmyk@profile}%
+    \edef\OBJ at CMYK{\the\pdflastobj\space 0 R}%
+   \fi
+   \edef\pdfx at outintent@dict{%
+     /Type /OutputIntent
+    \ifpdfx at e
+     /S/ISO_PDFE1
+    \else
+     /S/GTS_PDFA1
+    \fi
+    /OutputCondition (\pdfx at cmyk@intent)%  use this or  /Info ?
+    /OutputConditionIdentifier (\pdfx at cmyk@identifier)%
+    /DestOutputProfile \OBJ at CMYK
+    /Info(\pdfx at cmyk@intent)%
+    /RegistryName(\pdfx at cmyk@registry)
+  }%
+ }{%
+   \PackageError{pdfx}{No color profile \pdfx at cmyk@profilename\space found
+     to use for CMYK printing colors.}%
+     {Is this the correct directory: \pdfx at CMYKcolorprofiledir\space  ?}%
+ }% end of \IfFileExists for CMYK
+ \else
+%%  PDF/A and PDF/E  usually need an RGB color profile for on-screen rendering
+ \global\pdfx at cmykfalse
+  \expandafter\IfFileExists\expandafter{\pdfx at rgb@profile}{%
+   \def\pdfx at numcoords{/N 3 /Alternate/DeviceRGB}
+  \ifxetex
+    \def\OBJ at RGB{ @colorprofile }%
+    \immediate\special{pdf:fstream @colorprofile (\pdfx at rgb@profile) <<\pdfx at numcoords >>}
+  \else
+    \immediate\pdfobj stream attr{\pdfx at numcoords} file{\pdfx at rgb@profile}%
+    \edef\OBJ at RGB{\the\pdflastobj\space 0 R}%
+  \fi
+  \edef\pdfx at outintent@dict{%
+    /Type /OutputIntent
+   \ifpdfx at e
+    /S/ISO_PDFE1
+   \else
+    /S/GTS_PDFA1
+   \fi
+    /OutputConditionIdentifier (\pdfx at rgb@identifier)%
+    /DestOutputProfile \OBJ at RGB
+    /Info(\pdfx at rgb@info)
+    /RegistryName(\pdfx at rgb@registry)
+  }%
+ }{%
+   \PackageError{pdfx}%
+    {No color profile \pdfx at rgb@profilename\space found to use for RGB screen colors.}%
+    {Is this the correct directory: \pdfx at RGBcolorprofiledir\space  ?}%
+ }% end of \IfFileExists for RGB
+ \fi % end of ifx  for PDF/A or PDF/E
+\fi % end of  ifpdfx at x
+%%
+ \expandafter\ifx\csname pdfx at outintent@dict\endcsname\relax
+ \else
+%%
+%% build the OutputIntent array
+%%
+  \ifxetex
+   \def\pdfx at outintents{ @outintentsarray }%
+   \def\pdfx at outintentref{ @outintent at dict }%
+   \immediate\special{pdf:obj \pdfx at outintentref << \pdfx at outintent@dict >>}
+   \immediate\special{pdf:obj \pdfx at outintents [ ]}%
+   \immediate\special{pdf:put \pdfx at outintents \pdfx at outintentref }%
+  \else
+   \immediate\pdfobj{<<\pdfx at outintent@dict>>}%
+   \edef\pdfx at outintents{[\the\pdflastobj\space 0 R]}%
+  \fi
+%%
+%% make the Catalog entry, if not already done
+%%
+  \ifx\pdfx at outcatalog@dict\relax
+  \else
+   \pdfcatalog{\pdfx at outcatalog@dict}%
+  \fi
+\fi  % end of  OutputIntent array and Catalog entry
+\endgroup
+
+%% ----------------------------------------------------------------------
+%% Make a version of \xmp at Keywords and \xmp at Author where \sep has been
+%% replaced by a comma. The first is for the pdf:Keywords property,
+%% which accepts a comma-separated string of keywords, and seems to be
+%% mandatory for PDF/A-1 compliance. The second is for the dc:creator
+%% property. Although it is defined to be a sequence of authors, Adobe
+%% Acrobat will in fact ignore and delete all except the first author.
+%% Therefore, it's safer to always separate authors by commas.
+
+\begingroup
+ \let\pdfx at xmpunimarkup\relax
+ \pdfx at xmpmarkup
+ \ifluatex\else\ifxetex\else
+  \inputencoding{8bit}%
+ \fi\fi
+ \makeatletter
+ \IfFileExists{\pdfx at encodingfile}{%
+  \def\cf at encoding{L8U}\fontencoding{L8U}%
+ }{}%
+ \let\protect\@typeset at protect
+ \pdfx at xmpmarkup %%  !!!!! no longer needed
+%% \xdef\xmp@@Author{\xmp at Author}% no need to expand
+ \global\let\xmp@@Author\xmp at Author
+ \def\sep{; }%  expand to replace \sep   !!!  no longer needed
+%% \xdef\xmp@@Copyright{\xmp at Copyright}%
+ \global\let\xmp@@Copyright\xmp at Copyright
+%% \xdef\xmp@@Keywords{\xmp at Keywords}%
+%% \global\let\xmp@@Keywords\xmp at Keywords
+%% \global\let\xmp at Keywords\@empty %
+ \global\let\xmp@@Keywords\@empty % don't use  pdf:Keywords
+\endgroup
+
+%% ----------------------------------------------------------------------
+\def\xmp at convertDate{\pdfx at getYear}
+{\catcode`\D=12 \catcode`\:=12
+ \gdef\pdfx at getYear D:#1#2#3#4{\edef\pdfx at xYear{#1#2#3#4}\pdfx at getMonth}
+}
+\def\pdfx at getMonth#1#2{\edef\pdfx at xMonth{#1#2}\pdfx at getDay}
+\def\pdfx at getDay#1#2{\edef\pdfx at xDay{#1#2}\pdfx at getHour}
+\def\pdfx at getHour#1#2{\edef\pdfx at xHour{#1#2}\pdfx at getMin}
+\def\pdfx at getMin#1#2{\edef\pdfx at xMin{#1#2}\pdfx at getSec}
+\def\pdfx at getSec#1#2{\edef\pdfx at xSec{#1#2}\pdfx at getTZh}
+\def\pdfx at getTZh{\futurelet\pdfx at next\pdfx at getTzh@branches}
+
+{\catcode`\@=11 \catcode`\Z=12 \catcode`\+=12 \catcode`\-=12
+\gdef\pdfx at getTzh@branches{%
+ \ifx\pdfx at next Z\let\pdfx at getTzbranch\pdfx at getTznozone
+ \else\ifx\pdfx at next +\let\pdfx at getTzbranch\pdfx at getTzplus
+ \else\ifx\pdfx at next -\let\pdfx at getTzbranch\pdfx at getTzminus
+ \else\let\pdfx at getTzbranch\pdfx at getTzerror
+ \fi\fi\fi \pdfx at getTzbranch }
+
+\catcode`\0=12
+\gdef\pdfx at getTznozone Z#1\pdfx at getTzend{%
+ \edef\pdfx at xTzh{+00}\edef\pdfx at xTzm{00}}
+\gdef\pdfx at getTzplus +#1'#2'#3\pdfx at getTzend{%
+ \edef\pdfx at xTzh{+#1}\edef\pdfx at xTzm{#2}%
+ \ifx\relax#2\relax\def\pdfx at xTzm{00}\fi}
+\gdef\pdfx at getTzminus -#1'#2'#3\pdfx at getTzend{%
+ \edef\pdfx at xTzh{-#1}\edef\pdfx at xTzm{#2}%
+ \ifx\relax#2\relax\def\pdfx at xTzm{00}\fi}
+%%
+%% How to support XeTeX here ?
+\expandafter\ifx\csname pdfcreationdate\endcsname\relax
+%% \xdef\pdfx at convDate{2016-04-01}%  April fool!
+%% \xdef\xmp at convDate{2016-04-01}%  April fool!
+\else
+ \expandafter\expandafter\expandafter\xmp at convertDate\pdfcreationdate''\pdfx at getTzend
+ \xdef\pdfx at convDate{\pdfx at xYear\pdfx at xMonth\pdfx at xDay\pdfx at xHour
+  \pdfx at xMin\pdfx at xSec\pdfx at xTzh'\pdfx at xTzm'}%
+ \xdef\xmp at convDate{\pdfx at xYear-\pdfx at xMonth-\pdfx at xDay
+  T\pdfx at xHour:\pdfx at xMin:\pdfx at xSec\pdfx at xTzh:\pdfx at xTzm}%
+\fi
+}% end of \catcode
+
+%% ----------------------------------------------------------------------
+%% \pdfx at topdfstring\toka\tokb: Convert the string in \tokb to a format
+%% appropriate for PDF /Info strings, i.e., PDFDoc encoding or UTF-16
+%% encoding, and store the result in \toka As a special case, if \tokb
+%% is \@empty, set \toka to \@empty.
+
+\def\pdfx at topdfstring#1#2{%
+ \ifx#2\@empty
+  \global\let#1\empty
+ \else
+  \begingroup
+   \ifluatex\else\ifxetex\else
+    \inputencoding{utf8}%
+   \fi\fi
+   \hypersetup{pdfencoding=auto}%
+   \pdfstringdef#1{#2}%
+  \endgroup
+ \fi
+}
+
+%% ----------------------------------------------------------------------
+%% if high-bit characters are already encoded as active
+%% then  \pdfstringdef  probably changes their meaning
+%% so save these for later reversion.
+%%
+\newif\ifpdf at activechars
+{\ifnum\catcode`^^c0 = 13\relax \aftergroup\pdf at activecharstrue\fi}%
+%%
+%% normally not used with XeTeX or LuaTeX
+%%
+
+\ifpdf at activechars
+ \global\let\pdfx at save@co ^^c0\relax
+ \global\let\pdfx at save@ci ^^c1\relax
+ \global\let\pdfx at save@cii ^^c2\relax
+ \global\let\pdfx at save@ciii ^^c3\relax
+ \global\let\pdfx at save@civ ^^c4\relax
+ \global\let\pdfx at save@cv ^^c5\relax
+ \global\let\pdfx at save@cvi ^^c6\relax
+ \global\let\pdfx at save@cvii ^^c7\relax
+ \global\let\pdfx at save@cviii ^^c8\relax
+ \global\let\pdfx at save@cix ^^c9\relax
+ \global\let\pdfx at save@ca ^^ca\relax
+ \global\let\pdfx at save@cb ^^cb\relax
+ \global\let\pdfx at save@cc ^^cc\relax
+ \global\let\pdfx at save@cd ^^cd\relax
+ \global\let\pdfx at save@ce ^^ce\relax
+ \global\let\pdfx at save@cf ^^cf\relax
+ \global\let\pdfx at save@do ^^d0\relax
+ \global\let\pdfx at save@di ^^d1\relax
+ \global\let\pdfx at save@dii ^^d2\relax
+ \global\let\pdfx at save@diii ^^d3\relax
+ \global\let\pdfx at save@div ^^d4\relax
+ \global\let\pdfx at save@dv ^^d5\relax
+ \global\let\pdfx at save@dvi ^^d6\relax
+ \global\let\pdfx at save@dvii ^^d7\relax
+ \global\let\pdfx at save@dviii ^^d8\relax
+ \global\let\pdfx at save@dix ^^d9\relax
+ \global\let\pdfx at save@da ^^da\relax
+ \global\let\pdfx at save@db ^^db\relax
+ \global\let\pdfx at save@dc ^^dc\relax
+ \global\let\pdfx at save@dd ^^dd\relax
+ \global\let\pdfx at save@de ^^de\relax
+ \global\let\pdfx at save@df ^^df\relax
+ \global\let\pdfx at save@eo ^^e0\relax
+ \global\let\pdfx at save@ei ^^e1\relax
+ \global\let\pdfx at save@eii ^^e2\relax
+ \global\let\pdfx at save@eiii ^^e3\relax
+ \global\let\pdfx at save@eiv ^^e4\relax
+ \global\let\pdfx at save@ev ^^e5\relax
+ \global\let\pdfx at save@evi ^^e6\relax
+ \global\let\pdfx at save@evii ^^e7\relax
+ \global\let\pdfx at save@eviii ^^e8\relax
+ \global\let\pdfx at save@eix ^^e9\relax
+ \global\let\pdfx at save@ea ^^ea\relax
+ \global\let\pdfx at save@eb ^^eb\relax
+ \global\let\pdfx at save@ec ^^ec\relax
+ \global\let\pdfx at save@ed ^^ed\relax
+ \global\let\pdfx at save@ee ^^ee\relax
+ \global\let\pdfx at save@ef ^^ef\relax
+ \global\let\pdfx at save@fo ^^f0\relax
+ \global\let\pdfx at save@fi ^^f1\relax
+ \global\let\pdfx at save@fii ^^f2\relax
+ \global\let\pdfx at save@fiii ^^f3\relax
+\fi
+
+%% ----------------------------------------------------------------------
+%% detect when \sep is used for multiple authors
+%% then suppress the /Author field in PDF /Info
+\newif\ifpdfx at sep@infield@
+\let\pdfx at endparse\relax
+\def\pdfx at parseforsep#1\sep#2\pdfx at endparse{%
+ \pdfx at sep@infield at false
+ \ifx\relax#2\relax\else\pdfx at sep@infield at true\fi
+}
+
+\begingroup
+ \let\CATCODE\catcode
+ \let\ENDGROUP\endgroup
+ \let\GDEF\gdef
+ \CATCODE`\m 12 \CATCODE`\a 12 \CATCODE`\c 12 \CATCODE`\r 12 \CATCODE`\o 12
+ \CATCODE`\: 12 \CATCODE`\- 12 \CATCODE`\> 12
+ \GDEF\pdfx at DOSTRIP@MACRO macro:->#1\@{#1}%
+\ENDGROUP
+\def\pdfx at strip@macro#1{%
+  \expandafter\edef\expandafter#1\expandafter{%
+    \expandafter\pdfx at DOSTRIP@MACRO\meaning#1\@}%
+}
+
+%% Convert the relevant XMP properties to PDF strings, expanding markup
+%% (such as \sep, \&, \copyright, etc) in an appropriate way.
+%% These PDF strings are actually not always necessary, but if supplied they
+%% must match exactly what is in the XMP version. This may be impossible
+%% if math symbols are used; e.g. Plane-1 alphanumerics.
+%% Generally, it is better to *not* provide PDF-info strings;
+%% instead just providing metadata through XMP.
+%% This is not always enough — a driver may add it by default!
+%%
+%% But some PDF readers don't support XMP, so it is nice to have
+%%  /Info fields, when this can be done reliably.
+%%
+\begingroup
+ \RequirePackage{stringenc}%
+ \expandafter\ifx\csname pdf at escapehex\endcsname\relax
+  \PackageWarning{pdfx}{%
+   Missing an implementation of \string\pdf at escapehex ^^J
+   Translated Metadata cannot be generated as PDF strings.^^J}%
+  \def\pdfx at GeneratePdfString#1#2{}%
+  \def\pdfx at ConvertUTFtoBE#1#2{}%
+ \else
+  \def\pdfx at GeneratePdfString#1#2{%
+   % converts a UTF-8 string to UTF-16be
+   \StringEncodingConvert{#1}{#2}{utf8}{utf16be}%
+   \xdef#1{\string\376\string\377\pdfescapestring{#1}}%
+  }%
+  \def\pdfx at ConvertUTFtoBE#1#2{%
+   \setbox0=\hbox{% catch any rubbish escaping to the MVL
+    \def\cf at encoding{L8U}\fontencoding{L8U}%
+    \ifluatex
+     \let\pdfescapestring\luaescapestring
+    \else\ifxetex\else
+     \inputencoding{8bit}%
+    \fi\fi
+%%    \pdfx at xmpmarkup %% don't want some things
+    \pdfx at xmpunimarkup
+    \let\backslash\textbackslash
+    \edef\pdfx at temp{#2}% ensure XMP expands to UTF8
+    \pdfx at GeneratePdfString{#1}{\pdfx at temp}%
+   }%
+  }%
+ \fi
+ \pdfx at pdfmarkup
+ \global\let\pdfx at pdfAuthor\@empty
+ \global\let\pdfx at pdfTitle\@empty
+ \global\let\pdfx at pdfSubject\@empty
+ \global\let\pdfx at pdfKeywords\@empty
+ \ifpdfx at nopdfinfo  %  transliterated strings present
+%% RRM: this may still work with parser macros   ???
+ \ifluatex
+  %%  \pdf at escapehex   gets it wrong!!
+  %%   Is there a better way ?
+ \else
+  \pdfx at ConvertUTFtoBE\pdfx at pdfTitle\xmp at Title
+  \pdfx at ConvertUTFtoBE\pdfx at pdfSubject\xmp at Subject
+ \fi
+\else
+  \pdfx at topdfstring\pdfx at pdfTitle\xmp at Title
+  \ifpdfx at e\else\ifpdfx at x\else
+   \pdfx at topdfstring\pdfx at pdfSubject\xmp at Subject
+  \fi\fi
+ \fi
+ \pdfx at topdfstring\pdfx at CreatorTool\xmp at CreatorTool
+ \pdfx at topdfstring\pdfx at Producer\xmp at Producer
+%%  \pdfescapestring  needed
+ \expandafter\ifx\csname pdfescapestring\endcsname\relax
+  \else
+    \expandafter\ifx\expandafter\relax\xmp at Author\relax
+    \else
+%%  check for multiple authors with parser macro
+     \expandafter\pdfx at parseforsep\xmp at Author\sep\pdfx at endparse
+     \ifpdfx at sep@infield@
+     \else
+      \pdfx at ConvertUTFtoBE{\pdfx at pdfAuthor}{\xmp at Author}%
+     \fi %% end of  \ifpdfx at sep@infield@
+    \fi  %%  end of  \xmp at Author  test
+    \expandafter\ifx\expandafter\relax\xmp at Keywords\relax
+    \else
+%%  check for multiple keywords with parser macro
+     \expandafter\pdfx at parseforsep\xmp at Keywords\sep\pdfx at endparse
+     \ifpdfx at sep@infield@\else
+      \ifluatex\else
+      \pdfx at ConvertUTFtoBE{\pdfx at pdfKeywords}{\xmp at Keywords}%
+     \fi
+     \fi %% end of  \ifpdfx at sep@infield@
+    \fi  %%  end of  \xmp at Keywords  test
+%%
+  \fi  %%  end of \pdfescapestring  test
+\endgroup
+
+%% Affects CMap creation for certain fonts, according to glyph names
+%%  How to support XeTeX here ?
+%%  Maybe it's best to be using an updated  mmap.sty  ?
+\ifxetex
+\else
+ \input glyphtounicode.tex
+ \input glyphtounicode-cmr.tex
+ \input glyphtounicode-ntx.tex
+ \pdfgentounicode=1
+\fi
+\ifgrkLGRxmp
+ \ifxetex\else
+  \pdfglyphtounicode{internalchar2}{200D}%
+\fi \fi
+
+%% patch to place accents *after* the base character, rather than before
+%%  based on coding from  mmap.sty  by RRM
+\newif\ifPDFX at inaccent
+\let\LTX at add@accent\add at accent
+\def\PDFX at add@accent#1#2{%
+ \hmode at bgroup
+  \let \hmode at start@before at group \@firstofone
+  \setbox\@tempboxa\hbox{\PDFX at inaccenttrue
+   #2\global\mathchardef\accent at spacefactor\spacefactor}%
+  #2\kern-\wd\@tempboxa
+%%  \ifdim\ht\@tempboxa>1ex\relax
+   \dimen@=\ht\@tempboxa\advance\dimen at -1ex\relax
+%%% reduce how much a nested accent is raised
+   \ifPDFX at inaccent\advance\dimen at -.2ex\relax\fi
+   \raise\dimen@\hbox to\wd\@tempboxa{\hss
+    \accent#1{\vphantom{#2}}\hss}%
+%%  \else
+%%  \accent#1{%\vphantom{#2}
+%%   \vrule width\z@ height\ht\@tempboxa depth\dp\@tempboxa}%
+%% \fi
+ \egroup
+ \spacefactor\accent at spacefactor
+}
+
+%% How to support XeTeX here ?
+%%%%%  adjust accent characters to the Unicode Combining variant  %%%%
+\def\PDFX at combiningchars@unicode{%
+ \pdfglyphtounicode{grave}{0300}%
+ \pdfglyphtounicode{acute}{0301}%
+ \pdfglyphtounicode{circumflex}{0302}%
+ \pdfglyphtounicode{tilde}{0303}%
+ \pdfglyphtounicode{macron}{0304}%
+ \pdfglyphtounicode{Macronsmall}{0304}%
+ \pdfglyphtounicode{breve}{0306}%
+ \pdfglyphtounicode{dotaccent}{0307}%
+ \pdfglyphtounicode{Dotaccent}{0307}%
+ \pdfglyphtounicode{Dotaccentsmall}{0307}%
+ \pdfglyphtounicode{dieresis}{0308}%
+ \pdfglyphtounicode{ogonek}{0309}%
+ \pdfglyphtounicode{ring}{030A}%
+ \pdfglyphtounicode{hungarumlaut}{030B}%
+ \pdfglyphtounicode{caron}{030C}%
+ \pdfglyphtounicode{cedilla}{0327}%
+ \pdfglyphtounicode{commaaccent}{0326}%   droid
+ %  tie accents in  berenisadf  lm  stix  and others
+ \pdfglyphtounicode{tieaccentlowercase}{0311}%
+ \pdfglyphtounicode{tieaccentcapital}{0361}%
+ \pdfglyphtounicode{newtieaccentlowercase}{0311}%
+ \pdfglyphtounicode{newtieaccentcapital}{0361}%
+ % cm-unicode
+ \pdfglyphtounicode{space_uni030D}{030D}%
+ \pdfglyphtounicode{space_uni030E}{030E}%
+ \pdfglyphtounicode{space_uni030F}{030F}%
+ \pdfglyphtounicode{space_uni0311}{0311}%
+ \pdfglyphtounicode{space_uni0321}{0321}%
+ \pdfglyphtounicode{space_uni0322}{0322}%
+ \pdfglyphtounicode{space_uni032A}{032A}%
+ \pdfglyphtounicode{space_uni032B}{032B}%
+ \pdfglyphtounicode{space_uni0335}{0335}%
+ \pdfglyphtounicode{space_uni0337}{0337}%
+ \pdfglyphtounicode{space_uni033A}{033A}%
+ \pdfglyphtounicode{space_uni033B}{033B}%
+ \pdfglyphtounicode{space_uni033C}{033C}%
+ \pdfglyphtounicode{space_uni034D}{034D}%
+}
+
+\AtBeginDocument{%
+ \ifx\add at accent\LTX at add@accent
+  \let\add at accent\PDFX at add@accent
+ \else
+  \expandafter\ifx\csname MT at orig@add at accent\endcsname\relax
+  \TPDF at error{another package has already patched \string\add at accent }%
+  \else
+   \expandafter\let\csname MT at orig@add at accent\endcsname\PDFX at add@accent
+ \fi\fi
+ \ifxetex
+ \else
+  \PDFX at combiningchars@unicode
+  \@ifpackageloaded{newtxmath}{%
+    \pdfglyphtounicode{vec}{20D7}%
+    \pdfglyphtounicode{rvec}{20D6}%
+    \pdfglyphtounicode{lrvec}{20E1}%
+   }{}%
+  \fi %  end of   \ifxetex
+}
+
+%%  suppress hyperlinks when generating  PDF/X
+\def\pdfx at linkfile@pdfX#1#2#3{%
+ \Hy at colorlink\@filecolor#1\Hy at xspace@end}
+\def\pdfx at linkstart@pdfX#1#2#3{%
+ \Hy at colorlink\@linkcolor#3\endgroup\Hy at xspace@end}
+\def\pdfx at linkurl@pdfX#1#2{%
+ \Hy at colorlink\@urlcolor#1\endgroup\Hy at xspace@end}
+\def\pdfx at StartlinkName@pdfX#1#2{}
+\def\pdfx at close@pdflink{\Hy at VerboseLinkStop\Hy at endcolorlink}%
+\def\pdfx at Acrobatmenu@noaction#1#2{#2}
+
+\ifpdfx at x
+ \let\hyper at linkfile\pdfx at linkfile@pdfX
+ \let\hyper at linkurl\pdfx at linkurl@pdfX
+ \let\hyper at linkstart\pdfx at linkstart@pdfX
+ \let\hyper at linkend\relax
+ \let\Hy at StartlinkName\pdfx at StartlinkName@pdfX
+ \let\close at pdflink\pdfx at close@pdflink
+ \let\AcrobatMenu\pdfx at Acrobatmenu@noaction
+ \Hy at bookmarksfalse
+%% {\def\sep{;}% should not be needed, but just in case
+  \AtBeginDocument{%
+   % cancel annotations and links
+   %
+   \def\PDF at FinishDoc{%  ??? What uses this ???
+    \begingroup
+     \def\sep{; }% should not be needed, but just in case
+     \pdfinfo{%
+      \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)\fi
+      \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)\fi
+      \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)\fi
+      \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)\fi
+       /Creator(\pdfx at CreatorTool)%
+      \ifx\@pdfcreationdate\@empty
+       /CreationDate(D:\pdfx at convDate)%
+      \else
+       \ifxetex\else
+        /CreationDate(\@pdfcreationdate)%
+      \fi\fi
+      \ifx\@pdfmoddate\@empty
+       /ModDate(D:\pdfx at convDate)%
+      \else
+       /ModDate(\@pdfmoddate)%
+      \fi
+      /Producer(\pdfx at Producer)%
+      /Trapped/False
+      \ifnum\xmp at Part=1
+       /GTS_PDFXVersion(PDF/X-1\ifnum\xmp at ReleaseDate>2001
+        \xmp at Conformance\fi:\xmp at ReleaseDate)%
+      \else
+       /GTS_PDFXVersion(PDF/X-\xmp at Part\xmp at Conformance
+        \ifnum\xmp at Part< 4 :\xmp at ReleaseDate\fi)%
+      \fi
+      \ifnum\xmp at Part < 3
+        /GTS_PDFXConformance(PDF/X-\xmp at Part\xmp at Conformance
+          :\xmp at ReleaseDate)%
+      \fi
+      \ifpdfx at vt
+%%   support for PDF/VT extensions of  PDF/X-4 and PDF/X-5
+       /GTS_PDFVTVersion(PDF/VT-\xmp at vtPart\xmp at vtConformance)%
+      \fi
+     }%%  end of  PDF/X  info
+    \endgroup   %%  end of scope for  \sep
+   }%% end of  \PDF at FinishDoc
+  }% end of  \AtBeginDocument
+%%  \pdfinfo{%   order of these dictionary keys should not matter
+%%   \ifx\pdfx at Author\@empty\else /Author(\pdfx at Author)\fi
+%%   /CreationDate(D:\pdfx at convDate)%
+%%   /Creator(\pdfx at CreatorTool)%
+%%   \ifnum\xmp at Part=1
+%%     /GTS_PDFXVersion(PDF/X-1\ifnum\xmp at ReleaseDate>2001
+%%      \xmp at Conformance\fi:\xmp at ReleaseDate)%
+%%   \else
+%%    /GTS_PDFXVersion(PDF/X-\xmp at Part\xmp at Conformance
+%%     \ifnum\xmp at Part< 4 :\xmp at ReleaseDate\fi)%
+%%   \fi
+%%   \ifnum\xmp at Part < 3
+%%      /GTS_PDFXConformance(PDF/X-\xmp at Part\xmp at Conformance
+%%        :\xmp at ReleaseDate)%
+%%   \fi
+%%
+%%   \ifpdfx at vt
+%%%   support for PDF/VT extensions of  PDF/X-4 and PDF/X-5
+%%     /GTS_PDFVTVersion(PDF/VT-\xmp at vtPart\xmp at vtConformance)%
+%%   \fi
+%%   \ifx\pdfx at Keywords\@empty\else /Keywords(\pdfx at Keywords)\fi
+%%   /ModDate(D:\pdfx at convDate)%
+%%   /Producer(\pdfx at Producer)%
+%%   \ifx\pdfx at Subject\@empty\else /Subject(\pdfx at Subject)\fi
+%%   \ifx\pdfx at Title\@empty\else /Title(\pdfx at Title)\fi
+%%   /Trapped/False%
+%%  }%  end of  PDF/X  info
+%% }% end of scope for  \sep
+\else
+ \ifpdfx at e   %% PDF/E
+  \AtBeginDocument{%
+   \def\PDF at FinishDoc{%  ??? What uses this ???
+    \begingroup
+     \def\sep{; }% should not be needed, but just in case
+     \pdfinfo{%
+      \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)\fi
+      \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)\fi
+      \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)\fi
+      \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)\fi
+       /Creator(\pdfx at CreatorTool)%
+      \ifx\@pdfcreationdate\@empty
+       /CreationDate(D:\pdfx at convDate)%
+      \else
+       \ifxetex\else
+        /CreationDate(\@pdfcreationdate)%
+      \fi\fi
+      \ifx\@pdfmoddate\@empty
+       /ModDate(D:\pdfx at convDate)%
+      \else
+       /ModDate(\@pdfmoddate)%
+      \fi
+      /Producer(\pdfx at Producer)%
+      /Trapped/False
+      /GTS_PDFEVersion(PDF/E-1\xmp at Conformance:\xmp at ReleaseDate)%
+     }%  end of  PDF/E  info
+    \endgroup  %% end of scope for  \sep
+   }% end of  \PDF at FinishDoc
+  }% end of  \AtBeginDocument
+%% {\def\sep{;}% should not be needed, but just in case
+%%  \pdfinfo{%   order of these dictionary keys should not matter
+%%     \ifx\pdfx at Title\@empty\else /Title(\pdfx at Title)\fi
+%%     \ifx\pdfx at Author\@empty\else /Author(\pdfx at Author)\fi
+%%     \ifx\pdfx at Subject\@empty\else /Subject(\pdfx at Subject)\fi
+%%     \ifx\pdfx at Keywords\@empty\else /Keywords(\pdfx at Keywords)\fi
+%%   \ifx\pdfx at Author\@empty\else /Author(\pdfx at Author)\fi
+%%   /CreationDate(\pdfx at convDate)%
+%%   /Creator(\pdfx at CreatorTool)%
+%%   /GTS_PDFEVersion(PDF/E-1\xmp at Conformance:\xmp at ReleaseDate)%
+%%   \ifx\pdfx at Keywords\@empty\else /Keywords(\pdfx at Keywords)\fi
+%%   /ModDate(D:\pdfx at convDate)%
+%%   /Producer(\pdfx at Producer)%
+%%   \ifx\pdfx at Subject\@empty\else /Subject(\pdfx at Subject)\fi
+%%   \ifx\pdfx at Title\@empty\else /Title(\pdfx at Title)\fi
+%%   /Trapped/False%
+%%  }%  end of  PDF/E  info
+%% }% end of scope for  \sep
+ \else  %%  PDF/A
+  \def\pdfx at confA{a}%
+  \def\pdfx at confB{b}%
+  \def\pdfx at confU{u}%
+  \expandafter\def\expandafter\xmp at conf\expandafter
+   {\csname pdfx at conf\xmp at Conformance\endcsname}%
+  \AtBeginDocument{%
+   \def\PDF at FinishDoc{%  ??? What uses this ???
+   \begingroup
+    \def\sep{; }% should not be needed, but just in case
+    \pdfinfo{%
+     \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)\fi
+     \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)\fi
+     \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)\fi
+     \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)\fi
+      /Creator(\pdfx at CreatorTool)%
+     \ifx\@pdfcreationdate\@empty
+      /CreationDate(D:\pdfx at convDate)%
+     \else
+      \ifxetex\else
+       /CreationDate(\@pdfcreationdate)%
+     \fi\fi
+     \ifx\@pdfmoddate\@empty
+      /ModDate(D:\pdfx at convDate)%
+     \else
+      /ModDate(\@pdfmoddate)%
+     \fi
+     /Producer(\pdfx at Producer)%
+     /Trapped/False
+     /GTS_PDFA1Version (PDF/A-\xmp at Part\xmp at conf:\xmp at ReleaseDate)%
+    }%  end of  PDF/A  info
+   \endgroup  %%  end of scope for  \sep
+  }% end of  \PDF at FinishDoc
+ }% end of  \AtBeginDocument
+\fi\fi
+
+%%----------------------------------------------------------------------
+\begingroup
+%% override the \ifpdf  check of  xmpincl  package
+\ifxetex
+ \pdftrue
+\else\ifluatex
+ \pdftrue
+\fi\fi
+\RequirePackage{xmpincl}
+\ifxetex
+ % revert \ifpdf
+ \pdffalse
+\else\ifluatex
+ \pdffalse
+\fi\fi
+
+%% combine coding from  xmpincl  and  hyperxml to support XeTeX
+\def\pdfx at xmpincl@xetex#1{%
+ \IfFileExists{#1.xmp}{%
+  \mcs at xmpincl@patchFile{#1}%
+  \begingroup
+   \special{pdf:fstream @pdfx at Metadata (#1.xmpi)
+    <<
+      /Type /Metadata
+      /Subtype /XML
+    >>
+   }%
+   \special{pdf:put @catalog
+    <<
+      /Metadata @pdfx at Metadata
+    >>
+   }%
+  \endgroup
+ }{%
+  \newcommand{\mcs at xmpincl@filename}{#1.xmp}%
+    \PackageError{xmpincl}%
+    {The file \mcs at xmpincl@filename\space was not found}%
+    {The file \mcs at xmpincl@filename\space The metadata file
+     wasn't found.\MessageBreak Oops.}%
+ }
+}
+\ifxetex
+ \let\includexmp\pdfx at xmpincl@xetex
+\fi
+
+%% macro provided by Leonardo E. Segovia on 2017-05-15
+%% <leonardo.segovia at cs.uns.edu.ar>
+\def\pdfx at xmpincl@luatex#1{%
+ \IfFileExists{#1.xmp}{%
+   \mcs at xmpincl@patchFile{#1}%
+   \begingroup
+   \pdfcompresslevel=0
+   \immediate\pdfobj uncompressed stream attr {/Type /Metadata /Subtype /XML}
+   file{#1.xmpi}%
+   \pdfcatalog{%\pdfx at LanguageSpec
+    /Metadata \the\pdflastobj\space 0 R}%
+   \endgroup
+ }{%
+  \newcommand{\mcs at xmpincl@filename}{#1.xmp}%
+   \PackageError{xmpincl}%
+   {The file \mcs at xmpincl@filename\space was not found}%
+   {The file \mcs at xmpincl@filename\space The metadata file
+     wasn't found.\MessageBreak Oops.}%
+ }
+}
+\ifluatex
+ \let\includexmp\pdfx at xmpincl@luatex
+\fi
+
+%%----------------------------------------------------------------------
+\begingroup
+ \ifpdfx at x
+  \ifpdfx at vt
+   \def\xmp at template{pdfvt}%
+  \else
+   \def\xmp at template{pdfx}%    formerly  pdfx-1a
+  \fi
+ \else
+  \ifpdfx at e
+   \def\xmp at template{pdfe}%
+  \else
+   \def\xmp at template{pdfa}%
+ \fi\fi
+ \catcode`\'=12 \catcode`\<=12 \catcode`\>=12 \catcode`\?=12
+ \catcode`\"=12 \catcode`\= 12 %% used within the template file
+%% patch commands from  xmpincl.sty  ...
+ \def\pdfx at xmpinclStart{% supply byte-order marker
+  <?xpacket begin='^^ef^^bb^^be' id='W5M0MpCehiHzreSzNTczkc9d' ?> %
+ }%
+ \def\pdfx at xmpinclStartAlt{% no byte-order marker
+  <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d' ?> %
+ }%
+ \def\pdfx at xmpinclEnd{%  allow XMP packet to be writable
+  <?xpacket end='w'?> %
+ }%
+ \let\mcs at xmpinclStart\pdfx at xmpinclStart
+ \let\mcs at xmpinclStartAlt\pdfx at xmpinclStartAlt
+ \ifpdfx at noBOM  % don't use the byte-order marker
+  \let\mcs at xmpinclStart\pdfx at xmpinclStartAlt
+ \fi
+ \let\mcs at xmpinclEnd\pdfx at xmpinclEnd
+%% ... preventing their redefinition
+ \def\newcommand#1#2{}%
+%%
+%% \def\pdfx at endeval{%
+%%  \noexpand \TE at setvaltrue \noexpand \else
+%%  \noexpand \TE at setvalfalse \noexpand \fi
+%%   \noexpand \TE at negatefalse \noexpand \fi}%
+%% \let\TE at endeval\pdfx at endeval
+ \ifluatex\else\ifxetex\else
+  \inputencoding{8bit}%
+ \fi\fi
+ \makeatletter
+ \def\cf at encoding{L8U}\fontencoding{L8U}%
+ \providecommand{\ifnot at empty}[2]{\ifx#1\@empty\relax\else#2\fi}%
+ \pdfx at xmpmarkup
+\expandafter\global\expandafter
+  \let\csname L8U-cmd\expandafter\endcsname\csname U-cmd\endcsname
+ \def\cf at encoding{L8U}\fontencoding{L8U}%
+ \providecommand{\ifnot at empty}[2]{\ifx#1\@empty\relax\else#2\fi}%
+ \obeyspaces%
+%% beware 128 space characters -- for padding end of XMP packet
+ \gdef\paddingline{                                                                                                                                }%
+ \typeout{Using XMP template file: \xmp at template.xmp}%
+ \includexmp{\xmp at template}%
+\endgroup
+
+%%
+%% revert active characters to previous encoding
+%%
+\ifpdf at activechars
+ \global\let ^^c0\pdfx at save@co
+ \global\let ^^c1\pdfx at save@ci
+ \global\let ^^c2\pdfx at save@cii
+ \global\let ^^c3\pdfx at save@ciii
+ \global\let ^^c4\pdfx at save@civ
+ \global\let ^^c5\pdfx at save@cv
+ \global\let ^^c6\pdfx at save@cvi
+ \global\let ^^c7\pdfx at save@cvii
+ \global\let ^^c8\pdfx at save@cviii
+ \global\let ^^c9\pdfx at save@cix
+ \global\let ^^ca\pdfx at save@ca
+ \global\let ^^cb\pdfx at save@cb
+ \global\let ^^cc\pdfx at save@cc
+ \global\let ^^cd\pdfx at save@cd
+ \global\let ^^ce\pdfx at save@ce
+ \global\let ^^cf\pdfx at save@cf
+ \global\let ^^d0\pdfx at save@do
+ \global\let ^^d1\pdfx at save@di
+ \global\let ^^d2\pdfx at save@dii
+ \global\let ^^d3\pdfx at save@diii
+ \global\let ^^d4\pdfx at save@div
+ \global\let ^^d5\pdfx at save@dv
+ \global\let ^^d6\pdfx at save@dvi
+ \global\let ^^d7\pdfx at save@dvii
+ \global\let ^^d8\pdfx at save@dviii
+ \global\let ^^d9\pdfx at save@dix
+ \global\let ^^da\pdfx at save@da
+ \global\let ^^db\pdfx at save@db
+ \global\let ^^dc\pdfx at save@dc
+ \global\let ^^dd\pdfx at save@dd
+ \global\let ^^de\pdfx at save@de
+ \global\let ^^df\pdfx at save@df
+ \global\let ^^e0\pdfx at save@eo
+ \global\let ^^e1\pdfx at save@ei
+ \global\let ^^e2\pdfx at save@eii
+ \global\let ^^e3\pdfx at save@eiii
+ \global\let ^^e4\pdfx at save@eiv
+ \global\let ^^e5\pdfx at save@ev
+ \global\let ^^e6\pdfx at save@evi
+ \global\let ^^e7\pdfx at save@evii
+ \global\let ^^e8\pdfx at save@eviii
+ \global\let ^^e9\pdfx at save@eix
+ \global\let ^^ea\pdfx at save@ea
+ \global\let ^^eb\pdfx at save@eb
+ \global\let ^^ec\pdfx at save@ec
+ \global\let ^^ed\pdfx at save@ed
+ \global\let ^^ee\pdfx at save@ee
+ \global\let ^^ef\pdfx at save@ef
+ \global\let ^^f0\pdfx at save@fo
+ \global\let ^^f1\pdfx at save@fi
+ \global\let ^^f2\pdfx at save@fii
+ \global\let ^^f3\pdfx at save@fiii
+\fi
+
+\endgroup
+
+%%
+%% controls the color model and conversions with  xcolor  package
+%%
+\ifpdfx at cmyk
+ %
+ % this will have been done already for PDF/X
+ %
+ \PassOptionsToPackage{xcolor}{cmyk,hyperref}
+ \def\pdfx at handlexcolor{\def\@@mod{cmyk}\selectcolormodel{cmyk}%
+   \convertcolorsUtrue\convertcolorsDtrue}
+ \ifpdfx at x
+ \else
+%%  \AtBeginDocument{%
+%%   \def\@linkcolor{0 1 1 0}%
+%%   \def\@anchorcolor{0 0 0 1}%
+%%   \def\@citecolor{1 0 1 0}%
+%%   \def\@filecolor{.5 0 0 .5}%
+%%   \def\@urlcolor{0 1 0 0}%
+%%   \def\@menucolor{0 1 1 0}%
+%%   \def\@runcolor{.5 0 0 .5}%
+%%   \def\@linkbordercolor{0 1 1 0}%
+%%   \def\@citebordercolor{1 0 1 0}%
+%%   \def\@filebordercolor{.5 0 0 .5}%
+%%   \def\@urlbordercolor{1 0 0 0}%
+%%   \def\@menubordercolor{0 1 1 0}%
+%%   \def\@runbordercolor{.7 0 0 .3}%
+%%   \def\Fld at bcolor{0 0 0 0}%
+%%   \def\Fld at bordercolor{0 1 1 0}%
+%%  }
+ \fi
+\else
+ \PassOptionsToPackage{xcolor}{rgb,hyperref}
+ \def\pdfx at handlexcolor{\def\@@mod{rgb}\selectcolormodel{rgb}%
+   \convertcolorsUtrue\convertcolorsDtrue}
+\fi
+\@ifpackageloaded{xcolor}{\pdfx at handlexcolor
+ \ifpdfx at cmyk\else\color{black}\fi}{%
+ \AtBeginDocument{\@ifpackageloaded{xcolor}{\pdfx at handlexcolor}{}}
+}
+
+%%----------------------------------------------------------------------
+%%  Disable some actions in Beamer navigation
+\@ifclassloaded{beamer}{%
+ \let\real at insertslidenavigationsymbol
+   \insertslidenavigationsymbol
+ \let\real at insertbackfindforwardnavigationsymbol
+   \insertbackfindforwardnavigationsymbol
+ \def\pdfx at insertslidenavigationsymbol{{%
+  \let\Acrobatmenu\pdfx at Acrobatmenu@noaction
+  \real at insertslidenavigationsymbol
+ }}%
+ \def\pdfx at insertbackfindforwardnavigationsymbol{{%
+  \let\Acrobatmenu\pdfx at Acrobatmenu@noaction
+  \real at insertbackfindforwardnavigationsymbol
+ }}%
+ \AtBeginDocument{%
+  \ifHy at pdfa
+   \let\insertslidenavigationsymbol
+     \pdfx at insertslidenavigationsymbol
+   \let\insertbackfindforwardnavigationsymbol
+     \pdfx at insertbackfindforwardnavigationsymbol
+  \fi}%
+}{}
+
+%%----------------------------------------------------------------------
+\ifpdfx at transliterated
+%% support for bookmarks with transliterated input
+ \RequirePackage{stringenc}
+ \ifxetex\let\pdf at escapehex\empty\fi  % don't need it
+ \expandafter\ifx\csname pdf at escapehex\endcsname\relax
+  \PackageWarning{pdfx}{%
+   Missing an implementation of \string\pdf at escapehex ^^J
+   Translated Bookmarks cannot be generated.^^J}%
+  \newcommand{\pdfxBookmark}[4][]{#2[#1]{#4}}%
+ \else
+  \def\pdfx at GeneratePdfString#1#2{%
+   % converts a UTF-8 string to UTF-16be
+   \StringEncodingConvert{#1}{#2}{utf8}{utf16be}%
+   \edef#1{\string\376\string\377\pdfescapestring{#1}}%
+  }
+  \newtoks\pdfx at DisabledCommands
+  \def\pdfxDisableCommands#1{%
+  \expandafter\pdfx at DisabledCommands
+   \expandafter{\the\pdfx at DisabledCommands#1}}
+  \pdfxDisableCommands{%
+   \def\80{}%    else   \000\( --> \000\80\050   \000\000\050
+   \aftergroup\let\aftergroup\HyPsd at ConvertToUnicode\aftergroup\@gobble}
+  \let\Hy@@writetorep\@@writetorep
+  \def\pdfx@@writetorep#1#2#3#4#5{%
+   \begingroup
+    \pdfx at xmpunimarkup
+    \pdfx at prebookmark
+    \edef\pdfstringdefPreHook{%\pdfstringdefPreHook
+     \the\pdfx at DisabledCommands}%
+    \Hy@@writetorep{#1}{#2}{#3}{#4}{#5}%
+   \endgroup
+  }
+  \newcommand{\pdfxBookmark}[4][]{%
+   \ifx\relax#3\relax
+    \PackageError{pdfx}{Unknown macro \string#3.
+      A proper bookmark cannot be created}%
+     {Proceed to process the \string#1 as usual.}%
+    #2{#4}%
+   \else
+    \ifluatex  % use the utf8 directly
+     \let\pdfx at temp#3\relax
+     \def\pdfx at prebookmark{%
+      \pdfx at DisabledCommands{}%
+      \let#3\pdfx at temp
+     }%
+    \else\ifxetex  % use the utf8 directly
+     \let\pdfx at temp#3\relax
+     \def\pdfx at prebookmark{%
+      \pdfx at DisabledCommands{}%
+      \let#3\pdfx at temp
+     }%
+    \else
+     % convert the utf8 to utf16be
+     \pdfxBookmarkString\pdfx at temp{#3}%
+    \fi\fi
+    \let\@@writetorep\pdfx@@writetorep
+    \ifx\empty#1\empty
+     \def#3{#4}%
+     #2{#3}%
+    \else
+     \def#3{#1}%
+     #2[#3]{#4}%
+    \fi
+    \let\@@writetorep\Hy@@writetorep
+   \fi
+   \ignorespaces
+  }
+%%  use as:  \pdfxBookmark{\section}{\sectAtitle}{...}
+%%  use as:  \pdfxBookmark[<opt-title>]{\section}{\sectAtitle}{...}
+%%  only needed by pdfTeX --- Lua-/XeTeX use the utf8 directly
+  \def\pdfxBookmarkString#1#2{%
+   \pdfx at GeneratePdfString#1{#2}%
+   \def\pdfx at prebookmark{%
+    \pdfxDisableCommands{\let#2#1}%
+   }%
+  }
+%% use as:  \pdfxBookmarkString\PdfSectA\sectAtitle
+%%  where \sectAtitle has been defined by e.g.
+%%  \pdfxEnableCommands{\xdef\sectAtitle{\textLGR{...}}}
+
+ \fi % end of \ifx\pdf at escapehex\relax
+\fi % end of \ifpdfx at transliterated
+
+%%----------------------------------------------------------------------
+
+%% disable hyperref options,
+%%   to prevent changes that will cause an incompatibility
+ \Hy at DisableOption{pdfauthor}%
+ \Hy at DisableOption{pdftitle}%
+ \Hy at DisableOption{pdfsubject}%
+ \Hy at DisableOption{pdfcreator}%
+ \Hy at DisableOption{pdfcreationdate}%
+ \Hy at DisableOption{pdfmoddate}%
+ \Hy at DisableOption{pdfproducer}%
+ \Hy at DisableOption{pdfkeywords}%
+%% once set correctly, don't let this change
+ \Hy at DisableOption{pdfa}\let\Hy at pdfafalse\relax\let\Hy at pdfatrue\relax
+\endinput
+%%
+%% End of file `pdfx.sty'.


Property changes on: trunk/Master/texmf-dist/doc/latex/pdfx/pdfx-16.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/pdfx/pdfx.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfx/sample.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pdfx/sample.tex	2018-12-23 23:03:56 UTC (rev 49486)
+++ trunk/Master/texmf-dist/doc/latex/pdfx/sample.tex	2018-12-23 23:04:18 UTC (rev 49487)
@@ -21,10 +21,10 @@
 \Language{en-GB\sep en-US}
 \Copyright{Copyright \copyright\ 2014 \textLF The artist <currently> known as Ƭ̵̬}
 \CopyrightURL{http://www.mathstat.dal.ca/~selinger/copyright.html}
-\Creator{pdfTeX + pdfx.sty with \pdfxopt\space option}
+\Creator{LaTeX + pdfx.sty with \pdfxopt\space option}
 \Source{\jobname.tex}
 \Coverage{PDF standards: PDF/A and PDF/X}
-\Relation{PDF/A\sep PDF/X\sep PDF 2.0}
+\Relation{PDF/A\sep PDF/X\sep PDF/UA\sep PDF 2.0}
 \Contributor{\TeX\space Users Group}
 \PublicationType[en-US]{pamphlet}
 \Date{2018-12-25}
@@ -31,6 +31,7 @@
 \Date{2019-01-01}
 \Date{2019-04-07}
 \Date{2019-11-08}
+\Date{2019-12-21}
 \Journaltitle{abc \textLF \S \ddag \dots ÀÁÂÃÄ
 %ÅąŅƅDžȅɅ  % A0 = 10100000
 ÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÛÜÝß 

Modified: trunk/Master/texmf-dist/source/latex/pdfx/pdfx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfx/pdfx.dtx	2018-12-23 23:03:56 UTC (rev 49486)
+++ trunk/Master/texmf-dist/source/latex/pdfx/pdfx.dtx	2018-12-23 23:04:18 UTC (rev 49487)
@@ -19,7 +19,7 @@
 %
 % \fi
 %
-% \CheckSum{6102}
+% \CheckSum{6202}
 % \iffalse
 %
 %<*driver>
@@ -38,9 +38,9 @@
 \Copyrighted{False}
 \CopyrightURL{http://tug.org/texlive/}
 \CoverDisplayDate{November \thisyear}
-\CoverDate{\thisyear-11-29}
-\CreatorTool{pdfTeX + pdfx.sty with option \pdfxopt, from TeX Live \lastyear}
-\Date{2017-05-18\sep 2017-06-23\sep 2018-11-29}
+\CoverDate{\thisyear-12-22}
+\CreatorTool{LaTeX + pdfx.sty with option \pdfxopt, from TeX Live \lastyear}
+\Date{2017-05-18\sep 2017-06-23\sep 2018-11-29\sep 2018-12-22}
 \Advisory{An earlier version of this documentation was published as: TUGboat 36, No.2, pp.136\textendash 142 (2015)}
 \Advisory{v1.6: Added XMP support for PDF/UA-1. Added more Metadata fields and Language support.}
 \Advisory{v1.6: Default RGB and CMYK profiles now require the  colorprofiles.sty  package.}
@@ -49,6 +49,8 @@
 \Advisory{v1.6: Revised  glyphtounicode.sty  to use variation selectors, altered maps to PUA codepoints; added more glyphs via glyphtounicode-ntx.tex }
 \Advisory{v1.6: Support for 8-bit Hebrew encodings, some Arabic and Devanagari.}
 \Advisory{v1.6: Updated documentation, incl. for LaTeX changes.}
+\Advisory{v1.6.1: Fixed issue with ifthen package; improved Metadata with LuaTeX and XeTeX.}
+\Advisory{v.1.6.1: Flexibility with page boxes for PDF/X.}
 \pdfxEnableCommands{%
  \def\CVR{C.V. Radhakrishnan}\def\Thanh{H\`an Th\eee Thanh}%
  \def\eee{^^c3^^aa^^cc^^81 }}
@@ -163,9 +165,11 @@
 % Support for 8-bit Hebrew encodings, some Arabic and Devanagari.
 % Updated documentation, incl. for LaTeX changes.
 %  }%
+% \changes{v1.6.1}{2018/12/22}{Fixed issue with ifthen package;
+%  improved Metadata with LuaTeX and XeTeX. Flexibility with page boxes for PDF/X.}
 % \title{Generation of PDF/X- and PDF/A-\penalty-200 compliant PDFs with \pdftex --- \texttt{pdfx.sty}}
-% \date{2018/11/18}
-% \version{1.6}
+% \date{2018/12/22}
+% \version{1.6.1}
 % \keywords{PDF, PDF/A, PDF/X, pdf\TeX, \LaTeX, Multilingual Metadata}
 % \author{C.\,V.\,Radhakrishnan, \Thanh, Ross Moore {\upshape\small
 % and} Peter Selinger}
@@ -292,9 +296,9 @@
 % were standardized in 2005, 2011 and 2012, respectively.  Earlier
 % versions contain a subset of the features of later versions, so for
 % maximum portability, it is preferable to use a lower-numbered
-% version. There is no conformance level `u' in version 1 of the
-% standard.  For many typical uses of PDF/A, it is sufficient to use
-% PDF/A-1b.
+% version, when the extra features allowed in higher versions are not used.
+% There is no conformance level `u' in version 1 of the standard.  
+% Thus for many typical uses of PDF/A, it is sufficient to use PDF/A-1b.
 %
 % \begin{itemize}
 % \item |a-1a|: generate PDF/A-1a. Experimental, not fully implemented.
@@ -590,6 +594,7 @@
 % \medskip
 % Other places for the |{filecontents*}| environment can work, 
 % but \emph{only} when it contains \emph{no} non-ascii UTF-8 byte sequences.
+% Since 2018, with default 
 % See Section~\ref{ssec-symbols} below for more information on the macros
 % that can be safely used within |.xmpdata| metadata files.
 % 
@@ -802,8 +807,9 @@
 %
 %  Unfortunately not all PDF browsers (in particular, older ones and much Apple software)
 %  give ready access to the XMP metadata packet. Some authors want to see everything
-%  using e.g., the Unix/Linux |pdfinfo| command. In fact there is the |-meta| option to get
-%  the complete metadata packet. This can give more than what one wants, so use it as follows:
+%  using e.g., the Unix/Linux command: |pdfinfo -enc UTF-8 |. In fact there is the |-meta| 
+%  option to get the complete metadata packet (in UTF-8 encoding). 
+%  This can give more than what one wants, so use it as follows:
 % \begin{decl}[]
 %    pdfinfo -meta  <filename>.pdf  \textbar\ grep 'dc:'
 % \end{decl}
@@ -1034,15 +1040,15 @@
 % \%\% Custom profile:  7C Indigo TAC370 (ColorLogic)\\
 % |\gdef\viiIndigoTAC{\let\CallasMacOSdir\CallasMacOSpdfaPilotdir |\\
 % | \setCUSTOMcolorprofile |\\
-% |  {7C Indigo_TAC370_ColorLogic.icc}\%|\\
-% |  {\CallasProfilesdir}\%|\\
-% |  {7C Indigo TAC370 \string\(ColorLogic\string\)}\%  /ProfileName |\\
-% |  {http://www.colorlogic.de}\% /RegistryName |\\
-% |  {7CLR}\% number of colors specifier |\\
-% |  {02400000}\%  ICC version |\\
-% |  {/Cyan /Magenta /Yellow /Black /Orange /Green /Violet}\%  colour names |\\
-% |  {48110b8b410ee6be015f3932c3167869}\%  CheckSum |\\
-% |}\%|
+% |  {7C Indigo_TAC370_ColorLogic.icc}%|\\
+% |  {\CallasProfilesdir}%|\\
+% |  {7C Indigo TAC370 \string\(ColorLogic\string\)}%  /ProfileName |\\
+% |  {http://www.colorlogic.de}% /RegistryName |\\
+% |  {7CLR}% number of colors specifier |\\
+% |  {02400000}%  ICC version |\\
+% |  {/Cyan /Magenta /Yellow /Black /Orange /Green /Violet}%  colour names |\\
+% |  {48110b8b410ee6be015f3932c3167869}%  CheckSum |\\
+% |}|
 % \end{decl}
 %  which uses a profile that accompanies the \texttt{pdfaPilot} software from
 %  Callas Software Gmbh~\cite{pdfaPilot}.
@@ -1094,7 +1100,8 @@
 % encountered while generating PDF/A compliant documents are available
 % here:
 % \url{http://support.river-valley.com/wiki/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex}.
-%
+%  Be aware that this is based on use of an earlier version of the |pdfx| package,
+%  so some of the advice may have been superseded.
 % 
 %
 % \section[Installing]{Installing}
@@ -1110,8 +1117,7 @@
 % to get the documentation that you are reading now,
 % run (\textsc{pdf})\LaTeX{} on the file |pdfx.dtx|. 
 % The resulting PDF should be valid as PDF/A-2u.
-% % Or better, use
-% % the included |Makefile|, which will also regenerate the index.
+% Or better, use the included |Makefile|, which will also regenerate the index.
 %
 % To install the package, first extract the program code; i.e., the
 % file |pdfx.sty|, by running \LaTeX{} or \TeX{} on the file |pdfx.ins|. 
@@ -1134,8 +1140,7 @@
 %   written into the PDF file, and supporting features such as
 %   hyperlinking, bookmarks, etc.
 %  \item |xcolor| for ensuring consistent use of the color model
-%    appropriate the PDF variant, within text and hyperlinks
-%   (when allowed).
+%    appropriate the PDF variant, within text and hyperlinks (when allowed).
 %  \item |glyphtounicode.tex| (not Xe\LaTeX) maps glyph names 
 %   to corresponding Unicode code-points.
 %  \item |ifluatex|  allowing coding specific to Lua\LaTeX.
@@ -1204,7 +1209,7 @@
 %  may fail to pass validation tests. 
 %
 % Xe\TeX\ is designed for processing UTF-8 input only. When presented
-% with a \LaTeX\ source using a legacy encoding, such as |latin2| or |koi8-r|, 
+% with \LaTeX\ source using a legacy encoding, such as |latin2| or |koi8-r|, 
 % the input is accepted and a PDF produced. Yet there will be garbage 
 % characters corresponding to each character entered from the upper range
 % (128--255). This is evident in the PDF content and bookmarks; 
@@ -1214,7 +1219,7 @@
 %
 % Not all fonts, in particular Open-Type fonts (OTF), naturally come with
 % mappings of the glyphs to Unicode code points. This is a requirement
-% with PDF/A and PDF/E standards. 
+% with PDF/A, PDF/E and PDF/UA standards. 
 % Use of such fonts can result in validation errors, such as:
 % \begin{itemize}
 % \item
@@ -1226,7 +1231,7 @@
 % If one has access to Adobe's |Acrobat Pro| software, then its |Preflight|
 % utility can rewrite the uncompressed output from Xe\LaTeX\ into a valid
 % PDF standard, using compression of the contents but not of the XMP packet.
-% Similarly |Preflight| can fix the missing font information.
+% Similarly |Preflight| can sometimes fix the missing font information.
 %
 %
 % \subsubsection{Limitations using Lua\LaTeX}\label{sssec-luatex}
@@ -1903,7 +1908,7 @@
 % to make this work cleanly, 
 % as just doing these commands would interfere with other uses of |\pdfstringdef|.
 % In case a long sectioning command has an optional argument, or a $*$-variant
-% in needed, then include it this way.
+% is needed, then include it this way.
 %\begin{decl}[]
 % |\pdfxBookmark[Ar'avot e'r]{\section*}{\sectAtitle}{Ar'avot e'r, Araratyan dashti ...}|
 %\end{decl}
@@ -2141,13 +2146,13 @@
 % As well as rebinding each command for a letter, the font style-switching commands 
 % are aliased to do nothing, as these are not relevant to creating UTF-8 output.
 % Being localised by the |L8U| grouping, this causes no problem elsewhere within the document.
-% This is similar to |\psdaliasnames| and |\psdmapshortnames| from |hyperref.sty|
+% These are similar to macros |\psdaliasnames| and |\psdmapshortnames| from |hyperref.sty|,
 % which rebind user macros to LICRs, so that |PU| encoded versions of LICRs can be used.
 %
 % \begin{figure}[htb]
 %  \includegraphics[scale=.625]{Armenian-example-UTF8.png}
-%  \caption{Part of the source coding for Figure~\ref{ex-arm}, viewed as UTF-8 encoded,
-%  within editing software.}\label{src-arm}
+%  \caption{Image of part of the source coding for Figure~\ref{ex-arm}, 
+%  viewed as UTF-8 encoded, within editing software.}\label{src-arm}
 % \end{figure}
 %
 % Several other `rebinding' commands are defined, mostly with package-loading options.
@@ -2546,7 +2551,7 @@
 }{}%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{pdfx}
-  [2018/11/29 v1.6 PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
+  [2018/12/22 v1.6.1 PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
 
 \newif\ifpdfx at noBOM \pdfx at noBOMfalse   % use a BOM in the XMP packet
 \newif\ifpdfx at x \pdfx at xfalse   % PDF/X mode
@@ -2633,7 +2638,7 @@
  }%  external OPI workflow, i.e. multiple files involved
 \DeclareOption{x-3}{\global\pdfx at xtrue\def\xmp at Part{3}% RGB allowed, but rare!
  \def\xmp at Conformance{}\def\xmp at ReleaseDate{2003}%
- \global\pdfminorversion=4 }%  same as x-303
+ \global\pdfx at minorversion=4 }%  same as x-303
 \DeclareOption{x-302}{\global\pdfx at xtrue\def\xmp at Part{3}%
  \def\xmp at Conformance{}\def\xmp at ReleaseDate{2002}%   ISO 15930-3:2002
  \global\pdfx at minorversion=3 }
@@ -2892,12 +2897,14 @@
 \RequirePackage{ifxetex}
 \ifxetex
  \def\pdfx at pages@xetex#1{\special{pdf:put @pages <<#1>>}}
+ \def\pdfx at pageattr@xetex#1{\special{pdf:put @thispage <<#1>>}}
  \def\pdfx at docinfo@xetex#1{\special{pdf:put @docinfo <<#1>>}}
  \def\pdfx at catalog@xetex#1{\special{pdf:put @catalog <<#1>>}}
- \def\pdfx at mapline@xetex#1{}
+ \def\pdfx at mapline@xetex#1{\special{pdf:mapline #1}}%% does this work ??
+%% \def\pdfx at mapline@xetex#1{}
  \def\pdf at compress@xetex=#1{}
 %%
- \let\pdfpageattr\pdfx at pages@xetex
+ \let\pdfpagesattr\pdfx at pages@xetex
  \let\pdfinfo\pdfx at docinfo@xetex
  \let\pdfcatalog\pdfx at catalog@xetex
  \let\pdfmapline\pdfx at mapline@xetex
@@ -2907,6 +2914,7 @@
 
 %%\newif\ifpdfx at pdfmark  %  control future support for  dvips
 
+\RequirePackage{everyshi}
 \RequirePackage{ifluatex}
 \ifluatex
  \IfFileExists{luatex85.sty}{% 2016+
@@ -2919,7 +2927,6 @@
  \let\pdfescapestring\pdf at escapestring
 \else
  \ifxetex
-  \usepackage{everyshi}%
   \expandafter\ifx\csname mdfivesum\endcsname\relax
    %  too early a version of  XeTeX
    \let\pdfx at mdfivesum\relax
@@ -2977,11 +2984,13 @@
   \edef\pdfx at theight{\strip at pt\dimen0}%
   \ifxetex
    \xdef\pdfx at everypage@xetex{%
-    /MediaBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
-    /TrimBox[25 20 \pdfx at twidth\space \pdfx at theight]%
+     /MediaBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
+     /BleedBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
+     /CropBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
+     /TrimBox[25 20 \pdfx at twidth\space \pdfx at theight]%
    }%
   \fi
-  \edef\next{\endgroup\pdfpageattr{%
+  \edef\next{\endgroup\pdfpagesattr{%
     /MediaBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
 %%    /ArtBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
     /BleedBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
@@ -2990,9 +2999,14 @@
   }\next
  \ifxetex
   \AtBeginDvi{%
-   \immediate\special{pdf:put @thispage <<\pdfx at everypage@xetex>>}}%
+   \expandafter\immediate\pdfx at pageattr@xetex{\pdfx at everypage@xetex}}%
   \EveryShipout{%
-   \immediate\special{pdf:put @thispage <<\pdfx at everypage@xetex>>}}%
+   \expandafter\immediate\pdfx at pageattr@xetex{\pdfx at everypage@xetex}}%
+ \else 
+   \EveryShipout{%
+    \expandafter\ifx\expandafter\relax\the\pdfpageattr\relax
+     \immediate\pdfpageattr\expandafter{\the\pdfpagesattr}%
+    \fi }%
  \fi
 \else
 %%  PDF/A-1b  doesn't allow object compression
@@ -4782,25 +4796,50 @@
 %% But some PDF readers don't support XMP, so it is nice to have
 %%  /Info fields, when this can be done reliably.
 %%
+%%  2018-12-16:   load package outside the grouping
+\RequirePackage{stringenc}%
 \begingroup
- \RequirePackage{stringenc}%
- \expandafter\ifx\csname pdf at escapehex\endcsname\relax
-  \PackageWarning{pdfx}{%
-   Missing an implementation of \string\pdf at escapehex ^^J
-   Translated Metadata cannot be generated as PDF strings.^^J}%
-  \def\pdfx at GeneratePdfString#1#2{}%
-  \def\pdfx at ConvertUTFtoBE#1#2{}%
- \else
-  \def\pdfx at GeneratePdfString#1#2{%
+ \catcode`\| 0
+ \catcode `\\ 12 
+ |gdef |pdfx at parsebackslash#1{%
+  |begingroup
+   |def |pdfx at parsemacro{#1}%
+   |def |pdfx at parseout{}%
+   |expandafter |pdfx at doparsebackslash#1\|pdfx at endparse
+ }
+ |gdef |pdfx at doparsebackslash#1\#2|pdfx at endparse{%
+  |edef |pdfx at parseout{|pdfx at parseout#1}%
+  |ifx |relax#2|relax
+   |let |next |pdfx at parseend
+  |else
+   |edef |pdfx at parseout{|pdfx at parseout \\}%
+   |def |next{|pdfx at doparsebackslash#2|pdfx at endparse}%
+  |fi |next
+  } 
+|endgroup
+\def\pdfx at parseend{%
+ \edef\next{\endgroup\def\expandafter\noexpand\pdfx at parsemacro{\pdfx at parseout}}%
+ \next
+}%
+\begingroup
+%% \expandafter\ifx\csname pdf at escapehex\endcsname\relax
+%%  \PackageWarning{pdfx}{%
+%%   Missing an implementation of \string\pdf at escapehex ^^J
+%%   Translated Metadata cannot be generated as PDF strings.^^J}%
+%%  \def\pdfx at GeneratePdfString#1#2{}%
+%%  \def\pdfx at ConvertUTFtoBE#1#2{}%
+%% \fi %%\else
+ \gdef\pdfx at GeneratePdfString#1#2{%
    % converts a UTF-8 string to UTF-16be
    \StringEncodingConvert{#1}{#2}{utf8}{utf16be}%
-   \xdef#1{\string\376\string\377\pdfescapestring{#1}}%
+   \edef\pdfx at tempii{#1}\relax
+   \xdef#1{\string\376\string\377\pdfescapestring{\pdfx at tempii}}%
   }%
-  \def\pdfx at ConvertUTFtoBE#1#2{%
+ \gdef\pdfx at ConvertUTFtoBE#1#2{%
    \setbox0=\hbox{% catch any rubbish escaping to the MVL
     \def\cf at encoding{L8U}\fontencoding{L8U}%
     \ifluatex
-     \let\pdfescapestring\luaescapestring
+%%     \let\pdfescapestring\luaescapestring
     \else\ifxetex\else
      \inputencoding{8bit}%
     \fi\fi
@@ -4808,10 +4847,18 @@
     \pdfx at xmpunimarkup
     \let\backslash\textbackslash
     \edef\pdfx at temp{#2}% ensure XMP expands to UTF8
-    \pdfx at GeneratePdfString{#1}{\pdfx at temp}%
-   }%
+    \ifluatex
+     \pdfx at parsebackslash\pdfx at temp
+     \pdfstringdef{#1}{\pdfx at temp}%
+    \else\ifxetex
+      \pdfx at parsebackslash\pdfx at temp
+      \pdfstringdef{#1}{\pdfx at temp}%
+     \else
+      \pdfx at GeneratePdfString{#1}{\pdfx at temp}%
+    \fi\fi
+   }% end of  \setbox
   }%
- \fi
+%% \fi
  \pdfx at pdfmarkup
  \global\let\pdfx at pdfAuthor\@empty
  \global\let\pdfx at pdfTitle\@empty
@@ -4819,24 +4866,37 @@
  \global\let\pdfx at pdfKeywords\@empty
  \ifpdfx at nopdfinfo  %  transliterated strings present
 %% RRM: this may still work with parser macros   ???
- \ifluatex
-  %%  \pdf at escapehex   gets it wrong!!
-  %%   Is there a better way ?
- \else
-  \pdfx at ConvertUTFtoBE\pdfx at pdfTitle\xmp at Title
-  \pdfx at ConvertUTFtoBE\pdfx at pdfSubject\xmp at Subject
- \fi
-\else
-  \pdfx at topdfstring\pdfx at pdfTitle\xmp at Title
-  \ifpdfx at e\else\ifpdfx at x\else
-   \pdfx at topdfstring\pdfx at pdfSubject\xmp at Subject
-  \fi\fi
- \fi
+  \expandafter\ifx\expandafter\relax\xmp at Title\relax\else
+   \pdfx at ConvertUTFtoBE{\pdfx at pdfTitle}{\xmp at Title}%
+  \fi
+  \expandafter\ifx\expandafter\relax\xmp at Subject\relax\else
+   \pdfx at ConvertUTFtoBE{\pdfx at pdfSubject}{\xmp at Subject}%
+  \fi
+\else %%  pdfx at nopdfinfotrue
+  \expandafter\ifx\expandafter\relax\xmp at Title\relax\else
+   \ifluatex
+    \pdfx at ConvertUTFtoBE\pdfx at pdfTitle\xmp at Title
+   \else\ifxetex
+    \pdfx at ConvertUTFtoBE\pdfx at pdfTitle\xmp at Title
+   \else
+     \pdfx at GeneratePdfString\pdfx at pdfTitle\xmp at Title
+   \fi\fi
+  \fi
+  \expandafter\ifx\expandafter\relax\xmp at Subject\relax\else
+   \ifluatex
+    \pdfx at ConvertUTFtoBE\pdfx at pdfSubject\xmp at Subject
+   \else\ifxetex
+    \pdfx at ConvertUTFtoBE\pdfx at pdfSubject\xmp at Subject
+   \else
+    \pdfx at GeneratePdfString\pdfx at pdfSubject\xmp at Subject
+   \fi\fi
+  \fi
+ \fi  % end of  \ifpdfx at nopdfinfo
  \pdfx at topdfstring\pdfx at CreatorTool\xmp at CreatorTool
  \pdfx at topdfstring\pdfx at Producer\xmp at Producer
 %%  \pdfescapestring  needed
- \expandafter\ifx\csname pdfescapestring\endcsname\relax
-  \else
+%% \expandafter\ifx\csname pdfescapestring\endcsname\relax
+%%  \else
     \expandafter\ifx\expandafter\relax\xmp at Author\relax
     \else
 %%  check for multiple authors with parser macro
@@ -4843,7 +4903,7 @@
      \expandafter\pdfx at parseforsep\xmp at Author\sep\pdfx at endparse
      \ifpdfx at sep@infield@
      \else
-      \pdfx at ConvertUTFtoBE{\pdfx at pdfAuthor}{\xmp at Author}%
+       \pdfx at ConvertUTFtoBE{\pdfx at pdfAuthor}{\xmp at Author}%
      \fi %% end of  \ifpdfx at sep@infield@
     \fi  %%  end of  \xmp at Author  test
     \expandafter\ifx\expandafter\relax\xmp at Keywords\relax
@@ -4850,14 +4910,13 @@
     \else
 %%  check for multiple keywords with parser macro
      \expandafter\pdfx at parseforsep\xmp at Keywords\sep\pdfx at endparse
-     \ifpdfx at sep@infield@\else
-      \ifluatex\else
-      \pdfx at ConvertUTFtoBE{\pdfx at pdfKeywords}{\xmp at Keywords}%
-     \fi
+     \ifpdfx at sep@infield@
+     \else
+       \pdfx at ConvertUTFtoBE{\pdfx at pdfKeywords}{\xmp at Keywords}%
      \fi %% end of  \ifpdfx at sep@infield@
     \fi  %%  end of  \xmp at Keywords  test
 %%
-  \fi  %%  end of \pdfescapestring  test
+%%  \fi  %%  end of \pdfescapestring  test
 \endgroup
 
 %% Affects CMap creation for certain fonts, according to glyph names
@@ -4989,11 +5048,11 @@
     \begingroup
      \def\sep{; }% should not be needed, but just in case
      \pdfinfo{%
-      \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)\fi
-      \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)\fi
-      \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)\fi
-      \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)\fi
-       /Creator(\pdfx at CreatorTool)%
+      \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)^^J\fi
+      \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)^^J\fi
+      \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)^^J\fi
+      \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)^^J\fi
+       /Creator(\pdfx at CreatorTool)^^J%
       \ifx\@pdfcreationdate\@empty
        /CreationDate(D:\pdfx at convDate)%
       \else
@@ -5005,8 +5064,8 @@
       \else
        /ModDate(\@pdfmoddate)%
       \fi
-      /Producer(\pdfx at Producer)%
-      /Trapped/False
+      ^^J/Producer(\pdfx at Producer)%
+      /Trapped/False^^J%
       \ifnum\xmp at Part=1
        /GTS_PDFXVersion(PDF/X-1\ifnum\xmp at ReleaseDate>2001
         \xmp at Conformance\fi:\xmp at ReleaseDate)%
@@ -5061,11 +5120,11 @@
     \begingroup
      \def\sep{; }% should not be needed, but just in case
      \pdfinfo{%
-      \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)\fi
-      \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)\fi
-      \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)\fi
-      \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)\fi
-       /Creator(\pdfx at CreatorTool)%
+      \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)^^J\fi
+      \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)^^J\fi
+      \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)^^J\fi
+      \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)^^J\fi
+       /Creator(\pdfx at CreatorTool)^^J%
       \ifx\@pdfcreationdate\@empty
        /CreationDate(D:\pdfx at convDate)%
       \else
@@ -5077,8 +5136,8 @@
       \else
        /ModDate(\@pdfmoddate)%
       \fi
-      /Producer(\pdfx at Producer)%
-      /Trapped/False
+      ^^J/Producer(\pdfx at Producer)%
+      /Trapped/False^^J%
       /GTS_PDFEVersion(PDF/E-1\xmp at Conformance:\xmp at ReleaseDate)%
      }%  end of  PDF/E  info
     \endgroup  %% end of scope for  \sep
@@ -5113,11 +5172,11 @@
    \begingroup
     \def\sep{; }% should not be needed, but just in case
     \pdfinfo{%
-     \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)\fi
-     \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)\fi
-     \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)\fi
-     \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)\fi
-      /Creator(\pdfx at CreatorTool)%
+     \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)^^J\fi
+     \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)^^J\fi
+     \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)^^J\fi
+     \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)^^J\fi
+      /Creator(\pdfx at CreatorTool)^^J%
      \ifx\@pdfcreationdate\@empty
       /CreationDate(D:\pdfx at convDate)%
      \else
@@ -5129,8 +5188,8 @@
      \else
       /ModDate(\@pdfmoddate)%
      \fi
-     /Producer(\pdfx at Producer)%
-     /Trapped/False
+     ^^J/Producer(\pdfx at Producer)%
+     /Trapped/False^^J%
      /GTS_PDFA1Version (PDF/A-\xmp at Part\xmp at conf:\xmp at ReleaseDate)%
     }%  end of  PDF/A  info
    \endgroup  %%  end of scope for  \sep
@@ -5139,21 +5198,14 @@
 \fi\fi
 
 %%----------------------------------------------------------------------
+%%  2018-12-16:   xmpincl  needs the  ifthen  package
+%%  it should be loaded outside the grouping, else  biblatex  may barf
+%%
+\RequirePackage{ifthen}
 \begingroup
-%% override the \ifpdf  check of  xmpincl  package
-\ifxetex
+%% override the \ifpdf  check of  xmpincl  package, inside the grouping
  \pdftrue
-\else\ifluatex
- \pdftrue
-\fi\fi
-\RequirePackage{xmpincl}
-\ifxetex
- % revert \ifpdf
- \pdffalse
-\else\ifluatex
- \pdffalse
-\fi\fi
-
+ \RequirePackage{xmpincl}
 %% combine coding from  xmpincl  and  hyperxml to support XeTeX
 \def\pdfx at xmpincl@xetex#1{%
  \IfFileExists{#1.xmp}{%
@@ -5392,7 +5444,6 @@
 %%----------------------------------------------------------------------
 \ifpdfx at transliterated
 %% support for bookmarks with transliterated input
- \RequirePackage{stringenc}
  \ifxetex\let\pdf at escapehex\empty\fi  % don't need it
  \expandafter\ifx\csname pdf at escapehex\endcsname\relax
   \PackageWarning{pdfx}{%

Modified: trunk/Master/texmf-dist/tex/latex/pdfx/pdfx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfx/pdfx.sty	2018-12-23 23:03:56 UTC (rev 49486)
+++ trunk/Master/texmf-dist/tex/latex/pdfx/pdfx.sty	2018-12-23 23:04:18 UTC (rev 49487)
@@ -31,7 +31,7 @@
 }{}%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{pdfx}
-  [2018/11/29 v1.6 PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
+  [2018/12/22 v1.6.1 PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
 
 \newif\ifpdfx at noBOM \pdfx at noBOMfalse   % use a BOM in the XMP packet
 \newif\ifpdfx at x \pdfx at xfalse   % PDF/X mode
@@ -118,7 +118,7 @@
  }%  external OPI workflow, i.e. multiple files involved
 \DeclareOption{x-3}{\global\pdfx at xtrue\def\xmp at Part{3}% RGB allowed, but rare!
  \def\xmp at Conformance{}\def\xmp at ReleaseDate{2003}%
- \global\pdfminorversion=4 }%  same as x-303
+ \global\pdfx at minorversion=4 }%  same as x-303
 \DeclareOption{x-302}{\global\pdfx at xtrue\def\xmp at Part{3}%
  \def\xmp at Conformance{}\def\xmp at ReleaseDate{2002}%   ISO 15930-3:2002
  \global\pdfx at minorversion=3 }
@@ -376,12 +376,14 @@
 \RequirePackage{ifxetex}
 \ifxetex
  \def\pdfx at pages@xetex#1{\special{pdf:put @pages <<#1>>}}
+ \def\pdfx at pageattr@xetex#1{\special{pdf:put @thispage <<#1>>}}
  \def\pdfx at docinfo@xetex#1{\special{pdf:put @docinfo <<#1>>}}
  \def\pdfx at catalog@xetex#1{\special{pdf:put @catalog <<#1>>}}
- \def\pdfx at mapline@xetex#1{}
+ \def\pdfx at mapline@xetex#1{\special{pdf:mapline #1}}%% does this work ??
+%% \def\pdfx at mapline@xetex#1{}
  \def\pdf at compress@xetex=#1{}
 %%
- \let\pdfpageattr\pdfx at pages@xetex
+ \let\pdfpagesattr\pdfx at pages@xetex
  \let\pdfinfo\pdfx at docinfo@xetex
  \let\pdfcatalog\pdfx at catalog@xetex
  \let\pdfmapline\pdfx at mapline@xetex
@@ -391,6 +393,7 @@
 
 %%\newif\ifpdfx at pdfmark  %  control future support for  dvips
 
+\RequirePackage{everyshi}
 \RequirePackage{ifluatex}
 \ifluatex
  \IfFileExists{luatex85.sty}{% 2016+
@@ -403,7 +406,6 @@
  \let\pdfescapestring\pdf at escapestring
 \else
  \ifxetex
-  \usepackage{everyshi}%
   \expandafter\ifx\csname mdfivesum\endcsname\relax
    %  too early a version of  XeTeX
    \let\pdfx at mdfivesum\relax
@@ -461,11 +463,13 @@
   \edef\pdfx at theight{\strip at pt\dimen0}%
   \ifxetex
    \xdef\pdfx at everypage@xetex{%
-    /MediaBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
-    /TrimBox[25 20 \pdfx at twidth\space \pdfx at theight]%
+     /MediaBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
+     /BleedBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
+     /CropBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
+     /TrimBox[25 20 \pdfx at twidth\space \pdfx at theight]%
    }%
   \fi
-  \edef\next{\endgroup\pdfpageattr{%
+  \edef\next{\endgroup\pdfpagesattr{%
     /MediaBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
 %%    /ArtBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
     /BleedBox[0 0 \pdfx at mwidth\space \pdfx at mheight]^^J
@@ -474,9 +478,14 @@
   }\next
  \ifxetex
   \AtBeginDvi{%
-   \immediate\special{pdf:put @thispage <<\pdfx at everypage@xetex>>}}%
+   \expandafter\immediate\pdfx at pageattr@xetex{\pdfx at everypage@xetex}}%
   \EveryShipout{%
-   \immediate\special{pdf:put @thispage <<\pdfx at everypage@xetex>>}}%
+   \expandafter\immediate\pdfx at pageattr@xetex{\pdfx at everypage@xetex}}%
+ \else
+   \EveryShipout{%
+    \expandafter\ifx\expandafter\relax\the\pdfpageattr\relax
+     \immediate\pdfpageattr\expandafter{\the\pdfpagesattr}%
+    \fi }%
  \fi
 \else
 %%  PDF/A-1b  doesn't allow object compression
@@ -2266,25 +2275,50 @@
 %% But some PDF readers don't support XMP, so it is nice to have
 %%  /Info fields, when this can be done reliably.
 %%
+%%  2018-12-16:   load package outside the grouping
+\RequirePackage{stringenc}%
 \begingroup
- \RequirePackage{stringenc}%
- \expandafter\ifx\csname pdf at escapehex\endcsname\relax
-  \PackageWarning{pdfx}{%
-   Missing an implementation of \string\pdf at escapehex ^^J
-   Translated Metadata cannot be generated as PDF strings.^^J}%
-  \def\pdfx at GeneratePdfString#1#2{}%
-  \def\pdfx at ConvertUTFtoBE#1#2{}%
- \else
-  \def\pdfx at GeneratePdfString#1#2{%
+ \catcode`\| 0
+ \catcode `\\ 12
+ |gdef |pdfx at parsebackslash#1{%
+  |begingroup
+   |def |pdfx at parsemacro{#1}%
+   |def |pdfx at parseout{}%
+   |expandafter |pdfx at doparsebackslash#1\|pdfx at endparse
+ }
+ |gdef |pdfx at doparsebackslash#1\#2|pdfx at endparse{%
+  |edef |pdfx at parseout{|pdfx at parseout#1}%
+  |ifx |relax#2|relax
+   |let |next |pdfx at parseend
+  |else
+   |edef |pdfx at parseout{|pdfx at parseout \\}%
+   |def |next{|pdfx at doparsebackslash#2|pdfx at endparse}%
+  |fi |next
+  }
+|endgroup
+\def\pdfx at parseend{%
+ \edef\next{\endgroup\def\expandafter\noexpand\pdfx at parsemacro{\pdfx at parseout}}%
+ \next
+}%
+\begingroup
+%% \expandafter\ifx\csname pdf at escapehex\endcsname\relax
+%%  \PackageWarning{pdfx}{%
+%%   Missing an implementation of \string\pdf at escapehex ^^J
+%%   Translated Metadata cannot be generated as PDF strings.^^J}%
+%%  \def\pdfx at GeneratePdfString#1#2{}%
+%%  \def\pdfx at ConvertUTFtoBE#1#2{}%
+%% \fi %%\else
+ \gdef\pdfx at GeneratePdfString#1#2{%
    % converts a UTF-8 string to UTF-16be
    \StringEncodingConvert{#1}{#2}{utf8}{utf16be}%
-   \xdef#1{\string\376\string\377\pdfescapestring{#1}}%
+   \edef\pdfx at tempii{#1}\relax
+   \xdef#1{\string\376\string\377\pdfescapestring{\pdfx at tempii}}%
   }%
-  \def\pdfx at ConvertUTFtoBE#1#2{%
+ \gdef\pdfx at ConvertUTFtoBE#1#2{%
    \setbox0=\hbox{% catch any rubbish escaping to the MVL
     \def\cf at encoding{L8U}\fontencoding{L8U}%
     \ifluatex
-     \let\pdfescapestring\luaescapestring
+%%     \let\pdfescapestring\luaescapestring
     \else\ifxetex\else
      \inputencoding{8bit}%
     \fi\fi
@@ -2292,10 +2326,18 @@
     \pdfx at xmpunimarkup
     \let\backslash\textbackslash
     \edef\pdfx at temp{#2}% ensure XMP expands to UTF8
-    \pdfx at GeneratePdfString{#1}{\pdfx at temp}%
-   }%
+    \ifluatex
+     \pdfx at parsebackslash\pdfx at temp
+     \pdfstringdef{#1}{\pdfx at temp}%
+    \else\ifxetex
+      \pdfx at parsebackslash\pdfx at temp
+      \pdfstringdef{#1}{\pdfx at temp}%
+     \else
+      \pdfx at GeneratePdfString{#1}{\pdfx at temp}%
+    \fi\fi
+   }% end of  \setbox
   }%
- \fi
+%% \fi
  \pdfx at pdfmarkup
  \global\let\pdfx at pdfAuthor\@empty
  \global\let\pdfx at pdfTitle\@empty
@@ -2303,24 +2345,37 @@
  \global\let\pdfx at pdfKeywords\@empty
  \ifpdfx at nopdfinfo  %  transliterated strings present
 %% RRM: this may still work with parser macros   ???
- \ifluatex
-  %%  \pdf at escapehex   gets it wrong!!
-  %%   Is there a better way ?
- \else
-  \pdfx at ConvertUTFtoBE\pdfx at pdfTitle\xmp at Title
-  \pdfx at ConvertUTFtoBE\pdfx at pdfSubject\xmp at Subject
- \fi
-\else
-  \pdfx at topdfstring\pdfx at pdfTitle\xmp at Title
-  \ifpdfx at e\else\ifpdfx at x\else
-   \pdfx at topdfstring\pdfx at pdfSubject\xmp at Subject
-  \fi\fi
- \fi
+  \expandafter\ifx\expandafter\relax\xmp at Title\relax\else
+   \pdfx at ConvertUTFtoBE{\pdfx at pdfTitle}{\xmp at Title}%
+  \fi
+  \expandafter\ifx\expandafter\relax\xmp at Subject\relax\else
+   \pdfx at ConvertUTFtoBE{\pdfx at pdfSubject}{\xmp at Subject}%
+  \fi
+\else %%  pdfx at nopdfinfotrue
+  \expandafter\ifx\expandafter\relax\xmp at Title\relax\else
+   \ifluatex
+    \pdfx at ConvertUTFtoBE\pdfx at pdfTitle\xmp at Title
+   \else\ifxetex
+    \pdfx at ConvertUTFtoBE\pdfx at pdfTitle\xmp at Title
+   \else
+     \pdfx at GeneratePdfString\pdfx at pdfTitle\xmp at Title
+   \fi\fi
+  \fi
+  \expandafter\ifx\expandafter\relax\xmp at Subject\relax\else
+   \ifluatex
+    \pdfx at ConvertUTFtoBE\pdfx at pdfSubject\xmp at Subject
+   \else\ifxetex
+    \pdfx at ConvertUTFtoBE\pdfx at pdfSubject\xmp at Subject
+   \else
+    \pdfx at GeneratePdfString\pdfx at pdfSubject\xmp at Subject
+   \fi\fi
+  \fi
+ \fi  % end of  \ifpdfx at nopdfinfo
  \pdfx at topdfstring\pdfx at CreatorTool\xmp at CreatorTool
  \pdfx at topdfstring\pdfx at Producer\xmp at Producer
 %%  \pdfescapestring  needed
- \expandafter\ifx\csname pdfescapestring\endcsname\relax
-  \else
+%% \expandafter\ifx\csname pdfescapestring\endcsname\relax
+%%  \else
     \expandafter\ifx\expandafter\relax\xmp at Author\relax
     \else
 %%  check for multiple authors with parser macro
@@ -2327,7 +2382,7 @@
      \expandafter\pdfx at parseforsep\xmp at Author\sep\pdfx at endparse
      \ifpdfx at sep@infield@
      \else
-      \pdfx at ConvertUTFtoBE{\pdfx at pdfAuthor}{\xmp at Author}%
+       \pdfx at ConvertUTFtoBE{\pdfx at pdfAuthor}{\xmp at Author}%
      \fi %% end of  \ifpdfx at sep@infield@
     \fi  %%  end of  \xmp at Author  test
     \expandafter\ifx\expandafter\relax\xmp at Keywords\relax
@@ -2334,14 +2389,13 @@
     \else
 %%  check for multiple keywords with parser macro
      \expandafter\pdfx at parseforsep\xmp at Keywords\sep\pdfx at endparse
-     \ifpdfx at sep@infield@\else
-      \ifluatex\else
-      \pdfx at ConvertUTFtoBE{\pdfx at pdfKeywords}{\xmp at Keywords}%
-     \fi
+     \ifpdfx at sep@infield@
+     \else
+       \pdfx at ConvertUTFtoBE{\pdfx at pdfKeywords}{\xmp at Keywords}%
      \fi %% end of  \ifpdfx at sep@infield@
     \fi  %%  end of  \xmp at Keywords  test
 %%
-  \fi  %%  end of \pdfescapestring  test
+%%  \fi  %%  end of \pdfescapestring  test
 \endgroup
 
 %% Affects CMap creation for certain fonts, according to glyph names
@@ -2473,11 +2527,11 @@
     \begingroup
      \def\sep{; }% should not be needed, but just in case
      \pdfinfo{%
-      \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)\fi
-      \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)\fi
-      \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)\fi
-      \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)\fi
-       /Creator(\pdfx at CreatorTool)%
+      \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)^^J\fi
+      \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)^^J\fi
+      \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)^^J\fi
+      \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)^^J\fi
+       /Creator(\pdfx at CreatorTool)^^J%
       \ifx\@pdfcreationdate\@empty
        /CreationDate(D:\pdfx at convDate)%
       \else
@@ -2489,8 +2543,8 @@
       \else
        /ModDate(\@pdfmoddate)%
       \fi
-      /Producer(\pdfx at Producer)%
-      /Trapped/False
+      ^^J/Producer(\pdfx at Producer)%
+      /Trapped/False^^J%
       \ifnum\xmp at Part=1
        /GTS_PDFXVersion(PDF/X-1\ifnum\xmp at ReleaseDate>2001
         \xmp at Conformance\fi:\xmp at ReleaseDate)%
@@ -2545,11 +2599,11 @@
     \begingroup
      \def\sep{; }% should not be needed, but just in case
      \pdfinfo{%
-      \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)\fi
-      \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)\fi
-      \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)\fi
-      \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)\fi
-       /Creator(\pdfx at CreatorTool)%
+      \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)^^J\fi
+      \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)^^J\fi
+      \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)^^J\fi
+      \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)^^J\fi
+       /Creator(\pdfx at CreatorTool)^^J%
       \ifx\@pdfcreationdate\@empty
        /CreationDate(D:\pdfx at convDate)%
       \else
@@ -2561,8 +2615,8 @@
       \else
        /ModDate(\@pdfmoddate)%
       \fi
-      /Producer(\pdfx at Producer)%
-      /Trapped/False
+      ^^J/Producer(\pdfx at Producer)%
+      /Trapped/False^^J%
       /GTS_PDFEVersion(PDF/E-1\xmp at Conformance:\xmp at ReleaseDate)%
      }%  end of  PDF/E  info
     \endgroup  %% end of scope for  \sep
@@ -2597,11 +2651,11 @@
    \begingroup
     \def\sep{; }% should not be needed, but just in case
     \pdfinfo{%
-     \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)\fi
-     \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)\fi
-     \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)\fi
-     \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)\fi
-      /Creator(\pdfx at CreatorTool)%
+     \ifx\pdfx at pdfTitle\@empty\else /Title(\pdfx at pdfTitle)^^J\fi
+     \ifx\pdfx at pdfAuthor\@empty\else /Author(\pdfx at pdfAuthor)^^J\fi
+     \ifx\pdfx at pdfSubject\@empty\else /Subject(\pdfx at pdfSubject)^^J\fi
+     \ifx\pdfx at pdfKeywords\@empty\else /Keywords(\pdfx at pdfKeywords)^^J\fi
+      /Creator(\pdfx at CreatorTool)^^J%
      \ifx\@pdfcreationdate\@empty
       /CreationDate(D:\pdfx at convDate)%
      \else
@@ -2613,8 +2667,8 @@
      \else
       /ModDate(\@pdfmoddate)%
      \fi
-     /Producer(\pdfx at Producer)%
-     /Trapped/False
+     ^^J/Producer(\pdfx at Producer)%
+     /Trapped/False^^J%
      /GTS_PDFA1Version (PDF/A-\xmp at Part\xmp at conf:\xmp at ReleaseDate)%
     }%  end of  PDF/A  info
    \endgroup  %%  end of scope for  \sep
@@ -2623,21 +2677,14 @@
 \fi\fi
 
 %%----------------------------------------------------------------------
+%%  2018-12-16:   xmpincl  needs the  ifthen  package
+%%  it should be loaded outside the grouping, else  biblatex  may barf
+%%
+\RequirePackage{ifthen}
 \begingroup
-%% override the \ifpdf  check of  xmpincl  package
-\ifxetex
+%% override the \ifpdf  check of  xmpincl  package, inside the grouping
  \pdftrue
-\else\ifluatex
- \pdftrue
-\fi\fi
-\RequirePackage{xmpincl}
-\ifxetex
- % revert \ifpdf
- \pdffalse
-\else\ifluatex
- \pdffalse
-\fi\fi
-
+ \RequirePackage{xmpincl}
 %% combine coding from  xmpincl  and  hyperxml to support XeTeX
 \def\pdfx at xmpincl@xetex#1{%
  \IfFileExists{#1.xmp}{%
@@ -2876,7 +2923,6 @@
 %%----------------------------------------------------------------------
 \ifpdfx at transliterated
 %% support for bookmarks with transliterated input
- \RequirePackage{stringenc}
  \ifxetex\let\pdf at escapehex\empty\fi  % don't need it
  \expandafter\ifx\csname pdf at escapehex\endcsname\relax
   \PackageWarning{pdfx}{%



More information about the tex-live-commits mailing list