Debian Codegraph @

texmf-dist/source/latex/pdfx/pdfx.dtx

raw
1 % \iffalse meta-comment
2 %
3 % File: pdfx.dtx
4 %
5 % Copyright (c) 2019, CV Radhakrishnan <[email protected]>,
6 % Han The Thanh <[email protected]>,
7 % Ross Moore <[email protected]>,
8 % Peter Selinger <[email protected]>
9 %
10 % This file may be distributed and/or modified under the conditions
11 % of the LaTeX Project Public License, either version 1.2 of this
12 % license or (at your option) any later version. The latest version
13 % of this license is in:
14 %
15 % http://www.latex-project.org/lppl.txt
16 %
17 % and version 1.2 or later is part of all distributions of LaTeX
18 % version 1999/12/01 or later.
19 %
20 % \fi
21 %
22 % \CheckSum{6802}
23 % \iffalse
24 %
25 %<*driver>
26 \pdfcompresslevel 9
27 \providecommand{\pdfxopt}{a-2u}
28 \providecommand{\lastyear}{2018}
29 \providecommand{\thisyear}{2024}
30 \begin{filecontents}[force]{./\jobname.xmpdata}
31 \Title{Generation of PDF/X- and PDF/A-compliant PDFs with pdfTeX \textemdash\ pdfx.sty}
32 \Author{\CVR\sep \Thanh\sep Ross Moore\sep Peter Selinger}
33 \Subject{This package supports generation of PDF/X-, PDF/A- and PDF/E-compliant documents, in most of their variants, using pdfLaTeX, LuaLaTeX and XeLaTeX.}
34 \Keywords{PDF/X-, PDF/A- and PDF/E-compliance\sep Multilingual Metadata\sep installation\sep \TeX Live \thisyear}
35 \PublicationType{manual}
36 \Contributor{Norbert Preining: 'colorprofiles' package}
37 \Copyright{Public domain.}
38 \Copyrighted{False}
39 \CopyrightURL{http://tug.org/texlive/}
40 \CoverDisplayDate{July \thisyear}
41 \CoverDate{\thisyear-07-01}
42 \CreatorTool{LaTeX + pdfx.sty with option \pdfxopt, from TeX Live \thisyear}
43 \Date{2024-07-01}
44 \Advisory{An earlier version of this documentation was published as: TUGboat 36, No.2, pp.136\textendash 142 (2015)}
45 \Advisory{v1.6: Added XMP support for PDF/UA-1. Added more Metadata fields and Language support.}
46 \Advisory{v1.6: Default RGB and CMYK profiles now require the colorprofiles.sty package.}
47 \Relation{Requires the colorprofiles package for RGB and CMYK default profiles.}
48 \Advisory{v1.6: Access more profiles, incl. to pdfaPilot's color profile folders.}
49 \Advisory{v1.6: Revised glyphtounicode.sty to use variation selectors.}
50 \Advisory{v1.6: altered maps to PUA codepoints.}
51 \Advisory{v1.6: added more glyphs via glyphtounicode-ntx.tex }
52 \Advisory{v1.6: Support for 8-bit Hebrew encodings, some Arabic and Devanagari.}
53 \Advisory{v1.6: Updated documentation, incl. for LaTeX changes.}
54 \Advisory{v1.6.1: Fixed issue with ifthen package; improved Metadata with LuaTeX and XeTeX.}
55 \Advisory{v1.6.1: Flexibility with page boxes for PDF/X.}
56 \Advisory{v1.6.2: Fixed passing of options to xcolor, and some glyphtounicode values.}
57 \Advisory{v1.6.2: Fixed encoding issue. Extra warning when colorprofiles.tex is missing.}
58 \Advisory{v1.6.3: Properly fixed encoding issue; supports \string\pdfomitcharset\ primitive.}
59 \Advisory{v1.6.3: Reference to veraPDF validation software; additions to glyphtounicode-ntx.tex.}
60 \Advisory{v1.6.3: Patched \string\mathaccentV\ to output accents after the base character.}
61 \Advisory{v1.6.4: Added check and warning with luatex for whether \string\pdfminorversion\ can be changed.}
62 \Advisory{v1.6.4: Ensure correct \string\catcode for input characters up to 31, when reading .xmpdata file.}
63 \Advisory{v1.6.4: Disabled patched \string\mathaccentV\ due to incompatibility with wide base expressions.}
64 \Advisory{v1.6.5: Support for \string\Nickname\ as Metadata command.}
65 \Advisory{v1.6.5: Ensure par is unexpandable when reading Metadata.}
66 \Advisory{v1.6.5a: Support for Memoir class's \string\stockwidth\ and \string\stockheight.}
67 \Advisory{v1.6.5a: Added pdf20 option for PDF 2.0, with support for \string\pdfmajorversion.}
68 \Advisory{v1.6.5b: Avoid loading xmpincl package from within a TeX grouping.}
69 \Advisory{v1.6.5c: Avoid loading stringenc package from within a TeX grouping.}
70 \Advisory{v1.6.5d: Disable some options for xcolor after use.}
71 \Advisory{v1.6.5e: Ensure \string\pdfmajorversion\ and \string\pdfminorversion\ are both defined and set correctly.}
72 \Advisory{v1.6.5e: Updated documentation; added new Bibliography entries and revised URL links.}
73 \Advisory{v1.6.5f: Reset ifpdf properly; support \string\creationdate with XeTeX. Revised Glossary layout.}
74 \pdfxEnableCommands{%
75 \def\CVR{C.V. Radhakrishnan}\def\Thanh{H\`an Th\eee Thanh}%
76 \def\eee{^^c3^^aa^^cc^^81 }}
77 \end{filecontents}
78 \PassOptionsToPackage{dvipsnames,svgnames}{xcolor}
79 \documentclass[a4paper]{ltxdoc}
80 \usepackage[\pdfxopt]{pdfx}
81 \usepackage{rvdtx}
82 \usepackage{graphicx}
83 \usepackage[latin10]{inputenc}
84 \input text89.def
85 \usepackage[T1]{fontenc}
86 \hypersetup{citecolor=blue}
87 \pdfstringdefDisableCommands{\def\thinspace{}}
88 \newcommand{\fixmd}{${}^{\mathrm f}$}
89 \newcommand{\starmd}{${}^{\ast}$}
90 \EnableCrossrefs
91 \CodelineIndex
92 \RecordChanges
93 \begin{document}
94 \DocInput{\jobname.dtx}
95 \PrintChanges
96 \PrintIndex
97 \end{document}
98 %</driver>
99 % \fi
100 %
101 % \CharacterTable
102 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
103 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
104 % Digits \0\1\2\3\4\5\6\7\8\9
105 % Exclamation \! Double quote \" Hash (number) \#
106 % Dollar \$ Percent \% Ampersand \&
107 % Acute accent \' Left paren \( Right paren \)
108 % Asterisk \* Plus \+ Comma \,
109 % Minus \- Point \. Solidus \/
110 % Colon \: Semicolon \; Less than \<
111 % Equals \= Greater than \> Question mark \?
112 % Commercial at \@ Left bracket \[ Backslash \\
113 % Right bracket \] Circumflex \^ Underscore \_
114 % Grave accent \` Left brace \{ Vertical bar \|
115 % Right brace \} Tilde \~}
116 %
117 % \GetFileInfo{pdfx.dtx}
118 %
119 % \DoNotIndex{\newcommand,\newenvironment}
120 %
121 % \DoNotIndex{\def,\edef,\gdef,\xdef,\global,\long,\let}
122 % \DoNotIndex{\expandafter,\string,\the,\ifx,\else,\fi}
123 % \DoNotIndex{\csname,\endcsname,\relax,\begingroup,\endgroup}
124 % \DoNotIndex{\DeclareTextCommand,\DeclareTextCompositeCommand}
125 % \DoNotIndex{\space,\@empty,\special,\@nil,\z@,\@@mod}
126 % \DoNotIndex{\\,\@gobble,\@@,\@fornoop,\@fortmp,\@ifundefined,\@firstoftwo,\@secondoftwo}
127 % \DoNotIndex{\@tempcnta,\@tempcntb,\@tempboxa,\ifnot@empty,\@this,\@firstofone}
128 % \DoNotIndex{\{,\},\alph,\bgroup,\dp,\ht,\kern,\egroup}
129 % \DoNotIndex{\do,\end,\HN,\ifcase,\ifnum,\IfFileExists,\ifvmode}
130 % \DoNotIndex{\ignorespaces,\immediate,\input,\item,\jobname}
131 % \DoNotIndex{\leavevmode,\loop,\repeat,\makeatletter,\makeatother}
132 % \DoNotIndex{\meaning,\newcounter,\next,\or,\par,\renewcommand}
133 % \DoNotIndex{\renewcommand,\renewenvironment,\stepcounter}
134 % \DoNotIndex{\Tg,\thepage,\unskip,\write,\advance,\{,\}}
135 % \DoNotIndex{\@ifpackageloaded,\@ifclassloaded,\@pdfcreationdate,\@pdfcreator}
136 % \DoNotIndex{\@pdfmoddate,\AtBeginDocument,\catcode,\DeclareOption}
137 % \DoNotIndex{\endinput,\endlinechar,\errmessage,\everyeof,\futurelet}
138 % \DoNotIndex{\Hy@DisableOption,\Hy@UseMaketitleInfos,\hypersetup}
139 % \DoNotIndex{\inputencoding,\InputIfFileExists,\NeedsTeXFormat}
140 % \DoNotIndex{\newif,\noexpand,\obeyspaces,\PackageError,\PDF@FinishDoc}
141 % \DoNotIndex{\pdfcatalog,\pdfcreationdate,\pdfgeninterwordspace}
142 % \DoNotIndex{\pdfinterwordspace,\pdfinterwordspaceoff,\pdfgentounicode}
143 % \DoNotIndex{\pdfinfo,\pdfinterwordspaceon,\pdflastobj,\pdfmapline}
144 % \DoNotIndex{\pdfmdfivesum,\pdfminorversion,\pdfobj,\pdfobjcompresslevel}
145 % \DoNotIndex{\pdfpageattr,\pdfresetpageorigin,\pdfstringdef}
146 % \DoNotIndex{\pdftexbanner,\ProcessOptions,\ProvidesPackage,\RequirePackage}
147 % \DoNotIndex{\scantokens,\typeout,\vrule,\wd}
148 %
149 % \changes{v1.00}{2008/12/01}{Initial commit to the CVS.}
150 % \changes{v1.01}{2008/12/10}{\texttt{glyphtounicode-cmr.tex} included with the package.}
151 % \changes{v1.3}{2008/12/01}{Fix copyright in \texttt{.xmp} files.}
152 % \changes{v1.5.4}{2015/02/28}{Fixed timezone bug; Unicode support; more
153 % PDF variants; added color profiles.}
154 % \changes{v1.5.5}{2015/03/23}{Support for PDF/X-4p and PDF/X-5pg
155 % with external color profiles.}
156 % \changes{v1.5.6}{2016/02/05}{Suppressed `dummy-space' font warning;
157 % removed spurious `?' in XMP packets; improved handling of Color Profiles;
158 % ensure \texttt{\textbackslash Hy@pdfatrue} when building PDF/A, for link flags;
159 % properly enables \texttt{xcolor} conversion of color models.}
160 % \changes{v1.5.7}{2016/02/17}{Removed UTF-8 characters that appear in
161 % the documentation only, within comments in the package source,
162 % but result in a validation failure. Language support in XMP metadata.
163 % Added macros for Windows and Mac system color profile directories.}
164 % \changes{v1.5.8}{2016/05/03}{MediaBox, TrimBox, etc. derived from
165 % the \texttt{\textbackslash paperheight}, \texttt{\textbackslash paperwidth}.
166 % Improved language support, incl. KOI8-R
167 % encoded cyrillics, Armenian OT6, and LGR Greek encoding, incl. polytonic Greek.
168 % All the encodings Latin-1--9 are supported for upper 8-bit characters.
169 % Fixed the quoted file-name problem, evident with Lua\TeX.
170 % Method to generate correct bookmarks with non-active (transliterated) input.
171 % Added support for Xe\LaTeX, improvements with Lua\TeX. Updated documentation.}
172 % \changes{v1.5.82}{2017/05/12}{%
173 % Adjusted to changes in the \LaTeX\ core, affecting macros for composite
174 % commands; incl. \texttt{\textbackslash textsuperscript} and others.}%
175 % \changes{v1.5.83}{2017/05/16}{Improved support for Xe\LaTeX\ and Lua\LaTeX.}%
176 % \changes{v1.5.84}{2017/05/18}{Fully expand options for \texttt{hyperref}. Better support
177 % for extended IPA letters and modifiers. Adjusted release versions and dates.}%
178 % \changes{v1.5.85}{2017/06/23}{Fixed bugs, and fully implemented L8U as
179 % a pseudo-encoding; renamed L8U files into the form \texttt{*-penc.def}.}%
180 % \changes{v1.6}{2018/11/18}{Added XMP support for PDF/UA-1.
181 % Added more Metadata fields and Language support.
182 % Default RGB and CMYK profiles now require the \texttt{colorprofiles.sty} package.
183 % Added file \texttt{CallasColorProfiles.tex}.
184 % Revised \texttt{glyphtounicode.sty} to use variation selectors, altered maps to PUA
185 % codepoints; added more glyphs via \texttt{glyphtounicode-ntx.tex}.
186 % Support for 8-bit Hebrew encodings, some Arabic and Devanagari.
187 % Updated documentation, incl. for \LaTeX\ changes.
188 % }%
189 % \changes{v1.6.1}{2018/12/22}{Fixed issue with \texttt{ifthen} package;
190 % improved Metadata with Lua\TeX\ and Xe\TeX. Flexibility with page boxes for PDF/X.}%
191 % \changes{v1.6.2}{2019/01/04}{Fixed passing of options to \texttt{xcolor}, and some \texttt{glyphtounicode} values.}%
192 % \changes{v1.6.3}{2019/02/27}{Fixed encoding issues; support for new \texttt{\textbackslash pdfomitcharset} primitive;
193 % reference to \textsf{veraPDF} validation software; additions to \texttt{glyphtounicode-ntx.tex}.}%
194 % \changes{v1.6.4}{2019/09/26}{Added check and warning with \texttt{luatex} for whether \texttt{\textbackslash pdfminorversion} can be changed;
195 % ensure correct \texttt{\textbackslash catcode} for input characters up to 31, when reading \texttt{.xmpdata} file;
196 % disabled patched \texttt{\textbackslash mathaccentV} due to incompatibility with wide base expressions.}
197 % \changes{v1.6.5}{2021/07/06}{Support for \texttt{\textbackslash Nickname} as Metadata command;
198 % ensure \texttt{\textbackslash par} is unexpandable when processing XMP metadata.}
199 % \changes{v1.6.5a}{2023/10/17}{Added option \texttt{pdf20} for future need with PDF 2.0; support for \texttt{\textbackslash pdfmajorversion};
200 % support for Memoir's \texttt{\textbackslash stockwidth} and \texttt{\textbackslash stockheight} dimen registers.}
201 % \changes{v1.6.5b}{2024/04/05}{Avoid loading \texttt{xmpincl} package from within a \TeX\ grouping.}
202 % \changes{v1.6.5c}{2024/05/23}{Avoid loading \texttt{stringenc} package from within a \TeX\ grouping.}
203 % \changes{v1.6.5d}{2024/05/29}{Adjust for non-zero \texttt{\textbackslash stockwidth} only; prevent changes to \texttt{xcolor} options after use.}
204 % \changes{v1.6.5e}{2024/06/22}{Ensure \texttt{\textbackslash pdfmajorversion} and \texttt{\textbackslash pdfminorversion}
205 % are both defined and set correctly. Updated documentation; added new Bibliography entries and revised URL links.}
206 % \changes{v1.6.5f}{2024/06/24}{Reset \texttt{\textbackslash ifpdf} properly; support \texttt{\textbackslash creationdate} with Xe\TeX. Revised Glossary layout.}
207 % \title{Generation of PDF/X- and PDF/A-\penalty-200 compliant PDFs with \pdftex --- \texttt{pdfx.sty}}
208 % \date{2024/07/01}
209 % \version{1.6.5f}
210 % \keywords{PDF, PDF/A, PDF/X, pdf\TeX, \LaTeX, Multilingual Metadata}
211 % \author{C.\,V.\,Radhakrishnan, \Thanh, Ross Moore {\upshape\small
212 % and} Peter Selinger}
213 % \contact{\texttt{[cvr,thanh]@river-valley.org},\\%
214 % \texttt{[email protected]}, \texttt{[email protected]}\hss}
215 %
216 % \maketitle
217 %
218 % \StopEventually{}
219 %
220 % \section[Introduction]{Introduction}
221 %
222 % This package\footnote{An earlier version of this documentation
223 % was published as \cite{pdfx}. All the changes since then have been developed
224 % and coded by the 3rd-listed author.}
225 % currently supports generation of PDF/X-, PDF/A- and PDF/E-compliant
226 % documents, using \pdftex, in most of their variants;
227 % see the complete list in Section~\ref{ssec-options} below.
228 % As of \TeX\,Live 2016 it now also works with Lua\LaTeX\ and Xe\LaTeX,
229 % when using appropriate command-line options\footnote{%
230 % The required invocation is:\quad
231 % |xelatex --shell-escape -output-driver="xdvipdfmx -z 0" <filename>.tex |}, but
232 % with some limitations --- see Sections~\ref{sssec-xetex} and \ref{sssec-luatex}.
233 % By `supports', we mean that the package provides correct and sufficient
234 % means to declare that a document conforms with a stated PDF variant
235 % (PDF/X, PDF/A, PDF/E, PDF/VT, PDF/UA, etc.) along with the version and/or
236 % level of conformance.
237 % This package also allows appropriate Metadata and Color Profile
238 % to be specified, according to the requirements of the PDF variant.
239 %
240 % Metadata elements, most of which must ultimately be written as XML
241 % using the UTF-8 encoding, is provided via a file named |\jobname.xmpdata|,
242 % for the running \LaTeX\ job. Without such a file, providing some required
243 % information as well as a large range of optional data, a fully validating
244 % PDF file cannot be achieved. The PDF can be created, having the correct
245 % visual appearance on all pages, but it will not pass validation checks.
246 % Sections~\ref{ssec-metadata} and \ref{ssec-multi} describe
247 % how this file should be constructed.
248 %
249 % \medskip
250 % What this package \emph{does not do} is to check for all the details
251 % of document structure and type of content that may be required
252 % (or restricted) within a PDF variant. For example, PDF/VT \cite{PDFVT} requires
253 % well-structured parts, using Form XObject sections tagged as `/DPart'.
254 % Similarly PDF/A-1a (and 2a and 3a) \cite{PDFA,PDFA2,PDFA3} require
255 % a fully `Tagged PDF', including a detailed structure tagging which
256 % envelops the complete contents of the document, as does also PDF/UA \cite{PDF-UA}.
257 % This is beyond the current version of \LaTeX\ engines as commonly shipped;
258 % though see Section~\ref{sec-pdf20} for recent developments.
259 % So while this package provides enough to meet the declaration,
260 % Metadata and font-handling aspects for these PDF/A variants,
261 % it is not sufficient to produce fully-conforming PDFs.
262 % However, with extra \pdftex-based software or macro coding that \emph{is} capable
263 % of producing `Tagged PDF', this package can be used as part of
264 % the overall workflow to produce fully-conforming documents; see \cite{tpdf}.
265 %
266 %
267 % \subsection{PDF standards}\label{ssec-standards}
268 %
269 % PDF/X and PDF/A are umbrella terms used to denote several ISO
270 % standards \cite{PDFX,PDFX3,PDFX1a,PDFX4,PDFX5,PDFA,PDFA2,PDFA3}
271 % that define different subsets of the PDF standard \cite{PDF17,ISO32000}.
272 % The objective of PDF/X is to facilitate graphics exchange between
273 % document creator and printer and therefore, has all requirements
274 % related to printing. For instance, in PDF/X, all fonts need to be
275 % embedded and all images need to be CMYK or spot colors. PDF/X-2 and
276 % PDF/X-3 accept calibrated RGB and CIELAB colors along with all other
277 % specifications of PDF/X.
278 % Since 2005 other variants of PDF/X have emerged, as extra effects
279 % (such as layering and transparency) have been supported within the PDF
280 % standard itself. The full range of versions and conformance supported
281 % in this package is discussed below in Section~\ref{ssec-options}.
282 %
283 % PDF/A defines a profile for archiving PDF documents, which ensures
284 % the documents can be reproduced in the exact same way in years to
285 % come. A key element to achieving this is that PDF/A documents
286 % are 100\% self-contained. All the information needed to display the
287 % document in the same manner every time is embedded in the file.
288 % A PDF/A document is not permitted to be reliant on information from
289 % external sources. Other restrictions include avoidance of
290 % audio/video content, JavaScript and encryption.
291 % Mandatory inclusion of fonts, color profile and standards-based metadata
292 % are absolutely essential for PDF/A.
293 % Later versions allow for use of image compression and file attachments.
294 %
295 % PDF/E is an ISO standard \cite{PDFE} intended for documents used in engineering workflows.
296 % PDF/VT \cite{PDFVT} allows for high-volume customised form printing, such as utility bills.
297 % PDF/UA (`Universal Accessibility') has emerged as a standard \cite{PDF-UA,PDFUA1,PDFUABSI}
298 % supporting Assistive Technologies, incorporating web-accessibility guidelines (WCAG)
299 % for electronic documents.
300 % In future, PDF/H may emerge for health records and medical-related
301 % documents. Other applications can be envisaged.
302 % Declarations and Metadata are supported for the first three of these.
303 % The others are the subject of further work; revised versions of this
304 % package can be expected in later years.
305 %
306 % More complete descriptions of these standards and their usage can be
307 % found on Wikipedia pages~\cite{wikiPDF}. These pages also include
308 % comprehensive links to web resources, guides, commentaries, discussions
309 % and whatever else is relevant to how the standards have been established
310 % and how they can be used.
311 %
312 % \subsection{Later \LaTeX\ changes, support for newer PDF standards}\label{sec-pdf20}
313 %
314 % Although PDF 2.0~\cite{PDF20} was first published in 2017 and revised in 2020, it has taken
315 % a long time for it to become a target format for documents built using \LaTeX.
316 % This is because the requirement of using `Tagged PDF' is stringent, requiring
317 % a reworking of almost every aspect of \LaTeX's document production model \cite{LaTeXPDF}.
318 % Work to this end is going on, via the PDF Association's `\LaTeX\ Project LWG'\cite{PDF-LaTeX},
319 % the experimental |tagpdf| package \cite{tagpdf}, and Ross Moore's |tpdf| package and macro suite \cite{tpdf}.
320 % Significant internal changes have been made to \LaTeX\ itself, which in turn have
321 % required the |v1.6.5x| updates in 2024 to this |pdfx| package. We thank the following users for reporting
322 % issues arising from such changes: Sergio Zenoni, Takehiko Tanabe, Tom\'a\v s Nov\'a\v cek.
323 %
324 % In early 2024 the PDF Association published several documents for new and updated standards
325 % based upon PDF 2.0~\cite{PDF20}. These include PDF/UA-2 \cite{PDFUA2}, PDF `Declarations' \cite{PDFDecl},
326 % `Well-Tagged PDF' (WTPDF) \cite{WTPDF} with declarations for `Accessibility' and `Reuse',
327 % adding to PDF/A-4 \cite{PDFA4}, PDF/X-6 \cite{PDFX6} and PDF/VT-3 \cite{PDFVT3}, each with various flavours.
328 % To support these, there will be released in late 2024 a variant named |pdfx2| as an extension of |pdfx|,
329 % with separate documentation detailing how to specify appropriate XMP metadata \cite{XMP-ISO}.
330 %
331 % Once |pdfx2| becomes available, this will take on the role of handling new developments for
332 % \LaTeX\ support of PDF 2.0-based software solutions. The |pdfx| package will remain under
333 % active development, primarily to ensure compatibility of existing documents with PDF 1.7-based
334 % requirements (tagged or otherwise), following any further changes in \LaTeX\ or other packages.
335 %
336 % \section[Usage]{Usage}\label{sec-usage}
337 %
338 % The package can be loaded with the command:
339 % \begin{decl}
340 % \defmacro{usepackage}|[<option>]{pdfx}|
341 % \end{decl}
342 % where the options are as follows.
343 %
344 % \subsection{Package options}\label{ssec-options}
345 %
346 % \subsubsection{PDF/A options}
347 %
348 % PDF/A is an ISO standard~\cite{PDFA,PDFA2,PDFA3} intended for long-term archiving of
349 % electronic documents. It therefore emphasizes self-containedness and
350 % reproducibility, as well as machine-readable metadata. The PDF/A
351 % standard has three conformance levels `a', `b', and `u'. Level
352 % `a' is the strictest, but is not yet fully implemented by the
353 % |pdfx| package. Conformance level `u' has the same requirements as
354 % level `b', but with the additional requirement that all text in
355 % the document must have a Unicode mapping. However, the |pdfx|
356 % package produces such Unicode mappings even in level `b' files.
357 % The standard also has three different versions 1, 2, and 3, which
358 % were standardized in 2005, 2011 and 2012, respectively. Earlier
359 % versions contain a subset of the features of later versions, so for
360 % maximum portability, it is preferable to use a lower-numbered
361 % version, when the extra features allowed in higher versions are not used.
362 % There is no conformance level `u' in version 1 of the standard.
363 % Thus for many typical uses of PDF/A, it is sufficient to use PDF/A-1b.
364 %
365 % \begin{itemize}
366 % \item |a-1a|: generate PDF/A-1a. Experimental, not fully implemented.
367 % \item |a-1b|: generate PDF/A-1b.
368 % \item |a-2a|: generate PDF/A-2a. Experimental, not fully implemented.
369 % \item |a-2b|: generate PDF/A-2b.
370 % \item |a-2u|: generate PDF/A-2u.
371 % \item |a-3a|: generate PDF/A-3a. Experimental, not fully implemented.
372 % \item |a-3b|: generate PDF/A-3b.
373 % \item |a-3u|: generate PDF/A-3u.
374 % \end{itemize}
375 % By `Experimental, not fully implemented' here we mean primarily that
376 % the document structure, as required for `Tagged PDF', is not handled
377 % by this package. Using other \pdftex-based software that \emph{is}
378 % capable of producing such complete tagging, conforming documents
379 % can indeed be produced.
380 %
381 % \subsubsection{PDF/E options}
382 %
383 % PDF/E is an ISO standard~\cite{PDFE} intended for documents used in engineering
384 % workflows. There is only one version of the PDF/E standard so far,
385 % and it is called PDF/E-1.
386 %
387 % \begin{itemize}
388 % \item |e-1|: generate PDF/E-1.
389 % \item |e|: same as |e-1|.
390 % \end{itemize}
391 %
392 % \subsubsection{PDF/UA options}
393 %
394 % PDF/UA is an ISO and ANSI standard~\cite{PDF-UA,PDFUABSI} intended for making
395 % structured documents readable and navigable using Assistive Technology;
396 % e.g., screen-readers, Braille keyboards and such-like.
397 % Documents prepared this way can be easily saved in other formats which
398 % preserve the structure, such as XML, HTML, and (Microsoft) Word-based formats.
399 %
400 % \begin{itemize}
401 % \item |ua-1|: generate PDF/UA-1.
402 % \item |ua|: same as |ua-1|.
403 % \end{itemize}
404 %
405 % \subsubsection{PDF/VT options}
406 %
407 % PDF/VT is an ISO standard intended as an exchange format for
408 % variable and transactional printing, and is an extension of the
409 % PDF/X-4 standard. The standard specifies three PDF/VT conformance
410 % levels. Level 1 is for single-file exchange, level 2 is for
411 % multi-file exchange, and level 2s is for streamed delivery.
412 % Currently, none of the PDF/VT conformance levels are fully
413 % implemented by the |pdfx| package.
414 %
415 % \begin{itemize}
416 % \item |vt-1|: generate PDF/VT-1, based on PDF/X-4. Experimental, not fully implemented
417 % \item |vt-2|: generate PDF/VT-2, based on PDF/X-5pg. Experimental, not fully implemented.
418 % \item |vt-2s|: generate PDF/VT-2s. Experimental, not fully implemented.
419 % \end{itemize}
420 % By `Experimental, not fully implemented' here we mean primarily that
421 % the structuring of a document into `/DPart' sections, as Form XObjects,
422 % is not handled by this package.
423 % This \emph{is} possible with current \pdftex\ software,
424 % but not yet in a way that lends itself easily to full automation, due to
425 % requirements of knowing the internal object number of certain internal
426 % PDF constructs. All the other aspects: PDFInfo declaration, Metadata
427 % and Color Profile, of the PDF/VT variants are correctly handled.
428 %
429 % \subsubsection{PDF/X options}
430 %
431 % PDF/X is an ISO standard intended for graphics interchange. It
432 % emphasizes printing-related requirements, such as embedded fonts and
433 % color profiles. The PDF/X standard has a large number of variants
434 % and conformance levels. The basic variants are X-1, X-1a,
435 % X-3, X-4, and X-5. (Note that a revised version of the X-2 standard
436 % was published in 2003 but withdrawn as an ISO standard in 2011,
437 % basically due to lack of interest in using it).
438 % The PDF/X-1a standard exists in revisions of 2001 and 2003,
439 % the PDF/X-3 standard exists in revisions of 2002 and 2003,
440 % and the PDF/X-4 and PDF/X-5 standards exist in revisions of 2008 and 2010.
441 % Moreover, some of these standards have a `p' version, which permits the
442 % use of an externally supplied color profile (instead of an embedded one),
443 % and/or a `g' version, which permits the use of external graphical
444 % content. Moreover, PDF/X-5 has an `n' version, which extends
445 % PDF/X-4p by permitting additional `Custom' color spaces other than Grayscale,
446 % RGB, and CMYK. For many typical uses of PDF/X, it is sufficient to
447 % use PDF/X-1a.
448 %
449 % \begin{itemize}
450 % \item |x-1|: generate PDF/X-1; now obsolete, doesn't validate.
451 % \item |x-1a|: generate PDF/X-1a. Options |x-1a1| and |x-1a3| are
452 % also available to specify PDF/X-1a:2001 or PDF/X-1a:2003 explicitly.
453 % \item |x-2|: generate PDF/X-2; unpublished, doesn't validate.
454 % \item |x-3|: generate PDF/X-3. Options |x-302| and |x-303| are
455 % also available to specify PDF/X-3:2002 or PDF/X-3:2003 explicitly.
456 % \item |x-4|: generate PDF/X-4. Options |x-408| and |x-410| are
457 % also available to specify PDF/X-4:2008 or PDF/X-4:2010 explicitly.
458 % \item |x-4p|: generate PDF/X-4p. Options |x-4p08| and |x-4p10| are
459 % also available to specify PDF/X-4p:2008 or PDF/X-4p:2010 explicitly.
460 % \item |x-5g|: generate PDF/X-5g. Options |x-5g08| and |x-5g10| are
461 % also available to specify PDF/X-5g:2008 or PDF/X-5g:2010 explicitly.
462 % \item |x-5n|: generate PDF/X-5n. Options |x-5n08| and |x-5n10| are
463 % also available to specify PDF/X-5n:2008 or PDF/X-5n:2010 explicitly.
464 % Experimental, not fully implemented.
465 % \item |x-5pg|: generate PDF/X-5pg. Options |x-5pg08| and |x-5pg10| are
466 % also available to specify PDF/X-5pg:2008 or PDF/X-5pg:2010 explicitly.
467 % \end{itemize}
468 %
469 % \subsubsection{Other options}
470 %
471 % These options are experimental and should not normally be used.
472 %
473 % \begin{itemize}
474 % \item |useBOM|: generate an explicit UTF-8 byte-order marker in the
475 % embedded XMP metadata, and make the XMP packet writable. Neither
476 % of these features are required by the PDF/A standard, but there
477 % exist some PDF/A validators (reportedly |validatepdfa.com|) that
478 % seem to require them. Note: the implementation of this feature is
479 % experimental and may break with future updates to the |xmpincl|
480 % package.
481 % \item |noBOM|: do not generate the optional byte-order marker. (default)
482 % \item |noerr|: avoids stopping when making PDF/X with an RGB profile,
483 % and at other unusual situations; e.g., PDF/UA without also PDF/A.
484 % \item |pdf12|: use PDF 1.2, overriding the version specified by the
485 % applicable standard.\\This may produce a non-standard-conforming PDF file.
486 % \item |pdf13|: use PDF 1.3, overriding the version specified by the
487 % applicable standard.\\This may produce a non-standard-conforming PDF file.
488 % \item |pdf14|: use PDF 1.4, overriding the version specified by the
489 % applicable standard.\\This may produce a non-standard-conforming PDF file.
490 % \item |pdf15|: use PDF 1.5, overriding the version specified by the
491 % applicable standard.\\This may produce a non-standard-conforming PDF file.
492 % \item |pdf16|: use PDF 1.6, overriding the version specified by the
493 % applicable standard.\\This may produce a non-standard-conforming PDF file.
494 % \item |pdf17|: use PDF 1.7, overriding the version specified by the
495 % applicable standard.\\This may produce a non-standard-conforming PDF file.
496 % \item |pdf20|: use PDF 2.0, experimental in preparation for use with future
497 % software, under development. This may produce a non-standard-conforming PDF file.
498 % \item |nocharset|: do not generate the Charset entry for fonts (\pdftex\ only).
499 % \item |usecharset|: generate the Charset entry for fonts (\pdftex\ only).
500 % \end{itemize}
501 % The latter two options affect the value of the |\pdfomitcharset| primitive,
502 % added to \pdftex\ in 2019, due to differing requirements for PDF/A-1
503 % and other PDF/A versions. Indeed use of the |/Charset| entry for a font
504 % is deprecated entirely for PDF 2.0~\cite{PDF20} and later.
505 %
506 % \subsubsection{XMP language options}\label{ssec-xmplang}
507 %
508 % These options allow for characters in alphabets other than those
509 % used for English and Western European languages to be used
510 % within the |.xmpdata| file (see Section~\ref{ssec-metadata}),
511 % supported through \LaTeX\ character representation macros.
512 % \begin{itemize}
513 % \item |latxmp|: extended Latin blocks, |Ux0180|--|Ux024F|
514 % and |Ux1E00|--|Ux1EFF|
515 % \item |armxmp|: armenian letters and ligatures, |Ux0530|--|Ux058F|,
516 % via macros |\armyba|, |\armfe|, |\armcomma|, etc.
517 % \item |cyrxmp|: cyrillic letters and accents, |Ux0400|--|Ux04FF|
518 % and |Ux0500|--|Ux0527| via macros |\cyra|, |\CYRN|, etc.
519 % \item |grkxmp|: greek letters and diacritics, |Ux0370|--|Ux03FF|
520 % and |Ux1F00|--|Ux1FFF| via macros |\textalpha|, |\textPi|, etc.
521 % \item |hebxmp|: some hebrew letters and marks, |Ux05C0|--|Ux05F4|
522 % via macros |\hebalef|, |\hebtav|, |\doubleyod|, etc.
523 % \item |arbxmp|: some arabic letters and marks, |Ux0600|--|Ux06FF|
524 % via macros |\hamza|, |\alef|, |\sukun|, etc.
525 % \item |vnmxmp|: vietnamese letters and accents, |Ux1EA0|--|Ux1EFF|
526 % via macros |\abreve|, |\uhorn|, |\ECIRCUMFLEX|, etc.
527 % \item |ipaxmp|: phonetic extensions, |Ux0250|--|Ux02AF|
528 % and |Ux1D00|--|Ux1DFF|
529 % \item |mathxmp|: mathematical letters, symbols, operators
530 % arrows, alphanumeric forms.
531 % \item |allxmp|: all of the above, as well as those listed next;
532 % used primarily for testing compatibility with other packages.
533 % \end{itemize}
534 % The characters supported by these options include those supported
535 % by |hyperref.sty| via the |PDFdoc| encodings (|PD1| and |PU|)
536 % for inclusion in PDF files. Extra support is provided for math
537 % alphabets. For Armenian, the macros defined by Arm\TeX\ are supported.
538 %
539 % \medskip
540 % Further options allow direct (enclosed) input of upper 8-bit
541 % characters, from encodings such as Latin-1--Latin-9, KOI8-R,
542 % LGR (Greek), ArmSSCI8, and a few more.
543 % Use of these requires a carefully controlled parsing regime.
544 % Here we list the package options that declare such content
545 % may be present in the |.xmpdata| file.
546 % A detailed account of how these are used is given
547 % in~Section~\ref{ssec-multi} (``Multilingual Metadata'').
548 % \begin{itemize}
549 % \item |LATxmp|: support for direct use of the upper-range characters
550 % (byte codes 160--255) for input encodings Latin1--Latin9, for
551 % Latin-based alphabets as used in European countries and elsewhere.
552 % This defines parser macros |\textLAT|, |\textLII|, \dots, |\textLIX|.
553 % All support from |latxmp| is loaded also.
554 % \item |KOIxmp|: support for direct use of cyrillic letters by use
555 % of upper-range characters (byte codes 148--255) under input
556 % encodings KOI8-R and KOIR8-RU, using |\textKOI| as parser macro.
557 % All support from |cyrxmp| is loaded also.
558 % \item |LGRxmp|: support for greek letters entered using either
559 % the LGR input transliteration of ASCII characters, or the ISO-8859-7
560 % encoding of upper-range characters (byte codes 160--255),
561 % or a combination of both, using |\textLGR| as parser macro.
562 % All support from |grkxmp| is loaded also.
563 % \item |AR8xmp|: support for armenian letters entered using the
564 % Arm\TeX~2.0 input transliteration of ASCII characters, or the
565 % ArmSCII8 encoding of upper-range characters (byte codes 160--255),
566 % or a combination of both, using |\textARM| as parser macro.
567 % All support from |armxmp| is loaded also.
568 % \item |HEBxmp|: support for hebrew letters entered using either
569 % LHE input transliteration of ASCII characters, or the CP1255, CP862
570 % or ISO-8859-8 (HE8) encoding of upper-range characters (byte codes 160--255),
571 % or a combination of these using |\textLHE|, |\textHEBO|, |\textHEB| as parser macros.
572 % All support from |hebxmp| is loaded also.
573 % \end{itemize}
574 % These `parser' options have received limited testing, so please
575 % report any mistakes in the UTF-8 output that you may encounter.
576 %
577 % \subsection{Data file for metadata}\label{ssec-metadata}
578 %
579 % As mentioned above, standards-compliant PDF documents require
580 % document-level metadata to be included.
581 % This, known as an `XMP packet'~\cite{XMP-spec,XMP-ISO},
582 % is like having a library catalog card included within the PDF itself. It is an unencrypted
583 % portion of the PDF file, with data expressed in Extensible Markup Language (XML),
584 % using Resource Description Format (RDF~\cite{RDF}) syntax, encoded as UTF-8
585 % so readable by any text editing software on any modern computing platform.
586 %
587 % Some advantages of doing this are clear.
588 % \begin{itemize}
589 % \item For a librarian: cataloguing information is available within the file itself,
590 % without the need to search explicitly in the visual layout of the content or elsewhere;
591 % \item All actual libraries cataloguing this PDF can have consistent information;
592 % including web-based indexing sites such as Google.
593 % \item For the author(s): who can specify the kind of information most appropriate
594 % to help readers understand the nature and purpose of the document.
595 % \end{itemize}
596 %
597 % The |pdfx| package builds the XMP metadata from information supplied via a special data file
598 % called |\jobname.xmpdata|. Here, |\jobname| is usually the basename of the document's main
599 % |.tex| file. For example, if your document source is in the file |main.tex|,
600 % then the metadata must be in a file called |main.xmpdata|.
601 % None of the individual metadata fields are mandatory, but for most documents, it makes sense
602 % to specify at least the title and the author. For more technical aspects of metadata
603 % and its uses, consult the work of the Dublin Core Initiative~\cite{DC} and PRISM~\cite{PRISM}.
604 %
605 % Here is a short |.xmpdata| file:
606 % \begin{decl}[]
607 % |\Title{Baking through the ages}|\\
608 % |\Author{A. Baker\sep C. Kneader}|\\
609 % |\Language{en-GB}|\\
610 % |\Keywords{cookies\sep muffins\sep cakes}|\\
611 % |\Publisher{Baking International}|
612 % \end{decl}
613 % You should note that multiple authors and keywords have been separated
614 % by |\sep|. This |\sep| macro serves a technical purpose and is
615 % permitted within the |\Author|, |\Keywords|, and |\Publisher| fields,
616 % as well as some others. See \S\ref{mdfields} below for a complete listing
617 % of the supported author-supplied metadata fields.
618 %
619 % After processing, the local directory contains a file named such as
620 % |pdfa.xmpi| or |pdfe.xmpi| or |pdfx.xmpi| according to the PDF variant desired.
621 % This file is the complete XMP Metadata packet.
622 % It can be checked for validity, using an online validator, such as at
623 % \href{http://www.pdflib.com/knowledge-base/xmp-metadata/free-xmp-validator/}{www.pdflib.com}.
624 % \textsf{veraPDF}~\cite{veraPDF} is Open Source software providing validation for PDF/A,
625 % and other checkers useful in a PDF/A production setting.
626 %
627 % \textbf{Warning}: The |\jobname.xmpdata| file may be included in the
628 % main document source, within a |{filecontents}| environment,
629 % provided this comes \emph{before} the |\documentclass| command, as follows.
630 % The |force| option ensures overwriting a previous file to catch recent edits.
631 % \begin{decl}[]
632 % |\begin{filecontents}[force]{\jobname.xmpdata}|\\
633 % | \Title{Baking through the ages}|\\
634 % | \Author{A. Baker\sep C. Kneader}|\\
635 % | \Language{en-GB}|\\
636 % | \Keywords{cookies\sep muffins\sep cakes}|\\
637 % | \Publisher{Baking International}|\\
638 % |\end{filecontents}|\\
639 % |\documentclass[11pt,a4paper]{article}|\\
640 % |...|
641 % \end{decl}
642 % Including the metadata with the \LaTeX\ source is very convenient.
643 % Having it at the top of the file also brings attention to it, placing emphasis on
644 % the desirability of including metadata, and keeping it accurate while the main
645 % content of the document is subject to changes or revision.
646 % Macro definitions can also occur prior to the |\documentclass| command,
647 % including any that may be needed within the metadata.
648 % An example of this is apparent in Figure~\ref{koi8-code} occurring later.
649 %
650 % However, this ordering is also extremely important, else any non-ascii UTF-8 byte
651 % sequences can become active characters and expand upon data being written out,
652 % rather than remaining as inactive bytes.
653 % If you edit the metadata supplied this way, remember to remove the
654 % existing copy of |\jobname.xmpdata| file before the next processing run,
655 % as \LaTeX\ does not write a new copy of the file when it exists on disk already,
656 % within the current working directory or elsewhere that \LaTeX\ may find.
657 % In development or testing situations the filename may need to be given as
658 % |./\jobname.xmpdata|, else an older version may be loaded in error.
659 %
660 % Experienced users/programmers can employ the \verb|\write18| mechanism%
661 % \footnote{If you don't already know what this is, they you probably
662 % should not try using it |:-)|.}, together with the |--shell-escape| command-line
663 % option, to automatically execute a shell command that removes |\jobname.xmpdata|
664 % on every (or on selected) processing runs.
665 % This is only useful when the metadata changes, for whatever reason.
666 %
667 % \medskip
668 % Other places for the |{filecontents}| environment can work,
669 % but \emph{only} when it contains \emph{no} non-ascii UTF-8 byte sequences.
670 % Since 2018, with default
671 % See Section~\ref{ssec-symbols} below for more information on the macros
672 % that can be safely used within |.xmpdata| metadata files.
673 %
674 % \subsection{List of supported metadata fields}\label{mdfields}
675 %
676 % Following is a complete list of user-definable metadata fields currently supported,
677 % separated into particular groupings.
678 % Each command is accompanied by the specific XML tagged field name (with namespace)
679 % that is placed into the document-level Metadata packet, as well as the kind of information
680 % being conveyed.
681 % More may be added in the future.
682 % These commands can \emph{only} be used within the |.xmpdata| file.
683 %
684 % Most commands take an optional argument specifying the natural language,
685 % using RFC5646 (BCP 47)~\cite{BCP47} codes, in which the metadata field is given.
686 % Languages for multiple entries can use e.g., |\sep[de] ...|.
687 % Only those fields requiring a specific format (e.g. dates) do \emph{not}
688 % support language specifiers; these are indicated with \fixmd.
689 % Fields allowing more than one value are indicated with \starmd.
690 % Multiple values may be given as separate instances of the macro, or as a single
691 % instance with the values delimited by |\sep|, as in the example above.
692 %
693 % \subsubsection{General information:}
694 %
695 % \begin{itemize}
696 % \item \starmd|\Author|: \hfill (|dc:creator|)\\
697 % the document's human author(s). Separate multiple authors with |\sep|.
698 % \item \starmd|\Title|: \hfill (|dc:title|)\\
699 % the document's title; multiple language versions are supported.
700 % \item \starmd\fixmd|\Language|: \hfill (|dc:language|)\\
701 % list of languages used within the document.
702 % \item \starmd|\Keywords|: \hfill (|dc:subject|)\\
703 % list of keywords, separated with |\sep|.
704 % \item \starmd|\Publisher|: \hfill (|dc:publisher|)\\
705 % the publisher(s). Multiple pieces in a publishing chain should be separated with |\sep|.
706 % \item \starmd|\Subject|: \hfill (|dc:description|)\\
707 % the abstract, or short description.
708 % \end{itemize}
709 %
710 % \subsubsection{Copyright information:}\label{sssec-copy}
711 %
712 % \begin{itemize}
713 % \item |\Copyright|: \hfill (|dc:rights|)\\
714 % a copyright statement.
715 % \item \fixmd|\CopyrightURL|: \hfill (|xmpRights:WebStatement|)\\
716 % location of a web page describing the owner
717 % and/or rights statement for this document.
718 % \item \fixmd|\Copyrighted|: \hfill (|xmpRights:Marked|)\\
719 % `True' if the document is copyrighted, and `False' if it isn't.
720 % This is automatically set to `True' if either |\Copyright| or |\CopyrightURL| is specified,
721 % but this can be overridden.
722 % For example, if the copyright statement is `Public Domain',
723 % then specify also |\Copyrighted{False}|.
724 % \item \starmd|\Owner|: \hfill (|xmpRights:Owner|)\\
725 % specifies the owner(s) of the document or resource.
726 % \item \fixmd|\CertificateURL|: \hfill (|xmpRights:Certificate|)\\
727 % gives the URL to online proof of ownership, if available.
728 % \end{itemize}
729 %
730 % \subsubsection{more Dublin Core metadata:}\label{sssec-dc}
731 % From version 1.6 of |pdfx.sty|, the following fields can be used to provide a greater
732 % range of information to be specified as metadata.
733 % \begin{itemize}
734 % \item \starmd|\Contributor|: \hfill (|dc:contributor|)\\
735 % contributor(s) other than author(s) of the PDF document.
736 % \item |\Coverage|: \hfill (|dc:coverage|)\\
737 % statement about the extent or scope of the document's contents.
738 % \item \starmd\fixmd|\Date|: \hfill (|dc:date|)\\
739 % date(s) when something significant occurred relating to the resource (e.g., version changes);
740 % must be in ISO date format |YYYY-MM-DD| or |YYYY-MM|.
741 % \item \fixmd|\PublicationType|: \hfill (|dc:type|)\\
742 % The type of publication. If specified, must be one of `book', `catalog', `feed', `journal',
743 % `magazine', `manual', `newsletter', `pamphlet'. This is automatically set to `journal'
744 % if |\Journaltitle| is specified (see below), but can be overridden.
745 % \item \starmd|\Relation|: \hfill (|dc:relation|)\\
746 % how this PDF or resource relates to other document(s) or resources.
747 % \item \fixmd|\Source|: \hfill (|dc:source|)\\
748 % specifies a source document from which the PDF is derived.
749 % \item \fixmd|\Doi|: \hfill (|dc:identifier|, |prism:doi|, |prism:url|)\\
750 % Digital Object Identifier (DOI) for the document, without the leading `doi:'.
751 % \item \fixmd|\ISBN|: \hfill (|dc:identifier|)\\
752 % the ISBN for the PDF itself, or Book/Monograph of which it is part.
753 % \item \fixmd|\URLlink|: \hfill (|dc:identifier|, |prism:url|)\\
754 % gives a URL address for an online copy of the document.
755 % \end{itemize}
756 %
757 % The remaining Dublin Core field |(dc:format)| is always set to `|application/pdf|'.
758 %
759 % \subsubsection{Publication information:}\label{sssec-publ}
760 % The following macros allow for inclusion of publication related metadata fields,
761 % as specified by PRISM~\cite{PRISM} to meet publishing requirements.
762 % \begin{itemize}
763 % \item |\Journaltitle|: \hfill (|prism:issueName|)\\
764 % The title of the journal in which the document was published.
765 % \item \fixmd|\Journalnumber|: \hfill (|prism:issn|)\\
766 % The ISSN for the journal/series in which the document was published.
767 % \item \fixmd|\Volume|: \hfill (|prism:volume|)\\
768 % Journal volume.
769 % \item \fixmd|\Issue|: \hfill (|prism:number|)\\
770 % Journal issue/number.
771 % \item \fixmd|\Firstpage|: \hfill (|prism:startingPage|, |prism:pageRange|)\\
772 % First page number of the published version of the document.
773 % \item \fixmd|\Lastpage|: \hfill (|prism:endingPage|, |prism:pageRange|)\\
774 % Last page number of the published version of the document.
775 % \item |\CoverDisplayDate|: \hfill (|prism:coverDisplayDate|)\\
776 % Date on the cover of the journal issue, as a human-readable text string.
777 % \item \fixmd|\CoverDate|: \hfill (|prism:coverDate|)\\
778 % Date on the cover of the journal issue, in a format suitable for storing in a database
779 % field with a `date' data type; e.g. |YYYY-MM|, or |YYYY-MM-DD|.
780 % \end{itemize}
781 % This is an area which can be expanded, to deal with more kinds
782 % of publication and metadata fields.
783 % The ExtensionSchema \cite{TN0009} technique is used to add new fields.
784 % Examples of this can be found in the template files |pdfx.xmp|, |pdfa.xmp|, |pdfe.xmp|.
785 %
786 % \subsubsection{Backward Compatibility}
787 % The following macros are also recognised, for backward compatibility
788 % with earlier versions of the package.
789 % \begin{itemize}
790 % \item \starmd|\AuthoritativeDomain|: \hfill (|pdfx:AuthoritativeDomain|)\\
791 % specifies extra names (e.g., of companies) associated to the existence of the PDF or resource.
792 % \item |\Creator|: \hfill (|xmp:CreatorTool|)\\
793 % synonymous with |\CreatorTool| which is usually handled automatically anyway,
794 % but can be over-ridden.
795 % \item |\Org|: synonymous with |\Publisher|.
796 % \item |\WebStatement|: synonymous with |\CopyrightURL|.
797 % \end{itemize}
798 %
799 % \subsubsection{more XMP metadata:}\label{sssec-xmp}
800 %
801 % \begin{itemize}
802 % \item \starmd|\Advisory|: \hfill (|xmp:Advisory|)\\
803 % noteworthy information; e.g., revision data or changes.
804 % \item \fixmd|\BaseURL|: \hfill (|xmp:BaseURL|)\\
805 % base-URL for relative hyperlinks within the PDF.
806 % \item \starmd|\Identifier|: \hfill (|xmp:Identifier|)\\
807 % more advance forms than (|dc:identifier|); see~\cite{XMP-spec,XMP-ISO}.
808 % \item |\Nickname|: \hfill (|xmp:Nickname|)\\
809 % a pseudonym or `nickname' as a colloquial identifier for the resource.
810 % \item \starmd|\Thumbnails|: \hfill (|xmp:Thumbnails|)\\
811 % allows small page images to be associated with each page of the PDF.
812 % An appropriate XML-compatible representation is required for such images.
813 % \end{itemize}
814 %
815 % \subsubsection{PDF standards metadata:}\label{sssec-pdfstd}
816 % The following metadata fields are generated automatically by the \LaTeX\ engine.
817 % Some are dependent on the particular loading options that specify the desired compliance
818 % with a PDF standard, and level of conformance.
819 % There are no separate user-macros to alter these.
820 % The first three dates are usually set to be identical.
821 %
822 % \begin{itemize}
823 % \item (|xmp:CreateDate|) : creation date\&time of the PDF.
824 % \item (|xmp:MetadataDate|) : creation date\&time of the Metadata for the PDF.
825 % \item (|xmp:ModifyDate|) : date\&time of latest modifications to the PDF.
826 % \item (|xmpMM:DocumentID|) : unique identifier for the PDF, based on MD5 sum.
827 % \item (|xmpMM:InstanceID|) : unique identifier based on creation date\&time.
828 % \item (|pdf:Producer|) : \TeX\ engine used; either `Lua\TeX', `Xe\TeX', `\pdftex'.
829 % \item (|pdf:Trapped|) : currently always set to `False'.
830 % \item (|pdfaid:part|) : |1|, |2| or |3| for PDF/A-?
831 % \item (|pdfaid:conformance|) : |a|, |b| or |u| for PDF/A-??
832 % \item (|pdfuaid:part|) : currently |1| for PDF/UA-1
833 % \item (|pdfe:ISO_PDFEVersion|) : currently |1| for PDF/E-1
834 % \item (|pdf:Version|) : |PDF/X-1|, |PDF/X-2| or |PDF/X-3|
835 % \item (|pdfx:GTS_PDFXVersion|) : e.g., |PDF/X-1a:2003| up to PDF/X-3 ;
836 % but no year for PDF/X-4 and PDF/X-5 variants
837 % \item (|pdfx:GTS_PDFXConformance|) : e.g., |PDF/X-1a:2003| up to PDF/X-2
838 % \item (|pdfxid:GTS_PDFXVersion|) : e.g., |PDF/X-4p:2008| after PDF/X-3
839 % \item (|pdfvtid:GTS_PDFVTVersion|) : e.g., |PDF/VT-2s| for PDF/VT
840 % \item (|pdfvtid:GTS_PDFVTModDate|) : same as |xmp:ModifyDate|
841 % \end{itemize}
842 %
843 % \subsection{Symbols permitted in metadata}\label{ssec-symbols}
844 %
845 % Within the metadata, all printable ASCII characters except
846 % |\|, |{|, |}| and |%| represent themselves. Also, all printable Unicode characters
847 % from the basic multilingual plane (i.e., up to code point U+FFFF)
848 % can be used directly with the UTF-8 encoding.
849 % (Please note: encodings other than UTF-8 are not supported in the metadata,
850 % except as arguments to `parser-macros'; see Section~\ref{ssec-xmplang}).
851 % Consecutive whitespace characters are combined into a single space.
852 % Whitespace after a macro such as |\copyright|, |\backslash|, or |\sep| is ignored.
853 % Blank lines are not permitted.
854 % Moreover, the following markup can be used:
855 %
856 % \begin{itemize}
857 % \item ``|\ |'': a literal space (for example after a macro)
858 % \item |\%|: a literal |%|
859 % \item |\{|: a literal |{|
860 % \item |\}|: a literal |}|
861 % \item |\backslash|: a literal backslash |\|
862 % \item |\copyright|: the copyright symbol \textcopyright
863 % \end{itemize}
864 % The macro |\sep| is permitted within |\Author|, |\Keywords|,
865 % |\Publisher|, and other macros marked with \starmd\ above.
866 % It's purpose is to separate multiple authors, keywords, etc.
867 % to appear as separate list items appropriately and consistently
868 % in the different ways that such information is represented
869 % within the PDF file.
870 % The package takes care of this when |\sep| is used.
871 % For example, in the XMP metadata, it expands as |</rdf:li><rdf:li>| tagging.
872 %
873 % \subsubsection{PDF Info strings}\label{sssec-info}
874 % When |\sep| is not used within its argument, the metadata from |\Title|,
875 % |\Author| and |\Keywords| is also included in the PDF |/Info| dictionary.
876 % When this is the case, validation for the declared standard
877 % will occur only if the corresponding |/Info| item and XMP metadata field
878 % convert to exactly the same Unicode string.
879 % This cannot happen when |\sep| is used, so the |/Info| items are then not populated.
880 %
881 % Unfortunately not all PDF browsers (in particular, older ones and much Apple software)
882 % give ready access to the XMP metadata packet. Some authors want to see everything
883 % using e.g., the Unix/Linux command: |pdfinfo -enc UTF-8 |. In fact there is the |-meta|
884 % option to get the complete metadata packet (in UTF-8 encoding).
885 % This can give more than what one wants, so use it as follows:
886 % \begin{decl}[]
887 % pdfinfo -meta <filename>.pdf \textbar\ grep 'dc:'
888 % \end{decl}
889 % to extract just the Dublin Core metadata fields.
890 %
891 % Another possibility is to \emph{not} use |\sep| with multiple authors and/or keywords.
892 % Instead replace it with simply `|, |'. We do not recommend doing this, as more sophisticated
893 % metadata tools will see the result as a single value, rather than multiple authors, say.
894 % Different language codes cannot be applied when done this way.
895 % However, some authors may find this a satisfactory solution that suits their own tools.
896 %
897 %
898 % \subsection{Macros permitted in metadata}\label{ssec-macros}
899 %
900 % Other \TeX\ macros actually can be used, provided the author is very
901 % careful and not ask for too-complicated \TeX\ or \LaTeX\ expansions
902 % into internal commands or non-character primitives; basically just accents,
903 % macros for Latin-based special characters, and simple textual replacements,
904 % perhaps with a simple parameter. A special macro |\pdfxEnableCommands{...}|
905 % is provided to help resolve difficulties that may arise.
906 %
907 % Here is an example\footnote{ Other use cases are discussed with regard to
908 % Figures~\ref{arm-code} and \ref{math-wflow}.} of the use of |\pdfxEnableCommands|,
909 % which occurs with the name of one of our authors {(H\`an Th\'{\^e} Thanh)}
910 % due to the doubly-accented letter \'{\^e}.
911 % It is usual to define a macro such as: |\def\thanh{H\`an Th\'{\^e} Thanh}|.
912 % In previous versions of the |pdfx| package, use of such a macro
913 % within the |.xmpdata| file, in the |Copyright| information say,
914 % could result in the accent macros expanding into internal primitives, such as
915 % \begin{decl}[]
916 % | H\unhbox \voidb@x \bgroup \let \unhbox \voidb@x \setbox \@tempboxa ... |
917 % \end{decl}
918 % going on for many lines. This clearly has no place within the XMP metadata.
919 % To get around this, one could try using simplified macro definitions
920 % \begin{decl}[]
921 % | \pdfxEnableCommands{|\\
922 % | \def\`#1{#1^^cc^80}\def\'#1{#1^^cc^81}\def\^#1{#1^^cc^82}}|
923 % \end{decl}
924 % \removelastskip\noindent
925 % where the |^^cc^80|, |^^cc^81|, |^^cc^82| cause \TeX\ to generate the correct
926 % UTF-8 bytes for `combining accent' characters.
927 %
928 % This works fine for metadata fields that appear just in the XMP packet.
929 % However, it is not sufficient for the PDF |/Author| key, which must exactly match
930 % with the |dc:creator| metadata element. What is needed instead is
931 % \begin{decl}[]
932 % | \pdfxEnableCommands{|\\
933 % | \def\thanh{H^^c3^^a0n Th\eee Thanh}\def\eee{^^c3^^aa^^cc^^81 }}|
934 % \end{decl}
935 % \removelastskip\noindent
936 % or the above with `\`a' typed directly as UTF-8 instead of |^^c3^^a0|
937 % and `\^e' in UTF-8 for |^^c3^^aa|.
938 % The reason for this is due to the |\pdfstringdef| command, which constructs
939 % the accented latin letters as single combined characters \`a and \^e,
940 % without resorting to combining accents, wherever possible.
941 % If the Metadata does not have the same, irrespective of Unicode normalisation,
942 % then validation fails.
943 %
944 % With version (1.5.6) of the |pdfx| package, such difficulties
945 % have been overcome, at least for characters used in Western European,
946 % Latin-based languages. The input encoding used when reading the |.xmpdata|
947 % file now includes interpretations of \TeX's usual accent commands to
948 % produce the required UTF-8 byte sequences.
949 %
950 % \medskip
951 % Since version (1.5.8) this input encoding was extended to include
952 % macro definitions covering \LaTeX's internal character representation
953 % of other alphabets (e.g., extended Latin, Cyrillic, Greek, etc.).
954 % However this can become memory intensive, requiring a large number of
955 % macro definitions, most of which will never be used. So loading options
956 % are provided, enabling a document author to choose only those that may
957 % be relevant. Currently these are as in Section~\ref{ssec-xmplang}.
958 %
959 % A significant portion of the Unicode Basic Plane characters can be covered
960 % this way. Modules could even be provided for CJK character sets and
961 % mathematical symbols, etc. However, as this can become memory intensive,
962 % significant testing will be required before these become a standard
963 % part of the |pdfx| package.
964 %
965 %
966 % \subsection{Color profiles}\label{sec-profiles}
967 %
968 % Most standards compliant PDF documents require a \emph{color
969 % profile} to be embedded within the file. In a nutshell, such a profile
970 % determines precisely how the colors used in the document will be
971 % rendered when printed to a physical medium. This can be used to
972 % ensure that the document will look exactly the same, even when it is
973 % printed on different printers, with different paper types, etc.
974 % The inclusion of a color profile is necessary to make the document
975 % completely self-contained.
976 %
977 % Since most \LaTeX\ users are not graphics professionals and are not
978 % particularly picky about colors, the |pdfx| package includes default
979 % profiles that will be included when nothing else is specified.
980 % Therefore, the average user doesn't have to do anything
981 % special about color.
982 %
983 % For users who have a specific color profile they wish to use, it is
984 % possible to do so by including a |\setRGBcolorprofile| or
985 % |\setCMYKcolorprofile| command in the |.xmpdata| file. Note that
986 % PDF/A and PDF/E require a profile of type `|mnrt|' (monitor) which
987 % is usually an RGB color profile, while PDF/X and PDF/VT require type `|prtr|'
988 % (printer) which is usually a CMYK color profile; but valid documents
989 % can be created with the correct type designed for the other color space.
990 % Use the following commands to specify an RGB or CMYK color profile,
991 % respectively:
992 %
993 % \begin{decl}
994 % \defmacro{setRGBcolorprofile}\marg{filename}\marg{identifier}\marg{info
995 % string}\marg{registry URL}
996 % \\[1ex]
997 % \defmacro{setCMYKcolorprofile}\marg{filename}\marg{output
998 % intent}\marg{identifier}\marg{registry URL}
999 % \end{decl}
1000 % Within the arguments of these macros, the characters |<|, |>|, |&|,
1001 % |^|, |_|, |#|, |$|, and |~| can be used as themselves, but
1002 % |%| must be escaped as |\%|.
1003 %
1004 % From version (1.6) the default RGB and CMYK color profiles are now supplied
1005 % using the |colorprofiles| package by Norbert Preining and Ross Moore~\cite{colorp}.
1006 % Earlier versions of \texttt{pdfx.sty} set the defaults via:
1007 % \begin{decl}[]
1008 % |\setRGBcolorprofile{sRGB_IEC61966-2-1_black_scaled.icc}|\\
1009 % | {sRGB_IEC61966-2-1_black_scaled}|\\
1010 % | {sRGB IEC61966 v2.1 with black scaling}|\\
1011 % | {http://www.color.org}|\\[4pt]
1012 % |\setCMYKcolorprofile{coated_FOGRA39L_argl.icc}|\\
1013 % | {Coated FOGRA39}|\\
1014 % | {FOGRA39 (ISO Coated v2 300\% (ECI))}|\\
1015 % | {http://www.argyllcms.com/}|
1016 % \end{decl}
1017 % These can still be used if the files from earlier version are available
1018 % on your \TeX\ system, but they will need to be requested, as above.
1019 % Other color profile files may be obtained from the International
1020 % Color Consortium. Please take a look at
1021 % \url{http://www.color.org/iccprofile.xalter}.
1022 %
1023 % Alternatively, color profiles are shipped with many Adobe software
1024 % applications; these are then available for use also with non-Adobe
1025 % software. Now the |pdfx| package includes coding to streamline
1026 % inclusion of these profiles in PDF documents, or to specify
1027 % them as `external' profiles, with PDF/X-4p and PDF/X-5pg variants.
1028 % Two files |AdobeColorProfiles.tex| and |AdobeExternalProfiles.tex|
1029 % are distributed with the |pdfx| package. The latter is for use
1030 % with PDF/X-4p and PDF/X-5pg, which do not require color profiles to
1031 % be embedded, while the former can be used with other PDF/X variants.
1032 % Both define commands to use Color Profiles as follows.
1033 % \begin{decl}[]
1034 % \begin{tabular}{ll}
1035 % \texttt{\string\FOGRAXXXIX} & Coated FOGRA39 (ISO 12647-2:2004)\\
1036 % \texttt{\string\SWOPCGATSI} & U.S. Web Coated (SWOP) v2\\
1037 % \texttt{\string\JapanColorMMICoated} & Japan Color 2001 Coated\\
1038 % \texttt{\string\JapanColorMMIUncoated} & Japan Color 2001 Uncoated\\
1039 % \texttt{\string\JapanColorMMIINewspaper} & Japan Color 2002 Newspaper\\
1040 % \texttt{\string\JapanWebCoatedAd} & Japan Web Coated (Ad)\\
1041 % \texttt{\string\CoatedGRACoL} & Coated GRACoL 2006 (ISO 12647-2:2004)\\
1042 % \texttt{\string\SNAPCGATSII} & CGATS TR 002\\
1043 % \texttt{\string\SWOPCGATSIII} & CGATS TR 003\\
1044 % \texttt{\string\SWOPCGATSV} & CGATS TR 005\\
1045 % \texttt{\string\ISOWebCoated} & Web Coated FOGRA28 (ISO 12647-2:2004)\\
1046 % \texttt{\string\ISOCoatedECI} & ISO Coated v2 (ECI)\\
1047 % \texttt{\string\CoatedFOGRA} & Coated FOGRA27 (ISO 12647-2:2004)\\
1048 % \texttt{\string\WebCoatedFOGRA} & Web Coated FOGRA28 (ISO 12647-2:2004)\\
1049 % \texttt{\string\UncoatedFOGRA} & Uncoated FOGRA29 (ISO 12647-2:2004)\\
1050 % \texttt{\string\IFRAXXVI} & ISOnewspaper26v4 ISO/DIS 12647-3:2004\\
1051 % \texttt{\string\IFRAXXX} & ISOnewspaper30v4 ISO/DIS 12647-3:2004\\
1052 % \end{tabular}
1053 % \end{decl}
1054 % As of the time of first compiling this list, only the first six of these result in PDFs
1055 % which can validate with external profiles (i.e., for PDF/X-4p and PDF/X-5pg)
1056 % using the then-current versions of Adobe Acrobat Pro software. It is unclear
1057 % whether the others (incl.\,\verb|\IFRAXXVI| and \verb|\IFRAXXX|) failed due
1058 % to incorrect data or problems in the validation software.
1059 % Since then, with updates to Acrobat Pro, almost all the others have been verified
1060 % to work, except \verb|\IFRAXXX| which seems no longer available.
1061 % Thus these commands come with a `use at own risk' clause.
1062 %
1063 % For `external' profiles, there is a command |\setEXTERNALprofile|, taking 9 arguments,
1064 % that must be used. Consult |AdobeExternalProfiles.tex| for examples of its use.
1065 %
1066 % All but the last of the macros listed above can also be used for valid embedded profiles,
1067 % providing the corresponding files can be found.
1068 % The following macros are used to set the (absolute or relative) path,
1069 % on the local operating system, to the location of color profile files.
1070 % \begin{decl}
1071 % \defmacro{pdfxSetRGBcolorProfileDir}\marg{path to RGB color profiles}\\
1072 % \defmacro{pdfxSetCMYKcolorProfileDir}\marg{path to CMYK profiles}
1073 % \end{decl}
1074 % On a Macintosh, there are various places where the color profiles may be found.
1075 % One can use either a macro |\MacOSColordir| which expands
1076 % into the path for system-provided profiles:
1077 % \begin{decl}[]
1078 % |/System/Library/ColorSync/Profiles/|
1079 % \end{decl}
1080 % or the macro |\MacOSLibraryColordir| expanding to:
1081 % \begin{decl}[]
1082 % |/Library/ColorSync/Profiles/|
1083 % \end{decl}
1084 % or |\AdobeMacOSdir| which expands into the path:
1085 % \begin{decl}[]
1086 % |/Library/Application Support/Adobe/Color/Profiles/Recommended/|
1087 % \end{decl}
1088 % Under Windows an available macro is |\WindowsColordir| which expands to:
1089 % \begin{decl}[]
1090 % |C:\Windows\System32\Spool\Drivers\Color/|
1091 % \end{decl}
1092 % being the common location for color profiles.
1093 % Use these within the \verb|.xmpdata| file as, e.g.,
1094 % \begin{decl}[]
1095 % |\pdfxSetCMYKcolorProfileDir{\AdobeMacOSdir}|
1096 % \end{decl}
1097 % Authors may change the paths to suit their own circumstances, either
1098 % \emph{before} loading |pdfx.sty| or within the \verb|.xmpdata| file.
1099 %
1100 % PDF/A and PDF/E usually need an RGB profile, while PDF/X and PDF/VT
1101 % require a CMYK profile. It is possible to use a CMYK profile with PDF/A
1102 % or PDF/E by specifying |\setRGBcolorprofile{}{}{}{}| in the \verb|.xmpdata| file.
1103 % Beware however, that with PDF/A any coloured hyperlink annotations can
1104 % cause a validation problem, as these are interpreted as RGB colours
1105 % even when 4 components are given. This may be a bug in validators,
1106 % as PDF specifies that the number of components should match the color space.
1107 %
1108 % \subsubsection{`Custom' color spaces}\label{ssec-custom}
1109 %
1110 % It is also possible to specify `Custom' color spaces, other than RGB or CMYK.
1111 % Here is an example command |\viiIndigoTAC|, defined as follows:
1112 % \begin{decl}[]
1113 % \%\% Custom profile: 7C Indigo TAC370 (ColorLogic)\\
1114 % |\gdef\viiIndigoTAC{\let\CallasMacOSdir\CallasMacOSpdfaPilotdir |\\
1115 % | \setCUSTOMcolorprofile |\\
1116 % | {7C Indigo_TAC370_ColorLogic.icc}%|\\
1117 % | {\CallasProfilesdir}%|\\
1118 % | {7C Indigo TAC370 \string\(ColorLogic\string\)}% /ProfileName |\\
1119 % | {http://www.colorlogic.de}% /RegistryName |\\
1120 % | {7CLR}% number of colors specifier |\\
1121 % | {02400000}% ICC version |\\
1122 % | {/Cyan /Magenta /Yellow /Black /Orange /Green /Violet}% colour names |\\
1123 % | {48110b8b410ee6be015f3932c3167869}% CheckSum |\\
1124 % |}|
1125 % \end{decl}
1126 % which uses a profile that accompanies the \texttt{pdfaPilot} software from
1127 % Callas Software Gmbh~\cite{pdfaPilot}.
1128 % The macro |\CallasMacOSpdfaPilotdir|, defined in the file \texttt{CallasColorProfiles.tex},
1129 % specifies the directory where this Custom profile is located, when installed under MacOS.
1130 % One needs to |\input CallasColorProfiles.tex| \emph{before} loading the |pdfx| package.
1131 % Macros for other directories are also defined in this file.
1132 %
1133 % \subsection{Notes on the internal representation of metadata}
1134 %
1135 % Within the PDF file, metadata is deposited in two places: some data
1136 % goes into the native PDF |/Info| dictionary, and some data goes into
1137 % an XMP packet stored separately within the file. XMP is Adobe's
1138 % Extensible Metadata Platform~\cite{XMP-spec,XMP-ISO}, and is an XML-based format.
1139 % See \href{http://www.adobe.com/devnet/xmp/}{Adobe XMP Development Center}
1140 % for more exhaustive information about XMP.
1141 % An XMP Toolkit SDK which supports the GNU/Linux, Macintosh and Windows operating
1142 % systems is also available under modified BSD licence.
1143 %
1144 % Some of the metadata, such as the author, title, and keywords, can be
1145 % stored \emph{both} in the XMP packet and in the |/Info| dictionary.
1146 % For the resulting file to be standards-compliant, the two copies of the data
1147 % must be identical. This is taken care of automatically by the |pdfx| package,
1148 % except when |\sep| is used to handle multiple entries, as discussed above
1149 % in \S\ref{sssec-info}. In such cases the string is not included within the |/Info|
1150 % dictionary. Note that this is in accordance with the PDF 2.0 specification~\cite{PDF20},
1151 % which deprecates use of the |/Info| dictionary for such metadata.
1152 %
1153 % In principle, users can resort to alternate ways to create an XMP file
1154 % for inclusion in PDF. In this case, one should create a customised template
1155 % file |pdfa.xmp| or |pdfx.xmp| or |pdfe.xmp| (etc., depending on the PDF flavor)
1156 % containing the pre-defined data. This can be done by modifying the ones supplied
1157 % with the |pdfx| package. However, this is an error-prone process and is
1158 % \emph{not} recommended for most users.
1159 % If there is a particular field of metadata that you need and that is not currently
1160 % supported, please contact the package authors.
1161 %
1162 % |pdfx| makes use of the |xmpincl| package to include XMP data into
1163 % the PDF. The documentation of |xmpincl| package may help interested
1164 % users to understand the process of XMP data inclusion.
1165 %
1166 % \subsection{Tutorials and technical notes}
1167 %
1168 % A tutorial with step-by-step instructions for generating PDF/A files
1169 % can be found at:
1170 % \url{http://www.mathstat.dal.ca/~selinger/pdfa/}.
1171 %
1172 % Some technical notes about production problems the authors have
1173 % encountered while generating PDF/A compliant documents are available
1174 % here:
1175 % \url{http://support.river-valley.com/wiki/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex}.
1176 % Be aware that this is based on use of an earlier version of the |pdfx| package,
1177 % so some of the advice may have been superseded.
1178 %
1179 %
1180 % \section[Installing]{Installing}
1181 % The |pdfx.dtx| package is available on CTAN as usual, via
1182 % \url{http://ctan.org/pkg/pdfx}. It is also included in
1183 % \TeX\ distributions such as Mac\TeX, \TeX\ Live and MiK\TeX.
1184 % Thus most users will not need to handle installation at all.
1185 %
1186 % For those wishing to do a manual installation, here are some notes.
1187 % The file |pdfx.dtx| is a composite document of program code and
1188 % documentation in \LaTeX{} format, in the tradition of \emph{literate
1189 % programming}. After having installed the package,
1190 % to get the documentation that you are reading now,
1191 % run (\textsc{pdf})\LaTeX{} on the file |pdfx.dtx|.
1192 % The resulting PDF should be valid as PDF/A-2u.
1193 % Or better, use the included |Makefile|, which will also regenerate the index.
1194 %
1195 % To install the package, first extract the program code; i.e., the
1196 % file |pdfx.sty|, by running \LaTeX{} or \TeX{} on the file |pdfx.ins|.
1197 % Create a directory named |pdfx| under |$TEXMF/tex/latex| and copy the files
1198 % |pdfx.sty|, |8bit.def|, |glyphtounicode-cmr.tex|, |glyphtounicode-ntx.tex| as well
1199 % as the other |*.tex|, |l8u*-penc.def| and |*.xmp| files, into it. Then update
1200 % \TeX's file database using the appropriate command for your distribution
1201 % and operating system (such as |texhash| or |mktexlsr|, or similar).
1202 %
1203 % \subsection{Limitations and dependencies}
1204 %
1205 % The |pdfx.sty| package works with \pdftex\ and also Lua\TeX\ and Xe\TeX\
1206 % with some minor limitations.
1207 % It further depends on the following other packages.
1208 % \begin{enumerate}
1209 % \item |xmpincl| for insertion of metadata into PDF.
1210 % \item |inputenc| to establish input-encoding infrastructure ---
1211 % see Section~\ref{ssec-L8U}.
1212 % \item |hyperref| for ensuring data is correctly encoded when being
1213 % written into the PDF file, and supporting features such as
1214 % hyperlinking, bookmarks, etc.
1215 % \item |xcolor| for ensuring consistent use of the color model
1216 % appropriate the PDF variant, within text and hyperlinks (when allowed).
1217 % \item |glyphtounicode.tex| (not Xe\LaTeX) maps glyph names
1218 % to corresponding Unicode code-points.
1219 % \item |ifluatex| allowing coding specific to Lua\LaTeX.
1220 % \item |ifxetex| allowing coding specific to Xe\LaTeX.
1221 % \item |luatex85| or |pdftexcmds| (Lua\TeX\ only) for access
1222 % to primitive commands using \pdftex\ macro names.
1223 % \item |stringenc| used to help generate proper bookmarks with transliterated input;
1224 % e.g., with |\textLGR| or |\textARM| --- see Section~\ref{sssec-arm}.
1225 % \end{enumerate}
1226 % Other files and packages are loaded as sub-packages or as
1227 % configuration files for these. Since some of these packages
1228 % may be loaded by existing documents we provide here advice on
1229 % how to deal with potential loading and option conflicts.
1230 %
1231 % Firstly, it is best if |pdfx| is the first package loaded; e.g.,
1232 % directly after the |\documentclass| line. This is not a strict requirement,
1233 % but it is worthwhile to deal with the metadata at the top of your \LaTeX\ source,
1234 % allowing correct options to be loaded to cope with validation aspects.
1235 %
1236 % Secondly, replace |\usepackage[<options>]{hyperref}| with |\hypersetup{<options>}|.
1237 % This deals with most loading issues with the |hyperref| package.
1238 % Note that PDF/X is a format intended for printing.
1239 % It forbids inclusion of hyperlinks and other actions, including via bookmarks.
1240 % To produce a validating PDF/X document, |pdfx| overrides internal macros
1241 % while keeping colors associated with link anchors.
1242 % To inhibit these colors also, you could specify options as follows.
1243 % \begin{decl}[]
1244 % |\hypersetup{colorlinks,allcolors=black}|
1245 % \end{decl}
1246 % Furthermore, options to set metadata components (such as |pdfauthor|,
1247 % |pdftitle|, |pdfsubject|, |pdfkeywords|, etc.) are disabled, since
1248 % |pdfx| has already taken care of this information.
1249 %
1250 % Thirdly, conflicts with other packages may be dealt with by simply
1251 % changing |\usepackage| to |\RequirePackage| within the document's
1252 % preamble. But this may not be possible when the |\usepackage|
1253 % or |\RequirePackage| command occurs within another package, or with
1254 % a specific set of options, thereby causing processing to stop.
1255 % Few packages have a command analogous to |\hypersetup|.
1256 % Instead |\PassOptionsToPackage{<options>}{<package>}| can help.
1257 % For |<options>| specify the ones associated with the loading yet to come.
1258 % This can give a smooth processing run, but you'll need to check whether
1259 % the results from those options have actually taken effect.
1260 % Some examples of this can be seen later, in Figures~\ref{koi8-code}
1261 % and \ref{tldoc-pol}.
1262 %
1263 % \subsubsection{Limitations using Xe\LaTeX}\label{sssec-xetex}
1264 %
1265 % To process a file using Xe\LaTeX, to produce a document that can
1266 % validate to a particular PDF standard, one need to use a command
1267 % to run the \TeX\ engine, as follows.
1268 % \begin{decl}[]
1269 % |xelatex -shell-escape -output-driver="xdvipdfmx -z 0" <filename>.tex |
1270 % \end{decl}
1271 % The |-shell-escape| option allows a command-line task to be run,
1272 % which writes the creation-date \& time of the running job into
1273 % a small file on disk. This data, written in a specific format, is then
1274 % read by the job for inclusion into several metadata fields.
1275 % This emulates the result of \pdftex's |\pdfcreationdate| primitive.
1276 % As there are security implications in allowing arbitrary commands to be run,
1277 % this need for |-shell-escape| must be viewed as imposing a limitation on the
1278 % work-flows in which this can be safely used.
1279 %
1280 % The |-output-driver="xdvipdfmx -z 0"| suppresses compression, which
1281 % is not allowed for the XMP metadata packet. Without this, the resulting PDF
1282 % may fail to pass validation tests.
1283 %
1284 % Xe\TeX\ is designed for processing UTF-8 input only. When presented
1285 % with \LaTeX\ source using a legacy encoding, such as |latin2| or |koi8-r|,
1286 % the input is accepted and a PDF produced. Yet there will be garbage
1287 % characters corresponding to each character entered from the upper range
1288 % (128--255). This is evident in the PDF content and bookmarks;
1289 % yet |pdfx| produces the correct XMP metadata packet.
1290 % So while the techniques explained later in Section~\ref{ssec-multi} are
1291 % valid, the PDF itself does not contain correct content.
1292 %
1293 % Not all fonts, in particular Open-Type fonts (OTF), naturally come with
1294 % mappings of the glyphs to Unicode code points. This is a requirement
1295 % with PDF/A, PDF/E and PDF/UA standards.
1296 % Use of such fonts can result in validation errors, such as:
1297 % \begin{itemize}
1298 % \item
1299 % CIDset in subset font is incomplete (font contains glyphs that are not listed).
1300 % \item
1301 % Type 2 CID font: CIDToGID map is invalid or missing.
1302 % \end{itemize}
1303 %
1304 % If one has access to Adobe's |Acrobat Pro| software, then its |Preflight|
1305 % utility can rewrite the uncompressed output from Xe\LaTeX\ into a valid
1306 % PDF standard, using compression of the contents but not of the XMP packet.
1307 % Similarly |Preflight| can sometimes fix the missing font information.
1308 %
1309 %
1310 % \subsubsection{Limitations using Lua\LaTeX}\label{sssec-luatex}
1311 %
1312 % Lua\LaTeX\ can handle the OTF font issues mentioned for Xe\LaTeX,
1313 % so can produce valid PDF/A documents where Xe\LaTeX\ fails.
1314 % However, since Lua\TeX\ expects all input source to be UTF8-encoded,
1315 % it cannot work at all with documents using older legacy encodings.
1316 % Instead one gets error messages such as:
1317 %\begin{decl}
1318 % |! String contains an invalid utf-8 sequence.|\\
1319 % |l.5 \Copyright{\textLII{UWAGA dla recenzent|\\
1320 % | �w/t³umaczy}}|\\
1321 % |? |
1322 %\end{decl}
1323 % from a document using |latin2| encoded characters.
1324 % Thus most of Section~\ref{ssec-multi} is just not applicable for Lua\LaTeX,
1325 % whereas it is for \pdftex.
1326 % This is essentially the same problem as described above for Xe\TeX,
1327 % but here Lua\TeX\ advises that there are problems as soon as it
1328 % encounters an invalid (for UTF-8) character. Some would regard
1329 % this as better than having the job run to completion, only to later
1330 % discover garbage content within the PDF.
1331 %
1332 %
1333 % \subsection{Files included}
1334 %
1335 % The following files are included in the package.
1336 % Some can be created from |pdfx.dtx|, using the |Makefile|.
1337 %
1338 % \subsubsection{Package files}
1339 %
1340 % \begin{itemize}
1341 % \item |pdfx.sty| --- main package file generated from |pdfx.dtx|.
1342 % \item |pdfa.xmp| --- specimen |xmp| template for PDF/A.
1343 % \item |pdfe.xmp| --- specimen |xmp| template for PDF/E.
1344 % \item |pdfvt.xmp| --- specimen |xmp| template for PDF/VT.
1345 % \item |pdfx.xmp| --- specimen |xmp| template for PDF/X.
1346 % \item |8bit.def| --- custom input encoding.
1347 % \item |l8u-penc.def| --- input encoding macro declarations.
1348 % \item |l8uarb-penc.def| --- input macro declarations for Arabic.
1349 % \item |l8uarm-penc.def| --- input macro declarations for Armenian.
1350 % \item |armglyphs.dfu| --- Unicode mapping for Armenian letters.
1351 % \item |l8ucyr-penc.def| --- input macro declarations for Cyrillic alphabet.
1352 % \item |l8udev-penc.def| --- input macro declarations for Devanagari.
1353 % \item |l8ugrk-penc.def| --- input macro declarations for Greek alphabet.
1354 % \item |l8uheb-penc.def| --- input macro declarations for Hebrew alphabet.
1355 % \item |l8ulat-penc.def| --- input macro declarations for Latin 1--9 encodings.
1356 % \item |l8umath-penc.def| --- input macro declarations for mathematical symbols.
1357 % \item |glyphtounicode-cmr.tex|, |glyphtounicode-ntx.tex| --- maps glyph names
1358 % to corresponding Unicode for Computer Modern and other \TeX-specific fonts.
1359 % \item |AdobeColorProfiles.tex| --- macros for inclusion of Adobe-supplied color profiles.
1360 % \item |AdobeExternalProfiles.tex| --- macros for use of external color profiles.
1361 % \item |CallasColorProfiles.tex| --- macros for profiles included with Callas pdfaPilot software.
1362 % \end{itemize}
1363 %
1364 % \subsubsection{Documentation \& Examples}
1365 %
1366 % \begin{itemize}
1367 % \item |README| --- usual top-level information.
1368 % \item |manifest.txt| --- file list.
1369 % \item |pdfx.pdf| --- package documentation.
1370 % \item |sample.tex|, |sample.xmpdata| --- a sample file with sample metadata.
1371 % \item |small2e-pdfx.tex| --- sample file with included metadata.
1372 % \end{itemize}
1373 %
1374 % \subsubsection{Sources}
1375 %
1376 % \begin{itemize}
1377 % \item |src/pdfx.dtx| --- composite package and documentation.
1378 % \item |src/pdfx.ins| --- installer batch file.
1379 % \item |src/pdfx.xmpdata| --- metadata for the documentation.
1380 % \item |src/rvdtx.sty| --- used by |pdfx.dtx|.
1381 % \item |src/Makefile| --- a Makefile for building the documentation.
1382 % \item |src/MANIFEST| --- list of files in this directory.
1383 % \item |src/text89.def| --- used with Figure\,\ref{ex-arm} in the documentation.
1384 % \item |src/{arm-start,koi8-example,koi8-example2,latin2-example}.tex|
1385 % --- used in the documentation with figures showing example coding.
1386 % \item |src/{TL-POL-meta,TL-RU-LICRs,TL-RU-metadata,TL-RU-toc,Armenian-example-UTF8,|\\
1387 % |armtex-meta,usage-meta,math-assign5}.png| --- screenshot images showing multilingual
1388 % and other metadata.
1389 % \end{itemize}
1390 %
1391 % \subsection{Miscellaneous information}
1392 %
1393 % The package is released under the \LaTeX{} Project Public
1394 % Licence. Bug reports, suggestions, feature requests, etc., may be
1395 % sent to the original authors at
1396 % \href{mailto:[email protected]}{\ttfamily [email protected]}
1397 % and/or
1398 % \href{mailto:[email protected]}{\ttfamily [email protected]},
1399 % or to the more recent contributors at
1400 % \href{mailto:[email protected]}{\ttfamily [email protected]}
1401 % and/or
1402 % \href{mailto:[email protected]}{\ttfamily [email protected]}.
1403 %
1404 %
1405 % \section[Multilingual and Technical Considerations]{Multilingual and Technical Considerations}\label{sec-meta}
1406 %
1407 % \TeX\ and \LaTeX\ have an on-going practice of including metadata within
1408 % the source files and package documentation. Usually this is done as comments
1409 % at the beginning of the file; such as the following from the English
1410 % language version of the 2015 \TeX\ Live documentation\footnote{%
1411 % found at |/usr/local/texlive/2016/texmf-dist/doc/texlive/texlive-en/|.}.
1412 % \begin{decl}[]
1413 % |$Id: texlive-en.tex 37205 2015-05-05 21:36:33Z karl $|\\
1414 % |TeX Live documentation. Originally written by Sebastian Rahtz and|\\
1415 % |Michel Goossens, now maintained by Karl Berry and others.|\\
1416 % |Public domain.|
1417 % \end{decl}
1418 % This provides information, ideally suited for copyright metadata
1419 % fields, as in Section~\ref{sssec-copy}, as well as for |\Subject|
1420 % and |\CoverDate| from Section~\ref{sssec-publ}.
1421 %
1422 % Also near the top of the file one finds front-matter content
1423 % \begin{decl}[]
1424 % |\title{%|\\
1425 % | {\huge \textit{The \TeX\ Live Guide---2015}}|\\
1426 % |}|\\
1427 % |\author{Karl Berry, editor \\[3mm]|\\
1428 % | \url{http://tug.org/texlive/}|\\
1429 % | }|\\
1430 % |\date{May 2015}|
1431 % \end{decl}
1432 % which supplies metadata information for the commands |\Title|, |\Author|,
1433 % |\CoverDisplayDate| also from Section~\ref{sssec-publ}, and |\CopyrightURL|.
1434 %
1435 % Most of the hundreds of thousands, if not millions of documents prepared
1436 % using \TeX, \LaTeX\ and other \TeX-based formats, include similar
1437 % metadata information, much of which currently does not accompany the
1438 % resulting PDF. It is becoming increasingly common, if not yet a legal
1439 % requirement, for PDFs to satisfy a standard that requires inclusion
1440 % of metadata. This is especially so for government agencies and institutions
1441 % receiving government funding, in several countries around the world.
1442 %
1443 % It is an aim of the |pdfx| to simplify the process of capturing and
1444 % including metadata within \LaTeX-produced PDFs, from both the author's
1445 % view and that of archivists. The extra features introduced with version
1446 % 1.5.8 take a large step in that direction.
1447 % This includes the ability, described in the next subsection, to reliably
1448 % include data presented in different text encodings, rather than being
1449 % restricted to UTF-8 only. It is a role of the software to make the
1450 % conversion, rather than rely on some 3rd party for a translation.
1451 %
1452 %
1453 % \subsection[Multilingual Metadata]{Multilingual Metadata}\label{ssec-multi}
1454 %
1455 % A cursory search of the documentation (|.../texmf-dist/doc|) subtree
1456 % of the forthcoming \TeX\,Live 2016 release reveals more than 730 different
1457 % |.tex| or |.dtx| document sources which specify an input encoding,
1458 % via the |\usepackage[...]{inputenc}| command. Roughly 380 (a bit more
1459 % than half) declare UTF-8 as the input encoding.
1460 % Of the remainder there are $\approx 20$ other encodings specified,
1461 % covering a range of languages for at least part of their content.
1462 % At some point in time, these documents may be required to have accurate
1463 % accompanying metadata, as part of conformance to a designated PDF
1464 % (or other) standard. There are libraries and archives that already must
1465 % meet such standards.
1466 %
1467 % We have shown above, in Section~\ref{ssec-metadata}, how the |.xmpdata|
1468 % file can be inserted into the document source, which then ensures that
1469 % metadata is reliably transferred along with the source itself.
1470 % This seems a good strategy, but are there any problems with it,
1471 % especially in a multi-lingual context?
1472 %
1473 % Modern editing software can require an encoding to be associated
1474 % with each file. This is what allows the correct characters to be shown,
1475 % from what is otherwise just a sequence of 8-bit bytes. The flip-side
1476 % is that arbitrary editing is not permitted. Add some UTF-8 data into
1477 % a file that is encoded as Latin-2 then try to save it. You may be asked
1478 % to specify a new encoding, or the application may even crash out entirely.
1479 % Maybe this happens \emph{accidentally}. It is not hard for a curly quote
1480 % (`) or endash (--) to be included; many editors have settings which can
1481 % do this with normal ascii input. Turn \emph{off} such settings.
1482 %
1483 % The approach that we advocate is that when editing to add metadata,
1484 % best is to:
1485 % \begin{enumerate}
1486 % \item
1487 % use the \emph{same encoding} as is specified for the file itself,
1488 % if known (as is usually the case);
1489 % \item
1490 % even if 1. is not possible, use Copy/Paste \emph{within} the document source
1491 % (e.g., for authors' names, addresses, affiliations, etc.) and from comments,
1492 % as in Section~\ref{sec-meta} above;
1493 % \item
1494 % avoid typing new characters, especially quotes and dashes, and be extra
1495 % careful with back-spacing to preserve the real meaning of copied content.
1496 % \end{enumerate}
1497 % Even if the original encoding is not known, use of Copy/Paste from other
1498 % parts of the document is normally not going to change its encoding.
1499 % This should not cause the file to become invalid due to mixed content.
1500 % In some situations it may be necessary to use an ASCII-only representation,
1501 % such as \LaTeX's LICR\footnote{LICR: \LaTeX\ Internal Character Representation;
1502 % or think `I $=$ Interchange'.} macros~\cite[\S\,7.11]{LC2}.
1503 %
1504 % \begin{figure}[htb]
1505 % \centering
1506 % \includegraphics[scale=.33]{TL-RU-metadata}
1507 % \caption{Metadata generated from the coding shown in Figure\,\ref{koi8-code},
1508 % viewed using Acrobat Pro's `Additional Metadata \dots' panel.}\label{koi8-meta}
1509 % \end{figure}
1510 % \begin{figure}[htb]
1511 % {\UseRawInputEncoding
1512 % \begin{decl}[]
1513 % \input{koi8-example}
1514 % \end{decl}
1515 % }%
1516 % \setbox0=\hbox{\kern-10cm\texttt{\`{ }\^{ }\~{ }\"{ }\r{ }\^{ }\u{ }\H{ }\'{ }\k{ }\v{ }\.{ }\i}}%
1517 % \ht0=0pt\dp0=0pt\box0\vskip-\baselineskip
1518 % \caption{Example of cyrillics in metadata, shown as if \texttt{T1}-encoded.
1519 % See Figure\,\ref{koi8-meta} for the actual result.}\label{koi8-code}
1520 % \end{figure}
1521 %
1522 % \subsubsection[Metadata with Cyrillics]{Metadata with Cyrillics}\label{sssec-cyr}
1523 %
1524 % Here is a `real-world' example, with Figure\,\ref{koi8-meta} showing the metadata
1525 % as could be produced for the Russian language version of the \TeX\ Live documentation,
1526 % from coding as shown in Figure\,\ref{koi8-code}.
1527 % The source file itself is actually encoded for KOI8-R, as indicated by the presence
1528 % of the code line |\usepackage[koi8-r]{inputenc}|,
1529 % but is deliberately shown here encoded as |T1|~\cite[p.\,449]{LC2}.
1530 % This difference is immaterial for checking the validity of the metadata.
1531 % For example, the stream of upper (accents, etc.) characters within
1532 % |\Title{\textKOI{ ... }}| is the same as within |\title{...\textit{ ... }}|.
1533 % Similarly for |\Author{\textKOI{...}}| and |\author{...}|, and |\CoverDate| and |\date|.
1534 % Strings for the |\Subject| and |\Keywords| are taken from the first actual paragraph
1535 % in the document, and from early subsection titles.
1536 %
1537 % It is the `parser' command/macro |\textKOI{ ... }| that indicates that the upper range
1538 % characters (having byte codes 128--255) are to be treated as KOI8-R characters,
1539 % rather than as part of UTF-8 byte sequences. It works by examining each byte in sequence,
1540 % and returning the appropriate UTF-8 2-byte sequence for the required cyrillic character.
1541 % This happens during the processing of data from |\jobname.xmpdata| for fleshing-out
1542 % the XMP metadata packet to be included within the final PDF/A document.
1543 %
1544 % The `parser' macros defined for various encodings, are given in Figure\,\ref{parsers}.
1545 % In Section\,\ref{ssec-xmplang} the package options are given
1546 % for loading the appropriate support for desired languages or alphabets.
1547 % Support for other encodings can be added, if there proves to be a need.
1548 %
1549 %\begin{figure}[ht]
1550 % \centering
1551 % \begin{tabular}{lll}\hline
1552 % macro & encodings & bytes 128--255 with languages\\\hline
1553 % |\textLAT| & Latin-1 & Western European \\
1554 % |\textLII| & Latin-2 & Middle European \\
1555 % |\textLIII| & Latin-3 & South European \\
1556 % |\textLIV| & Latin-4 & North European \\
1557 % |\textLTV| & Latin-5 & Turkish \\
1558 % |\textLVI| & Latin-6 & Nordic \\
1559 % |\textLVII| & Latin-7 & Baltic Rim \\
1560 % |\textLIIX| & Latin-8 & Celtic \\
1561 % |\textLIX| & Latin-9 & Western European, incl. \texteuro \\
1562 % |\textKOI| & KOI8-R, KOI8-RU & cyrillic alphabets \\
1563 % |\textLGR| & LGR, ISO-8859-7 & Greek \& Polytonic Greek\\
1564 % |\textARM| & Arm\TeX, ArmSCII8 & Armenian\\
1565 % |\textHEB| & HE8, ISO-8859-8, CP1255 & Hebrew\\
1566 % |\textHEBO| & CP862 & Hebrew\\
1567 % |\(...\)| & parses simple mathematical expressions\\\hline
1568 % \end{tabular}
1569 % \caption{Parser macros, defined for specific types of input.}\label{parsers}
1570 % \end{figure}
1571 % \begin{figure}[hbt]
1572 % \centering
1573 % \includegraphics[scale=.5]{TL-RU-LICRs}
1574 % \caption{How to see LICRs in the \texttt{.log} window.}\label{koi8-LICR}
1575 % \end{figure}
1576 %
1577 % With encoded characters marked in this way with a `parser' macro,
1578 % it is actually possible to mix UTF-8 metadata with other bytes;
1579 % provided, of course, you have an editor that allows such a file
1580 % to be created and saved. On the other hand, if you are unhappy with mixing
1581 % content having different encodings, then there is another way, based upon
1582 % \LaTeX's LICR macros~\cite[\S\,7.11]{LC2} for representing accented
1583 % and non-latin characters.
1584 % These are normally hidden away (`I $=$ Internal') but in fact can be seen
1585 % within auxiliary files, such as |.aux| and |.toc|, |.lof| and |.lot|.
1586 % This is how \LaTeX\ stores the knowledge of such characters for use in
1587 % a part of the document processing which may not have the same encoding
1588 % as the document as a whole, or may require characters generated using several
1589 % different encodings. Thus LICRs allow for a reliable representation
1590 % passed to a different context; think `I $=$ Interchange'.
1591 %
1592 % \begin{figure}[hbt]
1593 % {\UseRawInputEncoding
1594 % \begin{decl}[]
1595 % \input{koi8-example2}
1596 % \end{decl}
1597 % }%
1598 % \caption{Example of cyrillics in metadata, using LICRs.}\label{koi8-code2}
1599 % \end{figure}
1600 % \begin{figure}[htbp]
1601 % \centering
1602 % \includegraphics[scale=.5]{TL-RU-toc}
1603 % \caption{How to get desired LICRs into the \texttt{.toc} file.}\label{koi8-toc}
1604 % \end{figure}
1605 %
1606 % Figure~\ref{koi8-LICR} shows how to see this.
1607 % The document source in the lower portion clearly shows the cyrillic
1608 % input, whereas the |.log| messages in a command-line window above
1609 % reveal the LICR representation. A command |\showLICRs| is available
1610 % with |pdfx.sty| version 1.5.8, specifically to allow this.
1611 % Now the LICR representation can be copied directly from the |.log| file,
1612 % modulo slight difficulties due to the way long lines are broken.
1613 % As this representation is entirely with ASCII characters, it should not
1614 % cause any conflict with any UTF-8 metadata that you want within the same file.
1615 % The |.xmpdata| file might now look as in Figure~\ref{koi8-code2}.
1616 % Although very verbose, this should be resistant to any corruption due to
1617 % character encodings, and produces the same result within the PDF,
1618 % as in Figure~\ref{koi8-meta}.
1619 %
1620 % Alternatively one can exploit the |.toc| file, using \LaTeX's command
1621 % |\addtocontents|, as shown in Figure~\ref{koi8-toc}.
1622 % After processing the file, you can copy the LICR representations out
1623 % of the |.toc| file, taking care to remove anything of a non-character
1624 % nature (e.g., implementing the size and spacing of the letters in \TeX).
1625 %
1626 % Of course once you have harvested the metadata in this format, remove
1627 % or comment-out those extra |\showLICRs| to get uninterrupted processing.
1628 % Similarly comment-out the extra |\addtocontents| lines, else the real
1629 % Table-of-Contents will become corrupted with unwanted entries.
1630 % A couple more \LaTeX\ processing runs should restore the PDF to the
1631 % way you want it.
1632 %
1633 % \subsubsection[Metadata with Polish]{Metadata with Polish}\label{sssec-pol}
1634 %
1635 % The next example has upper-range bytes intended to represent Latin-2 encoded
1636 % characters, as used in Polish.
1637 % With the \LaTeX\ source starting as in Figure~\ref{tldoc-pol},
1638 % the resulting metadata is shown in Figure~\ref{tlmeta-pol}.
1639 %
1640 %\begin{figure}[htb]
1641 % \centering
1642 % \includegraphics[scale=.45]{TL-POL-meta}
1643 %\caption{Metadata generated from the coding shown in Figure~\ref{tldoc-pol}
1644 % for the Polish version of \TeX\ Live 2015 documentation, showing Latin-2 encoded
1645 % characters. The document is valid for PDF/A-2, after having been processed with
1646 % pdf-\LaTeX.}\label{tlmeta-pol}
1647 %\end{figure}
1648 %
1649 %\begin{figure}[!htp]
1650 % {\UseRawInputEncoding
1651 %\begin{decl}[]
1652 % \input{latin2-example}
1653 %\end{decl}
1654 % }%
1655 %\caption{Start of the \LaTeX\ source for the Polish version of \TeX\ Live
1656 % documentation. Although Latin-2 encoded, the bytes are shown here using
1657 % \LaTeX's \texttt{T1} encoding \cite[p.\,449]{LC2}.}\label{tldoc-pol}
1658 %\end{figure}
1659 %
1660 % Here the `parser macro' is |\textLII|, which can be seen in Figure~\ref{tldoc-pol}
1661 % to surround either complete metadata entries, or just those parts containing
1662 % polish accented (or other) characters in entries that also contain english words.
1663 % The macro |\textLF| provides a line-feed character for the UTF-8 output.
1664 %
1665 % As a technical note, the |\jobname.xmpdata| file is read with |\obeyspaces|
1666 % in effect. This causes space runs in the input to be replaced by a single
1667 % `active space' character, which ultimately expands into a normal space upon output.
1668 % This is needed to preserve inter-word spaces, which would otherwise
1669 % get lost during parsing, due to \TeX's pattern matching when reading macro arguments.
1670 % Each byte is examined individually, with normal letters |a-zA-Z| and most punctuation
1671 % characters passed through unchanged.
1672 %
1673 % \medskip\goodbreak
1674 % Let's understand better how this example was created. There are three files involved.
1675 %\begin{itemize}
1676 % \item |pdfx.dtx|, the source for this documentation, open in an editor with
1677 % encoding declared as UTF-8;
1678 % \item |texlive-pl.tex| the Polish documentation for \TeX\ Live, open in the
1679 % same editor with Latin-2 encoding;
1680 % \item |latin2-example.tex| which starts life as an empty file on disk.
1681 %\end{itemize}
1682 % \noindent
1683 % This latter file must be opened in the editor, with encoding declared as
1684 % Latin-2 (ISO-8859-2).
1685 % Next the preamble is copied from |texlive-pl.tex| and pasted into |latin2-example.tex|
1686 % which is then saved to disk. Further editing is done to |latin2-example.tex| to
1687 % add verbatim markers (\texttt{$\vert$...$\vert$}) and adjust line lengths for display
1688 % within Figure~\ref{tldoc-pol}. This file's contents is included as part of the
1689 % documentation via |\input{latin2-example}| within an environment that handles
1690 % presentation aspects, and (since 2018) declares |\UseRawInputEncoding|.
1691 %
1692 % What \emph{cannot} be done is to paste the preamble content directly into |pdfx.dtx|.
1693 % Consider what would then happen, using `t{\l}umaczy' (`translators', on line 10
1694 % following `UWAGA'). This word shows correctly in the Latin-2 encoded files.
1695 % It was typeset here using |\l| for the `\l' letter, having Unicode code-point
1696 % |Ux0142| (so UTF-8 byte pair |"C5|\,|"82|).
1697 % However, it occurs at slot |"B3| within Latin-2 encoding.
1698 % In the |T1| font encoding \cite[p.\,449]{LC2} the character glyph name
1699 % for slot |"B3| is |/scedilla|, which is what shows in Figure~\ref{tldoc-pol}.
1700 % When the `\l' is pasted directly into a UTF-8 file and shown verbatim,
1701 % the result is the pair of glyphs |"C5| (|/Aring|) and |"82| (|/Cacute|);
1702 % \emph{viz.} {\UseRawInputEncoding |tłumaczy|}.
1703 %
1704 % As with Figure~\ref{koi8-code} it is not important that the correct characters
1705 % are shown here, but that the metadata in |\jobname.xmpdata| corresponds to what
1706 % is used on the titlepage of the PDF; e.g., the contents of |\Title| and |\title|,
1707 % |\Author| and |\author|, etc.
1708 %
1709 %
1710 % \subsubsection[Metadata with Greek]{Metadata with Greek}\label{sssec-grk}
1711 %
1712 %\begin{figure}[!hb]
1713 % \centering
1714 % \includegraphics[scale=.43]{usage-meta}
1715 %\caption{Metadata generated from the coding shown in Figure~\ref{greek-code}
1716 % using the greek language specified via the LGR encoding.}\label{greek-meta}
1717 %\end{figure}
1718 %
1719 %\begin{figure}[!htp]
1720 %\begin{decl}[]
1721 %|% ... |\\
1722 %|% This file is part of the Babel system.|\\
1723 %|% --------------------------------------|\\
1724 %|% |\\
1725 %|% It may be distributed and/or modified under the |\\
1726 %|% conditions of the LaTeX Project Public License, either version 1.3|\\
1727 %|% ... |\\
1728 %{\color{verbcolor}\texttt{\% The Current Maintainer of this work is G\"unter Milde.}}\\
1729 %|% ... |\\
1730 %| |\\
1731 %|\providecommand{\pdfxopts}{a-2u,LGRxmp,LATxmp}|\\
1732 %|\begin{filecontents}[force]{\jobname.xmpdata}|\\
1733 %|\Title{Writing Greek with the "greek" option of the "babel" package}|\\
1734 %{\color{verbcolor}\texttt{\string\Author\{Apostolos Syropoulos\string\sep\ G\"unter Milde\}}}\\
1735 %|\Subject{This document describes the use of the Latin transliteration for Greek that is |\\
1736 %| defined by the LGR font encoding. Today, all modern LaTeX distributions support literal|\\
1737 %| input of Greek, which is the preferred method for new documents. [G. Milde 2013/12/02]}|\\
1738 %|\Keywords{\textLGR{monotonik'o}\sep \textLGR{polutonik'o}\sep \textgreek{oxe'ia} \sep |\\
1739 %{\catcode `\|=11 \color{verbcolor}
1740 %\texttt{\ \ \string\textgreek\{>a'erac\}\string\sep\ \string\textgreek\{>anate'ilh|\}\string\sep\ \string\textgreek\{qa"ide'uh|c\}\}}}| \sep |\\
1741 %| \textgreek{D'uskoloc} of \textgreek{M'enandroc}\textLF \textLGR{T'i f'hic? <Id`wn |\\
1742 %| >enj'ede pa~id'' >eleuj'eran\textLF t`ac plhs'ion N'umfac stefano~usan, S'wstrate,|\\
1743 %| \textLF >er~wn 'ap~hljec e>uj'uc? \sep |\\
1744 %| \textaristerikeraia\textalpha\textsampi\textqoppa\textzeta\textdexiakeraia\sep |\\
1745 %| \textaristerikeraia\textAlpha\textSampi\textQoppa\textZeta\textdexiakeraia}}|\\
1746 %|\CoverDate{1997-10-15}|\\
1747 %|\CoverDisplayDate{October 15, 1997}|\\
1748 %|\Copyright{This file is part of the Babel system.\textLF This file may be distributed and/or|\\
1749 %| modified under the conditions of the LaTeX Project Public License, either version 1.3 |\\
1750 %| of this license or (at your option) any later version.}|\\
1751 %|\CopyrightURL{http://www.latex-project.org/lppl.txt}|\\
1752 %|\end{filecontents}|\\
1753 %|%|\\
1754 %|\documentclass[11pt]{article}|\\
1755 %|\usepackage[\pdfxopts]{pdfx}[2016/04/13]|\\
1756 %|\hypersetup{colorlinks,allcolors=blue}|\\
1757 %|\usepackage[american,greek]{babel}|\\
1758 %|\languageattribute{greek}{polutoniko}|\\
1759 %|\usepackage{athnum,grmath}|\\
1760 %|\newcommand{\sg}{\selectlanguage{greek}}|\\
1761 %|\newcommand{\sa}{\selectlanguage{american}}|\\
1762 %|\begin{document}|\\
1763 %|\selectlanguage{american}|\\
1764 %|\title{Writing Greek with the \ttfamily greek\rmfamily\ option of the |\\
1765 %| \ttfamily babel\rmfamily\ package}|\\
1766 %|\author{Apostolos Syropoulos\\|\\
1767 %| ...\\...}|\\
1768 %|\date{October 15, 1997}|\\
1769 %|\maketitle|\\
1770 %|\abstract{\noindent|\\
1771 %|This document describes the use of the Latin transliteration for Greek that|\\
1772 %|is defined by the LGR font encoding. Today, all modern LaTeX distributions|\\
1773 %|support literal input of Greek, which is the preferred method for new|\\
1774 %|documents. [G. Milde 2013/12/02]}|
1775 %\end{decl}
1776 %\caption{Start of enriched \LaTeX\ source for a document describing how to typeset
1777 % in Greek, with added metadata demonstrating the LGR transliteration encoding.
1778 % }\label{greek-code}
1779 %\end{figure}
1780 %
1781 % Prior to proper support for UTF-8 input, a method for preparing document source
1782 % for the modern Greek language (and also for polytonic Greek), involved the use
1783 % of LGR encoded fonts. Such a font has Greek (instead of Latin) letters in the
1784 % slots for |a-zA-Z|, see~\cite[\S9.4.2]{LC2}. Thus ordinary ASCII letters are used
1785 % to produce the Greek characters; the mapping of ASCII to Greek is referred to as
1786 % a `transliteration' scheme. It serves as \emph{both} an input encoding, and as
1787 % a font encoding. Accents and diacritic marks are provided through ligatures
1788 % built-in to the fonts. Various documents can be found on the web\footnote{e.g.,
1789 % \url{http://milde.users.sourceforge.net/LGR/}} and
1790 % within \TeX\ Live distributions\footnote{%
1791 % TeXLive: \textcolor{urlcolor}{\texttt{.../2016/texmf-dist/doc/generic/babel-greek/}}}.
1792 %
1793 % Indeed the current maintainer G\"unther Milde states
1794 % ``The LGR transliteration does not work for PDF metadata''.
1795 % This is because there is no translation of LGR input into \LaTeX\ LICRs,
1796 % as happens with say |\usepackage[utf8]{inputenc}| for UTF-8 input,
1797 % or when upper 8-bit characters are present using |\usepackage[iso-8859-7]{inputenc}|.
1798 % With these, LICRs such as |\textAlpha|, |\textOmicron|, \dots, |\textomega|
1799 % are produced, which result in the correct characters for metadata and bookmarks,
1800 % perhaps employing Unicode `combining' characters for accented letters.
1801 % Using |pdfx| the UTF-8 characters can be put directly into the |.xmpdata| file;
1802 % LICRs are interpreted provided the |grkxmp| loading option has been specified.
1803 %
1804 % Using the methods of |pdfx| the metadata difficulty is remedied, as can be seen in
1805 % Figure~\ref{greek-meta} using coding as shown in Figure~\ref{greek-code}. This requires
1806 % the |LGRxmp| option and |\textLGR| `parser' macro. The original document source,
1807 % called |usage.tex|, can be found in the directory specified in the footnote below.
1808 % As this document is essentially an English description of how to use LGR for Greek,
1809 % we have used the `Keywords' field to provide examples of such usage.
1810 % Since a macro |\textgreek| can be used for greek portions within such documents,
1811 % this macro name is aliased to |\textLGR| within the context where metadata is processed.
1812 % Furthermore, parsing using |\textLGR| generates correct pre-composed characters
1813 % for letters with accents or diacritics. Bookmarks can also be generated from
1814 % LGR input, using a technique described in Section~\ref{sssec-arm}.
1815 %
1816 % \bigskip\noindent
1817 % The features available with different loading options are summarised here.
1818 % \begin{itemize}
1819 % \item
1820 % no option: all metadata in |.xmpdata| file is in UTF-8 (incl. ASCII)
1821 % \item
1822 % |grkxmp|: LICRs can be present; e.g. |\textAlpha|, |\textOmega|, etc.
1823 % \item
1824 % |LGRxmp|: supports LGR-encoded input and |ISO-8859-7| upper range characters,
1825 % using the |\textLGR| `parser' macro.
1826 % \end{itemize}
1827 % With |LGRxmp| specified, the features of |grkxmp| are also available; so any
1828 % lower-listed option allows data to be mixed with that for higher-listed ones.
1829 %
1830 %
1831 % The final piece to get validation for PDF/A from LGR input, is to specify
1832 % a Unicode point for the `|v|' used only in the strong `|sv|' ligature to obtain
1833 % a non-final `sigma' typeset in isolation.
1834 %\begin{decl}[]
1835 % |\pdfglyphtounicode{internalchar2}{200D}|
1836 %\end{decl}
1837 % This gives an interpretation as `zero-width joiner'.
1838 % There are two instances of this within |usage.tex|. Copy/Paste works as desired.
1839 % Using \pdftex\ the above command is done automatically.
1840 % Drivers, such as Xe\LaTeX\ lacking an implementation of |\pdfglyphtounicode|,
1841 % can fail to produce a valid PDF due to this rather minor deficiency.
1842 %
1843 % Greek numerals, using |\greeknumeral| or |\Greeknumeral| cannot work directly within
1844 % a |.xmpdata| file. However if such is desired, the following technique allows
1845 % correct LICRs to be found for use in the metadata.
1846 % At any convenient place within the \LaTeX\ source; e.g., near where the required
1847 % number is used, insert coding such as:
1848 % \begin{decl}[]
1849 % |{\pdfxGreeknumeralsHack \textgreek{\edef\num{\greeknumeral{1997}}\show\num}}%|
1850 % \end{decl}
1851 % Upon processing, the following will be written to the console or |.log|-window.
1852 % \begin{decl}[]
1853 %|> \num=macro:|\\
1854 %|->\LGR\textaristerikeraia \LGR\textalpha \LGR\textsampi \let \protect \LGR\text|\\
1855 %|dexiakeraia \LGR\textqoppa \let \protect \LGR\textdexiakeraia \LGR\textzeta \le|\\
1856 %|t \protect \LGR\textdexiakeraia \protect \LGR\textdexiakeraia .|\\
1857 %|<argument> ...um {\greeknumeral {1997}}\show \num |\\
1858 %| |\\
1859 %|l.90 ...k{\edef\num{\greeknumeral{1997}}\show\num}|\\
1860 %| }|\\
1861 %|? |
1862 % \end{decl}
1863 % from which the desired string of LICRs, is extracted; \emph{viz}.
1864 % \begin{decl}[]
1865 % |\textaristerikeraia\textalpha\textsampi\textqoppa\textzeta\textdexiakeraia|
1866 % \end{decl}
1867 % The corresponding trick does not work with |\Greeknumeral|, but the uppercasing
1868 % can be done manually from the string obtained using |\greeknumeral|,
1869 % \begin{decl}[]
1870 % |\textaristerikeraia\textAlpha\textSampi\textQoppa\textZeta\textdexiakeraia|
1871 % \end{decl}
1872 % leaving the initial and final |\text...keraia| macros as all lowercase.
1873 % For smooth processing, remove or comment-out the added line after collecting the LICRs.
1874 %
1875 %
1876 % \def\ArmTeX{Arm\kern -0.15em\TeX}%
1877 % \subsubsection[Metadata with Armenian]{Metadata with Armenian}\label{sssec-arm}
1878 %
1879 % \begin{figure}[!htbp]
1880 % \centering
1881 % \includegraphics[scale=.42]{armtex-meta}
1882 %\caption{Metadata generated from the coding shown in Figure~\ref{arm-code}
1883 % using the Armenian language specified using \ArmTeX\ transliteration.
1884 % Bookmarks have been generated in Armenian. Figure ~\ref{ex-arm} explains
1885 % how the word indicated in red is obtained via parsing.}\label{arm-meta}
1886 % \end{figure}
1887 %
1888 % \begin{figure}[!htbp]
1889 % \let\small\scriptsize
1890 % {\UseRawInputEncoding
1891 % \begin{decl}[]
1892 % \input{arm-start.tex}%
1893 % \end{decl}
1894 % }%
1895 % \caption{Enriched \LaTeX\ source for the Armenian version of the \ArmTeX\ manual,
1896 % with added metadata demonstrating the \ArmTeX\ transliteration scheme for \texttt{OT6} encoding.
1897 % Also shown is coding used to produce bookmarks from the transliteration.}\label{arm-code}
1898 % \end{figure}
1899 %
1900 % The \ArmTeX\ package\footnote{documentation: %
1901 % TeXLive: \textcolor{urlcolor}{\texttt{.../2016/texmf-dist/doc/generic/armenian/}}}
1902 % provides the method to typeset Armenian, with input being specified in various ways
1903 % including a transliteration scheme from ASCII input. This transliteration is directed
1904 % at the use of the |OT6| encoding, developed for this purpose.
1905 % Each way is supported by |pdfx.sty| with appropriate loading options, similar
1906 % to the support for Greek~(see Section~\ref{sssec-grk}).
1907 % \begin{itemize}
1908 % \item
1909 % no option: all metadata in |.xmpdata| file is in UTF-8 (incl. ASCII)
1910 % \item
1911 % |armxmp|: using LICR-like macro names; e.g. |\armAyb|, |\armsha|, |\armfe| etc.
1912 % \item
1913 % |AR8xmp|: using the \ArmTeX\ (|OT6|) transliteration scheme or with upper-range
1914 % characters in |ArmSCII8| encoding, using the `parser' macro |\textARM|.
1915 % \end{itemize}
1916 %
1917 % \goodbreak\noindent
1918 % There are 39 letters in the Armenian alphabet, so the transliteration includes
1919 % many 2-letter combinations to specify the desired character. Whereas Greek uses
1920 % punctuation symbols to specify diacritics, Armenian requires either ligatures
1921 % implemented in the |OT6|-encoded font, or careful parsing of the input into
1922 % LICR-like macros.
1923 % \LaTeX\ source\footnote{TeXLive: %
1924 % \textcolor{urlcolor}{\texttt{.../2016/texmf-dist/doc/generic/armenian/examples/latex/}}}
1925 % for the \ArmTeX\ documentation is available in both English and Armenian.
1926 % Figure~\ref{arm-meta} shows the result of enriching the Armenian version with relevant
1927 % metadata, using coding as shown in Figure~\ref{arm-code}.
1928 %
1929 % As in earlier examples, that metadata has come from the extensive comments at the head
1930 % of the \LaTeX\ source file (represented by |...| in Figure~\ref{arm-code}), and other
1931 % title-page material, such as title and author names in both English and Armenian.
1932 % Within the keywords are armenian words that are mentioned in the documentation as being
1933 % slightly tricky to represent in transliteration, to verify that the required tricks have
1934 % been correctly implemented.
1935 %
1936 % Also apparent in Figure~\ref{arm-meta} is the use of Armenian letters in the Bookmarks
1937 % pane, having been generated from the transliteration source. This requires a 3-step
1938 % process, as follows.
1939 % \begin{enumerate}
1940 % \item
1941 % conversion of transliterated source into UTF-8.
1942 % This is done as the |.xmpdata| file is processed, using |\pdfxEnableCommands|
1943 % to make global definitions; e.g,
1944 %\begin{decl}[]
1945 % |\xdef\sectAtitle{\textARM{Nerac'uthyun}}|
1946 %\end{decl}
1947 % capturing the section title in the form supplied in the \LaTeX\ source.
1948 % This can be seen in Figure~\ref{arm-code}, near the end of the |{filecontents}|
1949 % environment, and at the bottom where the |\section| command would occur.
1950 % \item
1951 % conversion of the UTF-8 representation into |UTF16-be|, suitable for bookmark
1952 % strings within the PDF file. With \pdftex\ this is done using
1953 % |\StringEncodingConvert| from Heiko Oberdiek's |stringenc.sty| package.
1954 % Lua\LaTeX\ and Xe\LaTeX\ can use the UTF-8 representation directly.
1955 % \item
1956 % integration of the |UTF16-be| string (\pdftex) or UTF-8 string (Lua\TeX\ and Xe\TeX)
1957 % into the coding that would normally generate the bookmark from a provided section title,
1958 % in transliterated form.
1959 % \end{enumerate}
1960 % These last two steps are combined into a single command, to replace the usual
1961 % command for a section title; |\section|, |\subsection|, etc.
1962 % \begin{decl}[]
1963 % |\pdfxBookmark{\section}{\sectAtitle}{Nerac'uthyun}|
1964 % \end{decl}
1965 % Now |\pdfxBookmark| first checks that the macro passed as the 2nd argument
1966 % actually exists. If it does not, an error message is given and upon continuation
1967 % would just do |\section{Nerac'uthyun}| as normal.
1968 % When it does exist, then step 2 is done (by \pdftex) storing the result as |\pdfx@temp|.
1969 % With Lua\TeX\ and Xe\TeX, |\pdfx@temp| stores a copy of the UTF-8 data.
1970 % Then the commands needing to be executed are essentially
1971 %\begin{decl}[]
1972 % |\pdfstringdefDisableCommands{\let\sectAtitle\pdfx@temp}|\\
1973 % |\def\sectAtitle{Nerac'uthyun}|\\
1974 % |\section{\sectAtitle}|
1975 %\end{decl}
1976 % so that the correct section heading is displayed on the page,
1977 % but when |\sectAtitle| is processed to create a bookmark it is replaced
1978 % by the pre-prepared contents of |\pdfx@temp|.
1979 % There are some technicalities\footnote{In fact a small change is made
1980 % to how \textcolor{verbcolor}{\texttt{\string\@@writetorep}} is used.}
1981 % to make this work cleanly,
1982 % as just doing these commands would interfere with other uses of |\pdfstringdef|.
1983 % In case a long sectioning command has an optional argument, or a $*$-variant
1984 % is needed, then include it this way.
1985 %\begin{decl}[]
1986 % |\pdfxBookmark[Ar'avot e'r]{\section*}{\sectAtitle}{Ar'avot e'r, Araratyan dashti ...}|
1987 %\end{decl}
1988 %
1989 %
1990 % \subsubsection[Other Languages]{Other Languages}\label{sssec-other}
1991 %
1992 % There is support for Metadata using characters from other languages,
1993 % with corresponding loading options, as follows.
1994 % \begin{itemize}
1995 % \item |arbxmp| : Arabic;
1996 % via LICRs |\textarabicalef|, |\textarabicqaf|,\\ |\textarabicaleflowerhamza|, etc.
1997 % \item |devxmp| : Devanagari;
1998 % via LICRs |\textdevanagaria|, |\textdevanagarivocalicr|,\\ |\textdevanagaricandrabindu|, etc.
1999 % \item |hebxmp| : Hebrew;
2000 % via LICRs |\hebalef|, |\hebsamekh|, |\hebfinalpe| and accent marks |\segol|, |\qubuts|, etc.
2001 % \item |vnmxmp| : Vietnamese;
2002 % via LICRs |\ABREVE|, |\OCIRCUMFLEX|, |\uhorn| etc. and the combinations of multiple accents
2003 % applied as usual via |\'|, |\`|, |\^|, etc.
2004 % \end{itemize}
2005 % The LICRs include support mapping accented letters to precomposed glyphs, falling back on
2006 % `combining characters' only in unusual situations. Special input conventions or methods,
2007 % such as transliteration schemes, are \emph{not yet} supported.
2008 % Indeed, these options are largely untested, so any difficulties encountered should
2009 % be reported to the package authors. Requests to support extra input methods or other
2010 % language blocks should also be directed to the authors, along with pointers to where
2011 % the desired input methods are fully described.
2012 % Sample `real-world' documents would be greatly appreciated.
2013 %
2014 %
2015 % \subsection[L8U pseudo-encoding]{L8U pseudo-encoding}\label{ssec-L8U}
2016 %
2017 % To understand how |pdfx| handles the translation into UTF-8 of input that is not already
2018 % in that format, we'll briefly discuss \LaTeX's font-encoding mechanism, which is the
2019 % basis for LICR macros~\cite[\S\,7.11]{LC2}. As an example, consider the macro |\textgamma|
2020 % representing the lowercase Greek letter $\gamma$.
2021 % Various \LaTeX\ packages declare this as LICR in different ways, for different purposes.
2022 %\begin{decl}[]
2023 % |greek-fontenc/lgrenc.def:\DeclareTextSymbol{\textgamma}{LGR}{103}|\\
2024 % |tipa/t3enc.def:\DeclareTextSymbol\textgamma{T3}{71} % Gamma|\\
2025 % |greek-fontenc/greek-euenc.def:\DeclareTextCommand{\textgamma}{\LastDeclaredEncoding}{γ}|\\
2026 % |hyperref/puenc.def:\DeclareTextCommand{\textgamma}{PU}{\83\263}%* U+03B3|\\
2027 % |ucs/data/uni-2.def:\uc@dclc{611}{tipa}{\textgamma}%|\\
2028 % |ucs/data/uni-3.def:\uc@dclc{947}{default}{\textgamma}%|
2029 % \end{decl}
2030 % Here the |\uc@dclc| commands associate UTF-8 input of |Ux0263| (IPA small letter gamma)
2031 % and |Ux03B3| (Greek small letter gamma) internally with |\textgamma|,
2032 % whereas the others deal with output formats\footnote{Whereas {\color{verbcolor}\texttt{ucs.sty}}
2033 % handles UTF-8 input, mapping it to LICRs, with {\color{verbcolor}\texttt{pdfx.sty}}
2034 % we need the reverse mapping into UTF-8, not just from LICRs but also from legacy
2035 % 8-bit encodings and transliteration schemes.}.
2036 % In four of these examples there is a number, which refers to a position in an `encoding vector'
2037 % for the particular font used to place the character onto the printable page.
2038 % For example |LGR| refers to greek fonts, encoded as explained in Section~\ref{sssec-grk}.
2039 % IPA phonetics use the |T3| encoding, so |\textgamma| refers to a character
2040 % from a different Unicode block.
2041 %
2042 % With two of these cases there is no specific font.
2043 % For example, |PU| is used to create bookmark strings,
2044 % and other PDF string inclusions, using |\pdfstringdef| from the |hyperref| package.
2045 % With |greek-euenc.def| designed for Xe\TeX\ and Lua\TeX, the encoding can be variable,
2046 % with the output bytes being those for the UTF-8 encoding of $\gamma$, namely |^^ce^^b3|,
2047 % shown here as the |T1|-encoded pair |γ|.
2048 % The term `pseudo-encoding' has been coined by the \LaTeX\ team.
2049 % Although there is no actual font to determine the encoding, to an author there is essentially
2050 % no difference in how corresponding macros can be used to get a character placed into
2051 % an appropriate structure within the PDF.
2052 %
2053 % Thus there are 4 output forms for this character,
2054 % and we've not even considered how $\gamma$ is used in mathematics!
2055 % To handle these concurrently, one has internally-defined control-sequence names
2056 % \begin{decl}[]
2057 % |\LGR\textgamma=\char"67| \qquad where $6\times 16 + 7 = 103$\\
2058 % |\T3\textgamma=\char"47| \qquad where $4\times 16 + 7 = 71$\\
2059 % |\PU\textgamma=\long macro:->\83\263|\\
2060 % |\L8U\textgamma=\long macro:->γ|
2061 % \end{decl}
2062 % where the 2nd `\textbackslash' is part of the name\footnote{%
2063 % obtained using {\color{verbcolor}%
2064 % \texttt{\string\csname\space LGR\string\string\string\textgamma\string\endcsname}}.}.
2065 % The latter macro is explained below.
2066 % To use the specific version of the macro, \LaTeX\ maintains a `font-encoding'
2067 % parameter, set using |\fontencoding{...}| local to the surrounding environment grouping.
2068 %
2069 % To the above declarations of |\textgamma|, to deal with conversion to UTF-8,
2070 % the |pdfx| package adds the following declarations when the |LGRxmp| option is used.
2071 % \begin{decl}[]
2072 % |pdfx/l8ugrk.def:\DeclareTextCommand{\textgamma}{L8U}{γ}|\\
2073 % |pdfx/l8ugrk.def:\DeclareTextCompositeCommand{\textLGRenc}{L8U}{\textgamma}{γ}|\\
2074 % |pdfx/l8ugrk.def:\DeclareTextCompositeCommand{\textLGRenc}{L8U}{g}{γ} |\\
2075 % |pdfx/l8ugrk.def:\DeclareTextCompositeCommand{\textLGRenc}{L8U}{^^e3}{γ}|
2076 % \end{decl}
2077 % The pseudo-encoding name |L8U| indicates \textbf{L}ocal conversion into UTF-\textbf{8} \textbf{U}nicode,
2078 % as required for metadata, using |pdfx.sty|. Currently this pseudo-encoding is used in one place only;
2079 % during the interpretation of information supplied through the |\jobname.xmpdata| file.
2080 % This happens as part of the |pdfx| package, \emph{before} it uses |xmpincl.sty|.
2081 % Such specificity justifies being called a `Local' encoding.
2082 % However, other tasks may emerge requiring on-the-fly conversion to UTF-8.
2083 % In this case all the functionality of this pseudo-encoding could be shifted into a separate package,
2084 % and the name changed to reflect this more general usage.
2085 % Bookmarks from transliterated input, as described in Section~\ref{sssec-arm},
2086 % is possibly a sufficient reason to have a separate package. Another possibility is to
2087 % generate on-the-fly creation of UTF-8 strings, to be sent to Xe\TeX\ or Lua\TeX\ running
2088 % as a slave process to generate images of string using OTF fonts, which \pdftex\ currently
2089 % cannot handle. The result would then be imported back into the running job as an image.
2090 % The authors invite suggestions of how this |L8U| pseudo-encoding functionality can be put to
2091 % good use.
2092 %
2093 % \goodbreak
2094 % Accented letters normally use (e.g., from |t1enc.def|)
2095 %\begin{decl}[]
2096 % |\DeclareTextComposite{\`}{T1}{A}{192}|
2097 %\end{decl}
2098 % to get the pre-composed `\`A', rather than a composite built from \`{} and `A'.
2099 % The last parameter is an index into a font; however the |\DeclareTextCompositeCommand|
2100 % variant allows arbitrary coding as that final parameter, so can be the bytes for the
2101 % UTF-8 representation of a character.
2102 % In the above code lines, macros are defined as follows
2103 %\begin{decl}[]
2104 % |\\L8U\textLGRenc-\textgamma=macro:->γ|\\
2105 % |\\L8U\textLGRenc-g=macro:->γ|\\
2106 % |\\L8U\textLGRenc-|{\color{verbcolor}\texttt{\~a}}|=macro:->γ|
2107 %\end{decl}
2108 % where now the 2nd and 3rd (and perhaps 4th) `\textbackslash' are part of the name\footnote{%
2109 % obtained using {\color{verbcolor}%
2110 % \texttt{\string\csname\string\string\string\LGR\string\string\string\textLGRenc-\string\string\string\textgamma\string\endcsname}}.}.
2111 % This shows how the ascii letter `g' is associated with the UTF-8 bytes for $\gamma$,
2112 % and how the upper 8-bit character from |^^e3| can be similarly associated,
2113 % as in |ISO-8859-7| encoding.
2114 %
2115 % All these associations come together in the `parser' macro |\textLGR| which works as follows.
2116 % Firstly, |\textLGR| is declared for |L8U| pseudo-encoding only, where it expands as follows.
2117 %\begin{decl}[]
2118 % |\L8U\textLGR #1->\textgreekLGRstring {#1}|\\
2119 % |\L8U\textgreekLGRstring #1->\textgreekLGR@ii #1\@empty \@empty|\\
2120 % |\textgreekLGR@ii #1#2\@empty -> ... | coding to test what is in |#2|\\
2121 % | ... \textLGRenc{#1}\@empty | \quad if |#2| is |\@empty|\\
2122 % | ... \textLGRenc{#1}\textgreekLGR@i #2\@empty | \quad if |#2| has more tokens\\
2123 % |\textgreekLGR@i #1->\textgreekLGR@ii #1|
2124 %\end{decl}
2125 % Thus |\textLGRenc| is called on each token in the argument of |\textLGR|.
2126 % Now |\textLGRenc|, which is applicable only when |L8U| pseudo-encoding is in effect,
2127 % has a default expansion of just passing the character through unchanged; \emph{viz.}
2128 %\begin{decl}[]
2129 % |\DeclareTextCommand{\textLGRenc}{L8U}[1]{#1}|
2130 %\end{decl}
2131 % but by using |\DeclareTextCompositeCommand{\textLGRenc}{L8U}{...}{...}|,
2132 % alternate expansions apply with specific arguments, as shown above.
2133 % In particular, that final argument can include coding that `looks ahead' to find the next
2134 % character. This is used, for example, with diacritics in Greek, multi-letter sequences
2135 % for Armenian letters, and other special cases related to ligatures and punctuation symbols.
2136 % To illustrate this Figure~\ref{ex-arm} (below) follows the conversion of a specific word,
2137 % given in the transliteration for Armenian~(see Section~\ref{sssec-arm}).
2138 % This conversion occurs using only \TeX's macro-expansion ability.
2139 % Some details relevant to this example are explained there.
2140 %
2141 %\begin{figure}[!htbp]
2142 %\begin{decl}[]
2143 % |\textARM{Se\armuh van}|\\
2144 % |\textarmenARMstring {Se\armuh van}|\\
2145 % |\textarmenARM@ii Se\armuh van\@empty \@empty|\\
2146 % |\textARMenc {S}\textarmenARM@i e\armuh van\@empty \@empty|\\
2147 % |\arm@en{S}{Ս}{\arm@nc{h}{Շ}{\arm@nc{H}{Շ}{Ս}}}\textarmenARM@i e\armuh van\@empty ...|\\
2148 % |\arm@nc{h}{Շ}{\arm@nc{H}{Շ}{Ս}}\textarmenARM@i e\armuh van\@empty \@empty|\\
2149 % |\arm@nc{H}{Շ}{Ս}\textarmenARM@i e\armuh van\@empty \@empty|\\
2150 % |Ս\textarmenARM@i e\armuh van\@empty \@empty|\\
2151 % |Ս\textARMenc {e}\textarmenARM@i \armuh van\@empty \@empty|\\
2152 % |Ս\textARMenc {e}\textarmenARM@i \armuh van\@empty \@empty|\\
2153 % |Ս\arm@en{e}{ե}{\arm@nc{'}{է}{\arm@nc{v}{և}{ե}}}\textarmenARM@i \armuh van\@empty ...|\\
2154 % |Ս\arm@nc{'}{է}{\arm@nc{v}{և}{ե}}\textarmenARM@i \armuh van\@empty \@empty|\\
2155 % |Ս\arm@nc{v}{և}{ե}\textarmenARM@i \armuh van\@empty \@empty|\\
2156 % |Սե\textarmenARM@i \armuh van\@empty \@empty|\\
2157 % |Սե\textARMenc {\armuh }\textarmenARM@i van\@empty \@empty|\\
2158 % |Սե\textarmuh\textarmenARM@i van\@empty \@empty|\\
2159 % |Սե\\L8U\textarmuh-\textarmenARM@i van\@empty \@empty|\\
2160 % |Սե\textarmgobblespace van\@empty \@empty|\\
2161 % |Սե\\L8U\textarmgobblespace- van\@empty \@empty|\\
2162 % |Սե\textarmenARM@i van\@empty \@empty|\\
2163 % |Սե\textARMenc {v}\textarmenARM@i an\@empty \@empty|\\
2164 % |Սե\arm@en{v}{վ}{\arm@nc{n}{ﬖ}{վ}}\textarmenARM@i an\@empty \@empty|\\
2165 % |Սե\arm@nc{n}{ﬖ}{վ}\textarmenARM@i an\@empty \@empty|\\
2166 % |Սեվ\textarmenARM@i an\@empty \@empty|\\
2167 % |Սեվ\textARMenc {a}\textarmenARM@i n\@empty \@empty|\\
2168 % |Սեվա\textarmenARM@i n\@empty \@empty|\\
2169 % |Սեվա\textARMenc {n}\@empty|\\
2170 % |Սեվան\@empty|\\
2171 % |Սեվան|
2172 %\end{decl}
2173 % The macro |\armen@en| (named for \textbf{e}mpty or \textbf{n}ext),
2174 % looks ahead to see if the 5th-next argument token is |\@empty|,
2175 % signifying that there is nothing left of the original input.
2176 % (A closed bracing |{...}| counts as a single argument.) If |\@empty| the tokens in
2177 % the 2nd bracing are substituted, otherwise those in the 3rd bracing.
2178 % Similarly |\armen@nc| (named for \textbf{n}ext \textbf{c}haracter)
2179 % looks to see whether that 5th argument token matches with the character in the
2180 % 1st bracing. If so, the 2nd bracing's tokens are substituted, else those of the 3rd bracing.
2181 % This is how to cope with `Sh' or `SH', implemented as ligatures in an |OT6| encoded font,
2182 % denoting a different letter from a single `S'. The macro |\armuh| is used here
2183 % to \emph{prevent} a ligature from |ev| that would otherwise occur.
2184 % One writes |e\armuh v| to get the separate letters. As the space becomes an active token,
2185 % we need |\textarmgobblespace| to restart parsing appropriately.
2186 % Of course |\textarmenARM@i| behaves like |\textgreekLGR@i|
2187 % as explained earlier, with a test for |\@empty| as the 2nd token.
2188 % At the end, any remaining |\@empty| expand into nothing.
2189 %
2190 % \caption{Partial tracing of the conversion of an Armenian word, indicated by the red oval
2191 % in Figure~\ref{arm-meta}, from {\color{verbcolor}\texttt{OT6}} transliterated form into UTF-8 bytes.
2192 % In each line, \TeX\ expansion occurs at the position of the left-most `\textbackslash'.
2193 % The resulting bytes are shown here in {\color{verbcolor}\texttt{T1}} encoding,
2194 % as in previous examples, with {\color{verbcolor}\texttt{?}} indicating an invisible character
2195 % in the byte range {\color{verbcolor}\texttt{Ox80}--\texttt{Ox9f}}.
2196 % See Figure\,\ref{src-arm} for how this source appears with UTF-8 encoding.
2197 % }\label{ex-arm}
2198 % \bigskip
2199 %\end{figure}
2200 %
2201 % Note how in Figure~\ref{ex-arm} the Arm\TeX\ user macro |\armuh| gets aliased
2202 % to an LICR called |\textarmuh|. Since |\armuh| is already defined, not as an LICR,
2203 % it cannot be declared to be one without creating problems.
2204 % Instead, within the environment grouping where |L8U| pseudo-encoding is specified,
2205 % one uses |\let\armuh\textarmuh| within a `rebinding' macro command
2206 % |\LIIXUmaparmenianletters|\footnote{The start of the macro name is derived from pseudo-Roman
2207 % numerals: IX = 9, IIX = 8}
2208 % to get LICR functionality from user-commands.
2209 %\begin{decl}[]
2210 % |\def\LIIXUmaparmenianletters{%|\\
2211 % | \let\ArmTeX\textArmTeX|\\
2212 % | \let\Armayb\textArmayb|\\
2213 % | ... |\\
2214 % | \let\armuh\textarmuh |\\
2215 % | ... |\\
2216 % | \def\armbf{}%|\\
2217 % | ... }|
2218 %\end{decl}
2219 % As well as rebinding each command for a letter, the font style-switching commands
2220 % are aliased to do nothing, as these are not relevant to creating UTF-8 output.
2221 % Being localised by the |L8U| grouping, this causes no problem elsewhere within the document.
2222 % These are similar to macros |\psdaliasnames| and |\psdmapshortnames| from |hyperref.sty|,
2223 % which rebind user macros to LICRs, so that |PU| encoded versions of LICRs can be used.
2224 %
2225 % \begin{figure}[htb]
2226 % \includegraphics[scale=.625]{Armenian-example-UTF8.png}
2227 % \caption{Image of part of the source coding for Figure~\ref{ex-arm},
2228 % viewed as UTF-8 encoded, within editing software.}\label{src-arm}
2229 % \end{figure}
2230 %
2231 % Several other `rebinding' commands are defined, mostly with package-loading options.
2232 %\begin{itemize}
2233 % \item |\LIIXUmapTeXnames| always defined
2234 % \item |\LIIXUscriptcommands| handles |\textsuperscript|, |\textsubscript|, |\t|
2235 % \item |\LIIXUtipacommands| handles IPA letters and symbols
2236 % \item |\LIIXUmaparabicletters| with |arbxmp|
2237 % \item |\LIIXUmaparmenianletters| with |armxmp| and |AR8xmp|
2238 % \item |\LIIXUmapdevaccents| with |devxmp|
2239 % \item |\LIIXUmapgreekletters| with |grkxmp| and |LGRxmp|
2240 % \item |\LIIXUmaphebrewletters| with |hebxmp| and |HEBxmp|
2241 % \item |\LIIXUmaplatinchars| and |\LIIXUcancelfontswitches| with |LATxmp|
2242 % \item |\LIIXUmapmathletterlikes| always defined
2243 % \item |\LIIXUmapmathspaces| always defined
2244 % \item |\LIIXUmapmath...| with |mathxmp| --- see Section~\ref{ssec-math} below.
2245 %\end{itemize}
2246 % It may well be that more macro names can be added to some of these commands,
2247 % to allow macro usage within the metadata.
2248 % Suggestions for such additions should be sent to the |pdfx| package authors, along
2249 % with example documents. Similarly support for more languages can be requested.
2250 %
2251 % \subsection[Nested Parsing\,\textemdash\,Mathematics in Metadata]%
2252 % {Nested Parsing\,\textemdash\,Mathematics in Metadata}\label{ssec-math}
2253 %
2254 % Macro commands for many mathematical symbols can be used directly in metadata without extra
2255 % support; e.g., basic arithmetic operations, letter-like symbols, spacing commands.
2256 % Super- and subscripted letters and numerals can use |\textsuperscript| and |\textsubscript|
2257 % when there is an appropriate Unicode character (digits, comma, $+$/$-$/$=$, parentheses,
2258 % many letters but not all).
2259 %
2260 % When the |mathxmp| loading option is specified, many more symbols become available,
2261 % using `rebinding' macros. These are necessary, as the macros for mathematical symbols
2262 % are generally \emph{not} defined as LICRs, but use |\mathchar|. Thus new LICRs are needed,
2263 % and existing names bound to these.
2264 %\begin{decl}[]
2265 % |\LIIXUmapmathaccents| using `combining' characters from Unicode ranges at |Ux0300|, |Ux1DC0|, |Ux20D0|\\
2266 % |\LIIXUmapisomathgreek| using |Ux0391|--|Ux03F8| for greek symbols\\
2267 % |\LIIXUmapmatharrowsA| supporting symbols in the |Ux2190|--|Ux21FF| block\\
2268 % |\LIIXUmapmathoperatorsA| supporting symbols in the |Ux2200|--|Ux227F| block\\
2269 % |\LIIXUmapmathoperatorsB| supporting symbols in the |Ux2280|--|Ux22FF| block\\
2270 % |\LIIXUmapmiscmathsymbolsA| supporting some symbols in the |Ux27C0|--|Ux27EF| range\\
2271 % |\LIIXUmapsupparrowsA| supporting some symbols in the |Ux27F0|--|Ux27FF| block\\
2272 % |\LIIXUmapsupparrowsB| supporting some symbols in the |Ux2900|-–|Ux297F| block\\
2273 % |\LIIXUmapmiscmathsymbolsB| supporting symbols in the |Ux2980|--|Ux29FF| block\\
2274 % |\LIIXUmapsuppmathoperators| supporting symbols in the |Ux2A00|--|Ux2AFF| block\\
2275 % |\LIIXUmapunimathgreek| using |Ux1D6E2|--|Ux1D71B| for greek symbols\\
2276 % |\LIIXUmapmathalphabets| allows access to symbols in the |Ux1D400|--|Ux1D755| block
2277 %\end{decl}
2278 %
2279 % The `parser' macro idea can extends to handle a large class of mathematical expressions.
2280 %\begin{decl}[]
2281 % |\let\(\textinlinemath|\\
2282 % |\DeclareTextCommand{\textinlinemath}{L8U}{\liixu@getinlinemath}|\\
2283 % |\def\liixu@getinlinemath#1\){\space\textmathnormalstring{#1}\space}|\\
2284 % |\DeclareTextCommand{\textmathnormalstring}{L8U}[1]{\textmathnormal@ii#1\@empty\@empty}|\\
2285 % |\textmathnormal@ii #1#2\@empty -> ... | coding to test what is in |#2|\\
2286 % | ... \textmathnormal{#1}\@empty | \quad if |#2| is |\@empty|\\
2287 % | ... \textmathnormal{#1}\textmathnormal@i #2\@empty | \quad if |#2| has more tokens\\
2288 % |\let\[\textdisplaymath| defined similarly to call |\textmathnormalstring|
2289 %\end{decl}
2290 % This allows |\textmathnormal| to test each token, in particular mapping letters A--Za--z
2291 % into the Unicode range |Ux1D44E|--|Ux1D467| (except for $h$).
2292 % Mathematical styles, such as |\mathrm|, |\mathbf|, |\mathbb| etc. can now be handled
2293 % using declarations such as:
2294 %\begin{decl}[]
2295 % |\Dec...positeCommand{\textmathnormal}{L8U}{\mathrm}{\liixu@mathreorder\textmathrmstring}|\\
2296 % |\Dec...positeCommand{\textmathnormal}{L8U}{\mathbf}{\liixu@mathreorder\textmathbfstring}|\\
2297 %\end{decl}
2298 % where |\liixu@mathreorder| uses some \TeX\ pattern-matching to allow the |\textmathrmstring|
2299 % parser macro to work on the argument to |\mathrm| before allowing |\textmathnormal| parsing
2300 % to continue afterwards. We refer to this as `nested parsing'.
2301 %
2302 % Similarly `nested parsing' can be used with superscripts and subscripts using |^{...}| and |_{...}|
2303 % and to specify linebreaks, and even super-/subscripts within styles; viz.
2304 %\begin{decl}[]
2305 % |\Declar...CompositeCommand{\textmathnormal}{L8U}{^}{\liixu@mathreorder\textsuperstring}|\\
2306 % |\DeclareTextCompositeCommand{\textmathnormal}{L8U}{_}{\liixu@mathreorder\textsubstring}|\\
2307 % |\DeclareTextCompositeCommand{\textmathnormal}{L8U}{\\}{\textLF}|\\
2308 % |\DeclareTextCompositeCommand{\textmathnormal}{L8U}{\cr}{\textLF}|\\
2309 % |\DeclareTextCompositeCommand{\textmathrm}{L8U}{^}{\liixu@mathreorder\textsuperstring}|\\
2310 % |\DeclareTextCompositeCommand{\textmathrm}{L8U}{_}{\liixu@mathreorder\textsubstring}|
2311 %\end{decl}
2312 % Such `nested parsing' seems to be quite robust\footnote{%
2313 % ... so far, barring multi-line aligned environments.}, but a great deal more testing
2314 % is required to uncover cases which may require special handling.
2315 % An ultimate aim is to be able to just copy the \LaTeX\ source for the `Abstract' of a technical
2316 % paper into the |\Subject{...}| field of the |.xmpdata| file, with a large expectation that
2317 % it will `just work', or need only trivial edits to make it so.
2318 %
2319 %
2320 % \subsection[Metadata in a Production Workflow]{Metadata in a Production Workflow}\label{ssec-wflow}
2321 %
2322 %\begin{figure}[htbp]
2323 % \centering
2324 % \includegraphics[scale=.45]{math-assign5.png}
2325 % \caption{Metadata from student assignment papers, using information drawn from a database.
2326 % The start of the \LaTeX\ coding for this example is shown in Figure~\ref{math-wflow}.}\label{wflow-meta}
2327 %\end{figure}
2328 % \noindent
2329 % At Macquarie University, the Mathematics Department produces personalised topmatter
2330 % or coversheets for student assignments and tutorial papers using \LaTeX, incorporating
2331 % information that has been stored in a database. This is done by writing extra definitions
2332 % at the top of a copy of the \LaTeX\ source as prepared by the lecturers.
2333 % For example information analogous to the following
2334 %\begin{decl}[]
2335 % |\def\thestudentname{\utext{Moore} Ross}|\\
2336 % |\def\thestudentid{55507247}|\\
2337 % |\def\theunitcode{MATH337}|\\
2338 % |\def\theoffering{S116}|\\
2339 % |\def\thetaskname{Assignment 5}|\\
2340 % |\def\theassignmentnumber{5}|\\
2341 % |\def\theduedate{09/05 2016}|\\
2342 % |...|
2343 %\end{decl}
2344 % is prepended to the file shown in Figure~\ref{math-wflow},
2345 % for each student downloading their personalised assignment paper.
2346 % The \LaTeX\ source makes use of this information, including recording some of it
2347 % within the Metadata.
2348 %\begin{figure}[!htbp]
2349 %\begin{decl}[]
2350 % |\providecommand{\theassignmentnumber}{5}|\\
2351 % |\providecommand{\assignLecturer}{Dr Ross Moore}|\\
2352 % |\providecommand{\theunitcode}{MATH337}|\\
2353 % |\providecommand{\theunitname}{Algebra IIIA}|\\
2354 % |\providecommand{\theyear}{2016}|\\
2355 % |...|\\
2356 % |\def\assigntopics{orbits, stabilisers, groups of matrices}|\\
2357 % |\providecommand{\pdfxopts}{a-1b}|\\
2358 % |%% XMP metadata for PDF/A conformance|\\
2359 % |\begin{filecontents}[force]{\jobname.xmpdata}|\\
2360 % |\Title{\theunitcode\ \theoffering: Assignment \theassignmentnumber}|\\
2361 % |\Author{\assignLecturer}|\\
2362 % |\Copyright{Macquarie University, Mathematics Department}|\\
2363 % |\Subject{Assignment \theassignmentnumber, with coversheet personalised for \thestudentname,|\\
2364 % | id = \thestudentid}|\\
2365 % |\Keywords{\assigntopics}|\\
2366 % |\Creator{pdfTeX + pdfx.sty with \pdfxopts\space option}|\\
2367 % |\pdfxEnableCommands{\def\utext#1{#1,}}|\\
2368 % |\end{filecontents}|\\
2369 % ||\\
2370 % |\documentclass[a4paper,11pt]{article}|\\
2371 % |\RequirePackage{assignments}|\\
2372 % |\usepackage[\pdfxopts]{pdfx}|
2373 %\end{decl}
2374 % \caption{Start of the \LaTeX\ source for an assignment paper, using macro expansion values
2375 % supplied via definitions prepended to this file.}\label{math-wflow}
2376 %\end{figure}
2377 % When preparing such documents \LaTeX's |\providecommand| is used to supply default values,
2378 % not drawn from the database; but when actually used, these are ignored as the required
2379 % information has been supplied using \TeX's |\def| command.
2380 % The resulting metadata is as in Figure~\ref{wflow-meta}, showing also how the information
2381 % is displayed at the top of the PDF file that is produced.
2382 % Notice how a command |\utext| is included to obtain the underlining of the surname within
2383 % the produced PDF. This is modified, using |\pdfxEnableCommands| in the |\jobname.xmpdata|
2384 % file, to just place a comma after the surname in the metadata, as it precedes the given name.
2385 %
2386 %\newpage\noindent
2387 % Another way that jobs can be customised using essentially the same \LaTeX\ source,
2388 % is via the command used to initiate the job. For example the file |sample.tex|,
2389 % accompanying the |pdfx| distribution, can be used to test the loading options to create
2390 % PDFs conforming to the various flavours of PDF/A, PDF/E and PDF/X.
2391 % Consider a shell script containing the following (Unix/Linux) commands.
2392 %\begin{decl}[]
2393 % |pdflatex "\def\pdfxopt{a-2b}\input sample.tex"|\\
2394 % |pdflatex "\def\pdfxopt{a-2b}\input sample.tex"|\\
2395 % |mv sample.pdf sample-a2b.pdf|\\
2396 % ||\\
2397 % |pdflatex "\def\pdfxopt{a-2u}\input sample.tex"|\\
2398 % |pdflatex "\def\pdfxopt{a-2u}\input sample.tex"|\\
2399 % |mv sample.pdf sample-a2u.pdf|\\
2400 % |...|
2401 %\end{decl}
2402 % With a 3-line block for each flavour, this produces a corresponding PDF
2403 % from the same \LaTeX\ source, named according to each particular variant.
2404 % A default |\providecommand{\pdfxopt}{a-1b}| at the start of |sample.tex| catches the case
2405 % of normal typesetting, doing nothing when |\pdfxopt| already has an expansion value.
2406 %
2407 % \goodbreak
2408 % \subsection[Further Developments]{Further Developments}\label{ssec-further}
2409 %
2410 % Prospects for further development of the |pdfx| package are as follows,
2411 % listed not necessarily in order of perceived importance.
2412 % \begin{itemize}
2413 % \item
2414 % Support for the |dvips| driver with Ghostscript as PDF producer; possible since |gs v9.21|.
2415 % \item
2416 % Separate the |L8U| pseudo-encoding support into a separate package.
2417 % \item
2418 % Conformance to multiple PDF standards; e.g. both PDF/A and PDF/E,
2419 % both PDF/A and PDF/X with RGB or CMYK color profile, other combinations.
2420 % \item
2421 % Explore delaying the processing of metadata until |\begin{document}|,
2422 % thereby allowing some fields to be set automatically from other information
2423 % supplied within the document preamble.
2424 % \item
2425 % Support for input using other legacy 8-bit encodings and transliterations.
2426 % \item
2427 % Support for more mathematical environments within the metadata.
2428 % \item
2429 % Support for more PRISM metadata fields, incl. PRISM 3.0~\cite{PRISM}.
2430 % \item
2431 % Explore ways to overcome incompatibilities that may arise with other packages.
2432 % \item
2433 % Full support for PDF/VT; in particular, transparency groups and PDF/VT-2s.
2434 % \item
2435 % Support for more aspects of PDF/UA and `Tagged PDF'.
2436 % \item
2437 % Develop ways to usefully use |L8U| apart from metadata and bookmarks.
2438 % \item
2439 % Support emerging standards based on PDF 2.0~\cite{PDF20}.
2440 % \end{itemize}
2441 %
2442 % \section[Bibliography]{Bibliography}%
2443 % {\let\newpage\relax
2444 % \begin{thebibliography}{999}
2445 %
2446 % \bibitem{PDF17}Adobe Systems Inc.;
2447 % {PDF} Reference 1.7, November 2006.
2448 % Also available as \cite{ISO32000}.\\
2449 % \url{http://www.adobe.com/devnet/pdf/pdf_reference.html}.
2450 %
2451 % \bibitem{XMP-spec}Adobe Systems Inc.;
2452 % XMP Specification, Adding Intelligence to Media. September 2005.
2453 % Also available as ISO 16684-1:2012\,\cite{XMP-ISO}. %\\
2454 % \url{http://www.adobe.com/devnet/xmp/}.
2455 %
2456 % \bibitem{PDFUA1} ANSI\,/\,AIIM\,/\,ISO\,14289-1:2012;
2457 % Document management applications --- Electronic document file format enhancement for accessibility
2458 % --- Part 1: Use of ISO\,32000-1\,(PDF/UA-1);
2459 % Technical Committee ISO/TC\,171/SC\,2 (July 2012 -- withdrawn). %\\
2460 % Revised as ISO\,14289-1:2014 (Dec. 2014):
2461 % \url{https://www.iso.org/standard/64599.html}.\\
2462 % Available from ANSI at \url{https://webstore.ansi.org/standards/iso/iso142892014}.
2463 %
2464 % \bibitem{PDFUA2} ISO\,14289-2:2024;
2465 % Document management applications --- Electronic document file format enhancement for accessibility
2466 % --- Part 2: Use of ISO\,32000-2\,(PDF/UA-2);\\
2467 % Technical Committee ISO/TC\,171/SC\,2 WG9 (March 2024).
2468 % \href{https://pdfa.org/iso-14289-2-pdfua-2/}%
2469 % {\UrlFont https://pdfa.org/iso-\penalty-20 14289-2-pdfua-2/}
2470 %
2471 % \bibitem{PDFUABSI} BS,/\,ISO\,14289-1:2014; Document Management Applications.
2472 % Electronic Document File Format Enhancement For Accessibility.
2473 % Use Of ISO 32000-1 (PDF/UA-1) (British Standard)
2474 % \url{https://webstore.ansi.org/standards/bsi/bsiso142892014}.
2475 %
2476 % \bibitem{pdfaPilot} Callas Software Gmbh.;
2477 % \texttt{pdfaPilot}, plug-in or desktop software for PDF/A versions.
2478 % \url{https://www.callassoftware.com/en/products/pdfapilot}.
2479 %
2480 % \bibitem{DC}
2481 % Dublin Core Metadata Element Set, Version 1.1, October 2010\\
2482 % \url{http://dublincore.org/documents/dces/}.
2483 %
2484 % \bibitem{BCP47}IETF; Best Current Practice \#47: Tags for Identifying Languages.
2485 % Incorporates RFC\,5646; obsoletes RFC\,4646. IETF Network Working Group, September 2009.
2486 % \url{https://tools.ietf.org/pdf/bcp47.pdf}.
2487 %
2488 % \bibitem{PDFX}ISO\,15930-1:2001;
2489 % Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 1:
2490 % Complete exchange using CMYK data (PDF/X-1 and PDF/X-1a).
2491 % Technical Committee ISO/TC\,130 (December 2001).
2492 % \url{https://www.iso.org/standard/29061.html}.
2493 %
2494 % \bibitem{PDFX3}ISO\,15930-3:2002;
2495 % Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 3:
2496 % Complete exchange suitable for colour-managed workflows (PDF/X-3).
2497 % Technical Committee ISO/TC\,130 (September 2002).
2498 % \url{https://www.iso.org/standard/34941.html}.
2499 %
2500 % \bibitem{PDFX1a}ISO\,15930-4:2003;
2501 % Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 4:
2502 % Complete exchange of CMYK and spot colour printing data using PDF 1.4 (PDF/X-1a).
2503 % Technical Committee ISO/TC\,130 (December 2003).
2504 % \url{https://www.iso.org/standard/39938.html}.
2505 %
2506 % \bibitem{PDFX3a}ISO\,15930-6:2003;
2507 % Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 6:
2508 % Complete exchange of printing data suitable for colour-managed workflows using PDF 1.4 (PDF/X-3).
2509 % Technical Committee ISO/TC\,130 (December 2003).
2510 % \url{https://www.iso.org/standard/39940.html}.
2511 %
2512 % \bibitem{PDFX4}ISO\,15930-7:2010;
2513 % Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 7:
2514 % Complete exchange of printing data (PDF/X-4) and partial exchange of printing data with external profile reference (PDF/X-4p) using PDF 1.6.
2515 % Technical Committee ISO/TC\,130 (July 2010).
2516 % \url{https://www.iso.org/standard/55843.html}.
2517 %
2518 % \bibitem{PDFX5}ISO\,15930-8:2010;
2519 % Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 8:
2520 % Partial exchange of printing data using PDF 1.6 (PDF/X-5).
2521 % Technical Committee ISO/TC\,130 (July 2010).
2522 % \url{https://www.iso.org/standard/55844.html}.
2523 % Revision via Corrigendum: ISO\,15930-8:2010/Cor\,1:2011 (August 2011);
2524 % \url{https://www.iso.org/standard/60210.html}.
2525 %
2526 % \bibitem{PDFX6}ISO\,15930-9:2020;
2527 % Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 9:
2528 % Complete exchange of printing data (PDF/X-6) and partial exchange of printing data
2529 % with external profile reference (PDF/X-6p and PDF/X-6n) using PDF 2.0
2530 % Technical Committee ISO/TC\,130 (November 2020).
2531 % \url{https://www.iso.org/standard/77103.html}.
2532 %
2533 %
2534 % \bibitem{PDFVT}ISO\,16612-2:2010;
2535 % Graphic technology\,---\,Variable data exchange---Part\,2:
2536 % Using PDF/X-4\penalty-5000\ and PDF/X-5 (PDF/VT-1 and PDF/VT-2).
2537 % Technical Committee ISO/TC\,130 (December 2005).
2538 % \url{https://www.iso.org/standard/38013.html}.%
2539 %
2540 %
2541 % \bibitem{PDFVT3}ISO\,16612-3:2020;
2542 % Graphic technology\,---\,Variable data exchange---Part\,3:
2543 % Using PDF/X-6\penalty-5000\ (PDF/VT-3).
2544 % Technical Committee ISO/TC\,130 (Edition1, 2020).
2545 % \url{https://www.iso.org/standard/75218.html}.%
2546 %
2547 % \bibitem{XMP-ISO}ISO\,16684-1:2012;
2548 % Graphic technology --- Extensible metadata platform (XMP) specification --- Part 1:
2549 % Data model, serialization and core properties.
2550 % Technical Committee ISO/TC\,130 (February 2012 -- withdrawn).
2551 % Revised as ISO\,16684-1:2019; (Edition 2, 2019).
2552 % \url{https://www.iso.org/standard/75163.html}.
2553 %
2554 % \bibitem{PDFA}ISO\,19005-1:2005;
2555 % Document Management --- Electronic document file format for long term preservation
2556 % --- Part 1: Use of PDF\,1.4\,(PDF/A-1);
2557 % Technical Committee ISO/TC\,171/SC\,2 (Sept. 2005).
2558 % Revisions via Corrigenda: ISO\,19005-1:2005/Cor\,1:2007 (March 2007);
2559 % ISO\,19005-1:2005/Cor\,2:2011 (Dec. 2011).
2560 % \url{https://www.iso.org/standard/38920.html}.
2561 %
2562 % \bibitem{PDFA2}ISO\,19005-2:2011;
2563 % Document Management --- Electronic document file format for long term preservation
2564 % --- Part 2: Use of ISO\,32000-1\,(PDF/A-2); \hfill
2565 % Technical Committee ISO/\penalty-200 TC\,171/SC\,2 (June 2011).
2566 % \url{https://www.iso.org/standard/50655.html}.
2567 %
2568 % \bibitem{PDFA3}ISO\,19005-3:2012;
2569 % Document Management --- Electronic document file format for long term preservation
2570 % --- Part 3: Use of ISO\,32000-1 with support for embedded files (PDF/A-3);
2571 % Technical Committee ISO/TC\,171/SC\,2 (October 2012).
2572 % \url{https://www.iso.org/standard/57229.html}.
2573 %
2574 % \bibitem{PDFA4}ISO\,19005-4:2020;
2575 % Document Management --- Electronic document file format for long term preservation
2576 % --- Part 4: Use of ISO\,32000-2 (PDF/A-4);
2577 % Technical Committee ISO/TC\,171/SC\,2 (Edition 1, 2020).
2578 % \url{https://www.iso.org/standard/71832.html}.
2579 %
2580 % \bibitem{PDFDecl} PDF Declarations. A use of ISO\,32000.
2581 % PDF Association, Berlin, Germany (2019).
2582 % \url{https://pdfa.org/resource/pdf-declarations/}
2583 %
2584 % \bibitem{PDFE}ISO\,24517-1:2008;
2585 % Document Management --- Engineering document format using PDF --- Part 1:
2586 % Use of PDF 1.6 (PDF/E-1);
2587 % Technical Committee ISO/TC\,171/SC\,2 (May 2008).\\
2588 % \url{https://www.iso.org/standard/42274.html}.
2589 %
2590 % \bibitem{ISO32000}ISO\,32000-1:2008;
2591 % Document management\,---\,Portable document format\,(PDF\,1.7);
2592 % Technical Committee ISO/TC\,171/SC\,2 (July 2008).
2593 % Also available as \cite{PDF17}.\\
2594 % \url{https://www.iso.org/standard/51502.html}.
2595 %
2596 % \bibitem{PDF20}ISO\,32000-2:2017;
2597 % Document management --- Portable document format --- Part~2: PDF\,2.0;
2598 % Technical Committee ISO/TC\,171/SC\,2 Document file formats, EDMS systems
2599 % and authenticity of information. (July 2017 --- withdrawn)
2600 % Revised as ISO\,32000-2:2020; (Edition 2, 2020)
2601 % \url{https://www.iso.org/standard/75839.html}.\\
2602 % Sponsored access available since 5 April 2023, from
2603 % \href{https://www.pdfa-inc.org/product/iso-32000-2-pdf-2-0-bundle-sponsored-access/}{PDF Association}.
2604 %
2605 % \bibitem{LC2} F.\,Mittelbach, M.\,Goossens with J.\,Braams, D.\,Carlisle, C.\,Rowley;
2606 % The \LaTeX\ Companion --- 2nd edition. Addison--Wesley (now Pearson Education Inc.), 2004.
2607 % ISBN 0-201-36299-6 (paperback).
2608 %
2609 % \bibitem{PDF-LaTeX} \LaTeX\ Project Working Group, PDF Association.
2610 % \url{https://pdfa.org/community/latex-project-lwg/}
2611 %
2612 % \bibitem{LaTeXPDF} \LaTeX\ Tagged PDF\,---\,A blueprint for a large project.
2613 % Frank Mittelbach, Chris Rowley; TUGboat, Volume 41 (2020), No 3.
2614 % \url{https://tug.org/TUGboat/tb41-3/tb129mitt-tagpdf.pdf}.
2615 % Project website \url{https://www.latex-project.org/};
2616 % \href{https://www.latex-project.org/publications/2020-FMi-TUB-tb129mitt-tagpdf.pdf}{Preprint}.
2617 %
2618 % \bibitem{TN0009}PDF/A Competence Centre;\,
2619 % TechNote\,0009: XMP Extension Schemas in PDF/A-1.\penalty-2000\ (March 2008) \ \
2620 % \href{https://www.pdfa.org/publication/technical-note-tn-0009-xmp-extension-schemas-in-pdfa-1/}%
2621 % {\UrlFont https://www.pdfa.org/publication/technical-note-tn-0009-xmp-\penalty-20 extension-schemas-in-pdfa-1/}.
2622 %
2623 % \bibitem{PDF-UA}
2624 % PDF/UA Technical Implementation Guide: Understanding ISO\,14289-1\penalty-2000\ (PDF/UA-1).
2625 % AIIM Global Community of Information Professionals.
2626 % \href{http://www.aiim.org/Research-and-Publications/standards/committees/PDFUA/Technical-Implementation-Guide}%
2627 % {\UrlFont http://\penalty-20 www.aiim.org/Research-and-Publications/standards/committees/PDFUA/Technical\penalty-200 -Implementation-Guide}.
2628 %
2629 % \bibitem{WTPDF} Well-Tagged PDF (WTPDF);
2630 % Using Tagged PDF for Accessibility and Reuse in PDF 2.0.
2631 % PDF Association; PDF Reuse TWG \& PDF/UA TWG. Version 1.0.0, February 2024.
2632 % \url{https://pdfa.org/wtpdf/}
2633 %
2634 % \bibitem{colorp} N.\,Preining;
2635 % \texttt{colorprofiles} \textemdash\ Collection of free ICC profiles.
2636 % \TeX\ and \LaTeX\ package (by R.\,Moore), distributed with \TeX{}Live. (Nov. 2018)
2637 % \url{https://ctan.org/pkg/colorprofiles}.
2638 %
2639 % \bibitem{PRISM}PRISM; Publishing Requirements for Industry Standard Metadata.
2640 % PRISM Metadata Initiative; Idealliance Working Group.
2641 % \url{http://www.idealliance.org/specifications/prism-metadata-initiative/prism}
2642 %
2643 % \bibitem{pdfx}C.\,V.\,Radhakrishnan, \Thanh, Ross Moore, Peter Selinger;
2644 % Generation of PDF/X- and PDF/A-compliant PDFs with \pdftex --- \texttt{pdfx.sty}.
2645 % TUGboat Vol.\,36, No.\,2; TUG 2015 Conference Proceedings. \TeX\ Users Group, 2015; pp.\,136--142.
2646 %
2647 % \bibitem{tagpdf} |tagpdf| -- Tools for experimenting with tagging using pdf\LaTeX\ and Lua\LaTeX.
2648 % Ulrike Fischer. Available via CTAN repository.
2649 % \url{https://ctan.org/pkg/tagpdf}.
2650 %
2651 % \bibitem{tpdf} |tpdf|; Ross Moore. Unpublished.
2652 % \LaTeX\ package and macro suite for producing `real-world' standards-conforming PDF documents.
2653 % Examples available at \url{http://maths.mq.edu.au/~ross/TaggedPDF/}.
2654 %
2655 % \bibitem{veraPDF} veraPDF. Industry Supported PDF/A Validation.
2656 % Software, dual-licensed under the GNU General Public License v3 or later (GPLv3+)
2657 % and Mozilla Public License v2 or later (MPLv2+). \url{https://verapdf.org}.
2658 % Wiki: \url{https://github.com/veraPDF/veraPDF-validation-profiles/wiki}
2659 %
2660 % \bibitem{RDF} World Wide Web Consortium (W3C);
2661 % Resource Description Format: RDF 1.1 XML Syntax. W3C Recommendation. (February 2014)
2662 % \url{https://www.w3.org/TR/rdf-syntax-grammar/}.
2663 %
2664 % \bibitem{wikiPDF}Wikipedia;
2665 % PDF/A: \url{https://en.wikipedia.org/wiki/PDF/A}\newline
2666 % PDF/E: \url{https://en.wikipedia.org/wiki/PDF/E}\newline
2667 % PDF/VT: \url{https://en.wikipedia.org/wiki/PDF/VT}\newline
2668 % PDF/UA: \url{https://en.wikipedia.org/wiki/PDF/UA}\newline
2669 % PDF/X: \url{https://en.wikipedia.org/wiki/PDF/X}
2670 %
2671 % \end{thebibliography}
2672 % }\goodbreak
2673 % \section[Implementation]{Implementation}
2674 %
2675 % \iffalse
2676 %<*package>
2677 % \fi \hfuzz=2.5pt%
2678 % \begin{macrocode}
2679 \@ifpackageloaded{pdfxmult}{%
2680 \PackageError{pdfx}%
2681 {^^JThis package may not be used in conjunction with the \space
2682 pdfxmult \space package}%
2683 {Type \space x <return> \space to exit; or just \space <return> \space
2684 to continue without this package.}%
2685 \expandafter\let\csname [email protected]\endcsname\@empty\endinput
2686 }{}%
2687 \NeedsTeXFormat{LaTeX2e}
2688 \ProvidesPackage{pdfx}
2689 [2024/06/24 v1.6.5f PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
2690
2691 \newif\ifpdfx@noBOM \pdfx@noBOMfalse % use a BOM in the XMP packet
2692 \newif\ifpdfx@x \pdfx@xfalse % PDF/X mode
2693 \newif\ifpdfx@e \pdfx@efalse % PDF/E mode; not fully implemented yet
2694 \newif\ifpdfx@ua\pdfx@uafalse % PDF/UA mode; not fully implemented yet
2695 \newif\ifpdfx@vt \pdfx@vtfalse % PDF/VT mode, extension of PDF/X
2696 \newif\ifno@iccprofile % used with PDF/X-4p and PDF/X-5pg
2697 \newif\ifpdfx@noerr % error messages become just warnings
2698 \newif\ifpdfx@omitcharset % used with pdfomitcharset primitive
2699
2700 \DeclareOption{noerr}{\pdfx@noerrtrue}
2701
2702 %% Not all combinations of the following parameters are meaningful.
2703 \def\xmp@Part{1} % PDF/A part: 1, 2, or 3
2704 \def\xmp@Conformance{B} % Conformance level: A, B, or U
2705 \def\xmp@ReleaseDate{2005} % 2001 for PDF/X-1, 2005 for PDF/A-1,
2706 % 2010 for PDF/A-2, 2012 for PDF/A-3.
2707
2708 %% with Beamer pgf will have written Resource objects already
2709 \newif\ifpdfx@luacheck@needed
2710 \@ifpackageloaded{pgfcore}{\pdfx@luacheck@neededtrue}{}
2711 %% thanks to Ryutaroh Matsumoto for reporting this issue
2712
2713 \newcount\pdfx@minorversion
2714 \newcount\pdfx@majorversion
2715 \expandafter\ifx\csname pdfmajorversion\endcsname\relax
2716 %% RRM: 20240614 LuaLaTeX may not have this defined
2717 \newcount\pdfmajorversion
2718 \pdfmajorversion=1\relax
2719 \fi
2720 \expandafter\ifx\csname pdfminorversion\endcsname\relax
2721 %% RRM: 20240614 this could be set in luatex85 package
2722 \newcount\pdfminorversion
2723 \pdfminorversion=3\relax
2724 \fi
2725 %% options can change these from the defaults
2726 \global\pdfx@majorversion=\the\pdfmajorversion
2727 \global\pdfx@minorversion=\the\pdfminorversion
2728
2729 \def\pdfx@ErrorWarning #1#2#3#4{%
2730 \ifpdfx@noerr \PackageWarning{pdfx}{#1.^^J #2#3.^^J}%
2731 \else \PackageError{pdfx}{#1}{#2#4.^^J
2732 Use option 'noerr' to avoid this message.^^J}%
2733 \fi}
2734
2735 \def\pdfx@Xvn@message{%
2736 \pdfx@ErrorWarning{PDF/X-5n has no default profile}%
2737 {Provide your own}{; continuing to build a non-valid document}%
2738 {, else continue to build a non-valid document}%
2739 }
2740
2741 %% support pdfomitcharset primitive, added to pdfTeX in 2019
2742 \DeclareOption{nocharset}{\pdfx@omitcharsettrue}
2743 \DeclareOption{usecharset}{\pdfx@omitcharsetfalse}
2744
2745 %% PDF/A options
2746 %% default is to create PDF/A-1b
2747 %% options can change this for PDF/X or higher levels of PDF/A
2748 \DeclareOption{a-1a}{\global\pdfx@xfalse\def\xmp@Part{1}%
2749 \def\xmp@Conformance{A}\def\xmp@ReleaseDate{2005}%
2750 \pdfx@omitcharsetfalse}
2751 \DeclareOption{a-1b}{\global\pdfx@xfalse\def\xmp@Part{1}%
2752 \def\xmp@Conformance{B}\def\xmp@ReleaseDate{2005}%
2753 \pdfx@omitcharsetfalse}
2754 \DeclareOption{a-2a}{\global\pdfx@xfalse\def\xmp@Part{2}%
2755 \def\xmp@Conformance{A}\def\xmp@ReleaseDate{2010}%
2756 \pdfx@omitcharsettrue}
2757 \DeclareOption{a-2b}{\global\pdfx@xfalse\def\xmp@Part{2}%
2758 \def\xmp@Conformance{B}\def\xmp@ReleaseDate{2010}%
2759 \pdfx@omitcharsettrue}
2760 \DeclareOption{a-2u}{\global\pdfx@xfalse\def\xmp@Part{2}%
2761 \def\xmp@Conformance{U}\def\xmp@ReleaseDate{2010}%
2762 \pdfx@omitcharsettrue}
2763 \DeclareOption{a-3a}{\global\pdfx@xfalse\def\xmp@Part{3}%
2764 \def\xmp@Conformance{A}\def\xmp@ReleaseDate{2012}%
2765 \pdfx@omitcharsettrue}
2766 \DeclareOption{a-3b}{\global\pdfx@xfalse\def\xmp@Part{3}%
2767 \def\xmp@Conformance{B}\def\xmp@ReleaseDate{2012}%
2768 \pdfx@omitcharsettrue}
2769 \DeclareOption{a-3u}{\global\pdfx@xfalse\def\xmp@Part{3}%
2770 \def\xmp@Conformance{U}\def\xmp@ReleaseDate{2012}%
2771 \pdfx@omitcharsettrue}
2772 %%
2773 %% PDF/X options
2774 %% comments added, using
2775 %% https://www.eci.org/_media/downloads/pdfx/pdfx_faq_english_nov05.pdf
2776 %% https://en.wikipedia.org/wiki/PDF/X#List_of_the_PDF.2FX_standards
2777 %%
2778 \DeclareOption{x-1}{\global\pdfx@xtrue\def\xmp@Part{1}% obsolete
2779 \def\xmp@Conformance{a}\def\xmp@ReleaseDate{1999}% CMYK only
2780 \global\pdfx@minorversion=2\relax
2781 \pdfx@ErrorWarning{PDF/X-1:1999 is no longer an accepted standard}%
2782 {Use option x-1a1 or x-1a3 }{; continuing to build a non-valid document}%
2783 {, else continue to build a non-valid document.}%
2784 }% effectively same as x-1a1
2785 \DeclareOption{x-1a}{\global\pdfx@xtrue\def\xmp@Part{1}% CMYK only
2786 \def\xmp@Conformance{a}\def\xmp@ReleaseDate{2003}%
2787 \global\pdfx@minorversion=3 }% same as x-1a3
2788 \DeclareOption{x-1a1}{\global\pdfx@xtrue\def\xmp@Part{1}%
2789 \def\xmp@Conformance{a}\def\xmp@ReleaseDate{2001}% ISO 15930-1:2001
2790 \global\pdfx@minorversion=3 }
2791 \DeclareOption{x-1a3}{\global\pdfx@xtrue\def\xmp@Part{1}%
2792 \def\xmp@Conformance{a}\def\xmp@ReleaseDate{2003}% ISO 15930-4:2003
2793 \global\pdfx@minorversion=3 }
2794 \DeclareOption{x-2}{\global\pdfx@xtrue\def\xmp@Part{2}% XMP Metadata
2795 %% \def\xmp@Conformance{}\def\xmp@ReleaseDate{2002}% ISO 15930-2:2003
2796 \def\xmp@Conformance{}\def\xmp@ReleaseDate{2003}% ISO 15930-5, withdrawn 2011
2797 \global\pdfx@minorversion=4\relax
2798 \pdfx@ErrorWarning{PDF/X-2:2003 was never published as a standard}%
2799 {Use option x-1a or x-3 }{; continuing to build a non-valid document}%
2800 {, else continue to build a non-valid document}%
2801 }% external OPI workflow, i.e. multiple files involved
2802 \DeclareOption{x-3}{\global\pdfx@xtrue\def\xmp@Part{3}% RGB allowed, but rare!
2803 \def\xmp@Conformance{}\def\xmp@ReleaseDate{2003}%
2804 \global\pdfx@minorversion=4 }% same as x-303
2805 \DeclareOption{x-302}{\global\pdfx@xtrue\def\xmp@Part{3}%
2806 \def\xmp@Conformance{}\def\xmp@ReleaseDate{2002}% ISO 15930-3:2002
2807 \global\pdfx@minorversion=3 }
2808 \DeclareOption{x-303}{\global\pdfx@xtrue\def\xmp@Part{3}%
2809 \def\xmp@Conformance{}\def\xmp@ReleaseDate{2003}% ISO 15930-6:2003
2810 \global\pdfx@minorversion=4 }
2811 %%% Later versions, yet to be fully implemented
2812 \DeclareOption{x-4}{\global\pdfx@xtrue\def\xmp@Part{4}%
2813 \def\xmp@Conformance{}\def\xmp@ReleaseDate{2010}% ISO 15930-7:2010
2814 \global\pdfx@minorversion=6 }% same as x-410
2815 \DeclareOption{x-4p}{\global\pdfx@xtrue\global\no@iccprofiletrue
2816 \def\xmp@Part{4}\def\xmp@Conformance{p}\def\xmp@ReleaseDate{2010}%
2817 \global\pdfx@minorversion=6 }% same as x-4p10
2818 \DeclareOption{x-408}{\global\pdfx@xtrue\def\xmp@Part{4}%
2819 \def\xmp@Conformance{}\def\xmp@ReleaseDate{2008}% ISO 15930-7:2008
2820 \global\pdfx@minorversion=6 }
2821 \DeclareOption{x-410}{\global\pdfx@xtrue\def\xmp@Part{4}%
2822 \def\xmp@Conformance{}\def\xmp@ReleaseDate{2010}% ISO 15930-7:2010
2823 \global\pdfx@minorversion=6 }
2824 \DeclareOption{x-4p08}{\global\pdfx@xtrue\global\no@iccprofiletrue
2825 \def\xmp@Part{4}\def\xmp@Conformance{p}\def\xmp@ReleaseDate{2008}%
2826 \global\pdfx@minorversion=6 }% ISO 15930-7:2010
2827 \DeclareOption{x-4p10}{\global\pdfx@xtrue\global\no@iccprofiletrue
2828 \def\xmp@Part{4}\def\xmp@Conformance{p}\def\xmp@ReleaseDate{2010}%
2829 \global\pdfx@minorversion=6 }% ISO 15930-7:2010
2830 \DeclareOption{x-5}{\global\pdfx@xtrue\def\xmp@Part{5}%
2831 \def\xmp@Conformance{g}\def\xmp@ReleaseDate{2008}%
2832 \global\pdfx@minorversion=6 }% ISO 15930-8:2010
2833 \DeclareOption{x-5g}{\global\pdfx@xtrue\def\xmp@Part{5}%
2834 \def\xmp@Conformance{g}\def\xmp@ReleaseDate{2008}%
2835 \global\pdfx@minorversion=6 }% ISO 15930-8:2010
2836 \DeclareOption{x-5n}{\global\pdfx@xtrue %\global\no@iccprofiletrue
2837 \def\xmp@Part{5}\def\xmp@Conformance{n}\def\xmp@ReleaseDate{2010}%
2838 \global\pdfx@minorversion=6 \pdfx@Xvn@message}% ISO 15930-8:2010
2839 \DeclareOption{x-5pg}{\global\pdfx@xtrue\global\no@iccprofiletrue
2840 \def\xmp@Part{5}\def\xmp@Conformance{pg}\def\xmp@ReleaseDate{2010}%
2841 \global\pdfx@minorversion=6 }% ISO 15930-8:2010
2842 \DeclareOption{x-508}{\global\pdfx@xtrue\def\xmp@Part{5}%
2843 \def\xmp@Conformance{g}\def\xmp@ReleaseDate{2008}%
2844 \global\pdfx@minorversion=6 }% ISO 15930-8:2008
2845 \DeclareOption{x-5g08}{\global\pdfx@xtrue\def\xmp@Part{5}%
2846 \def\xmp@Conformance{g}\def\xmp@ReleaseDate{2008}%
2847 \global\pdfx@minorversion=6 }% ISO 15930-8:2008
2848 \DeclareOption{x-5n08}{\global\pdfx@xtrue %\global\no@iccprofiletrue
2849 \def\xmp@Part{5}\def\xmp@Conformance{n}\def\xmp@ReleaseDate{2008}%
2850 \global\pdfx@minorversion=6 \pdfx@Xvn@message}% ISO 15930-8:2008
2851 \DeclareOption{x-5pg08}{\global\pdfx@xtrue\global\no@iccprofiletrue
2852 \def\xmp@Part{5}\def\xmp@Conformance{pg}\def\xmp@ReleaseDate{2008}%
2853 \global\pdfx@minorversion=6 }% ISO 15930-8:2008
2854 \DeclareOption{x-510}{\global\pdfx@xtrue\def\xmp@Part{5}%
2855 \def\xmp@Conformance{g}\def\xmp@ReleaseDate{2010}%
2856 \global\pdfx@minorversion=6 }% ISO 15930-8:2010
2857 \DeclareOption{x-5g10}{\global\pdfx@xtrue\def\xmp@Part{5}%
2858 \def\xmp@Conformance{g}\def\xmp@ReleaseDate{2010}%
2859 \global\pdfx@minorversion=6 }% ISO 15930-8:2010
2860 \DeclareOption{x-5n10}{\global\pdfx@xtrue %\global\no@iccprofiletrue
2861 \def\xmp@Part{5}\def\xmp@Conformance{n}\def\xmp@ReleaseDate{2010}%
2862 \global\pdfx@minorversion=6 \pdfx@Xvn@message}% ISO 15930-8:2010
2863 \DeclareOption{x-5pg10}{\global\pdfx@xtrue\global\no@iccprofiletrue
2864 \def\xmp@Part{5}\def\xmp@Conformance{pg}\def\xmp@ReleaseDate{2010}%
2865 \global\pdfx@minorversion=6 }% ISO 15930-8:2010
2866 %%
2867 %% PDF/E options
2868 %%
2869 \DeclareOption{e}{\global\pdfx@xfalse\global\pdfx@etrue
2870 \def\xmp@Part{1}\def\xmp@Conformance{}\def\xmp@ReleaseDate{2008}%
2871 \gdef\thepdfminorversion{6}% same as e-1
2872 }
2873 \DeclareOption{e-1}{\global\pdfx@xfalse\global\pdfx@etrue
2874 \def\xmp@Part{1}\def\xmp@Conformance{}\def\xmp@ReleaseDate{2008}%
2875 \gdef\thepdfminorversion{6}% ISO 24517-1:2008
2876 }
2877 %% PDF/UA options
2878 %%
2879 \let\xmp@PDFUA\@empty
2880 \DeclareOption{ua}{\global\pdfx@uatrue % ISO 14289-1:2012, 2014
2881 \def\xmp@UAlevel{1}\let\xmp@PDFUA\relax}% same as ua-1
2882 \DeclareOption{ua-1}{\global\pdfx@uatrue % ISO 14289-1:2012, 2014
2883 \def\xmp@UAlevel{1}\let\xmp@PDFUA\relax}
2884 %%
2885 %% PDF/VT options
2886 %%
2887 \DeclareOption{vt-1}{\global\pdfx@xtrue\global\pdfx@vttrue
2888 \def\xmp@Part{4}\def\xmp@vtPart{1}\def\xmp@Conformance{}%
2889 \def\xmp@vtConformance{}\def\xmp@ReleaseDate{2010}%
2890 \gdef\xmpMM@VersionID{1}%
2891 \global\pdfx@minorversion=6 }
2892 \DeclareOption{vt-2}{\global\pdfx@xtrue\global\pdfx@vttrue
2893 \global\no@iccprofiletrue \gdef\xmpMM@VersionID{1}%
2894 \def\xmp@Part{5}\def\xmp@vtPart{2}\def\xmp@Conformance{pg}%
2895 \def\xmp@vtConformance{}\def\xmp@ReleaseDate{2010}%
2896 \global\pdfx@minorversion=6 }
2897 \DeclareOption{vt-2s}{\global\pdfx@xtrue\global\pdfx@vttrue
2898 \global\no@iccprofiletrue \gdef\xmpMM@VersionID{1}%
2899 \def\xmp@Part{5}\def\xmp@vtPart{2}\def\xmp@Conformance{pg}%
2900 \def\xmp@vtConformance{s}\def\xmp@ReleaseDate{2010}%
2901 \global\pdfx@minorversion=6 }
2902
2903 %% options to alter PDF minor version, in case needed in special circumstances
2904 \DeclareOption{pdf12}{\global\pdfx@minorversion=2 }% 1999
2905 \DeclareOption{pdf13}{\global\pdfx@minorversion=3 }% 2001 Acrobat 4 (ISBN 0-201-61588-6)
2906 \DeclareOption{pdf14}{\global\pdfx@minorversion=4 }% 2003 Acrobat 5 (ISBN 0-201-75839-3)
2907 \DeclareOption{pdf15}{\global\pdfx@minorversion=5 }% 2005 Acrobat 6
2908 \DeclareOption{pdf16}{\global\pdfx@minorversion=6 }% 2006 Acrobat 7 (ISBN 0-321-30474-8)
2909 \DeclareOption{pdf17}{\global\pdfx@minorversion=7 }% 2008 ISO 32000-1:2008
2910 \DeclareOption{pdf20}{% 2020 ISO 32000-2:2020
2911 \global\pdfx@majorversion=2 \relax
2912 \global\pdfx@minorversion=0 }%
2913
2914 %% inhibits writing the XMP byte-order marker
2915 \DeclareOption{noBOM}{\pdfx@noBOMtrue}
2916 \DeclareOption{useBOM}{\pdfx@noBOMfalse}
2917
2918 %% options for language character macros in XMP metadata
2919 \newif\ifcyrxmp
2920 \newif\ifcyrKOIxmp
2921 \newif\ifgrkxmp
2922 \newif\ifgrkLGRxmp
2923 \newif\ifhebxmp
2924 \newif\ifhebHEBxmp
2925 \newif\ifarbxmp
2926 \newif\ifarmxmp
2927 \newif\ifarmSCIxmp
2928 \newif\ifdevxmp
2929 \newif\ifvnmxmp
2930 \newif\iflatEXTxmp
2931 \newif\iflatLATxmp
2932 \newif\ifipaxmp
2933 \newif\ifmathxmp
2934
2935 \DeclareOption{latxmp}{\global\latEXTxmptrue}
2936 \DeclareOption{LATxmp}{\global\latLATxmptrue\global\latEXTxmptrue}
2937 \DeclareOption{cyrxmp}{\global\cyrxmptrue}
2938 \DeclareOption{KOIxmp}{\global\cyrKOIxmptrue\global\cyrxmptrue}
2939 \DeclareOption{grkxmp}{\global\grkxmptrue}
2940 \DeclareOption{LGRxmp}{\global\grkLGRxmptrue\global\grkxmptrue}
2941 \DeclareOption{hebxmp}{\global\hebxmptrue}
2942 \DeclareOption{HEBxmp}{\global\hebHEBxmptrue\global\hebxmptrue}
2943 \DeclareOption{arbxmp}{\global\arbxmptrue}
2944 \DeclareOption{armxmp}{\global\armxmptrue}
2945 \DeclareOption{AR8xmp}{\global\armSCIxmptrue\global\armxmptrue}
2946 \DeclareOption{devxmp}{\global\devxmptrue}
2947 \DeclareOption{vnmxmp}{\global\vnmxmptrue}
2948 \DeclareOption{ipaxmp}{\global\ipaxmptrue\global\latEXTxmptrue}
2949 \DeclareOption{mathxmp}{\global\mathxmptrue\global\grkxmptrue}
2950
2951 %% all the above
2952 \DeclareOption{allxmp}{%
2953 \global\cyrxmptrue
2954 \global\cyrKOIxmptrue
2955 \global\grkxmptrue
2956 \global\grkLGRxmptrue
2957 \global\hebxmptrue
2958 \global\hebHEBxmptrue
2959 \global\arbxmptrue
2960 \global\armxmptrue
2961 \global\armSCIxmptrue
2962 \global\devxmptrue
2963 \global\vnmxmptrue
2964 \global\latEXTxmptrue
2965 \global\latLATxmptrue
2966 \global\vnmxmptrue
2967 \global\ipaxmptrue
2968 \global\mathxmptrue
2969 \global\let\pdfx@useactivespacestrue\pdfx@useactivespacesfalse
2970 }
2971
2972 \newif\ifpdfx@useactivespaces
2973
2974 \ExecuteOptions{noBOM,a-1b}
2975 \ProcessOptions
2976
2977 \RequirePackage{ifluatex}
2978 \ifpdfx@luacheck@needed
2979 \ifluatex
2980 \RequirePackage{luatex85}
2981 \fi
2982 \fi
2983
2984 \ifpdfx@ua\ifpdfx@x\else
2985 \expandafter\if\xmp@Conformance A\else
2986 \pdfx@ErrorWarning{PDF/UA requires 'Tagged PDF' for any structure.^^J
2987 Then PDF/A Conformance must be 'a'}%
2988 {Use option 'a-\xmp@Part a'}%
2989 {; continuing with a likely invalid document}%
2990 {, or continue for a likely invalid document}%
2991 %%% \gdef\xmp@Conformance{A}% do we want this?
2992 \fi\fi\fi
2993
2994 \expandafter\ifx\csname pdflastobj\endcsname\relax
2995 \else
2996 \ifnum\pdflastobj >\z@ % pdf/luatex has already written objects
2997 % e.g. by pgfcore , called from Beamer or other class
2998 \ifnum\pdfx@minorversion=\pdfminorversion\else
2999 \PackageError{pdfx}%
3000 {^^J(pdfx) Cannot change the \string\pdfminorversion^^J%
3001 (pdfx) PDF version remains at \the\pdfmajorversion.\the\pdfminorversion.^^J%
3002 (pdfx) Use \string\pdfmajorversion=\the\pdfx@majorversion\space^^J%
3003 and \string\pdfminorversion=\the\pdfx@minorversion\space
3004 before \string\documentclass}%
3005 {(pdfx) Another package or document-class has written objects into the PDF.^^J%
3006 (pdfx) Hit return to continue with PDF version %
3007 \the\pdfmajorversion.\the\pdfminorversion.}%
3008 \global\pdfx@majorversion=\the\pdfmajorversion
3009 \global\pdfx@minorversion=\the\pdfminorversion
3010 \fi
3011 \else
3012 \global\pdfmajorversion\pdfx@majorversion
3013 \global\pdfminorversion\pdfx@minorversion
3014 \fi
3015 \fi
3016
3017 \expandafter\ifx\csname thepdfminorversion\endcsname\relax
3018 \expandafter\ifx\csname pdfminorversion\endcsname\relax
3019 \else
3020 \xdef\thepdfmajorversion{\the\pdfmajorversion}
3021 \xdef\thepdfminorversion{\the\pdfminorversion}
3022 \fi\fi
3023
3024 \expandafter\ifx\csname pdfminorversion\endcsname\relax
3025 \gdef\thepdfminorversion{4}% assumed with XeTeX
3026 \def\pdf@minorversion@xetex=#1{\gdef\thepdfminorversion{#1}}%
3027 \let\pdfminorversion\pdf@minorversion@xetex
3028 \else
3029 \ifnum\pdfmajorversion > 1\relax
3030 \pdfminorversion=3\relax
3031 %% else some JPG graphics with DCT encoding will fail
3032 \else
3033 \ifnum\pdfminorversion < 4\relax
3034 \ifpdfx@x
3035 % more testing needed with PDF/X
3036 \else
3037 \pdfminorversion=4\relax % assumed for PDF/A ; options may change this for PDF/X
3038 \gdef\thepdfminorversion{4}%
3039 \fi
3040 \else
3041 \ifnum\pdfminorversion<\thepdfminorversion\relax
3042 \global\pdfminorversion=\thepdfminorversion\relax
3043 \fi
3044 \fi
3045 \fi
3046 \fi
3047 \expandafter\ifx\csname pdfresetpageorigin\endcsname\relax\else
3048 \pdfresetpageorigin=0
3049 \fi
3050
3051 \expandafter\ifx\csname pdfomitcharset\endcsname\relax
3052 \else
3053 \ifpdfx@omitcharset
3054 \pdfomitcharset = 1 %
3055 %% do not create /Charset listings of font glyphs;
3056 %% optional for PDF/A-2,3 and PDF 2.x
3057 \else
3058 \pdfomitcharset = 0 %
3059 %% create the /Charset listings of font glyphs, required with PDF/A-1
3060 \fi
3061 \fi
3062
3063 \newif\ifpdfx@nopdfinfo
3064 \ifmathxmp\pdfx@nopdfinfotrue
3065 \else
3066 \iflatLATxmp\pdfx@nopdfinfotrue
3067 \else
3068 \ifgrkLGRxmp\pdfx@nopdfinfotrue
3069 \else
3070 \ifhebHEBxmp\pdfx@nopdfinfotrue
3071 \else
3072 \ifcyrKOIxmp\pdfx@nopdfinfotrue
3073 \else
3074 \ifarmSCIxmp\pdfx@nopdfinfotrue
3075 \fi\fi\fi\fi\fi\fi
3076
3077 \iflatLATxmp\pdfx@useactivespacestrue\fi
3078 \ifgrkLGRxmp\pdfx@useactivespacestrue\fi
3079 \ifhebHEBxmp\pdfx@useactivespacestrue\fi
3080 \ifcyrKOIxmp\pdfx@useactivespacestrue\fi
3081 \ifarmSCIxmp\pdfx@useactivespacestrue\fi
3082
3083 \newif\ifpdfx@transliterated
3084 \ifgrkLGRxmp\pdfx@transliteratedtrue\fi
3085 \ifhebHEBxmp\pdfx@transliteratedtrue\fi
3086 \ifarmSCIxmp\pdfx@transliteratedtrue\fi
3087
3088 \RequirePackage{iftex}
3089 \RequirePackage{ifpdf}
3090 %\expandafter\show\csname ifpdf\endcsname
3091 %% Support for pdfTeX primitives when using XeTeX:
3092 \RequirePackage{ifxetex}
3093 %\expandafter\show\csname ifpdf\endcsname
3094 \ifxetex
3095 \def\pdfx@pages@xetex#1{\special{pdf:put @pages <<#1>>}}
3096 \def\pdfx@pageattr@xetex#1{\special{pdf:put @thispage <<#1>>}}
3097 \def\pdfx@docinfo@xetex#1{\special{pdf:put @docinfo <<#1>>}}
3098 \def\pdfx@catalog@xetex#1{\special{pdf:put @catalog <<#1>>}}
3099 \def\pdfx@mapline@xetex#1{\special{pdf:mapline #1}}%% does this work ??
3100 %% \def\pdfx@mapline@xetex#1{}
3101 \def\pdf@compress@xetex=#1{}
3102 %%
3103 \let\pdfpagesattr\pdfx@pages@xetex
3104 \let\pdfinfo\pdfx@docinfo@xetex
3105 \let\pdfcatalog\pdfx@catalog@xetex
3106 \let\pdfmapline\pdfx@mapline@xetex
3107 \let\pdfcompresslevel\pdf@compress@xetex
3108 \let\pdfobjcompresslevel\pdf@compress@xetex
3109 \fi
3110
3111 %%\newif\ifpdfx@pdfmark % control future support for dvips
3112
3113 \RequirePackage{everyshi}
3114 \RequirePackage{ifluatex}
3115 \ifluatex
3116 \IfFileExists{luatex85.sty}{% 2016+
3117 \RequirePackage{luatex85}%
3118 \edef\pdfcreationdate{\pdfcreationdate}%
3119 }{% earlier versions
3120 }%
3121 \RequirePackage{pdftexcmds}%
3122 \let\pdfx@mdfivesum\pdf@mdfivesum
3123 % \let\pdfescapestring\pdf@escapestring
3124 \long\def\pdf@escapestring@byte #1{%
3125 \directlua {oberdiek.pdftexcmds.escapestring("\luaescapestring {#1}", "byte")}}%
3126 %\let\pdf@escapestring\pdf@escapestring@byte
3127 \else
3128 \ifxetex
3129 \expandafter\ifx\csname mdfivesum\endcsname\relax
3130 % too early a version of XeTeX
3131 \let\pdfx@mdfivesum\relax
3132 \else
3133 % since mid-2015
3134 \let\pdfx@mdfivesum\mdfivesum
3135 \fi
3136 \else
3137 \let\pdfx@mdfivesum\pdfmdfivesum
3138 \fi
3139 \fi
3140 \def\pdfx@encodingfile{l8u-penc.def}
3141
3142 \expandafter\ifx\csname pdftexbanner\endcsname\relax
3143 \expandafter\ifx\csname luatexbanner\endcsname\relax
3144 \else % luatex85
3145 \let\pdftexbanner\luatexbanner
3146 \fi
3147 \else % pdfTeX, but which version ???
3148 {\endlinechar=-1
3149 \everyeof{\noexpand}%
3150 \xdef\pdfx@bannerstring{\expandafter\scantokens\expandafter{\pdftexbanner}}
3151 }%
3152 \def\pdfx@testbannerstr{%
3153 This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014/dev)
3154 kpathsea version 6.2.0dev}%
3155 \ifx\pdfx@bannerstring\pdfx@testbannerstr
3156 \typeout{This version of pdfTeX cannot write out upper-range character bytes,
3157 128-255.}%
3158 \typeout{Any UTF-8 Unicode characters in the Metadata will not be written
3159 correctly.}%
3160 \typeout{Please update to a more stable version of pdfTeX.^^J}%
3161 \fi
3162 \fi
3163
3164 %% How to support XeTeX here ?
3165 \ifpdfx@x
3166 \pdfobjcompresslevel=0 \relax
3167 \expandafter\ifx\csname pdfinterwordspaceoff\endcsname\relax\else
3168 \pdfinterwordspaceoff
3169 \let\pdfinterwordspaceon\pdfinterwordspaceoff
3170 \let\pdfinterwordspace\relax
3171 \fi
3172 \expandafter\ifx\csname pdfgeninterwordspace\endcsname\relax\else
3173 \pdfgeninterwordspace=0 \relax
3174 \fi
3175 \begingroup
3176 \expandafter\ifx\csname stockwidth\endcsname\relax\else
3177 \ifdim\stockwidth=\z@ %% 20240528
3178 \else
3179 %% 20231023 support for memoir's stockwidth/height
3180 \let\paperwidth\stockwidth
3181 \let\paperheight\stockheight
3182 \fi \fi
3183 \dimen0=0.996264009963\paperwidth\relax
3184 \edef\pdfx@mwidth{\strip@pt\dimen0}%
3185 \advance\dimen0 -25\p@
3186 \edef\pdfx@twidth{\strip@pt\dimen0}%
3187 \dimen0=0.996264009963\paperheight\relax
3188 \edef\pdfx@mheight{\strip@pt\dimen0}%
3189 \advance\dimen0 -20\p@
3190 \edef\pdfx@theight{\strip@pt\dimen0}%
3191 \ifxetex
3192 \xdef\pdfx@everypage@xetex{%
3193 /MediaBox[0 0 \pdfx@mwidth\space \pdfx@mheight]^^J
3194 /BleedBox[0 0 \pdfx@mwidth\space \pdfx@mheight]^^J
3195 /CropBox[0 0 \pdfx@mwidth\space \pdfx@mheight]^^J
3196 /TrimBox[25 20 \pdfx@twidth\space \pdfx@theight]%
3197 }%
3198 \fi
3199 \edef\next{\endgroup\pdfpagesattr{%
3200 /MediaBox[0 0 \pdfx@mwidth\space \pdfx@mheight]^^J
3201 %% /ArtBox[0 0 \pdfx@mwidth\space \pdfx@mheight]^^J
3202 /BleedBox[0 0 \pdfx@mwidth\space \pdfx@mheight]^^J
3203 /CropBox[0 0 \pdfx@mwidth\space \pdfx@mheight]^^J
3204 /TrimBox[25 20 \pdfx@twidth\space \pdfx@theight]}
3205 }\next
3206 \ifxetex
3207 \AtBeginDvi{%
3208 \expandafter\immediate\pdfx@pageattr@xetex{\pdfx@everypage@xetex}}%
3209 \EveryShipout{%
3210 \expandafter\immediate\pdfx@pageattr@xetex{\pdfx@everypage@xetex}}%
3211 \else
3212 \EveryShipout{%
3213 \expandafter\ifx\expandafter\relax\the\pdfpageattr\relax
3214 \immediate\pdfpageattr\expandafter{\the\pdfpagesattr}%
3215 \fi }%
3216 \fi
3217 \else
3218 %% PDF/A-1b doesn't allow object compression
3219 \ifnum\xmp@ReleaseDate=2005\relax
3220 \expandafter\ifx\csname pdfobjcompresslevel\endcsname\relax
3221 \else
3222 \pdfobjcompresslevel=0\relax
3223 \fi \fi
3224 \fi
3225 \ifxetex
3226 %% How to support XeTeX here ?
3227 \else
3228 \ifnum\thepdfminorversion >3 \relax
3229 \expandafter\ifx\csname pdfsuppresswarningdupmap\endcsname\relax
3230 \expandafter\ifx\csname pdfmapline\endcsname\relax
3231 \else
3232 \pdfmapline{+dummy-space <dummy-space.pfb}
3233 \fi
3234 \else
3235 \advance\pdfsuppresswarningdupmap 1
3236 \pdfmapline{+dummy-space <dummy-space.pfb}
3237 \advance\pdfsuppresswarningdupmap -1
3238 \fi
3239 \expandafter\ifx\csname pdfgeninterwordspace\endcsname\relax\else
3240 \pdfgeninterwordspace=1 \relax
3241 \fi
3242 \fi
3243 \fi
3244
3245 \ifluatex\else\ifxetex\else
3246 \@ifpackageloaded{inputenc}{%
3247 }{%
3248 \RequirePackage{inputenc}
3249 % allow this to be loaded again cleanly
3250 \expandafter\let\csname [email protected]\endcsname\relax
3251 }
3252 \fi\fi
3253
3254 %% pseudo-declare the L8U encoding
3255 \expandafter\let\csname L8U-cmd\expandafter\endcsname\csname OT1-cmd\endcsname
3256 \@namedef{T@L8U}{}%
3257 \@namedef{D@L8U}{}%
3258 \@namedef{M@L8U}{}%
3259
3260 %% adjust to LaTeX's 2018 change to the default encoding
3261 \def\pdfx@utfencodingname{utf8}%
3262 \def\pdfx@RawInputEncoding{%
3263 % \begingroup
3264 % \@tempcnta=0
3265 % % print out the catcodes of chars < 32
3266 % \loop
3267 % \typeout{\the\@tempcnta: \expandafter\the\catcode\@tempcnta}%
3268 % \advance\@tempcnta\@ne
3269 % \ifnum\@tempcnta<32
3270 % \repeat
3271 % \endgroup
3272 \UseRawInputEncoding
3273 }
3274 \expandafter\ifx\csname inputencodingname\endcsname\relax
3275 \else
3276 \def\pdfx@restoreencoding#1{%
3277 \@tempcnta=1\relax
3278 \loop
3279 % \catcode\@tempcnta=13\relax
3280 \advance\@tempcnta\@ne
3281 \ifnum\@tempcnta<8\relax
3282 \repeat
3283 \catcode11=13 \relax
3284 \@tempcnta=14\relax
3285 \loop
3286 % \catcode\@tempcnta=13\relax
3287 \advance\@tempcnta\@ne
3288 \ifnum\@tempcnta<31 \relax
3289 \repeat
3290 \@tempcnta=128\relax
3291 \loop
3292 % \catcode\@tempcnta=13\relax
3293 \advance\@tempcnta\@ne
3294 \ifnum\@tempcnta<256
3295 \repeat
3296 % {\tracingall
3297 % \ifx\inputencodingname\pdfx@utfencodingname\else
3298 \let\inputencodingname\relax %% kill previous
3299 % \fi
3300 \inputencoding{#1}%}%
3301 \let\LastDeclaredEncoding\pdfx@LastDeclaredEncoding
3302 \let\DeclareFontEncoding@\pdfx@DeclareFontEncoding@
3303 \let\DeclareUnicodeCharacter\pdfx@DeclareUnicodeCharacter
3304 }%
3305 \AtEndOfPackage{\pdfx@restoreencoding\pdfx@inputencodingname}%
3306 \let\pdfx@inputencodingname\inputencodingname
3307 \global\let\pdfx@DeclareUnicodeCharacter\DeclareUnicodeCharacter
3308 \global\let\pdfx@DeclareFontEncoding@\DeclareFontEncoding@
3309 % \@tempcnta=0
3310 % \loop
3311 % \typeout{\the\@tempcnta: \expandafter\the\catcode\@tempcnta}%
3312 %% \expandafter\showthe\catcode\@tempcnta
3313 % \advance\@tempcnta\@ne
3314 % \ifnum\@tempcnta<32
3315 % \repeat
3316 %\show\UseRawInputEncoding
3317 %% if the encoding is utf8 then don't change it here – wrong!
3318 % \ifx\inputencodingname\pdfx@utfencodingname\else
3319 % \expandafter\expandafter
3320 \expandafter\pdfx@RawInputEncoding %\fi
3321 \fi
3322 \InputIfFileExists{\pdfx@encodingfile}{}{}
3323 \expandafter\ifx\csname pdfx@inputencodingname\endcsname\relax
3324 \else
3325 \let\inputencodingname\pdfx@inputencodingname
3326 %% \global\let\DeclareUnicodeCharacter\pdfx@DeclareUnicodeCharacter
3327 %% \global\let\DeclareFontEncoding@\DeclareFontEncoding@saved
3328 \global\let\pdfx@LastDeclaredEncoding\LastDeclaredEncoding
3329 \expandafter\inputencoding\expandafter{\inputencodingname}%
3330 \fi
3331
3332 %%----------------------------------------------------------------------
3333 %% Macros for reading XMP data with special catcodes. Usage:
3334 %%
3335 %% \xmp@parse{continuation}{data}
3336 %%
3337 %% The effect is to read the data with special catcodes: '<', '>', and
3338 %% '&' are "active", and '^', '_', '#', '$', '~' are "other". The data
3339 %% is then bound to the locally scoped name \@this, and the
3340 %% continuation is called.
3341 \def\xmp@parse#1{%
3342 \begingroup
3343 \catcode`\<=13\catcode`\>=13\catcode`\&=13\catcode`\^=12
3344 \catcode`\_=12\catcode`\#=12\catcode`\$=12\catcode`\~=12
3345 \ifpdfx@useactivespaces\obeyspaces\fi % capture spaces as active characters
3346 \xmp@doparse{#1}%
3347 }
3348 \def\afterxmp@parse{}% methods may change this
3349 \def\xmp@doparse#1#2{%
3350 \def\@this{#2}#1
3351 \endgroup
3352 % do any post-processing
3353 \afterxmp@parse
3354 \def\afterxmp@parse{}%
3355 }
3356
3357 %%----------------------------------------------------------------------
3358 %% Local commands. They are only brought into scope during the reading
3359 %% of xmpdata. Some fields can have a 'xml:lang' attribute; others must have.
3360 %% LANG values as in: (BCP 47) https://tools.ietf.org/html/rfc5646#appendix-A
3361 %%
3362 \def\xmp@lang@Default{x-default}
3363 \let\xmp@lang@Title\xmp@lang@Default
3364 \let\xmp@lang@Author\xmp@lang@Default
3365 \let\xmp@lang@Keywords\xmp@lang@Default
3366 \let\xmp@lang@Subject\xmp@lang@Default
3367 %%\def\xmp@lang@CreatorTool{\xmp@lang@Default}
3368 \let\xmp@lang@Producer\xmp@lang@Default
3369 %%\def\xmp@lang@Volume{\xmp@lang@Default}
3370 %%\def\xmp@lang@Issue{\xmp@lang@Default}
3371 \let\xmp@lang@Copyright\xmp@lang@Default
3372 \let\xmp@lang@PublicationType\xmp@lang@Default
3373 \let\xmp@lang@Publisher\xmp@lang@Default
3374 \let\xmp@lang@Coverage\xmp@lang@Default
3375 \let\xmp@lang@Contributor\xmp@lang@Default
3376 \let\xmp@lang@Relation\xmp@lang@Default
3377 %%% PRISM fields
3378 \let\xmp@lang@CoverDisplayDate\xmp@lang@Default
3379 \let\xmp@lang@JournalTitle\xmp@lang@Default
3380 %%\def\xmp@lang@JournalNumber{\xmp@lang@Default}
3381 %%% xmp: & xmpRights: fields
3382 \let\xmp@lang@Advisory\xmp@lang@Default
3383 \let\xmp@lang@Identifier\xmp@lang@Default
3384 \let\xmp@lang@Nickname\xmp@lang@Default
3385 \let\xmp@lang@Owner\xmp@lang@Default
3386
3387 %% some validators require a language attribute for
3388 %% dc:title set via \Title
3389 %% dc:description set via \Subject
3390 %% dc:rights set via \Copyright
3391 %% xmpRights:UsageTerms set via \Copyright
3392 %%
3393 {\catcode `\" 12 \catcode`\: 12 \catcode`\= 12
3394 \gdef\pdfx@xmp@checklang#1{%
3395 \ifx #1\xmp@lang@Default\else\space xml:lang="#1"\fi}
3396 \gdef\pdfx@xmp@strictlang#1{\space xml:lang="#1"}
3397 }% end of \catcodes
3398 \let\xmp@checklang\pdfx@xmp@checklang
3399 \let\xmp@strictlang\pdfx@xmp@strictlang
3400
3401 \newcommand{\pdfx@Title}[1][]{%
3402 \ifx\relax#1\relax\else\gdef\xmp@lang@Title{#1}\fi
3403 \xmp@parse{\global\let\xmp@Title\@this}}
3404
3405 %% allow for multiple authors, keywords and languages
3406 %% also: contributor, date, relation, type, thumbnails
3407 %% and AuthoritativeDomain, Advisory, Identifier, Owner
3408 \newcommand{\pdfx@Author}[1][]{%
3409 \ifx\relax#1\relax\else\gdef\xmp@lang@Author{#1}\fi
3410 \def\afterxmp@parse{\let\Author\pdfx@extraAuthor}%
3411 \xmp@parse{\global\let\xmp@Author\@this}}
3412 \newcommand{\pdfx@Keywords}[1][]{%
3413 \ifx\relax#1\relax\else\gdef\xmp@lang@Keywords{#1}\fi
3414 \def\afterxmp@parse{\let\Keywords\pdfx@extraKeywords}%
3415 \xmp@parse{\global\let\xmp@Keywords\@this}}
3416 \newcommand{\pdfx@Language}{%
3417 \def\afterxmp@parse{\let\Language\pdfx@extraLanguages}%
3418 \xmp@parse{\global\let\xmp@Language\@this}}
3419
3420 \newcommand{\pdfx@AuthoritativeDomain}{%
3421 \def\afterxmp@parse{\let\AuthoritativeDomain\pdfx@extraAuthoritativeDomain}%
3422 \xmp@parse{\global\let\xmp@AuthoritativeDomain\@this}}
3423 \newcommand{\pdfx@Date}{%
3424 \def\afterxmp@parse{\let\Date\pdfx@extraDate}%
3425 \xmp@parse{\global\let\xmp@Date\@this}}
3426 \newcommand{\pdfx@Contributor}[1][]{%
3427 \ifx\relax#1\relax\else\gdef\xmp@lang@Contributor{#1}\fi
3428 \def\afterxmp@parse{\let\Contributor\pdfx@extraContributor}%
3429 \xmp@parse{\global\let\xmp@Contributor\@this}}
3430 \newcommand{\pdfx@Relation}[1][]{%
3431 \ifx\relax#1\relax\else\gdef\xmp@lang@Relation{#1}\fi
3432 \def\afterxmp@parse{\let\Relation\pdfx@extraRelation}%
3433 \xmp@parse{\global\let\xmp@Relation\@this}}
3434 %%\newcommand{\pdfx@Type}[1][]{%
3435 %% \ifx\relax#1\relax\else\gdef\xmp@lang@Type{#1}\fi
3436 %% \def\afterxmp@parse{\let\Type\pdfx@extraType}%
3437 %% \xmp@parse{\global\let\xmp@Type\@this}}
3438
3439 \newcommand{\pdfx@Advisory}[1][]{%
3440 \ifx\relax#1\relax\else\gdef\xmp@lang@Advisory{#1}\fi
3441 \def\afterxmp@parse{\let\Advisory\pdfx@extraAdvisory}%
3442 \xmp@parse{\global\let\xmp@Advisory\@this}}
3443 \newcommand{\pdfx@Identifier}[1][]{%
3444 \ifx\relax#1\relax\else\gdef\xmp@lang@Identifier{#1}\fi
3445 \def\afterxmp@parse{\let\Identifier\pdfx@extraIdentifier}%
3446 \xmp@parse{\global\let\xmp@Identifier\@this}}
3447 \newcommand{\pdfx@Nickname}[1][]{%
3448 \ifx\relax#1\relax\else\gdef\xmp@lang@Nickname{#1}\fi
3449 % \def\afterxmp@parse{\let\Identifier\pdfx@extraNickname}%
3450 \xmp@parse{\global\let\xmp@Nickname\@this}}
3451 \newcommand{\pdfx@Thumbnails}{%
3452 \def\afterxmp@parse{\let\Thumbnails\pdfx@extraThumbnails}%
3453 \xmp@parse{\global\let\xmp@Thumbnails\@this}}
3454
3455 \newcommand{\pdfx@Owner}[1][]{%
3456 \ifx\relax#1\relax\else\gdef\xmp@lang@Owner{#1}\fi
3457 \def\afterxmp@parse{\let\Owner\pdfx@extraOwner}%
3458 \xmp@parse{\global\let\xmp@Owner\@this}}
3459
3460 {\obeyspaces%
3461 \ifpdfx@useactivespaces\gdef\pdfx@insert@sep{\sep }%
3462 \else\gdef\pdfx@insert@sep{\sep}\fi%
3463 }
3464 \newcommand{\pdfx@extraAuthor}[1][]{%
3465 \ifx\relax#1\relax
3466 \expandafter\expandafter\expandafter\gdef
3467 \expandafter\expandafter\expandafter\xmp@Author
3468 \expandafter\expandafter\expandafter{%
3469 \expandafter\xmp@Author\pdfx@insert@sep}%
3470 \else
3471 \expandafter\expandafter\expandafter\gdef
3472 \expandafter\expandafter\expandafter\xmp@Author
3473 \expandafter\expandafter\expandafter{%
3474 \expandafter\xmp@Author\pdfx@insert@sep[#1]}%
3475 \fi
3476 \def\afterxmp@parse{%
3477 \expandafter\expandafter\expandafter\gdef
3478 \expandafter\expandafter\expandafter\xmp@Author
3479 \expandafter\expandafter\expandafter{%
3480 \expandafter\xmp@Author\xmp@extraAuthor}%
3481 }%
3482 \xmp@parse{\global\let\xmp@extraAuthor\@this}%
3483 }%
3484 \newcommand{\pdfx@extraKeywords}[1][]{%
3485 \ifx\relax#1\relax
3486 \expandafter\expandafter\expandafter\gdef
3487 \expandafter\expandafter\expandafter\xmp@Keywords
3488 \expandafter\expandafter\expandafter{%
3489 \expandafter\xmp@Keywords\pdfx@insert@sep}%
3490 \else%
3491 \expandafter\expandafter\expandafter\gdef
3492 \expandafter\expandafter\expandafter\xmp@Keywords
3493 \expandafter\expandafter\expandafter{%
3494 \expandafter\xmp@Keywords\pdfx@insert@sep[#1]}%
3495 \fi%
3496 \def\afterxmp@parse{%
3497 \expandafter\expandafter\expandafter\gdef
3498 \expandafter\expandafter\expandafter\xmp@Keywords
3499 \expandafter\expandafter\expandafter{%
3500 \expandafter\xmp@Keywords\xmp@extraKeywords}}%
3501 \xmp@parse{\global\let\xmp@extraKeywords\@this}%
3502 }%
3503 \newcommand{\pdfx@extraLanguages}{%
3504 \expandafter\expandafter\expandafter\gdef
3505 \expandafter\expandafter\expandafter\xmp@Language
3506 \expandafter\expandafter\expandafter{%
3507 \expandafter\xmp@Language\pdfx@insert@sep}%
3508 \def\afterxmp@parse{%
3509 \expandafter\expandafter\expandafter\gdef
3510 \expandafter\expandafter\expandafter\xmp@Language
3511 \expandafter\expandafter\expandafter{%
3512 \expandafter\xmp@Language\xmp@extraLanguages}}%
3513 \xmp@parse{\global\let\xmp@extraLanguages\@this}%
3514 }%
3515
3516 \newcommand{\pdfx@extraContributor}[1][]{%
3517 \ifx\relax#1\relax
3518 \expandafter\expandafter\expandafter\gdef
3519 \expandafter\expandafter\expandafter\xmp@Contributor
3520 \expandafter\expandafter\expandafter{%
3521 \expandafter\xmp@Contributor\pdfx@insert@sep}%
3522 \else
3523 \expandafter\expandafter\expandafter\gdef
3524 \expandafter\expandafter\expandafter\xmp@Contributor
3525 \expandafter\expandafter\expandafter{%
3526 \expandafter\xmp@Contributor\pdfx@insert@sep[#1]}%
3527 \fi
3528 \def\afterxmp@parse{%
3529 \expandafter\expandafter\expandafter\gdef
3530 \expandafter\expandafter\expandafter\xmp@Contributor
3531 \expandafter\expandafter\expandafter{%
3532 \expandafter\xmp@Contributor\xmp@extraContributor}%
3533 }%
3534 \xmp@parse{\global\let\xmp@extraContributor\@this}%
3535 }%
3536
3537 \newcommand{\pdfx@extraAuthoritativeDomain}{%
3538 \expandafter\expandafter\expandafter\gdef
3539 \expandafter\expandafter\expandafter\xmp@AuthoritativeDomain
3540 \expandafter\expandafter\expandafter{%
3541 \expandafter\xmp@AuthoritativeDomain\pdfx@insert@sep}%
3542 \def\afterxmp@parse{%
3543 \expandafter\expandafter\expandafter\gdef
3544 \expandafter\expandafter\expandafter\xmp@AuthoritativeDomain
3545 \expandafter\expandafter\expandafter{%
3546 \expandafter\xmp@AuthoritativeDomain\xmp@extraAuthoritativeDomain}%
3547 }%
3548 \xmp@parse{\global\let\xmp@extraAuthoritativeDomain\@this}%
3549 }%
3550
3551 \newcommand{\pdfx@extraDate}{%
3552 \expandafter\expandafter\expandafter\gdef
3553 \expandafter\expandafter\expandafter\xmp@Date
3554 \expandafter\expandafter\expandafter{%
3555 \expandafter\xmp@Date\pdfx@insert@sep}%
3556 \def\afterxmp@parse{%
3557 \expandafter\expandafter\expandafter\gdef
3558 \expandafter\expandafter\expandafter\xmp@Date
3559 \expandafter\expandafter\expandafter{%
3560 \expandafter\xmp@Date\xmp@extraDate}%
3561 }%
3562 \xmp@parse{\global\let\xmp@extraDate\@this}%
3563 }%
3564
3565 \newcommand{\pdfx@extraRelation}[1][]{%
3566 \ifx\relax#1\relax
3567 \expandafter\expandafter\expandafter\gdef
3568 \expandafter\expandafter\expandafter\xmp@Relation
3569 \expandafter\expandafter\expandafter{%
3570 \expandafter\xmp@Relation\pdfx@insert@sep}%
3571 \else
3572 \expandafter\expandafter\expandafter\gdef
3573 \expandafter\expandafter\expandafter\xmp@Relation
3574 \expandafter\expandafter\expandafter{%
3575 \expandafter\xmp@Relation\pdfx@insert@sep[#1]}%
3576 \fi
3577 \def\afterxmp@parse{%
3578 \expandafter\expandafter\expandafter\gdef
3579 \expandafter\expandafter\expandafter\xmp@Relation
3580 \expandafter\expandafter\expandafter{%
3581 \expandafter\xmp@Relation\xmp@extraRelation}%
3582 }%
3583 \xmp@parse{\global\let\xmp@extraRelation\@this}%
3584 }%
3585
3586 %%\newcommand{\pdfx@extraType}[1][]{%
3587 %%% \show\xmp@Type
3588 %% \ifx\relax#1\relax
3589 %% \expandafter\expandafter\expandafter\gdef
3590 %% \expandafter\expandafter\expandafter\xmp@Type
3591 %% \expandafter\expandafter\expandafter{%
3592 %% \expandafter\xmp@Type\pdfx@insert@sep}%
3593 %% \else
3594 %% \expandafter\expandafter\expandafter\gdef
3595 %% \expandafter\expandafter\expandafter\xmp@Type
3596 %% \expandafter\expandafter\expandafter{%
3597 %% \expandafter\xmp@Type\pdfx@insert@sep[#1]}%
3598 %% \fi
3599 %% \def\afterxmp@parse{%
3600 %% \expandafter\expandafter\expandafter\gdef
3601 %% \expandafter\expandafter\expandafter\xmp@Type
3602 %% \expandafter\expandafter\expandafter{%
3603 %% \expandafter\xmp@Type\xmp@extraType}%
3604 %% %\show\xmp@Type
3605 %% }%
3606 %% \xmp@parse{\global\let\xmp@extraType\@this}%
3607 %% }%
3608
3609 \newcommand{\pdfx@extraAdvisory}[1][]{%
3610 \ifx\relax#1\relax
3611 \expandafter\expandafter\expandafter\gdef
3612 \expandafter\expandafter\expandafter\xmp@Advisory
3613 \expandafter\expandafter\expandafter{%
3614 \expandafter\xmp@Advisory\pdfx@insert@sep}%
3615 \else
3616 \expandafter\expandafter\expandafter\gdef
3617 \expandafter\expandafter\expandafter\xmp@Advisory
3618 \expandafter\expandafter\expandafter{%
3619 \expandafter\xmp@Advisory\pdfx@insert@sep[#1]}%
3620 \fi
3621 \def\afterxmp@parse{%
3622 \expandafter\expandafter\expandafter\gdef
3623 \expandafter\expandafter\expandafter\xmp@Advisory
3624 \expandafter\expandafter\expandafter{%
3625 \expandafter\xmp@Advisory\xmp@extraAdvisory}%
3626 }%
3627 \xmp@parse{\global\let\xmp@extraAdvisory\@this}%
3628 }%
3629
3630 \newcommand{\pdfx@extraIdentifier}[1][]{%
3631 \ifx\relax#1\relax
3632 \expandafter\expandafter\expandafter\gdef
3633 \expandafter\expandafter\expandafter\xmp@Identifier
3634 \expandafter\expandafter\expandafter{%
3635 \expandafter\xmp@Identifier\pdfx@insert@sep}%
3636 \else
3637 \expandafter\expandafter\expandafter\gdef
3638 \expandafter\expandafter\expandafter\xmp@Identifier
3639 \expandafter\expandafter\expandafter{%
3640 \expandafter\xmp@Identifier\pdfx@insert@sep[#1]}%
3641 \fi
3642 \def\afterxmp@parse{%
3643 \expandafter\expandafter\expandafter\gdef
3644 \expandafter\expandafter\expandafter\xmp@Identifier
3645 \expandafter\expandafter\expandafter{%
3646 \expandafter\xmp@Identifier\xmp@extraIdentifier}%
3647 }%
3648 \xmp@parse{\global\let\xmp@extraIdentifier\@this}%
3649 }%
3650
3651 %% Nickname only supports a single usage, for PDF/X
3652 %\newcommand{\pdfx@extraNickname}[1][]{%
3653 % \ifx\relax#1\relax
3654 % \expandafter\expandafter\expandafter\gdef
3655 % \expandafter\expandafter\expandafter\xmp@Nickname
3656 % \expandafter\expandafter\expandafter{%
3657 % \expandafter\xmp@Nickname\pdfx@insert@sep}%
3658 % \else
3659 % \expandafter\expandafter\expandafter\gdef
3660 % \expandafter\expandafter\expandafter\xmp@Nickname
3661 % \expandafter\expandafter\expandafter{%
3662 % \expandafter\xmp@Nickname\pdfx@insert@sep[#1]}%
3663 % \fi
3664 % \def\afterxmp@parse{%
3665 % \expandafter\expandafter\expandafter\gdef
3666 % \expandafter\expandafter\expandafter\xmp@Nickname
3667 % \expandafter\expandafter\expandafter{%
3668 % \expandafter\xmp@Nickname\xmp@extraNickname}%
3669 % }%
3670 % \xmp@parse{\global\let\xmp@extraNickname\@this}%
3671 % }%
3672
3673 \newcommand{\pdfx@extraThumbnails}[1][]{%
3674 \ifx\relax#1\relax
3675 \expandafter\expandafter\expandafter\gdef
3676 \expandafter\expandafter\expandafter\xmp@Thumbnails
3677 \expandafter\expandafter\expandafter{%
3678 \expandafter\xmp@Thumbnails\pdfx@insert@sep}%
3679 \else
3680 \expandafter\expandafter\expandafter\gdef
3681 \expandafter\expandafter\expandafter\xmp@Thumbnails
3682 \expandafter\expandafter\expandafter{%
3683 \expandafter\xmp@Thumbnails\pdfx@insert@sep[#1]}%
3684 \fi
3685 \def\afterxmp@parse{%
3686 \expandafter\expandafter\expandafter\gdef
3687 \expandafter\expandafter\expandafter\xmp@Thumbnails
3688 \expandafter\expandafter\expandafter{%
3689 \expandafter\xmp@Thumbnails\xmp@extraThumbnails}%
3690 }%
3691 \xmp@parse{\global\let\xmp@extraThumbnails\@this}%
3692 }%
3693
3694 \newcommand{\pdfx@extraOwner}[1][]{%
3695 \ifx\relax#1\relax
3696 \expandafter\expandafter\expandafter\gdef
3697 \expandafter\expandafter\expandafter\xmp@Owner
3698 \expandafter\expandafter\expandafter{%
3699 \expandafter\xmp@Owner\pdfx@insert@sep}%
3700 \else
3701 \expandafter\expandafter\expandafter\gdef
3702 \expandafter\expandafter\expandafter\xmp@Owner
3703 \expandafter\expandafter\expandafter{%
3704 \expandafter\xmp@Owner\pdfx@insert@sep[#1]}%
3705 \fi
3706 \def\afterxmp@parse{%
3707 \expandafter\expandafter\expandafter\gdef
3708 \expandafter\expandafter\expandafter\xmp@Owner
3709 \expandafter\expandafter\expandafter{%
3710 \expandafter\xmp@Owner\xmp@extraOwner}%
3711 }%
3712 \xmp@parse{\global\let\xmp@extraOwner\@this}%
3713 }%
3714
3715 \newcommand{\pdfx@Subject}[1][]{%
3716 \ifx\relax#1\relax\else\gdef\xmp@lang@Subject{#1}\fi
3717 \xmp@parse{\global\let\xmp@Subject\@this}}
3718 \newcommand{\pdfx@Producer}[1][]{%
3719 \ifx\relax#1\relax\else\gdef\xmp@lang@Producer{#1}\fi
3720 \xmp@parse{\global\let\xmp@Producer\@this}}
3721 \newcommand{\pdfx@Publisher}[1][]{%
3722 \ifx\relax#1\relax\else\gdef\xmp@lang@Publisher{#1}\fi
3723 \xmp@parse{\global\let\xmp@Publisher\@this}}
3724 \newcommand{\pdfx@Copyright}[1][]{%
3725 \ifx\relax#1\relax\else\gdef\xmp@lang@Copyright{#1}\fi
3726 \xmp@parse{\global\let\xmp@Copyright\@this%
3727 \ifx\xmp@Copyrighted\@empty\gdef\xmp@Copyrighted{True}\fi}}
3728
3729 \newcommand{\pdfx@Coverage}[1][]{%
3730 \ifx\relax#1\relax\else\gdef\xmp@lang@Coverage{#1}\fi
3731 \xmp@parse{\global\let\xmp@Coverage\@this}}
3732
3733 %% PRISM Text fields
3734 \newcommand{\pdfx@CoverDisplayDate}[1][]{%
3735 \ifx\relax#1\relax\else\gdef\xmp@lang@CoverDisplayDate{#1}\fi
3736 \xmp@parse{\global\let\xmp@CoverDisplayDate\@this}}
3737 \newcommand{\pdfx@JournalTitle}[1][]{%
3738 \ifx\relax#1\relax\else\gdef\xmp@lang@JournalTitle{#1}\fi
3739 \ifx\xmp@PublicationType\@empty\gdef\xmp@PublicationType{journal}\fi
3740 \xmp@parse{\global\let\xmp@JournalTitle\@this}}
3741
3742 %% Uses PRISM Controlled Vocabulary:
3743 %% http://prismstandard.org/vocabularies/3.0/aggregationtype.xml
3744 %% blog, book, bookazine, catalog, feed, journal, magazine, manual
3745 %% newsletter, newspaper, other, report, pamphlet, vook, whitepaper
3746 %%
3747 \newcommand{\pdfx@PublicationType}[1][]{%
3748 \ifx\relax#1\relax\else\gdef\xmp@lang@PublicationType{#1}\fi
3749 \xmp@parse{\global\let\xmp@PublicationType\@this}}
3750
3751 \def\pdfx@localcommands{
3752 \let\Title\pdfx@Title
3753 \let\Author\pdfx@Author
3754 \let\Keywords\pdfx@Keywords
3755 \let\Subject\pdfx@Subject
3756 \let\Language\pdfx@Language
3757 \def\CreatorTool{\xmp@parse{\global\let\xmp@CreatorTool\@this}}
3758 \let\Producer\pdfx@Producer
3759 \def\Volume{\xmp@parse{\global\let\xmp@Volume\@this}}
3760 \def\Issue{\xmp@parse{\global\let\xmp@Issue\@this}}
3761 \let\CoverDisplayDate\pdfx@CoverDisplayDate
3762 \def\CoverDate{\xmp@parse{\global\let\xmp@CoverDate\@this}}
3763 \let\Copyright\pdfx@Copyright
3764 \def\CopyrightURL{\xmp@parse{\global\let\xmp@CopyrightURL\@this%
3765 \ifx\xmp@Copyrighted\@empty\gdef\xmp@Copyrighted{True}\fi}}
3766 \def\Copyrighted{\xmp@parse{\global\let\xmp@Copyrighted\@this}}
3767 \def\Doi{\xmp@parse{\global\let\xmp@Doi\@this}}
3768 \def\ISBN{\xmp@parse{\global\let\xmp@ISBN\@this}}
3769 \def\URLlink{\xmp@parse{\global\let\xmp@URL\@this}}
3770 \def\Lastpage{\xmp@parse{\global\let\xmp@Lastpage\@this}}
3771 \def\Firstpage{\xmp@parse{\global\let\xmp@Firstpage\@this}}
3772 \let\PublicationType\pdfx@PublicationType
3773 \let\Journaltitle\pdfx@JournalTitle
3774 \def\Journalnumber{\xmp@parse{\global\let\xmp@Journalnumber\@this}}
3775 \let\Publisher\pdfx@Publisher
3776 \let\Coverage\pdfx@Coverage
3777 \def\Source{\xmp@parse{\global\let\xmp@Source\@this}}
3778 \let\Contributor\pdfx@Contributor
3779 \let\Date\pdfx@Date
3780 \let\Relation\pdfx@Relation
3781 \let\Advisory\pdfx@Advisory
3782 \def\BaseURL{\xmp@parse{\global\let\xmp@BaseURL\@this}}
3783 \let\Identifier\pdfx@Identifier
3784 \let\Nickname\pdfx@Nickname
3785 \let\Thumbnails\pdfx@Thumbnails
3786 \let\Owner\pdfx@Owner
3787 \def\CertificateURL{\xmp@parse{\global\let\xmp@CertificateURL\@this}}
3788 \def\MMversionID{\xmp@parse{\global\let\xmpMM@versionID\@this}}
3789 %% \let\Type\pdfx@Type
3790 %%
3791 %% currently unused; for backward compatibility only
3792 \let\AuthoritativeDomain\pdfx@AuthoritativeDomain
3793 \let\Creator\CreatorTool % for backward compatibility
3794 \let\Org\Publisher % for backward compatibility
3795 \let\WebStatement\CopyrightURL % for backward compatibility
3796 }
3797
3798 %%----------------------------------------------------------------------
3799 %% The following characters and markup can be used within the XMP data
3800 %% defined by \Author, \Title, and so on.
3801 %%
3802 %% * All printable non-whitespace ASCII characters except
3803 %% '%', '{', '}', '\' can be used as themselves.
3804 %%
3805 %% * All printable non-whitespace UTF-8 encoded Unicode characters
3806 %% from the basic multilingual plane can be used as themselves.
3807 %%
3808 %% * As usual, consecutive whitespace characters are contracted to a
3809 %% single space. Whitespace after a macro such as \copyright is
3810 %% ignored. Blank lines are not permitted.
3811 %%
3812 %% * The following markup can be used:
3813 %% '\ ' - a literal space (for example after a macro)
3814 %% \% - a literal '%'
3815 %% \{ - a literal '{'
3816 %% \} - a literal '}'
3817 %% \backslash - a literal '\'
3818 %% \copyright - the (c) copyright symbol
3819 %%
3820 %% \sep - only permitted within \Author, \Keywords, \Publisher.
3821 %%
3822 %% * For backward compatibility, \& and \TextCopyright are also
3823 %% provided. Their use is deprecated.
3824
3825 %%----------------------------------------------------------------------
3826 %% The macro \pdfx@actives binds the active characters
3827 %% '&', '<', and '>' to \pdfx@amp, \pdfx@lt, and \pdfx@gt,
3828 %% respectively, without actually making them active.
3829 \begingroup
3830 \catcode`\<=13
3831 \catcode`\>=13
3832 \catcode`\&=13
3833 \gdef\pdfx@actives{
3834 \def&{\pdfx@amp}
3835 \def<{\pdfx@lt}
3836 \def>{\pdfx@gt}
3837 }
3838 \endgroup
3839
3840 %%----------------------------------------------------------------------
3841 %% Markup bindings to be used during XMP generation.
3842
3843 {%
3844 \catcode`\<=12 \catcode`\>=12 \catcode`\/=12 \catcode`\:=12 \catcode`\"=12
3845 \obeyspaces\ifpdfx@useactivespaces%
3846 \gdef\pdfx@sep {\pdfx@check@lang}%
3847 \else%
3848 \gdef\pdfx@sep{\pdfx@check@lang}%
3849 \fi%
3850 \xdef\pdfx@sep@nolang{</rdf:li>^^J <rdf:li>}%
3851 \xdef\pdfx@sep@lang[#1]{</rdf:li>^^J <rdf:li xml:lang="#1">}%
3852 }% end of \obeyspaces and \catcode ....
3853
3854 \def\pdfx@check@lang#1{%
3855 \ifx[#1\expandafter\@firstoftwo
3856 \else\expandafter\@secondoftwo\fi
3857 {\pdfx@sep@lang#1}{\pdfx@sep@nolang#1}}
3858
3859 \def\pdfx@xmpmarkup{%
3860 \pdfx@actives
3861 \edef\@amp{\expandafter\@gobble\string\&}%
3862 \edef\@hash{\expandafter\@gobble\string\#}%
3863 \edef\ {\expandafter\@gobble\string\ }%
3864 \edef\%{\expandafter\@gobble\string\%}%
3865 \edef\{{\expandafter\@gobble\string\{}%
3866 \edef\}{\expandafter\@gobble\string\}}%
3867 \edef\backslash{\expandafter\@gobble\string\\}%
3868 \def\@unicode##1{\@amp\@hash x##1;}%
3869 \def\pdfx@amp{\@unicode{0026}}%
3870 \def\pdfx@lt{\@unicode{003c}}%
3871 \def\pdfx@gt{\@unicode{003e}}%
3872 \def\copyright{\@unicode{00A9}}%
3873 \let\&\pdfx@amp % for backward compatibility
3874 \let\TextCopyright\copyright % for backward compatibility
3875 \let\sep\pdfx@sep
3876 \pdfx@xmpunimarkup % only need this when writing XMP
3877 \the\pdfxsafeforxmp@toks
3878 }
3879
3880 %% cope with active spaces with LGR encoding
3881 %% and the spaces written out with \IeC in KOI8-r
3882 %% It's possible to have both together.
3883 \def\liixu@IeC#1#{\liixu@IeCi}
3884 \def\liixu@IeCi#1{\liixu@IeCii#1}
3885 \def\liixu@IeCii#1#2{#1}
3886 \def\liixu@enableIeC{\ifpdfx@useactivespaces
3887 \let\IeC\liixu@IeC\else\def\IeC##1{##1}\fi}
3888 \def\liixu@numberline#1#{\liixu@numberlinei}
3889 \def\liixu@numberlinei#1{\liixu@numberlineii#1}
3890 \def\liixu@numberlineii#1{\textLF #1. }
3891 \def\liixu@enablenumberline{\ifpdfx@useactivespaces
3892 \let\numberline\liixu@numberline
3893 \else\def\numberline##1{\textLF ##1. }\fi}
3894
3895 \def\pdfx@xmpunimarkup{%
3896 \liixu@enableIeC
3897 \liixu@enablenumberline
3898 \def\empty{}% used in LICR patterns
3899 \LIIXUscriptcommands
3900 \LIIXUtipacommands
3901 \LIIXUmapTeXnames
3902 %% from Hyperref's psdextra.def
3903 \csname psdmapshortnames\endcsname
3904 \csname psdaliasnames\endcsname
3905 %% from lu8enc.def
3906 \csname LIIXUmapmathletterlikes\endcsname
3907 \csname LIIXUmapmathspaces\endcsname
3908 \iflatLATxmp
3909 \LIIXUmaplatinchars
3910 \LIIXUcancelfontswitches
3911 \fi
3912 \ifmathxmp
3913 \let\(\textinlinemath
3914 \let\[\textdisplaymath
3915 \LIIXUmapmathaccents
3916 \LIIXUmapisomathgreek
3917 \LIIXUmapmatharrowsA
3918 \LIIXUmapmathoperatorsA
3919 \LIIXUmapmathoperatorsB
3920 \LIIXUmapmiscmathsymbolsA
3921 \LIIXUmapsupparrowsA
3922 \LIIXUmapsupparrowsB
3923 \LIIXUmapmiscmathsymbolsB
3924 \LIIXUmapsuppmathoperators
3925 \LIIXUmapunimathgreek
3926 \LIIXUmapmathalphabets
3927 \fi
3928 \ifarbxmp \LIIXUmaparabicletters\fi
3929 \ifarmxmp \LIIXUmaparmenianletters\fi
3930 \ifdevxmp\LIIXUmapdevaccents\fi
3931 \ifgrkxmp \LIIXUmapgreekletters\fi
3932 \ifhebxmp \LIIXUmaphebrewletters\fi
3933 }
3934
3935 %% In case macros are used in XMP Metadata, need a way to map these
3936 %% to simple text, rather than specific font characters, or whatever:
3937 \newtoks\pdfxsafeforxmp@toks
3938 \def\pdfxEnableCommands{% user command
3939 \begingroup
3940 \ifpdfx@useactivespaces\obeyspaces\fi
3941 \pdfx@EnableCommands
3942 }
3943 \def\pdfx@EnableCommands#1{% internal command
3944 \expandafter\global\expandafter\pdfxsafeforxmp@toks
3945 \expandafter{\the\pdfxsafeforxmp@toks#1}%
3946 \endgroup
3947 }
3948
3949 %%----------------------------------------------------------------------
3950 %% Markup bindings to be used during PDF string generation.
3951
3952 \def\pdfx@pdfmarkup{%
3953 \pdfx@actives
3954 \edef\%{\expandafter\@gobble\string\%}%
3955 \edef\{{\expandafter\@gobble\string\{}%
3956 \edef\}{\expandafter\@gobble\string\}}%
3957 \edef\pdfx@backslash{\expandafter\@gobble\string\\}%
3958 \def\backslash{\pdfx@backslash000\pdfx@backslash134}%
3959 \edef\pdfx@amp{\expandafter\@gobble\string\&}%
3960 \edef\pdfx@lt{\expandafter\@gobble\string\<}%
3961 \edef\pdfx@gt{\expandafter\@gobble\string\>}%
3962 \let\TextCopyright\copyright % for backward compatibility
3963 \def\sep{; }%
3964 %\let\sep\pdfx@sep
3965 %% Note: '\ ', \&, \copyright are already predefined by hyperref.
3966 %% allow LICRs to expand into PDF strings
3967 \def\cf@encoding{PU}%
3968 \def\9##1{\ifcase##1\string\0\or\string\1\or\string\2\or\string\3\fi}%
3969 \def\8{\string\00}%
3970 \def\0{\string\0}\def\1{\string\1}\def\2{\string\2}\def\3{\string\3}%
3971 \pdfx@xmpunimarkup
3972 \the\pdfxsafeforxmp@toks
3973 }
3974
3975 %%----------------------------------------------------------------------
3976 %% Defaults
3977 \ifxetex
3978 \def\xmp@Producer{XeTeX}
3979 \else\ifluatex
3980 \def\xmp@Producer{LuaTeX}
3981 \else
3982 \def\xmp@Producer{pdfTeX}
3983 \fi\fi
3984 \global\let\pdfxProducer\xmp@Producer
3985
3986 \global\let\xmp@CreatorTool\@empty
3987 \global\let\xmp@Title\@empty
3988 \global\let\xmp@Author\@empty
3989 \global\let\xmp@Keywords\@empty
3990 \global\let\xmp@Subject\@empty
3991 \global\let\xmp@Language\@empty
3992 \global\let\xmp@Volume\@empty
3993 \global\let\xmp@Issue\@empty
3994 \global\let\xmp@CoverDisplayDate\@empty
3995 \global\let\xmp@CoverDate\@empty
3996 \global\let\xmp@Copyright\@empty
3997 \global\let\xmp@Copyrighted\@empty
3998 \global\let\xmp@CopyrightURL\@empty
3999 \gdef\xmp@WebStatement{\xmp@CopyrightURL}
4000 \global\let\xmp@Doi\@empty
4001 \global\let\xmp@ISBN\@empty
4002 \global\let\xmp@URL\@empty
4003 \global\let\xmp@Lastpage\@empty
4004 \global\let\xmp@Firstpage\@empty
4005 \global\let\xmp@PublicationType\@empty
4006 \global\let\xmp@Journaltitle\@empty
4007 \global\let\xmp@Journalnumber\@empty
4008 %%\global\let\xmp@Type\@empty
4009 \global\let\xmp@Contributor\@empty
4010 \global\let\xmp@Coverage\@empty
4011 \global\let\xmp@Date\@empty
4012 \global\let\xmp@Relation\@empty
4013 \global\let\xmp@Source\@empty
4014 \global\let\xmp@Publisher\@empty
4015 \gdef\xmp@Org{\xmp@Publisher}
4016 \global\let\xmp@AuthoritativeDomain\@empty
4017 \global\let\xmp@Advisory\@empty
4018 \global\let\xmp@BaseURL\@empty
4019 \global\let\xmp@Identifier\@empty
4020 \global\let\xmp@Nickname\@empty
4021 \global\let\xmp@Thumbnails\@empty
4022 \global\let\xmp@Owner\@empty
4023 \global\let\xmp@CertificateURL\@empty
4024
4025 %%----------------------------------------------------------------------
4026 %% Alternative way to get the CreationDate using Lua for XeTeX
4027 \ifdefined\pdfcreationdate\else
4028 \ifdefined\creationdate %% added to XeTeX in 2019
4029 \let\pdfcreationdate\creationdate
4030 \else
4031 \begingroup %% ensure correct catcodes, not done by \dospecials
4032 \catcode`\:=12 \catcode`\.=12
4033 \begin{filecontents*}{creationdate.lua}
4034 os.remove("creationdate.timestamp")
4035 io.output("creationdate.timestamp"):write(os.date("\\edef\\tempa{\\string D:%Y%m%d%H%M%S}\n\\def\\tempb{%z}"))
4036 \end{filecontents*}
4037 \endgroup
4038 \ifnum\shellescape=1
4039 \begingroup %% ensure correct catcodes when file is read in
4040 \catcode`\'=12 \catcode`\.=12 \catcode`\:=12 \catcode`\+=12
4041 \immediate\write18{texlua creationdate.lua}
4042 \input{creationdate.timestamp}
4043 \def\tempc#1#2#3#4#5{#1#2#3'#4#5'}
4044 \edef\tempb{\expandafter\tempc\tempb}
4045 \edef\x{\endgroup\def\noexpand\pdfcreationdate{\tempa\tempb}}\x
4046 \else
4047 \begingroup %% ensure correct catcodes in the error/warning messages
4048 \catcode`\<=12 \catcode`\>=12 \catcode`\"=12 \catcode`\-=12
4049 \catcode`\: 12 \catcode`\' 12 \catcode`\= 12
4050 \ifpdfx@noerr
4051 \PackageWarning{pdfx}{%
4052 CreationDate is not properly supported;^^J
4053 PDF validation may fail. To avoid this problem use:^^J
4054 xelatex -shell-escape -output-driver="xdvipdfmx -z 0" <filename>^^J}
4055 \else
4056 \PackageError{pdfx}{%
4057 CreationDate is not properly supported;^^J
4058 PDF validation may fail.}{To avoid this problem use:^^J
4059 xelatex -shell-escape -output-driver="xdvipdfmx -z 0" <filename> }
4060 \fi
4061 %% Using a constant date, to allow processing to finish smoothly.
4062 \edef\x{\endgroup
4063 \def\noexpand\pdfcreationdate{\string D:20181028075445+10'00'}}%
4064 \x
4065 \fi
4066 \fi \fi
4067
4068 %%----------------------------------------------------------------------
4069 \def\pdfx@findUUID#1{\edef\pdfx@tmpstring{\pdfx@mdfivesum{#1}}
4070 \expandafter\pdfx@eightofnine\pdfx@tmpstring\end}
4071 \def\pdfx@eightofnine#1#2#3#4#5#6#7#8#9\end{%
4072 \xdef\pdfx@eightchars{#1#2#3#4#5#6#7#8}
4073 \pdfx@fouroffive#9\end}
4074 \def\pdfx@fouroffive#1#2#3#4#5\end{\xdef\pdfx@ffourchars{#1#2#3#4}
4075 \pdfx@sfouroffive#5\end}
4076 \def\pdfx@sfouroffive#1#2#3#4#5\end{\xdef\pdfx@sfourchars{#1#2#3#4}
4077 \pdfx@tfouroffive#5\end}
4078 \def\pdfx@tfouroffive#1#2#3#4#5\end{\xdef\pdfx@tfourchars{#1#2#3#4}
4079 \xdef\pdfx@laststring{#5}}
4080
4081 \def\pdfx@uuid{\pdfx@eightchars-%
4082 \pdfx@ffourchars-%
4083 \pdfx@sfourchars-%
4084 \pdfx@tfourchars-%
4085 \pdfx@laststring}
4086
4087 \expandafter\ifx\csname pdfx@mdfivesum\endcsname\relax
4088 \PackageError{pdfx}{%
4089 No implementation for \string\pdfx@mdfivesum.^^J
4090 \ifxetex XeTeX needs to be 2015 or later\fi
4091 }{%
4092 Continue without, but the PDF will not validate.
4093 }%
4094 \def\xmp@docid{}%
4095 \def\pdfx@findUUID#1{}%
4096 \def\pdfx@uuid{}%
4097 \else
4098 \pdfx@findUUID{\jobname.pdf}
4099 \edef\xmp@docid{\pdfx@uuid}
4100 \fi
4101
4102 \expandafter\ifx\csname pdfcreationdate\endcsname\relax\relax
4103 \PackageWarning{pdfx}{%
4104 No implementation for \string\pdfxcreation .
4105 }%
4106 \def\xmp@instid{}%
4107 %%
4108 \else %% use the MD5 sum methods
4109 %%
4110 \pdfx@findUUID{\pdfcreationdate}%
4111 \edef\xmp@instid{\pdfx@uuid}
4112 \fi
4113
4114 %%----------------------------------------------------------------------
4115 %% load xcolor before hyperref to get the link colors correct
4116 %%
4117 \PassOptionsToPackage{nosetpagesize}{color}
4118 \PassOptionsToPackage{nosetpagesize}{graphics}
4119 \@ifpackageloaded{xcolor}{%
4120 % Beamer will have already loaded xcolor
4121 % need to understand what options it used
4122 }{
4123 \ifpdfx@x
4124 \RequirePackage[cmyk,hyperref]{xcolor}
4125 \else
4126 \RequirePackage[rgb,hyperref]{xcolor}
4127 \fi
4128 }%
4129
4130 %% loading puenc.def will kill a lot of what mathtext.sty established
4131 \@ifpackageloaded{mathtext}{%
4132 \PackageWarningNoLine{pdfx}{pdfx.sty and hyperref.sty should be loaded^^J
4133 before mathtext.sty , otherwise text symbols may not show in math mode.}%
4134 }{}
4135
4136 \newif\ifpdfx@hluatex
4137 \IfFileExists{hluatex.def}{\pdfx@hluatextrue}{\pdfx@hluatexfalse}
4138
4139 %% the "pdftex" option seems to work fine with LuaTeX
4140 \def\pdfx@luatest{\ifpdfx@hluatex luatex\else pdftex \fi}
4141
4142 %% Hyperref options for PDF/X
4143 \edef\pdfx@pdfX@opts@pdftex{%
4144 draft,pdftex,pdfpagemode=UseNone,bookmarks=false,%
4145 pdfversion=1.\thepdfminorversion,pdfstartview=}
4146 \edef\pdfx@pdfX@opts@xetex{%
4147 draft,xetex,pdfpagemode=UseNone,bookmarks=false,%
4148 pdfversion=1.\thepdfminorversion,pdfstartview=}
4149 \edef\pdfx@pdfX@opts@luatex{%
4150 draft,\pdfx@luatest,pdfpagemode=UseNone,bookmarks=false,%
4151 pdfversion=1.\thepdfminorversion,pdfstartview=}%
4152
4153 \newif\ifpdfx@hyperrefloaded
4154 \expandafter\ifx\csname ifHy@pdfa\endcsname\relax\else\pdfx@hyperrefloadedtrue\fi
4155
4156 %% Hyperref options for PDF/A and PDF/E
4157 \newtoks\pdfx@tmptoks
4158 \pdfx@tmptoks{%
4159 \ifHy@pdfa
4160 \edef\pdfx@pdfAE@opts@pdftex{pdftex}%
4161 \edef\pdfx@pdfAE@opts@xetex{xetex,pdfversion=1.\thepdfminorversion}%
4162 \edef\pdfx@pdfAE@opts@luatex{\pdfx@luatest,pdfversion=1.\thepdfminorversion}%
4163 \edef\pdfx@pdfAE@opts@pdfmark{pdfmark,pdfversion=1.\thepdfminorversion}%
4164 \else
4165 \edef\pdfx@pdfAE@opts@pdftex{pdftex,pdfa}%
4166 \edef\pdfx@pdfAE@opts@xetex{xetex,pdfa,pdfversion=1.\thepdfminorversion}%
4167 \edef\pdfx@pdfAE@opts@luatex{\pdfx@luatest,pdfa,pdfversion=1.\thepdfminorversion}%
4168 \edef\pdfx@pdfAE@opts@pdfmark{pdfmark,pdfa,pdfversion=1.\thepdfminorversion}%
4169 \fi
4170 }
4171 \ifpdfx@hyperrefloaded
4172 \the\pdfx@tmptoks\relax
4173 \else
4174 \edef\pdfx@pdfAE@opts@pdftex{pdftex,pdfa}%
4175 \edef\pdfx@pdfAE@opts@xetex{xetex,pdfa,pdfversion=1.\thepdfminorversion}%
4176 \edef\pdfx@pdfAE@opts@luatex{\pdfx@luatest,pdfa,pdfversion=1.\thepdfminorversion}%
4177 \edef\pdfx@pdfAE@opts@pdfmark{pdfmark,pdfa,pdfversion=1.\thepdfminorversion}%
4178 \fi
4179 \pdfx@tmptoks{}%
4180
4181 \ifpdfx@x
4182 \@ifpackageloaded{hyperref}{%
4183 \ifxetex
4184 \expandafter\hypersetup\expandafter{\pdfx@pdfX@opts@xetex}
4185 \else\ifluatex
4186 \expandafter\hypersetup\expandafter{\pdfx@pdfX@opts@luatex}
4187 \else
4188 \expandafter\hypersetup\expandafter{\pdfx@pdfX@opts@pdftex}
4189 \fi\fi
4190 }{%
4191 \ifxetex
4192 \expandafter\RequirePackage\expandafter[\pdfx@pdfX@opts@xetex]{hyperref}
4193 \else\ifluatex
4194 \expandafter\RequirePackage\expandafter[\pdfx@pdfX@opts@luatex]{hyperref}
4195 \else
4196 \expandafter\RequirePackage\expandafter[\pdfx@pdfX@opts@pdftex]{hyperref}
4197 \fi\fi
4198 }%
4199 \else
4200 \ifpdfx@e
4201 \@ifpackageloaded{hyperref}{%
4202 \ifxetex
4203 \expandafter\hypersetup\expandafter{\pdfx@pdfAE@opts@xetex}
4204 \else\ifluatex
4205 \expandafter\hypersetup\expandafter{\pdfx@pdfAE@opts@luatex}
4206 \else
4207 \expandafter\hypersetup\expandafter{\pdfx@pdfAE@opts@pdftex}
4208 \fi\fi
4209 }{%
4210 \ifxetex
4211 \expandafter\RequirePackage\expandafter[\pdfx@pdfAE@opts@xetex]{hyperref}
4212 \else\ifluatex
4213 \expandafter\RequirePackage\expandafter[\pdfx@pdfAE@opts@luatex]{hyperref}
4214 \else
4215 \expandafter\RequirePackage\expandafter[\pdfx@pdfAE@opts@pdftex]{hyperref}
4216 \fi\fi
4217 }%
4218 \else % generating PDF/A or ...
4219 \@ifpackageloaded{hyperref}{%
4220 \ifxetex
4221 \expandafter\hypersetup\expandafter{\pdfx@pdfAE@opts@xetex}%
4222 \else\ifluatex
4223 \expandafter\hypersetup\expandafter{\pdfx@pdfAE@opts@luatex}%
4224 \else
4225 \expandafter\hypersetup\expandafter{\pdfx@pdfAE@opts@pdftex}%
4226 \fi\fi
4227 }{%
4228 \ifxetex
4229 \expandafter\RequirePackage\expandafter[\pdfx@pdfAE@opts@xetex]{hyperref}
4230 \else\ifluatex
4231 \expandafter\RequirePackage\expandafter[\pdfx@pdfAE@opts@luatex]{hyperref}
4232 \else
4233 \expandafter\RequirePackage\expandafter[\pdfx@pdfAE@opts@pdftex]{hyperref}
4234 \fi\fi
4235 }%
4236 \fi\fi
4237 %\hypersetup{pdfencoding=auto}% 2019-12-08 No; this writes 8-bit bookmarks.
4238 \expandafter\ifx\csname KV@Hyp@psdextra\endcsname\relax\else
4239 \hypersetup{psdextra}
4240 \fi
4241
4242 %% hyperref doesn't set the minor version for XeTeX
4243 \ifxetex
4244 \special{pdf:minorversion \thepdfminorversion}
4245 \fi
4246
4247 \ifx\xmp@CreatorTool\@empty
4248 \edef\xmp@CreatorTool{\@pdfcreator}
4249 \fi
4250
4251 \newif\ifpdfx@cmyk
4252 \newif\ifpdfx@custom
4253 \ifpdfx@x % PDF/X normally needs a CMYK color profile for printing
4254 \global\pdfx@cmyktrue
4255 \fi
4256 %%----------------------------------------------------------------------
4257 %% ----- Color Profiles -------
4258 %% Define how to specify the profile, so the default
4259 %% can be over-ridden in the .xmpdata file.
4260 %%
4261 %% --- user-command --- RGB profile needed with PDF/A-??
4262 %% \setRGBcolorprofile{<filename>}{<identifier>}
4263 %% {<info string>}{<registry URL>}
4264 \def\setRGBcolorprofile{%
4265 \begingroup
4266 \catcode`\_ 11\relax\catcode`\& 11\relax\catcode`\~ 11\relax
4267 \catcode`\% 11\relax
4268 \edef\({\string\(}\edef\){\string\)}%
4269 \pdfx@setrgbprofile}
4270 %%
4271 %% --- user-command --- CMYK profile needed with PDF/X-??
4272 %% \setCMYKcolorprofile{<filename>}{<output intent>}
4273 %% {<identifier>}{<registry URL>}
4274 \def\setCMYKcolorprofile{%
4275 \begingroup
4276 \catcode`\_ 11\relax\catcode`\& 11\relax\catcode`\~ 11\relax
4277 \catcode`\% 11\relax
4278 \edef\({\string\(}\edef\){\string\)}%
4279 \pdfx@setcmykprofile}
4280 %%
4281 %% --- user-command --- DeviceGray profile needed with PDF/E-1
4282 %% \setGRAYcolorprofile{<filename>}{<output intent>}
4283 %% {<identifier>}{<registry URL>}
4284 \def\setGRAYcolorprofile{%
4285 \begingroup
4286 \catcode`\_ 11\relax\catcode`\& 11\relax\catcode`\~ 11\relax
4287 \catcode`\% 11\relax
4288 \edef\({\string\(}\edef\){\string\)}%
4289 \pdfx@setgrayprofile}
4290 %%
4291 %% --- user-command --- External profile with PDF/X-4p and PDF/X-5pg
4292 %% \setEXTERNALprofile{<profilename>}{<output intent>}
4293 %% {<identifier>}{<registry URL>}{<color-space>}%
4294 %% {<ICC Version>}{<provider URL>}{<extra info>}{<Check Sum>}
4295 \def\setEXTERNALprofile{%
4296 \begingroup
4297 \catcode`\_ 11\relax\catcode`\& 11\relax\catcode`\~ 11\relax
4298 \catcode`\% 11\relax
4299 \edef\({\string\(}\edef\){\string\)}%
4300 \ifno@iccprofile
4301 \expandafter\pdfx@externalprofile
4302 \else
4303 \expandafter\pdfx@externalprofile@gobble
4304 \fi
4305 }
4306 %%
4307 %%
4308 \def\pdfx@setRGBcolorprofiledir#1{%
4309 \xdef\pdfx@RGBcolorprofiledir{#1}%
4310 }
4311 \def\pdfx@setCMYKcolorprofiledir#1{%
4312 \xdef\pdfx@CMYKcolorprofiledir{#1}%
4313 }
4314 \pdfx@setRGBcolorprofiledir{}
4315 \pdfx@setCMYKcolorprofiledir{}
4316
4317 %% This does indeed work! Use it in .xmpdata files
4318 \providecommand{\MacOSColordir}{/System/Library/ColorSync/Profiles/}
4319 \providecommand{\MacOSLibraryColordir}{/Library/ColorSync/Profiles/}
4320 \providecommand{\AdobeMacOSdir}%
4321 {/Library/Application Support/Adobe/Color/Profiles/Recommended/}
4322 \edef\pdfx@tmp{C:\string\Windows\string\System32\string\Spool%
4323 \string\Drivers\string\Color\string/}
4324 \expandafter\providecommand\expandafter
4325 {\expandafter\WindowsColordir\expandafter}\expandafter{\pdfx@tmp}
4326 %%\pdfx@setcolorprofiledir{\AdobeMacOSdir}
4327
4328 %% overide that value using the following commands:
4329 \let\pdfxSetCMYKcolorProfileDir\pdfx@setCMYKcolorprofiledir
4330 \let\pdfxSetRGBcolorProfileDir\pdfx@setRGBcolorprofiledir
4331 %% for back-compatibility
4332 \let\pdfxSetColorProfileDir\pdfxSetCMYKcolorProfileDir
4333 %%
4334 \def\pdfx@setrgbprofile#1#2#3#4{%
4335 \xdef\pdfx@rgb@profile{\pdfx@RGBcolorprofiledir#1}% valid file path/name
4336 \xdef\pdfx@rgb@profilename{#1}% valid file name
4337 \gdef\pdfx@rgb@identifier{#2}%
4338 \gdef\pdfx@rgb@info{#3}%
4339 \pdfstringdef\pdfx@rgb@registry{#4}% valid URL
4340 \endgroup
4341 \global\pdfx@cmykfalse
4342 }% closes-off \setRGBcolorprofile
4343 %%
4344 \def\pdfx@setcmykprofile#1#2#3#4{%
4345 \xdef\pdfx@cmyk@profile{\pdfx@CMYKcolorprofiledir#1}% valid file path/name
4346 \xdef\pdfx@cmyk@profilename{#1}% valid file name
4347 %% \expandafter\gdef\expandafter\pdfx@cmyk@profile\expandafter
4348 %% {\pdfx@colorprofiledir#1}% valid file name
4349 \gdef\pdfx@cmyk@intent{#2}%
4350 %% \pdfstringdef\pdfx@cmyk@intent{#2}% color intent
4351 \gdef\pdfx@cmyk@identifier{#3}%
4352 %% \pdfstringdef\pdfx@cmyk@identifier{#3}% text string identifier
4353 \gdef\pdfx@cmyk@registry{#4}%
4354 %% \pdfstringdef\pdfx@cmyk@registry{#4}% valid URL
4355 \endgroup
4356 \global\pdfx@cmyktrue
4357 }% closes-off \setcmykcolorprofile
4358 %%
4359 \def\setCUSTOMcolorprofile{%
4360 \begingroup
4361 \catcode`\_ 11\relax\catcode`\& 11\relax\catcode`\~ 11\relax
4362 \catcode`\% 11\relax
4363 \edef\({\string\(}\edef\){\string\)}%
4364 \pdfx@setcustomprofile
4365 }
4366 \def\pdfx@setcustomprofile#1#2#3#4#5#6#7#8{%
4367 \xdef\pdfx@customcolorprofiledir{#2}% valid directory location
4368 \xdef\pdfx@custom@profile{#1}% valid file name
4369 \gdef\pdfx@custom@identifier{#3}%
4370 \gdef\pdfx@custom@registry{#4}%
4371 \gdef\pdfx@custom@numcolors{#5}% num-colors specifier
4372 \gdef\pdfx@iccversion{#6}% Hex string for /ICCVersion < ... >
4373 \gdef\pdfx@custom@colornames{#7}%
4374 \gdef\pdfx@profile@checksum{#8}% Hex string for /CheckSum < ... >
4375 \endgroup
4376 \global\pdfx@cmykfalse
4377 \global\pdfx@customtrue
4378 }% closes-off \pdfx@setcustomprofile
4379 %%
4380 \def\pdfx@setgrayprofile#1#2#3#4{%
4381 \gdef\pdfx@gray@profile{#1}% valid file name
4382 \gdef\pdfx@gray@intent{#2}%
4383 \gdef\pdfx@gray@identifier{#3}%
4384 \pdfstringdef\pdfx@gray@registry{#4}% valid URL
4385 \endgroup}% closes-off \setGRAYcolorprofile
4386 %%
4387 \def\pdfx@externalprofile#1#2#3#4#5#6#7#8#9{%
4388 \gdef\pdfx@extprofile{#1}% PDF string for /ProfileName
4389 \gdef\pdfx@cmyk@intent{#2}% PDF string for /OutputCondition
4390 \gdef\pdfx@cmyk@identifier{#3}% PDF string for /OutputConditionIdentifier
4391 \gdef\pdfx@cmyk@registry{#4}% {http://www.color.org}%
4392 \gdef\pdfx@profileCS{#5}% 4 bytes for /ProfileCS
4393 \gdef\pdfx@iccversion{#6}% Hex string for /ICCVersion < ... >
4394 \gdef\pdfx@colorURL{#7}% URL
4395 \gdef\pdfx@cmyk@info{#8}% for /Info
4396 \gdef\pdfx@profile@checksum{#9}% Hex string for /CheckSum < ... >
4397 \endgroup}% closes-off \setEXTERNALprofile
4398 \def\pdfx@externalprofile@gobble#1#2#3#4#5#6#7#8#9{%
4399 \PackageError{pdfx}{Wrong option for using an External Color profile}%
4400 {Use one of the options: x-4p , x-4p08 , x-4p10 or x-5pg .}%
4401 \endgroup}
4402 %%
4403 %% default color profiles
4404
4405 {\catcode`\_ 12 \catcode`\& 12 \catcode`\~ 12
4406 \gdef\pdfx@xprofile@cmykdefault{coated_FOGRA39L_argl.icc}
4407 \gdef\pdfx@aprofile@rgbdefault{sRGB_IEC61966-2-1_black_scaled.icc}
4408 \gdef\pdfx@eprofile@graydefault{Gray_linear.icc}
4409 \gdef\pdfx@pprofile@externaldefault{FOGRA39}
4410 }% end of \catcode
4411 \xdef\pdfx@rgb@profile{\pdfx@aprofile@rgbdefault}
4412 \xdef\pdfx@cmyk@profile{\pdfx@xprofile@cmykdefault}
4413 \xdef\pdfx@gray@profile{\pdfx@eprofile@graydefault}
4414 \xdef\pdfx@external@profile{\pdfx@pprofile@externaldefault}
4415
4416 %%----------------------------------------------------------------------
4417 %% License for the file sRGB_IEC61966-2-1_black_scaled.icc :
4418 %%
4419 %% Copyright International Color Consortium, 2009 -- http://www.color.org/
4420 %%
4421 %% It is hereby acknowledged that the file "sRGB_IEC61966-2-1_black_scaled.icc"
4422 %% is provided "AS IS" WITH NO EXPRESS OR IMPLIED WARRANTY.
4423 %%
4424 %% Licensing
4425 %%
4426 %% This profile is made available by the International Color Consortium,
4427 %% and may be copied, distributed, embedded, made, used, and sold without
4428 %% restriction. Altered versions of this profile shall have the original
4429 %% identification and copyright information removed and shall not be
4430 %% misrepresented as the original profile.
4431 %%
4432 %% Terms of use
4433 %%
4434 %% To anyone who acknowledges that the file "sRGB_IEC61966-2-1_black_scaled.icc"
4435 %% is provided "AS IS" WITH NO EXPRESS OR IMPLIED WARRANTY, permission to use,
4436 %% copy and distribute these file for any purpose is hereby granted without fee,
4437 %% provided that the file is not changed including the ICC copyright notice tag,
4438 %% and that the name of ICC shall not be used in advertising or publicity
4439 %% pertaining to distribution of the software without specific, written prior
4440 %% permission. ICC makes no representations about the suitability of this
4441 %% software for any purpose.
4442 %%
4443 %%----------------------------------------------------------------------
4444
4445 \newif\ifpdfx@tryoldprofiles
4446
4447 %% The colorprofiles package was added to TeXLive in October 2018.
4448 %% It allows the default Color Profiles to be maintained independent
4449 %% of the pdfx package.
4450 %% In particular sRGB_IEC61966-2-1_black_scaled.icc is no longer
4451 %% distributed with TeXLive 2018 and later.
4452 %% Older versions still have this file.
4453 %%
4454 \IfFileExists{colorprofiles.tex}{%
4455 \RequirePackage{colorprofiles}[2018/11/01]%
4456 \ifx\colorpro@rgb@profile\relax
4457 \expandafter\pdfx@tryoldprofilestrue
4458 \else
4459 \begingroup %% \endgroup occurs within the macro expansion
4460 \pdfx@setrgbprofile{\colorpro@rgb@profile
4461 }{\colorpro@rgb@identifier
4462 }{\colorpro@rgb@info
4463 }{\colorpro@rgb@registry
4464 }%
4465 \begingroup %% \endgroup occurs within the macro expansion
4466 \pdfx@setcmykprofile{\colorpro@cmyk@profile
4467 }{\colorpro@cmyk@intent
4468 }{\colorpro@cmyk@identifier
4469 }{\colorpro@cmyk@registry
4470 }%
4471 \expandafter\pdfx@tryoldprofilesfalse
4472 \fi
4473 }{%
4474 \PackageWarning{pdfx}{%
4475 The 'colorprofiles' package is not installed correctly.^^J
4476 File 'colorprofiles.tex' is missing. Proceeding without it.
4477 }%
4478 \pdfx@tryoldprofilestrue
4479 }
4480
4481 {\catcode`\| 14 \catcode`\% 12 \catcode`\_ 12 \catcode`\: 12
4482 \catcode`\. 12 \catcode`\- 12 \catcode`\/ 12
4483 \edef\@bchar{\expandafter\@gobble\string\\}|
4484 \edef\({\string\(}\edef\){\string\)}|
4485 \ifpdfx@tryoldprofiles
4486 || this will be used by TeXLive installations up to 2017.
4487 \begingroup | \endgroup occurs within the macro expansion
4488 \expandafter\pdfx@setrgbprofile\expandafter
4489 {sRGB_IEC61966-2-1_black_scaled.icc}|
4490 {sRGB_IEC61966-2-1_black_scaled}|
4491 {sRGB IEC61966 v2.1 with black scaling}|
4492 {http://www.color.org}|
4493 \begingroup | \endgroup occurs within the macro expansion
4494 \pdfx@setcmykprofile{coated_FOGRA39L_argl.icc}| coated_FOGRA39L_argl.icc
4495 {Coated FOGRA39}|
4496 {FOGRA39 \string\(ISO Coated v2 300%\space \string\(ECI\string\)\string\)}|
4497 {http://www.argyllcms.com/}|{http://www.color.org}|
4498 \fi || end of \ifpdfx@tryoldprofiles
4499 \begingroup | \endgroup occurs within the macro expansion
4500 \pdfx@setgrayprofile{Gray_linear.icc}|
4501 {}|
4502 {Custom}|
4503 {http://www.freedesktop.org/wiki/OpenIcc}|
4504 \ifno@iccprofile
4505 \begingroup | \endgroup occurs within the macro expansion
4506 \pdfx@externalprofile{Coated FOGRA39 \(ISO 12647-2:2004\)}|
4507 {Offset commercial and specialty printing according to ISO 12647-2:2004 |
4508 / Amd 1, paper type 1 or 2 \(gloss or matte coated offset, 115 g/m2\), |
4509 screen frequency 60/cm.}|
4510 {FOGRA39}{http://www.color.org}{CMYK}{02100000}{http://www.adobe.com}|
4511 {Coated FOGRA39 \(ISO 12647-2:2004\)}{74FF62F330BF0DBE4495B5720542D511}|
4512 \fi
4513 }% end of \catcode
4514
4515 %%
4516 %%----------------------------------------------------------------------
4517 %% License for the file coated_FOGRA39L_argl.icc :
4518 %%
4519 %% The zlib/libpng License
4520 %%
4521 %% Copyright (c) 2008 Kai-Uwe Behrmann
4522 %%
4523 %% This software is provided 'as-is', without any express or implied
4524 %% warranty. In no event will the authors be held liable for any damages
4525 %% arising from the use of this software.
4526 %%
4527 %% Permission is granted to anyone to use this software for any purpose,
4528 %% including commercial applications, and to alter it and redistribute
4529 %% it freely, subject to the following restrictions:
4530 %%
4531 %% 1. The origin of this software must not be misrepresented; you
4532 %% must not claim that you wrote the original software. If you use
4533 %% this software in a product, an acknowledgment in the product
4534 %% documentation would be appreciated but is not required.
4535 %%
4536 %% 2. Altered source versions must be plainly marked as such, and
4537 %% must not be misrepresented as being the original software.
4538 %%
4539 %% 3. This notice may not be removed or altered from any source
4540 %% distribution.
4541 %%----------------------------------------------------------------------
4542
4543 \newif\ifexternalICCprofiles
4544 \newif\ifpdfx@noXMPdata
4545
4546 \begingroup
4547 %% override unneeded color-profile specifier
4548 \ifpdfx@x
4549 \ifno@iccprofile % PDF/X-4p and PDF/X-5pg PDF/VT-2
4550 \begingroup
4551 \def\pdfx@extprofiles@store{AdobeExternalProfiles.tex}%
4552 \InputIfFileExists{\pdfx@extprofiles@store}%
4553 {\global\externalICCprofilestrue \catcode `\# 12\relax}%
4554 {\typeout{** pdfx: No file \pdfx@extprofiles@store\space
4555 found for PDF/X-4p or PDF/X-5pg}}%
4556 \endgroup
4557 \else
4558 \begingroup
4559 \def\pdfx@profiles@store{AdobeColorProfiles.tex}%
4560 \InputIfFileExists{\pdfx@profiles@store}%
4561 {\global\externalICCprofilesfalse \catcode `\# 12\relax}%
4562 {\typeout{** pdfx: No file \pdfx@profiles@store\space
4563 found for PDF/X variants}}%
4564 \endgroup
4565 %% \def\setRGBcolorprofile#1#2#3#4{%
4566 %% \PackageError{pdfx}{PDF/X requires a CMYK color profile}%
4567 %% {Just continue using the default CMYK profile.^^J}}%
4568 \fi
4569 \else
4570 %% load it, in case the macros are used in .xmpdata
4571 \InputIfFileExists{AdobeColorProfiles.tex}{}{}%
4572 \ifpdfx@e
4573 \else
4574 \def\setCMYKcolorprofile#1#2#3#4{}%
4575 \def\setGRAYcolorprofile#1#2#3#4{}%
4576 \fi\fi
4577 %%
4578 \ifluatex\else\ifxetex\else
4579 \inputencoding{8bit}%
4580 \fi\fi
4581 \makeatletter
4582 \pdfx@localcommands
4583 %% Do this in a box, so any stray characters don't get into TeX's lists.
4584 \setbox0\hbox{%
4585 \InputIfFileExists{\jobname.xmpdata}%
4586 {\typeout{** pdfx: Metadata file \jobname.xmpdata read successfully.}}%
4587 {\typeout{** pdfx: No file \jobname.xmpdata .
4588 Metadata will be incomplete!}\aftergroup\pdfx@noXMPdatatrue}}
4589 \endgroup
4590 %% ----------------------------------------------------------------------
4591
4592 \def\pdfx@LanguageSpec{}
4593 \def\pdfx@mainLanguage{en-US}% absolute default
4594 \def\pdfx@checkfor@sep#1#2\sep#3\pdfx@endparse{\def#1{#2}}
4595 \ifx\@empty\xmp@Language\else
4596 \expandafter\pdfx@checkfor@sep\expandafter\pdfx@mainLanguage\xmp@Language
4597 \sep\pdfx@endparse
4598 \fi
4599 \edef\pdfx@LanguageSpec{/Lang (\pdfx@mainLanguage)}
4600
4601 %% ----------------------------------------------------------------------
4602 \begingroup
4603 \catcode`\_ 12 \catcode`\" 12 \catcode`\' 12
4604 \catcode`\< 12 \catcode`\> 12 \catcode`\/ 12 \catcode`\[ 12 \catcode`\] 12
4605 \edef\@pctchar{\expandafter\@gobble\string\%}
4606 \edef\@bchar{\expandafter\@gobble\string\\}
4607 \edef\0{\string\0}
4608 \edef\({\string\(}
4609 \edef\){\string\)}
4610 %%
4611 \def\pdfx@outcatalog@dict{%
4612 \pdfx@LanguageSpec
4613 /ViewerPreferences <</DisplayDocTitle true >>
4614 /OutputIntents \pdfx@outintents % needs appropriate expansion
4615 }%
4616 \ifpdfx@x % PDF/X needs a CMYK or RGB color profile for printing
4617 \ifno@iccprofile % PDF/X-4p and PDF/X-5pg
4618 %%
4619 %% URL and metadata for the desired external Color Profile
4620 %%
4621 \edef\pdfx@colorURL@dict{<</FS/URL/F(\pdfx@colorURL)>>}
4622 \def\pdfx@colorprofile@dict{<< %
4623 /CheckSum <\pdfx@profile@checksum>^^J%
4624 /ICCVersion <\pdfx@iccversion>%
4625 /ProfileCS (\pdfx@profileCS)^^J%
4626 /ProfileName (\pdfx@extprofile)^^J%
4627 /URLs [\OBJ@URLs] >>
4628 }
4629 %% How to specify the PDF objects with different drivers
4630 \ifxetex
4631 \def\OBJ@URLs{ @colorURL }%
4632 \def\OBJ@ICC{ @colorprofile }%
4633 \immediate\special{pdf:obj \OBJ@URLs \pdfx@colorURL@dict }%
4634 \immediate\special{pdf:obj \OBJ@ICC \pdfx@colorprofile@dict }%
4635 \else % pdfTeX & LuaTeX
4636 \immediate\pdfobj{\pdfx@colorURL@dict}%
4637 \edef\OBJ@URLs{\the\pdflastobj\space 0 R}%
4638 \immediate\pdfobj{\pdfx@colorprofile@dict}%
4639 \edef\OBJ@ICC{\the\pdflastobj\space 0 R}%
4640 \fi
4641 %% Output Intent dictionary, with object reference
4642 \edef\pdfx@outintent@dict{%
4643 /Type/OutputIntent
4644 /S/GTS_PDFX^^J
4645 /OutputCondition (\pdfx@cmyk@intent)^^J
4646 /OutputConditionIdentifier (\pdfx@cmyk@identifier)^^J
4647 /Info(\pdfx@cmyk@intent)^^J
4648 /RegistryName(\pdfx@cmyk@registry)^^J
4649 %% extra dictionary required for PDF/X-4p and PDF/X-5pg
4650 /DestOutputProfileRef \OBJ@ICC
4651 }%
4652 %%
4653 \else % PDF/X-1 , PDF/X-1a , PDF/X-3 , PDF/X-4 , PDF/X-5g
4654 %%
4655 \ifpdfx@cmyk
4656 \IfFileExists{"\pdfx@cmyk@profile"}{%
4657 % embedded CMYK color profile
4658 %%
4659 %% Output Intent dictionary, with object reference
4660 \def\pdfx@outintent@dict{%
4661 /Type/OutputIntent
4662 /S/GTS_PDFX^^J
4663 /OutputCondition (\pdfx@cmyk@intent)^^J
4664 /OutputConditionIdentifier (\pdfx@cmyk@identifier)^^J
4665 /Info(\pdfx@cmyk@intent)^^J
4666 /RegistryName(\pdfx@cmyk@registry)
4667 /DestOutputProfile \OBJ@CMYK
4668 }%
4669 \def\pdfx@numcoords{/N 4}%
4670 %%
4671 \ifxetex
4672 \def\OBJ@CMYK{@colorprofile}%
4673 \immediate\special{%
4674 pdf:fstream \OBJ@CMYK (\pdfx@cmyk@profile) <<\pdfx@numcoords >>}%
4675 \else % pdfTeX
4676 \immediate\pdfobj stream attr{\pdfx@numcoords} file {\pdfx@cmyk@profile}%
4677 \edef\OBJ@CMYK{\the\pdflastobj\space 0 R}%
4678 \fi
4679 \pdfcatalog{%
4680 \pdfx@LanguageSpec
4681 /OutputIntents [ <<
4682 /Type/OutputIntent
4683 /S/GTS_PDFX
4684 /OutputCondition (\pdfx@cmyk@intent)%
4685 /OutputConditionIdentifier (\pdfx@cmyk@identifier)%
4686 /Info(\pdfx@cmyk@intent)%
4687 /RegistryName(\pdfx@cmyk@registry)
4688 /DestOutputProfile \OBJ@CMYK
4689 >> ]}%
4690 }{%
4691 \PackageError{pdfx}{No color profile \pdfx@cmyk@profilename\space found
4692 to use for CMYK printing colors.}%
4693 {Is this the correct directory: \pdfx@CMYKcolorprofiledir\space ?}%
4694 }% end of \IfFileExists for CMYK
4695 \else\ifpdfx@custom
4696 %% allow Custom profile with PDF/X-5n
4697 \IfFileExists{"\pdfx@customcolorprofiledir\pdfx@custom@profile"}{%
4698 %% embedded Custom color profile
4699 %%
4700 %% Output Intent dictionary, with object reference
4701 \def\pdfx@outintent@dict{%
4702 /Type/OutputIntent
4703 /S/GTS_PDFX^^J
4704 /OutputConditionIdentifier (Custom)^^J
4705 /OutputCondition (\pdfx@custom@identifier)^^J
4706 /Info(\pdfx@custom@profile)^^J
4707 /RegistryName(\pdfx@custom@registry)
4708 /Registry(\pdfx@custom@registry)
4709 /DestOutputProfileRef \OBJ@CustomDir
4710 }%
4711 \def\OBJ@CustomDir{<<
4712 \pdfx@numcoords^^J
4713 /URLs [ << /Type /Filespec ^^J/EF \OBJ@CustomFile^^J
4714 /F (\pdfx@custom@profile) /UF (\pdfx@custom@profile) >>]^^J
4715 >>}
4716 %% need more attributes:
4717 \def\pdfx@numcoords{%
4718 /CheckSum <\pdfx@profile@checksum>^^J%
4719 /ICCVersion <\pdfx@iccversion>%
4720 /ProfileName (\pdfx@custom@profile)^^J%
4721 /ProfileCS (\pdfx@custom@numcolors)^^J%
4722 /ColorantTable [\pdfx@custom@colornames]
4723 }%
4724 \def\pdfx@custom@filespec{%
4725 /Type /EmbeddedFile >>^^J
4726 /Subtype (application/vnd.iccprofile )
4727 }%
4728 %%
4729 \ifxetex
4730 \def\OBJ@CustomFile{@colorprofile}%
4731 \immediate\special{pdf:fstream \OBJ@CustomFile
4732 (\pdfx@customcolorprofiledir\pdfx@custom@profile) <<\pdfx@custom@filespec >>}%
4733 \else % pdfTeX
4734 \immediate\pdfobj stream attr{\pdfx@custom@filespec} file %
4735 {\pdfx@customcolorprofiledir\pdfx@custom@profile}%
4736 \edef\OBJ@CustomFile{\the\pdflastobj\space 0 R}%
4737 \fi
4738 \pdfcatalog{%
4739 \pdfx@LanguageSpec
4740 /OutputIntents [ << \pdfx@outintent@dict >>]}%
4741 }{%
4742 \PackageError{pdfx}%
4743 {No color profile \pdfx@custom@profile\space found to use for Custom printing colors.}%
4744 {Is this the correct directory: \pdfx@customcolorprofiledir\space ?}%
4745 }% end of \IfFileExists for Custom
4746 \global\pdfx@cmyktrue % for TeX coloring
4747 %%
4748 \else % allow RGB profile with PDF/X ???
4749 \ifpdfx@noerr
4750 \PackageWarning{pdfx}{PDF/X normally requires a CMYK color profile.^^J
4751 Assuming RGB profile is of type 'prtr' not 'mntr'.^^J^^J}%
4752 \else
4753 \PackageError{pdfx}{PDF/X normally requires a CMYK color profile.}%
4754 {To use RGB ensure profile is of type 'prtr' not 'mntr'.^^J^^J}%
4755 \fi
4756 % embedded RGB color profile
4757 %%
4758 %% Output Intent dictionary, with object reference
4759 \def\pdfx@outintent@dict{%
4760 /Type /OutputIntent
4761 /S/GTS_PDFX^^J
4762 /OutputConditionIdentifier (\pdfx@rgb@identifier)^^J
4763 /DestOutputProfile \OBJ@RGB^^J
4764 /Info(\pdfx@rgb@info)^^J
4765 /RegistryName(\pdfx@rgb@registry)
4766 }%
4767 \IfFileExists{"\pdfx@rgb@profile"}{%
4768 \def\pdfx@numcoords{/N 3 /Alternate/DeviceRGB}
4769 \ifxetex
4770 \immediate\special{%
4771 pdf:fstream @colorprofile (\pdfx@rgb@profile) << \pdfx@numcoords >>}
4772 \def\OBJ@RGB{@colorprofile}%
4773 \else
4774 \immediate\pdfobj stream attr{\pdfx@numcoords} file{\pdfx@rgb@profile}%
4775 \edef\OBJ@RGB{\the\pdflastobj\space 0 R}%
4776 \fi
4777 \edef\pdfx@outintent@dict{%
4778 /Type /OutputIntent
4779 /S/GTS_PDFX
4780 /OutputConditionIdentifier (\pdfx@rgb@identifier)%
4781 /DestOutputProfile \OBJ@RGB
4782 /Info(\pdfx@rgb@info)
4783 /RegistryName(\pdfx@rgb@registry)
4784 }%
4785 \ifxetex
4786 \def\OBJ@RGB{ @colorprofile }%
4787 \immediate\special{%
4788 pdf:fstream @colorprofile (\pdfx@rgb@profile) <<\pdfx@numcoords >>}
4789 \else %% pdfTeX or LuaTeX
4790 \immediate\pdfobj stream attr{\pdfx@numcoords} file{\pdfx@rgb@profile}%
4791 \edef\OBJ@RGB{\the\pdflastobj\space 0 R}%
4792 \fi
4793 }{%
4794 \PackageError{pdfx}%
4795 {No color profile \pdfx@rgb@profilename\space found to use for RGB screen colors.}%
4796 {Is this the correct directory: \pdfx@RGBcolorprofiledir\space ?}%
4797 }% end of \IfFileExists for RGB
4798 \fi % end of \ifpdfx@custom
4799 \fi % end of \ifpdfx@cmyk
4800 \fi % end of \ifno@iccprofile
4801 %% end of PDF/X
4802 \else
4803 %% PDF/A and PDF/E can specify a CMYK profile
4804 \expandafter\ifx\expandafter\relax\pdfx@rgb@profile\relax
4805 \global\pdfx@cmyktrue
4806 \IfFileExists{"\pdfx@cmyk@profile"}{%
4807 \def\pdfx@numcoords{/N 4}
4808 % embedded CMYK color profile
4809 \ifxetex
4810 \def\OBJ@CMYK{@colorprofile}%
4811 \special{pdf:fstream @colorprofile (\pdfx@cmyk@profile) <<\pdfx@numcoords >>}
4812 \else %% pdfTeX or LuaTeX
4813 \immediate\pdfobj stream attr{\pdfx@numcoords} file{\pdfx@cmyk@profile}%
4814 \edef\OBJ@CMYK{\the\pdflastobj\space 0 R}%
4815 \fi
4816 \edef\pdfx@outintent@dict{%
4817 /Type /OutputIntent
4818 \ifpdfx@e
4819 /S/ISO_PDFE1
4820 \else
4821 /S/GTS_PDFA1
4822 \fi
4823 /OutputCondition (\pdfx@cmyk@intent)% use this or /Info ?
4824 /OutputConditionIdentifier (\pdfx@cmyk@identifier)%
4825 /DestOutputProfile \OBJ@CMYK
4826 /Info(\pdfx@cmyk@intent)%
4827 /RegistryName(\pdfx@cmyk@registry)
4828 }%
4829 }{%
4830 \PackageError{pdfx}{No color profile \pdfx@cmyk@profilename\space found
4831 to use for CMYK printing colors.}%
4832 {Is this the correct directory: \pdfx@CMYKcolorprofiledir\space ?}%
4833 }% end of \IfFileExists for CMYK
4834 \else
4835 %% PDF/A and PDF/E usually need an RGB color profile for on-screen rendering
4836 \global\pdfx@cmykfalse
4837 \expandafter\IfFileExists\expandafter{\pdfx@rgb@profile}{%
4838 \def\pdfx@numcoords{/N 3 /Alternate/DeviceRGB}
4839 \ifxetex
4840 \def\OBJ@RGB{ @colorprofile }%
4841 \immediate\special{pdf:fstream @colorprofile (\pdfx@rgb@profile) <<\pdfx@numcoords >>}
4842 \else
4843 \immediate\pdfobj stream attr{\pdfx@numcoords} file{\pdfx@rgb@profile}%
4844 \edef\OBJ@RGB{\the\pdflastobj\space 0 R}%
4845 \fi
4846 \edef\pdfx@outintent@dict{%
4847 /Type /OutputIntent
4848 \ifpdfx@e
4849 /S/ISO_PDFE1
4850 \else
4851 /S/GTS_PDFA1
4852 \fi
4853 /OutputConditionIdentifier (\pdfx@rgb@identifier)%
4854 /DestOutputProfile \OBJ@RGB
4855 /Info(\pdfx@rgb@info)
4856 /RegistryName(\pdfx@rgb@registry)
4857 }%
4858 }{%
4859 \PackageError{pdfx}%
4860 {No color profile \pdfx@rgb@profilename\space found to use for RGB screen colors.}%
4861 {Is this the correct directory: \pdfx@RGBcolorprofiledir\space ?}%
4862 }% end of \IfFileExists for RGB
4863 \fi % end of ifx for PDF/A or PDF/E
4864 \fi % end of ifpdfx@x
4865 %%
4866 \expandafter\ifx\csname pdfx@outintent@dict\endcsname\relax
4867 \else
4868 %%
4869 %% build the OutputIntent array
4870 %%
4871 \ifxetex
4872 \def\pdfx@outintents{ @outintentsarray }%
4873 \def\pdfx@outintentref{ @outintent@dict }%
4874 \immediate\special{pdf:obj \pdfx@outintentref << \pdfx@outintent@dict >>}
4875 \immediate\special{pdf:obj \pdfx@outintents [ ]}%
4876 \immediate\special{pdf:put \pdfx@outintents \pdfx@outintentref }%
4877 \else
4878 \immediate\pdfobj{<<\pdfx@outintent@dict>>}%
4879 \edef\pdfx@outintents{[\the\pdflastobj\space 0 R]}%
4880 \fi
4881 %%
4882 %% make the Catalog entry, if not already done
4883 %%
4884 \ifx\pdfx@outcatalog@dict\relax
4885 \else
4886 \pdfcatalog{\pdfx@outcatalog@dict}%
4887 \fi
4888 \fi % end of OutputIntent array and Catalog entry
4889 \endgroup
4890
4891 %% ----------------------------------------------------------------------
4892 %% Make a version of \xmp@Keywords and \xmp@Author where \sep has been
4893 %% replaced by a comma. The first is for the pdf:Keywords property,
4894 %% which accepts a comma-separated string of keywords, and seems to be
4895 %% mandatory for PDF/A-1 compliance. The second is for the dc:creator
4896 %% property. Although it is defined to be a sequence of authors, Adobe
4897 %% Acrobat will in fact ignore and delete all except the first author.
4898 %% Therefore, it's safer to always separate authors by commas.
4899
4900 \begingroup
4901 \let\pdfx@xmpunimarkup\relax
4902 \pdfx@xmpmarkup
4903 \ifluatex\else\ifxetex\else
4904 \inputencoding{8bit}%
4905 \fi\fi
4906 \makeatletter
4907 \IfFileExists{\pdfx@encodingfile}{%
4908 \def\cf@encoding{L8U}\fontencoding{L8U}%
4909 }{}%
4910 \let\protect\@typeset@protect
4911 \pdfx@xmpmarkup %% !!!!! no longer needed
4912 %% \xdef\xmp@@Author{\xmp@Author}% no need to expand
4913 \global\let\xmp@@Author\xmp@Author
4914 \def\sep{; }% expand to replace \sep !!! no longer needed
4915 %% \xdef\xmp@@Copyright{\xmp@Copyright}%
4916 \global\let\xmp@@Copyright\xmp@Copyright
4917 %% \xdef\xmp@@Keywords{\xmp@Keywords}%
4918 %% \global\let\xmp@@Keywords\xmp@Keywords
4919 %% \global\let\xmp@Keywords\@empty %
4920 \global\let\xmp@@Keywords\@empty % don't use pdf:Keywords
4921 \endgroup
4922
4923 %% ----------------------------------------------------------------------
4924 \def\xmp@convertDate{\pdfx@getYear}
4925 {\catcode`\D=12 \catcode`\:=12
4926 \gdef\pdfx@getYear D:#1#2#3#4{\edef\pdfx@xYear{#1#2#3#4}\pdfx@getMonth}
4927 }
4928 \def\pdfx@getMonth#1#2{\edef\pdfx@xMonth{#1#2}\pdfx@getDay}
4929 \def\pdfx@getDay#1#2{\edef\pdfx@xDay{#1#2}\pdfx@getHour}
4930 \def\pdfx@getHour#1#2{\edef\pdfx@xHour{#1#2}\pdfx@getMin}
4931 \def\pdfx@getMin#1#2{\edef\pdfx@xMin{#1#2}\pdfx@getSec}
4932 \def\pdfx@getSec#1#2{\edef\pdfx@xSec{#1#2}\pdfx@getTZh}
4933 \def\pdfx@getTZh{\futurelet\pdfx@next\pdfx@getTzh@branches}
4934
4935 {\catcode`\@=11 \catcode`\Z=12 \catcode`\+=12 \catcode`\-=12
4936 \gdef\pdfx@getTzh@branches{%
4937 \ifx\pdfx@next Z\let\pdfx@getTzbranch\pdfx@getTznozone
4938 \else\ifx\pdfx@next +\let\pdfx@getTzbranch\pdfx@getTzplus
4939 \else\ifx\pdfx@next -\let\pdfx@getTzbranch\pdfx@getTzminus
4940 \else\let\pdfx@getTzbranch\pdfx@getTzerror
4941 \fi\fi\fi \pdfx@getTzbranch }
4942
4943 \catcode`\0=12
4944 \gdef\pdfx@getTznozone Z#1\pdfx@getTzend{%
4945 \edef\pdfx@xTzh{+00}\edef\pdfx@xTzm{00}}
4946 \gdef\pdfx@getTzplus +#1'#2'#3\pdfx@getTzend{%
4947 \edef\pdfx@xTzh{+#1}\edef\pdfx@xTzm{#2}%
4948 \ifx\relax#2\relax\def\pdfx@xTzm{00}\fi}
4949 \gdef\pdfx@getTzminus -#1'#2'#3\pdfx@getTzend{%
4950 \edef\pdfx@xTzh{-#1}\edef\pdfx@xTzm{#2}%
4951 \ifx\relax#2\relax\def\pdfx@xTzm{00}\fi}
4952 %%
4953 %% How to support XeTeX here ?
4954 \expandafter\ifx\csname pdfcreationdate\endcsname\relax
4955 %% \xdef\pdfx@convDate{2016-04-01}% April fool!
4956 %% \xdef\xmp@convDate{2016-04-01}% April fool!
4957 \else
4958 \expandafter\expandafter\expandafter\xmp@convertDate\pdfcreationdate''\pdfx@getTzend
4959 \xdef\pdfx@convDate{\pdfx@xYear\pdfx@xMonth\pdfx@xDay\pdfx@xHour
4960 \pdfx@xMin\pdfx@xSec\pdfx@xTzh'\pdfx@xTzm'}%
4961 \xdef\xmp@convDate{\pdfx@xYear-\pdfx@xMonth-\pdfx@xDay
4962 T\pdfx@xHour:\pdfx@xMin:\pdfx@xSec\pdfx@xTzh:\pdfx@xTzm}%
4963 \fi
4964 }% end of \catcode
4965
4966
4967 %% ----------------------------------------------------------------------
4968 %% \pdfx@topdfstring\toka\tokb: Convert the string in \tokb to a format
4969 %% appropriate for PDF /Info strings, i.e., PDFDoc encoding or UTF-16
4970 %% encoding, and store the result in \toka As a special case, if \tokb
4971 %% is \@empty, set \toka to \@empty.
4972
4973 \RequirePackage{stringenc}% prevent it loading later inside a group
4974 \def\pdfx@topdfstring #1#2{%
4975 \ifx #2\@empty
4976 \global\let#1\empty
4977 \else
4978 \begingroup
4979 \ifluatex\else\ifxetex\else
4980 \inputencoding{utf8}%
4981 \fi\fi
4982 \@ifl@t@r\fmtversion{2022/06/01}{}{\hypersetup{pdfencoding=auto}}%
4983 \pdfstringdef #1{#2}%
4984 \endgroup
4985 \fi
4986 }
4987
4988 %% ----------------------------------------------------------------------
4989 %% if high-bit characters are already encoded as active
4990 %% then \pdfstringdef probably changes their meaning
4991 %% so save these for later reversion.
4992 %%
4993 \newif\ifpdf@activechars
4994 {\ifnum\catcode`^^c0 = 13\relax \aftergroup\pdf@activecharstrue\fi}%
4995 %%
4996 %% normally not used with XeTeX or LuaTeX
4997 %%
4998
4999 \ifpdf@activechars
5000 \global\let\pdfx@save@co ^^c0\relax
5001 \global\let\pdfx@save@ci ^^c1\relax
5002 \global\let\pdfx@save@cii ^^c2\relax
5003 \global\let\pdfx@save@ciii ^^c3\relax
5004 \global\let\pdfx@save@civ ^^c4\relax
5005 \global\let\pdfx@save@cv ^^c5\relax
5006 \global\let\pdfx@save@cvi ^^c6\relax
5007 \global\let\pdfx@save@cvii ^^c7\relax
5008 \global\let\pdfx@save@cviii ^^c8\relax
5009 \global\let\pdfx@save@cix ^^c9\relax
5010 \global\let\pdfx@save@ca ^^ca\relax
5011 \global\let\pdfx@save@cb ^^cb\relax
5012 \global\let\pdfx@save@cc ^^cc\relax
5013 \global\let\pdfx@save@cd ^^cd\relax
5014 \global\let\pdfx@save@ce ^^ce\relax
5015 \global\let\pdfx@save@cf ^^cf\relax
5016 \global\let\pdfx@save@do ^^d0\relax
5017 \global\let\pdfx@save@di ^^d1\relax
5018 \global\let\pdfx@save@dii ^^d2\relax
5019 \global\let\pdfx@save@diii ^^d3\relax
5020 \global\let\pdfx@save@div ^^d4\relax
5021 \global\let\pdfx@save@dv ^^d5\relax
5022 \global\let\pdfx@save@dvi ^^d6\relax
5023 \global\let\pdfx@save@dvii ^^d7\relax
5024 \global\let\pdfx@save@dviii ^^d8\relax
5025 \global\let\pdfx@save@dix ^^d9\relax
5026 \global\let\pdfx@save@da ^^da\relax
5027 \global\let\pdfx@save@db ^^db\relax
5028 \global\let\pdfx@save@dc ^^dc\relax
5029 \global\let\pdfx@save@dd ^^dd\relax
5030 \global\let\pdfx@save@de ^^de\relax
5031 \global\let\pdfx@save@df ^^df\relax
5032 \global\let\pdfx@save@eo ^^e0\relax
5033 \global\let\pdfx@save@ei ^^e1\relax
5034 \global\let\pdfx@save@eii ^^e2\relax
5035 \global\let\pdfx@save@eiii ^^e3\relax
5036 \global\let\pdfx@save@eiv ^^e4\relax
5037 \global\let\pdfx@save@ev ^^e5\relax
5038 \global\let\pdfx@save@evi ^^e6\relax
5039 \global\let\pdfx@save@evii ^^e7\relax
5040 \global\let\pdfx@save@eviii ^^e8\relax
5041 \global\let\pdfx@save@eix ^^e9\relax
5042 \global\let\pdfx@save@ea ^^ea\relax
5043 \global\let\pdfx@save@eb ^^eb\relax
5044 \global\let\pdfx@save@ec ^^ec\relax
5045 \global\let\pdfx@save@ed ^^ed\relax
5046 \global\let\pdfx@save@ee ^^ee\relax
5047 \global\let\pdfx@save@ef ^^ef\relax
5048 \global\let\pdfx@save@fo ^^f0\relax
5049 \global\let\pdfx@save@fi ^^f1\relax
5050 \global\let\pdfx@save@fii ^^f2\relax
5051 \global\let\pdfx@save@fiii ^^f3\relax
5052 \fi
5053
5054 %% ----------------------------------------------------------------------
5055 %% detect when \sep is used for multiple authors
5056 %% then suppress the /Author field in PDF /Info
5057 \newif\ifpdfx@sep@infield@
5058 \let\pdfx@endparse\relax
5059 \def\pdfx@parseforsep#1\sep#2\pdfx@endparse{%
5060 \pdfx@sep@infield@false
5061 \ifx\relax#2\relax\else\pdfx@sep@infield@true\fi
5062 }
5063
5064 \begingroup
5065 \let\CATCODE\catcode
5066 \let\ENDGROUP\endgroup
5067 \let\GDEF\gdef
5068 \CATCODE`\m 12 \CATCODE`\a 12 \CATCODE`\c 12 \CATCODE`\r 12 \CATCODE`\o 12
5069 \CATCODE`\: 12 \CATCODE`\- 12 \CATCODE`\> 12
5070 \GDEF\pdfx@DOSTRIP@MACRO macro:->#1\@{#1}%
5071 \ENDGROUP
5072 \def\pdfx@strip@macro#1{%
5073 \expandafter\edef\expandafter#1\expandafter{%
5074 \expandafter\pdfx@DOSTRIP@MACRO\meaning#1\@}%
5075 }
5076
5077 %% Convert the relevant XMP properties to PDF strings, expanding markup
5078 %% (such as \sep, \&, \copyright, etc) in an appropriate way.
5079 %% These PDF strings are actually not always necessary, but if supplied they
5080 %% must match exactly what is in the XMP version. This may be impossible
5081 %% if math symbols are used; e.g. Plane-1 alphanumerics.
5082 %% Generally, it is better to *not* provide PDF-info strings;
5083 %% instead just providing metadata through XMP.
5084 %% This is not always enough — a driver may add it by default!
5085 %%
5086 %% But some PDF readers don't support XMP, so it is nice to have
5087 %% /Info fields, when this can be done reliably.
5088 %%
5089 %% 2018-12-16: load package outside the grouping
5090 \RequirePackage{stringenc}%
5091 \begingroup
5092 \catcode`\| 0
5093 \catcode `\\ 12
5094 |gdef |pdfx@parsebackslash#1{%
5095 |begingroup
5096 |def |pdfx@parsemacro{#1}%
5097 |def |pdfx@parseout{}%
5098 |expandafter |pdfx@doparsebackslash#1\|pdfx@endparse
5099 }
5100 |gdef |pdfx@doparsebackslash#1\#2|pdfx@endparse{%
5101 |edef |pdfx@parseout{|pdfx@parseout#1}%
5102 |ifx |relax#2|relax
5103 |let |next |pdfx@parseend
5104 |else
5105 |edef |pdfx@parseout{|pdfx@parseout \\}%
5106 |def |next{|pdfx@doparsebackslash#2|pdfx@endparse}%
5107 |fi |next
5108 }
5109 |endgroup
5110 \def\pdfx@parseend{%
5111 \edef\next{\endgroup\def\expandafter\noexpand\pdfx@parsemacro{\pdfx@parseout}}%
5112 \next
5113 }%
5114 \begingroup
5115 %% \expandafter\ifx\csname pdf@escapehex\endcsname\relax
5116 %% \PackageWarning{pdfx}{%
5117 %% Missing an implementation of \string\pdf@escapehex ^^J
5118 %% Translated Metadata cannot be generated as PDF strings.^^J}%
5119 %% \def\pdfx@GeneratePdfString#1#2{}%
5120 %% \def\pdfx@ConvertUTFtoBE#1#2{}%
5121 %% \fi %%\else
5122 \gdef\pdfx@GeneratePdfString#1#2{%
5123 % converts a UTF-8 string to UTF-16be
5124 \StringEncodingConvert{#1}{#2}{utf8}{utf16be}%
5125 \edef\pdfx@tempii{#1}\relax
5126 \xdef#1{\string\376\string\377\pdfescapestring{\pdfx@tempii}}%
5127 }%
5128 \gdef\pdfx@ConvertUTFtoBE#1#2{%
5129 \setbox0=\hbox{% catch any rubbish escaping to the MVL
5130 \def\cf@encoding{L8U}\fontencoding{L8U}%
5131 \ifluatex
5132 %% \let\pdfescapestring\luaescapestring
5133 \else\ifxetex\else
5134 \inputencoding{8bit}%
5135 \fi\fi
5136 %% \pdfx@xmpmarkup %% don't want some things
5137 \pdfx@xmpunimarkup
5138 \let\backslash\textbackslash
5139 \edef\pdfx@temp{#2}% ensure XMP expands to UTF8
5140 \ifluatex
5141 \pdfx@parsebackslash\pdfx@temp
5142 \pdfstringdef{#1}{\pdfx@temp}%
5143 \else\ifxetex
5144 \pdfx@parsebackslash\pdfx@temp
5145 \pdfstringdef{#1}{\pdfx@temp}%
5146 \else
5147 \pdfx@GeneratePdfString{#1}{\pdfx@temp}%
5148 \fi\fi
5149 }% end of \setbox
5150 }%
5151 %% \fi
5152 \pdfx@pdfmarkup
5153 \global\let\pdfx@pdfAuthor\@empty
5154 \global\let\pdfx@pdfTitle\@empty
5155 \global\let\pdfx@pdfSubject\@empty
5156 \global\let\pdfx@pdfKeywords\@empty
5157 \ifpdfx@nopdfinfo % transliterated strings present
5158 %% RRM: this may still work with parser macros ???
5159 \expandafter\ifx\expandafter\relax\xmp@Title\relax\else
5160 \pdfx@ConvertUTFtoBE{\pdfx@pdfTitle}{\xmp@Title}%
5161 \fi
5162 \expandafter\ifx\expandafter\relax\xmp@Subject\relax\else
5163 \pdfx@ConvertUTFtoBE{\pdfx@pdfSubject}{\xmp@Subject}%
5164 \fi
5165 \else %% pdfx@nopdfinfofalse
5166 \expandafter\ifx\expandafter\relax\xmp@Title\relax\else
5167 \ifluatex
5168 \pdfx@ConvertUTFtoBE\pdfx@pdfTitle\xmp@Title
5169 \else\ifxetex
5170 \pdfx@ConvertUTFtoBE\pdfx@pdfTitle\xmp@Title
5171 \else
5172 %% \pdfx@GeneratePdfString\pdfx@pdfTitle\xmp@Title % why does this fail ???
5173 \pdfx@ConvertUTFtoBE{\pdfx@pdfTitle}{\xmp@Title}% ??? RRM 2019-02-17
5174 \fi\fi
5175 \fi
5176 \expandafter\ifx\expandafter\relax\xmp@Subject\relax\else
5177 \ifluatex
5178 \pdfx@ConvertUTFtoBE\pdfx@pdfSubject\xmp@Subject
5179 \else\ifxetex
5180 \pdfx@ConvertUTFtoBE\pdfx@pdfSubject\xmp@Subject
5181 \else
5182 %% \pdfx@GeneratePdfString\pdfx@pdfSubject\xmp@Subject % why does this fail ???
5183 \pdfx@ConvertUTFtoBE{\pdfx@pdfSubject}{\xmp@Subject}% 2019-02-17
5184 \fi\fi
5185 \fi
5186 \fi % end of \ifpdfx@nopdfinfo
5187 \pdfx@topdfstring\pdfx@CreatorTool\xmp@CreatorTool
5188 \pdfx@topdfstring\pdfx@Producer\xmp@Producer
5189 %% \pdfescapestring needed
5190 %% \expandafter\ifx\csname pdfescapestring\endcsname\relax
5191 %% \else
5192 \expandafter\ifx\expandafter\relax\xmp@Author\relax
5193 \else
5194 %% check for multiple authors with parser macro
5195 \expandafter\pdfx@parseforsep\xmp@Author\sep\pdfx@endparse
5196 \ifpdfx@sep@infield@
5197 \else
5198 \pdfx@ConvertUTFtoBE{\pdfx@pdfAuthor}{\xmp@Author}%
5199 \fi %% end of \ifpdfx@sep@infield@
5200 \fi %% end of \xmp@Author test
5201 \expandafter\ifx\expandafter\relax\xmp@Keywords\relax
5202 \else
5203 %% check for multiple keywords with parser macro
5204 \expandafter\pdfx@parseforsep\xmp@Keywords\sep\pdfx@endparse
5205 \ifpdfx@sep@infield@
5206 \else
5207 \pdfx@ConvertUTFtoBE{\pdfx@pdfKeywords}{\xmp@Keywords}%
5208 \fi %% end of \ifpdfx@sep@infield@
5209 \fi %% end of \xmp@Keywords test
5210 %%
5211 %% \fi %% end of \pdfescapestring test
5212 \endgroup
5213
5214 %% Affects CMap creation for certain fonts, according to glyph names
5215 %% How to support XeTeX here ?
5216 %% Maybe it's best to be using an updated mmap.sty ?
5217 \ifxetex
5218 \else
5219 \input glyphtounicode.tex
5220 \input glyphtounicode-cmr.tex
5221 \input glyphtounicode-ntx.tex
5222 \pdfgentounicode=1
5223 \fi
5224 \ifgrkLGRxmp
5225 \ifxetex\else
5226 \pdfglyphtounicode{internalchar2}{200D}%
5227 \fi \fi
5228
5229 %% patch to place accents *after* the base character, rather than before
5230 %% based on coding from mmap.sty by RRM
5231 \newif\ifPDFX@inaccent
5232 \let\LTX@add@accent\add@accent
5233 \def\PDFX@add@accent#1#2{%
5234 \hmode@bgroup
5235 \let \hmode@start@before@group \@firstofone
5236 \setbox\@tempboxa\hbox{\PDFX@inaccenttrue
5237 #2\global\mathchardef\accent@spacefactor\spacefactor}%
5238 #2\kern-\wd\@tempboxa
5239 %% \ifdim\ht\@tempboxa>1ex\relax
5240 \dimen@=\ht\@tempboxa\advance\dimen@-1ex\relax
5241 %%% reduce how much a nested accent is raised
5242 \ifPDFX@inaccent\advance\[email protected]\relax\fi
5243 \raise\dimen@\hbox to\wd\@tempboxa{\hss
5244 \accent#1{\vphantom{#2}}\hss}%
5245 %% \else
5246 %% \accent#1{%\vphantom{#2}
5247 %% \vrule width\z@ height\ht\@tempboxa depth\dp\@tempboxa}%
5248 %% \fi
5249 \egroup
5250 \spacefactor\accent@spacefactor
5251 }
5252 %% same for named accents in math-mode
5253 \def\pdfx@mathaccentV #1#2#3#4#5{%
5254 #5{\mathsurround=\z@\relax
5255 \everymath{}%
5256 \mathchoice
5257 {\setbox\z@\hbox{$\displaystyle #5$}\kern-\wd\z@}%
5258 {\setbox\z@\hbox{$\textstyle #5$}\kern-\wd\z@}%
5259 {\setbox\z@\hbox{$\scriptstyle #5$}\kern-\wd\z@}%
5260 {\setbox\z@\hbox{$\scriptscriptstyle #5$}\kern-\wd\z@}%
5261 }%
5262 % \pdfx@AMS@mathaccentV{#1}{#2}{#3}{#4}{#5}%
5263 \AMS@mathaccentV{#1}{#2}{#3}{#4}{\phantom{#5}}%
5264 }
5265
5266 %%% the original AMS coding:
5267 %%\mathaccentV=macro: #1#2#3#4#5->\ifmmode
5268 %% \gdef \macc@tmp {\macc@depth \@ne }%
5269 %% \setbox \z@ \hbox {\let\mathaccentV \macc@test
5270 %% \let \use@mathgroup \@gobbletwo
5271 %% \let \select@group \@gobblethree \frozen@everymath {}$#5$}\macc@tmp
5272 %% \ifnum \macc@depth =\@ne
5273 %% \global \let \macc@nucleus \@empty
5274 %% \mathaccent "\accentclass@
5275 %% \else \@xp \macc@nested
5276 %% \fi #2#3#4{#5}\macc@nucleus
5277 %% \else
5278 %% \@xp \nonmatherr@ \csname #1\endcsname \fi .
5279
5280 \def\pdfx@AMS@mathaccentV #1#2#3#4#5{%
5281 \ifmmode
5282 \gdef \macc@tmp {\macc@depth \@ne }%
5283 \setbox \z@ \hbox {\let\mathaccentV \macc@test
5284 \let \use@mathgroup \@gobbletwo
5285 \let \select@group \@gobblethree \frozen@everymath {}$\phantom{#5}$}\macc@tmp
5286 \ifnum \macc@depth =\@ne
5287 \global \let \macc@nucleus \@empty
5288 \mathaccent "\accentclass@
5289 \else \@xp \macc@nested
5290 \fi #2#3#4{#5}\macc@nucleus
5291 \else
5292 \@xp \nonmatherr@ \csname #1\endcsname
5293 \fi
5294 }
5295
5296
5297 %% code supplied by Yuwsuke Kieda, 7 May 2019 :
5298 %% https://gist.github.com/yuw/a31936370647d0044eeb4e47f3ae913f
5299 %%
5300 \@ifpackageloaded{amsmath}{%
5301 \def\pdfx@macc@a #1#2{%
5302 \begingroup
5303 \let\macc@style#1\relax
5304 \def\macc@palette ##1{##1\macc@style}%
5305 \advance\macc@depth\m@ne
5306 \ifnum\macc@depth=\z@
5307 \gdef\macc@nucleus{\phantom{#2}}%% <<< here
5308 \setbox\z@\hbox{$#1#2\@empty{}\macc@skewchar$}%
5309 \setbox\tw@\hbox{$#1#2\@empty\macc@skewchar$}%
5310 \dimen@\tw@\wd\tw@ \advance\dimen@-\tw@\wd\z@
5311 \xdef\macc@kerna{\the\dimen@\relax}%
5312 \setbox4\hbox{$#1#2\acc@check\@empty$}%
5313 \global\setbox\@ne\hbox to\wd4{}%
5314 \ht\@ne\ht4 \dp\@ne\dp4
5315 \xdef\macc@kernb{\the\wd4\relax}%
5316 \mathaccent\macc@code{\box\@ne\kern\macc@kerna}%
5317 \else
5318 \mathaccent\macc@code{\let\macc@adjust\@empty #1#2\@empty}%
5319 \macc@adjust
5320 \fi
5321 \endgroup
5322 }}\relax
5323 %
5324 \AtBeginDocument{%
5325 \@ifpackageloaded{amsmath}{%
5326 \let\AMS@mathaccentV\mathaccentV
5327 % \let\mathaccentV\pdfx@mathaccentV
5328 % \let\macc@a\pdfx@macc@a
5329 }%
5330 }%
5331
5332 %% How to support XeTeX here ?
5333 %%%%% adjust accent characters to the Unicode Combining variant %%%%
5334 \def\PDFX@combiningchars@unicode{%
5335 \pdfglyphtounicode{grave}{0300}%
5336 \pdfglyphtounicode{acute}{0301}%
5337 \pdfglyphtounicode{circumflex}{0302}%
5338 \pdfglyphtounicode{tilde}{0303}%
5339 \pdfglyphtounicode{macron}{0304}%
5340 \pdfglyphtounicode{Macronsmall}{0304}%
5341 \pdfglyphtounicode{breve}{0306}%
5342 \pdfglyphtounicode{dotaccent}{0307}%
5343 \pdfglyphtounicode{Dotaccent}{0307}%
5344 \pdfglyphtounicode{Dotaccentsmall}{0307}%
5345 \pdfglyphtounicode{dieresis}{0308}%
5346 \pdfglyphtounicode{ogonek}{0309}%
5347 \pdfglyphtounicode{ring}{030A}%
5348 \pdfglyphtounicode{hungarumlaut}{030B}%
5349 \pdfglyphtounicode{caron}{030C}%
5350 \pdfglyphtounicode{cedilla}{0327}%
5351 \pdfglyphtounicode{commaaccent}{0326}% droid
5352 % tie accents in berenisadf lm stix and others
5353 \pdfglyphtounicode{tieaccentlowercase}{0311}%
5354 \pdfglyphtounicode{tieaccentcapital}{0361}%
5355 \pdfglyphtounicode{newtieaccentlowercase}{0311}%
5356 \pdfglyphtounicode{newtieaccentcapital}{0361}%
5357 % cm-unicode
5358 \pdfglyphtounicode{space_uni030D}{030D}%
5359 \pdfglyphtounicode{space_uni030E}{030E}%
5360 \pdfglyphtounicode{space_uni030F}{030F}%
5361 \pdfglyphtounicode{space_uni0311}{0311}%
5362 \pdfglyphtounicode{space_uni0321}{0321}%
5363 \pdfglyphtounicode{space_uni0322}{0322}%
5364 \pdfglyphtounicode{space_uni032A}{032A}%
5365 \pdfglyphtounicode{space_uni032B}{032B}%
5366 \pdfglyphtounicode{space_uni0335}{0335}%
5367 \pdfglyphtounicode{space_uni0337}{0337}%
5368 \pdfglyphtounicode{space_uni033A}{033A}%
5369 \pdfglyphtounicode{space_uni033B}{033B}%
5370 \pdfglyphtounicode{space_uni033C}{033C}%
5371 \pdfglyphtounicode{space_uni034D}{034D}%
5372 }
5373
5374 \def\pdfx@check@accents{%
5375 \ifx\add@accent\LTX@add@accent
5376 \let\add@accent\PDFX@add@accent
5377 \else
5378 \expandafter\ifx\csname MT@orig@add@accent\endcsname\relax
5379 \@ifpackageloaded{mmap}{}{%
5380 \pdfx@ErrorWarning{another package has patched \string\add@accent }%
5381 {Hit <return> to continue}{}{}}%
5382 \else
5383 \expandafter\let\csname MT@orig@add@accent\endcsname\PDFX@add@accent
5384 \fi\fi
5385 \ifxetex
5386 \else
5387 \PDFX@combiningchars@unicode
5388 %% this is now handled by glyphtounicode-ntx.tex
5389 %% \@ifpackageloaded{newtxmath}{%
5390 %% \pdfglyphtounicode{vec}{20D7}%
5391 %% \pdfglyphtounicode{rvec}{20D6}%
5392 %% \pdfglyphtounicode{lrvec}{20E1}%
5393 %% }{}%
5394 \fi % end of \ifxetex
5395 \let\pdfx@check@accents\unDefiNeD
5396 }
5397 \AtBeginDocument{\pdfx@check@accents}
5398
5399 %% suppress hyperlinks when generating PDF/X
5400 \def\pdfx@linkfile@pdfX#1#2#3{%
5401 \Hy@colorlink\@filecolor#1\Hy@xspace@end}
5402 \def\pdfx@linkstart@pdfX#1#2#3{%
5403 \Hy@colorlink\@linkcolor#3\endgroup\Hy@xspace@end}
5404 \def\pdfx@linkurl@pdfX#1#2{%
5405 \Hy@colorlink\@urlcolor#1\endgroup\Hy@xspace@end}
5406 \def\pdfx@StartlinkName@pdfX#1#2{}
5407 \def\pdfx@close@pdflink{\Hy@VerboseLinkStop\Hy@endcolorlink}%
5408 \def\pdfx@Acrobatmenu@noaction#1#2{#2}
5409
5410 \ifpdfx@x
5411 \let\hyper@linkfile\pdfx@linkfile@pdfX
5412 \let\hyper@linkurl\pdfx@linkurl@pdfX
5413 \let\hyper@linkstart\pdfx@linkstart@pdfX
5414 \let\hyper@linkend\relax
5415 \let\Hy@StartlinkName\pdfx@StartlinkName@pdfX
5416 \let\close@pdflink\pdfx@close@pdflink
5417 \let\AcrobatMenu\pdfx@Acrobatmenu@noaction
5418 \Hy@bookmarksfalse
5419 %% {\def\sep{;}% should not be needed, but just in case
5420 \AtBeginDocument{%
5421 % cancel annotations and links
5422 %
5423 \def\PDF@FinishDoc{% ??? What uses this ???
5424 \begingroup
5425 \def\sep{; }% should not be needed, but just in case
5426 \pdfinfo{%
5427 \ifx\pdfx@pdfTitle\@empty\else /Title(\pdfx@pdfTitle)^^J\fi
5428 \ifx\pdfx@pdfAuthor\@empty\else /Author(\pdfx@pdfAuthor)^^J\fi
5429 \ifx\pdfx@pdfSubject\@empty\else /Subject(\pdfx@pdfSubject)^^J\fi
5430 \ifx\pdfx@pdfKeywords\@empty\else /Keywords(\pdfx@pdfKeywords)^^J\fi
5431 /Creator(\pdfx@CreatorTool)^^J%
5432 \ifx\@pdfcreationdate\@empty
5433 /CreationDate(D:\pdfx@convDate)%
5434 \else
5435 \ifxetex\else
5436 /CreationDate(\@pdfcreationdate)%
5437 \fi\fi
5438 \ifx\@pdfmoddate\@empty
5439 /ModDate(D:\pdfx@convDate)%
5440 \else
5441 /ModDate(\@pdfmoddate)%
5442 \fi
5443 ^^J/Producer(\pdfx@Producer)%
5444 /Trapped/False^^J%
5445 \ifnum\xmp@Part=1
5446 /GTS_PDFXVersion(PDF/X-1\ifnum\xmp@ReleaseDate>2001
5447 \xmp@Conformance\fi:\xmp@ReleaseDate)%
5448 \else
5449 /GTS_PDFXVersion(PDF/X-\xmp@Part\xmp@Conformance
5450 \ifnum\xmp@Part< 4 :\xmp@ReleaseDate\fi)%
5451 \fi
5452 \ifnum\xmp@Part < 3
5453 /GTS_PDFXConformance(PDF/X-\xmp@Part\xmp@Conformance
5454 :\xmp@ReleaseDate)%
5455 \fi
5456 \ifpdfx@vt
5457 %% support for PDF/VT extensions of PDF/X-4 and PDF/X-5
5458 /GTS_PDFVTVersion(PDF/VT-\xmp@vtPart\xmp@vtConformance)%
5459 \fi
5460 }%% end of PDF/X info
5461 \endgroup %% end of scope for \sep
5462 }%% end of \PDF@FinishDoc
5463 }% end of \AtBeginDocument
5464 %% \pdfinfo{% order of these dictionary keys should not matter
5465 %% \ifx\pdfx@Author\@empty\else /Author(\pdfx@Author)\fi
5466 %% /CreationDate(D:\pdfx@convDate)%
5467 %% /Creator(\pdfx@CreatorTool)%
5468 %% \ifnum\xmp@Part=1
5469 %% /GTS_PDFXVersion(PDF/X-1\ifnum\xmp@ReleaseDate>2001
5470 %% \xmp@Conformance\fi:\xmp@ReleaseDate)%
5471 %% \else
5472 %% /GTS_PDFXVersion(PDF/X-\xmp@Part\xmp@Conformance
5473 %% \ifnum\xmp@Part< 4 :\xmp@ReleaseDate\fi)%
5474 %% \fi
5475 %% \ifnum\xmp@Part < 3
5476 %% /GTS_PDFXConformance(PDF/X-\xmp@Part\xmp@Conformance
5477 %% :\xmp@ReleaseDate)%
5478 %% \fi
5479 %%
5480 %% \ifpdfx@vt
5481 %%% support for PDF/VT extensions of PDF/X-4 and PDF/X-5
5482 %% /GTS_PDFVTVersion(PDF/VT-\xmp@vtPart\xmp@vtConformance)%
5483 %% \fi
5484 %% \ifx\pdfx@Keywords\@empty\else /Keywords(\pdfx@Keywords)\fi
5485 %% /ModDate(D:\pdfx@convDate)%
5486 %% /Producer(\pdfx@Producer)%
5487 %% \ifx\pdfx@Subject\@empty\else /Subject(\pdfx@Subject)\fi
5488 %% \ifx\pdfx@Title\@empty\else /Title(\pdfx@Title)\fi
5489 %% /Trapped/False%
5490 %% }% end of PDF/X info
5491 %% }% end of scope for \sep
5492 \else
5493 \ifpdfx@e %% PDF/E
5494 \AtBeginDocument{%
5495 \def\PDF@FinishDoc{% ??? What uses this ???
5496 \begingroup
5497 \def\sep{; }% should not be needed, but just in case
5498 \pdfinfo{%
5499 \ifx\pdfx@pdfTitle\@empty\else /Title(\pdfx@pdfTitle)^^J\fi
5500 \ifx\pdfx@pdfAuthor\@empty\else /Author(\pdfx@pdfAuthor)^^J\fi
5501 \ifx\pdfx@pdfSubject\@empty\else /Subject(\pdfx@pdfSubject)^^J\fi
5502 \ifx\pdfx@pdfKeywords\@empty\else /Keywords(\pdfx@pdfKeywords)^^J\fi
5503 /Creator(\pdfx@CreatorTool)^^J%
5504 \ifx\@pdfcreationdate\@empty
5505 /CreationDate(D:\pdfx@convDate)%
5506 \else
5507 \ifxetex\else
5508 /CreationDate(\@pdfcreationdate)%
5509 \fi\fi
5510 \ifx\@pdfmoddate\@empty
5511 /ModDate(D:\pdfx@convDate)%
5512 \else
5513 /ModDate(\@pdfmoddate)%
5514 \fi
5515 ^^J/Producer(\pdfx@Producer)%
5516 /Trapped/False^^J%
5517 /GTS_PDFEVersion(PDF/E-1\xmp@Conformance:\xmp@ReleaseDate)%
5518 }% end of PDF/E info
5519 \endgroup %% end of scope for \sep
5520 }% end of \PDF@FinishDoc
5521 }% end of \AtBeginDocument
5522 %% {\def\sep{;}% should not be needed, but just in case
5523 %% \pdfinfo{% order of these dictionary keys should not matter
5524 %% \ifx\pdfx@Title\@empty\else /Title(\pdfx@Title)\fi
5525 %% \ifx\pdfx@Author\@empty\else /Author(\pdfx@Author)\fi
5526 %% \ifx\pdfx@Subject\@empty\else /Subject(\pdfx@Subject)\fi
5527 %% \ifx\pdfx@Keywords\@empty\else /Keywords(\pdfx@Keywords)\fi
5528 %% \ifx\pdfx@Author\@empty\else /Author(\pdfx@Author)\fi
5529 %% /CreationDate(\pdfx@convDate)%
5530 %% /Creator(\pdfx@CreatorTool)%
5531 %% /GTS_PDFEVersion(PDF/E-1\xmp@Conformance:\xmp@ReleaseDate)%
5532 %% \ifx\pdfx@Keywords\@empty\else /Keywords(\pdfx@Keywords)\fi
5533 %% /ModDate(D:\pdfx@convDate)%
5534 %% /Producer(\pdfx@Producer)%
5535 %% \ifx\pdfx@Subject\@empty\else /Subject(\pdfx@Subject)\fi
5536 %% \ifx\pdfx@Title\@empty\else /Title(\pdfx@Title)\fi
5537 %% /Trapped/False%
5538 %% }% end of PDF/E info
5539 %% }% end of scope for \sep
5540 \else %% PDF/A
5541 \def\pdfx@confA{a}%
5542 \def\pdfx@confB{b}%
5543 \def\pdfx@confU{u}%
5544 \expandafter\def\expandafter\xmp@conf\expandafter
5545 {\csname pdfx@conf\xmp@Conformance\endcsname}%
5546 \AtBeginDocument{%
5547 \def\PDF@FinishDoc{% ??? What uses this ???
5548 \begingroup
5549 \def\sep{; }% should not be needed, but just in case
5550 \pdfinfo{%
5551 \ifx\pdfx@pdfTitle\@empty\else /Title(\pdfx@pdfTitle)^^J\fi
5552 \ifx\pdfx@pdfAuthor\@empty\else /Author(\pdfx@pdfAuthor)^^J\fi
5553 \ifx\pdfx@pdfSubject\@empty\else /Subject(\pdfx@pdfSubject)^^J\fi
5554 \ifx\pdfx@pdfKeywords\@empty\else /Keywords(\pdfx@pdfKeywords)^^J\fi
5555 /Creator(\pdfx@CreatorTool)^^J%
5556 \ifx\@pdfcreationdate\@empty
5557 /CreationDate(D:\pdfx@convDate)%
5558 \else
5559 \ifxetex\else
5560 /CreationDate(\@pdfcreationdate)%
5561 \fi\fi
5562 \ifx\@pdfmoddate\@empty
5563 /ModDate(D:\pdfx@convDate)%
5564 \else
5565 /ModDate(\@pdfmoddate)%
5566 \fi
5567 ^^J/Producer(\pdfx@Producer)%
5568 /Trapped/False^^J%
5569 /GTS_PDFA1Version (PDF/A-\xmp@Part\xmp@conf:\xmp@ReleaseDate)%
5570 }% end of PDF/A info
5571 \endgroup %% end of scope for \sep
5572 }% end of \PDF@FinishDoc
5573 }% end of \AtBeginDocument
5574 \fi\fi
5575
5576 %%----------------------------------------------------------------------
5577 %% 2018-12-16: xmpincl needs the ifthen package
5578 %% it should be loaded outside the grouping, else biblatex may barf
5579 %%
5580 \RequirePackage{ifthen}
5581
5582 %% 2024-04-05: from July 2024 LaTeX will not allow packages to load
5583 %% within a grouping, so reorganise a bit.
5584 %%
5585 %% override the \ifpdf check of xmpincl package, inside the grouping
5586 %% after saving its current value:
5587 \let\pdfx@ifpdf\ifpdf
5588 \pdftrue
5589 %% now load the packages, then enter the grouping:
5590 \RequirePackage{xmpincl}
5591 %%
5592 \begingroup
5593 %%% 20240405 revert the value of \ifpdf ...
5594 \pdfx@ifpdf
5595 \else
5596 %% 20240624 ... outside the grouping
5597 \aftergroup\pdffalse
5598 \fi
5599
5600 %% combine coding from xmpincl and hyperxml to support XeTeX
5601 \def\pdfx@xmpincl@xetex#1{%
5602 \IfFileExists{#1.xmp}{%
5603 \mcs@xmpincl@patchFile{#1}%
5604 \begingroup
5605 \special{pdf:fstream @pdfx@Metadata (#1.xmpi)
5606 <<
5607 /Type /Metadata
5608 /Subtype /XML
5609 >>
5610 }%
5611 \special{pdf:put @catalog
5612 <<
5613 /Metadata @pdfx@Metadata
5614 >>
5615 }%
5616 \endgroup
5617 }{%
5618 \newcommand{\mcs@xmpincl@filename}{#1.xmp}%
5619 \PackageError{xmpincl}%
5620 {The file \mcs@xmpincl@filename\space was not found}%
5621 {The file \mcs@xmpincl@filename\space The metadata file
5622 wasn't found.\MessageBreak Oops.}%
5623 }
5624 }
5625 \ifxetex
5626 \let\includexmp\pdfx@xmpincl@xetex
5627 \fi
5628
5629 %% macro provided by Leonardo E. Segovia on 2017-05-15
5630 %% <[email protected]>
5631 \def\pdfx@xmpincl@luatex#1{%
5632 \IfFileExists{#1.xmp}{%
5633 \mcs@xmpincl@patchFile{#1}%
5634 \begingroup
5635 \pdfcompresslevel=0
5636 \immediate\pdfobj uncompressed stream attr {/Type /Metadata /Subtype /XML}
5637 file{#1.xmpi}%
5638 \pdfcatalog{%\pdfx@LanguageSpec
5639 /Metadata \the\pdflastobj\space 0 R}%
5640 \endgroup
5641 }{%
5642 \newcommand{\mcs@xmpincl@filename}{#1.xmp}%
5643 \PackageError{xmpincl}%
5644 {The file \mcs@xmpincl@filename\space was not found}%
5645 {The file \mcs@xmpincl@filename\space The metadata file
5646 wasn't found.\MessageBreak Oops.}%
5647 }
5648 }
5649 \ifluatex
5650 \let\includexmp\pdfx@xmpincl@luatex
5651 \fi
5652
5653 %%----------------------------------------------------------------------
5654 \begingroup
5655 %% 20210706 we need a pointer to unexpandable \par
5656 \expandafter\ifx\csname tex_par:D\endcsname \relax
5657 \let\pdfx@par\par
5658 \else
5659 %% using LaTeX 2021-06 or later
5660 \expandafter\let\expandafter\pdfx@par\csname tex_par:D\endcsname
5661 \fi
5662 \ifpdfx@x
5663 \ifpdfx@vt
5664 \def\xmp@template{pdfvt}%
5665 \else
5666 \def\xmp@template{pdfx}% formerly pdfx-1a
5667 \fi
5668 \else
5669 \ifpdfx@e
5670 \def\xmp@template{pdfe}%
5671 \else
5672 \def\xmp@template{pdfa}%
5673 \fi\fi
5674 \catcode`\'=12 \catcode`\<=12 \catcode`\>=12 \catcode`\?=12
5675 \catcode`\"=12 \catcode`\= 12 %% used within the template file
5676 %% patch commands from xmpincl.sty ...
5677 \def\pdfx@xmpinclStart{% supply byte-order marker
5678 <?xpacket begin='^^ef^^bb^^be' id='W5M0MpCehiHzreSzNTczkc9d' ?> %
5679 }%
5680 \def\pdfx@xmpinclStartAlt{% no byte-order marker
5681 <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d' ?> %
5682 }%
5683 \def\pdfx@xmpinclEnd{% allow XMP packet to be writable
5684 <?xpacket end='w'?> %
5685 }%
5686 \let\mcs@xmpinclStart\pdfx@xmpinclStart
5687 \let\mcs@xmpinclStartAlt\pdfx@xmpinclStartAlt
5688 \ifpdfx@noBOM % don't use the byte-order marker
5689 \let\mcs@xmpinclStart\pdfx@xmpinclStartAlt
5690 \fi
5691 \let\mcs@xmpinclEnd\pdfx@xmpinclEnd
5692 %% ... preventing their redefinition
5693 \def\newcommand#1#2{}%
5694 %%
5695 %% \def\pdfx@endeval{%
5696 %% \noexpand \TE@setvaltrue \noexpand \else
5697 %% \noexpand \TE@setvalfalse \noexpand \fi
5698 %% \noexpand \TE@negatefalse \noexpand \fi}%
5699 %% \let\TE@endeval\pdfx@endeval
5700 \ifluatex\else\ifxetex\else
5701 \inputencoding{8bit}%
5702 \fi\fi
5703 \makeatletter
5704 \def\cf@encoding{L8U}\fontencoding{L8U}%
5705 \providecommand{\ifnot@empty}[2]{\ifx#1\@empty\relax\else#2\fi}%
5706 \pdfx@xmpmarkup
5707 \expandafter\global\expandafter
5708 \let\csname L8U-cmd\expandafter\endcsname\csname U-cmd\endcsname
5709 \def\cf@encoding{L8U}\fontencoding{L8U}%
5710 \providecommand{\ifnot@empty}[2]{\ifx#1\@empty\relax\else#2\fi}%
5711 \obeyspaces%
5712 %% beware 128 space characters -- for padding end of XMP packet
5713 \gdef\paddingline{ }%
5714 \typeout{Using XMP template file: \[email protected]}%
5715 %% 20210706 ensure \par is unexpandable
5716 \let\par\pdfx@par
5717 \includexmp{\xmp@template}%
5718 \endgroup
5719 %%%
5720 %%
5721 %% revert active characters to previous encoding
5722 %%
5723 \ifpdf@activechars
5724 \global\let ^^c0\pdfx@save@co
5725 \global\let ^^c1\pdfx@save@ci
5726 \global\let ^^c2\pdfx@save@cii
5727 \global\let ^^c3\pdfx@save@ciii
5728 \global\let ^^c4\pdfx@save@civ
5729 \global\let ^^c5\pdfx@save@cv
5730 \global\let ^^c6\pdfx@save@cvi
5731 \global\let ^^c7\pdfx@save@cvii
5732 \global\let ^^c8\pdfx@save@cviii
5733 \global\let ^^c9\pdfx@save@cix
5734 \global\let ^^ca\pdfx@save@ca
5735 \global\let ^^cb\pdfx@save@cb
5736 \global\let ^^cc\pdfx@save@cc
5737 \global\let ^^cd\pdfx@save@cd
5738 \global\let ^^ce\pdfx@save@ce
5739 \global\let ^^cf\pdfx@save@cf
5740 \global\let ^^d0\pdfx@save@do
5741 \global\let ^^d1\pdfx@save@di
5742 \global\let ^^d2\pdfx@save@dii
5743 \global\let ^^d3\pdfx@save@diii
5744 \global\let ^^d4\pdfx@save@div
5745 \global\let ^^d5\pdfx@save@dv
5746 \global\let ^^d6\pdfx@save@dvi
5747 \global\let ^^d7\pdfx@save@dvii
5748 \global\let ^^d8\pdfx@save@dviii
5749 \global\let ^^d9\pdfx@save@dix
5750 \global\let ^^da\pdfx@save@da
5751 \global\let ^^db\pdfx@save@db
5752 \global\let ^^dc\pdfx@save@dc
5753 \global\let ^^dd\pdfx@save@dd
5754 \global\let ^^de\pdfx@save@de
5755 \global\let ^^df\pdfx@save@df
5756 \global\let ^^e0\pdfx@save@eo
5757 \global\let ^^e1\pdfx@save@ei
5758 \global\let ^^e2\pdfx@save@eii
5759 \global\let ^^e3\pdfx@save@eiii
5760 \global\let ^^e4\pdfx@save@eiv
5761 \global\let ^^e5\pdfx@save@ev
5762 \global\let ^^e6\pdfx@save@evi
5763 \global\let ^^e7\pdfx@save@evii
5764 \global\let ^^e8\pdfx@save@eviii
5765 \global\let ^^e9\pdfx@save@eix
5766 \global\let ^^ea\pdfx@save@ea
5767 \global\let ^^eb\pdfx@save@eb
5768 \global\let ^^ec\pdfx@save@ec
5769 \global\let ^^ed\pdfx@save@ed
5770 \global\let ^^ee\pdfx@save@ee
5771 \global\let ^^ef\pdfx@save@ef
5772 \global\let ^^f0\pdfx@save@fo
5773 \global\let ^^f1\pdfx@save@fi
5774 \global\let ^^f2\pdfx@save@fii
5775 \global\let ^^f3\pdfx@save@fiii
5776 \fi
5777
5778 \endgroup
5779
5780 %%
5781 %% controls the color model and conversions with xcolor package
5782 %%
5783 \def\pdfx@selectcolormodel@doing #1{%% Warning
5784 \PackageWarning{pdfx}{Setting all color commands to #1,^^J%
5785 consistent with the Color Model for PDF/%
5786 \ifpdfx@x X \else \ifpdfx@e E \else A \fi\fi}%
5787 }%% 20240528 inhibit any changes
5788 \def\pdfx@selectcolormodel@done #1{%% Warning
5789 \PackageWarning{pdfx}{Color Model already set for PDF/%
5790 \ifpdfx@x X\else \ifpdfx@e E\else A\fi\fi,^^Jcannot change to #1 }%
5791 }%% 20240528 inhibit any changes
5792 %%
5793 \ifpdfx@cmyk
5794 %
5795 % this will have been done already for PDF/X
5796 %
5797 \PassOptionsToPackage{cmyk,hyperref}{xcolor}
5798 \def\pdfx@handlexcolor{\def\@@mod{cmyk}%
5799 \pdfx@selectcolormodel@doing{cmyk}%
5800 \selectcolormodel{cmyk}%
5801 \convertcolorsUtrue\convertcolorsDtrue
5802 \let\selectcolormodel\pdfx@selectcolormodel@done
5803 }
5804 \ifpdfx@x
5805 \else
5806 %% \AtBeginDocument{%
5807 %% \def\@linkcolor{0 1 1 0}%
5808 %% \def\@anchorcolor{0 0 0 1}%
5809 %% \def\@citecolor{1 0 1 0}%
5810 %% \def\@filecolor{.5 0 0 .5}%
5811 %% \def\@urlcolor{0 1 0 0}%
5812 %% \def\@menucolor{0 1 1 0}%
5813 %% \def\@runcolor{.5 0 0 .5}%
5814 %% \def\@linkbordercolor{0 1 1 0}%
5815 %% \def\@citebordercolor{1 0 1 0}%
5816 %% \def\@filebordercolor{.5 0 0 .5}%
5817 %% \def\@urlbordercolor{1 0 0 0}%
5818 %% \def\@menubordercolor{0 1 1 0}%
5819 %% \def\@runbordercolor{.7 0 0 .3}%
5820 %% \def\Fld@bcolor{0 0 0 0}%
5821 %% \def\Fld@bordercolor{0 1 1 0}%
5822 %% }
5823 \fi
5824 \else
5825 \PassOptionsToPackage{rgb,hyperref}{xcolor}
5826 \def\pdfx@handlexcolor{\def\@@mod{rgb}%
5827 \pdfx@selectcolormodel@doing{rgb}%
5828 \selectcolormodel{rgb}%
5829 \convertcolorsUtrue\convertcolorsDtrue
5830 \let\selectcolormodel\pdfx@selectcolormodel@done
5831 }
5832 \fi
5833 \@ifpackageloaded{xcolor}{\pdfx@handlexcolor
5834 \ifpdfx@cmyk\else\color{black}\fi}{%
5835 \AtBeginDocument{\@ifpackageloaded{xcolor}{\pdfx@handlexcolor}{}}
5836 }
5837
5838 %%----------------------------------------------------------------------
5839 %% Disable some actions in Beamer navigation
5840 \@ifclassloaded{beamer}{%
5841 \let\real@insertslidenavigationsymbol
5842 \insertslidenavigationsymbol
5843 \let\real@insertbackfindforwardnavigationsymbol
5844 \insertbackfindforwardnavigationsymbol
5845 \def\pdfx@insertslidenavigationsymbol{{%
5846 \let\Acrobatmenu\pdfx@Acrobatmenu@noaction
5847 \real@insertslidenavigationsymbol
5848 }}%
5849 \def\pdfx@insertbackfindforwardnavigationsymbol{{%
5850 \let\Acrobatmenu\pdfx@Acrobatmenu@noaction
5851 \real@insertbackfindforwardnavigationsymbol
5852 }}%
5853 \AtBeginDocument{%
5854 \ifHy@pdfa
5855 \let\insertslidenavigationsymbol
5856 \pdfx@insertslidenavigationsymbol
5857 \let\insertbackfindforwardnavigationsymbol
5858 \pdfx@insertbackfindforwardnavigationsymbol
5859 \fi}%
5860 }{}
5861
5862 %%----------------------------------------------------------------------
5863 \ifpdfx@transliterated
5864 %% support for bookmarks with transliterated input
5865 \ifxetex\let\pdf@escapehex\empty\fi % don't need it
5866 \expandafter\ifx\csname pdf@escapehex\endcsname\relax
5867 \PackageWarning{pdfx}{%
5868 Missing an implementation of \string\pdf@escapehex ^^J
5869 Translated Bookmarks cannot be generated.^^J}%
5870 \newcommand{\pdfxBookmark}[4][]{#2[#1]{#4}}%
5871 \else
5872 \def\pdfx@GeneratePdfString#1#2{%
5873 % converts a UTF-8 string to UTF-16be
5874 \StringEncodingConvert{#1}{#2}{utf8}{utf16be}%
5875 \edef#1{\string\376\string\377\pdfescapestring{#1}}%
5876 }
5877 \newtoks\pdfx@DisabledCommands
5878 \def\pdfxDisableCommands#1{%
5879 \expandafter\pdfx@DisabledCommands
5880 \expandafter{\the\pdfx@DisabledCommands#1}}
5881 \pdfxDisableCommands{%
5882 \def\80{}% else \000\( --> \000\80\050 \000\000\050
5883 \aftergroup\let\aftergroup\HyPsd@ConvertToUnicode\aftergroup\@gobble}
5884 \let\Hy@@writetorep\@@writetorep
5885 \def\pdfx@@writetorep#1#2#3#4#5{%
5886 \begingroup
5887 \pdfx@xmpunimarkup
5888 \pdfx@prebookmark
5889 \edef\pdfstringdefPreHook{%\pdfstringdefPreHook
5890 \the\pdfx@DisabledCommands}%
5891 \Hy@@writetorep{#1}{#2}{#3}{#4}{#5}%
5892 \endgroup
5893 }
5894 \newcommand{\pdfxBookmark}[4][]{%
5895 \ifx\relax#3\relax
5896 \PackageError{pdfx}{Unknown macro \string#3.
5897 A proper bookmark cannot be created}%
5898 {Proceed to process the \string#1 as usual.}%
5899 #2{#4}%
5900 \else
5901 \ifluatex % use the utf8 directly
5902 \let\pdfx@temp#3\relax
5903 \def\pdfx@prebookmark{%
5904 \pdfx@DisabledCommands{}%
5905 \let#3\pdfx@temp
5906 }%
5907 \else\ifxetex % use the utf8 directly
5908 \let\pdfx@temp#3\relax
5909 \def\pdfx@prebookmark{%
5910 \pdfx@DisabledCommands{}%
5911 \let#3\pdfx@temp
5912 }%
5913 \else
5914 % convert the utf8 to utf16be
5915 \pdfxBookmarkString\pdfx@temp{#3}%
5916 \fi\fi
5917 \let\@@writetorep\pdfx@@writetorep
5918 \ifx\empty#1\empty
5919 \def#3{#4}%
5920 #2{#3}%
5921 \else
5922 \def#3{#1}%
5923 #2[#3]{#4}%
5924 \fi
5925 \let\@@writetorep\Hy@@writetorep
5926 \fi
5927 \ignorespaces
5928 }
5929 %% use as: \pdfxBookmark{\section}{\sectAtitle}{...}
5930 %% use as: \pdfxBookmark[<opt-title>]{\section}{\sectAtitle}{...}
5931 %% only needed by pdfTeX --- Lua-/XeTeX use the utf8 directly
5932 \def\pdfxBookmarkString#1#2{%
5933 \pdfx@GeneratePdfString#1{#2}%
5934 \def\pdfx@prebookmark{%
5935 \pdfxDisableCommands{\let#2#1}%
5936 }%
5937 }
5938 %% use as: \pdfxBookmarkString\PdfSectA\sectAtitle
5939 %% where \sectAtitle has been defined by e.g.
5940 %% \pdfxEnableCommands{\xdef\sectAtitle{\textLGR{...}}}
5941
5942 \fi % end of \ifx\pdf@escapehex\relax
5943 \fi % end of \ifpdfx@transliterated
5944
5945 %%----------------------------------------------------------------------
5946
5947 %% disable hyperref options,
5948 %% to prevent changes that will cause an incompatibility
5949 \Hy@DisableOption{pdfauthor}%
5950 \Hy@DisableOption{pdftitle}%
5951 \Hy@DisableOption{pdfsubject}%
5952 \Hy@DisableOption{pdfcreator}%
5953 \Hy@DisableOption{pdfcreationdate}%
5954 \Hy@DisableOption{pdfmoddate}%
5955 \Hy@DisableOption{pdfproducer}%
5956 \Hy@DisableOption{pdfkeywords}%
5957 %% once set correctly, don't let this change
5958 \Hy@DisableOption{pdfa}\let\Hy@pdfafalse\relax\let\Hy@pdfatrue\relax
5959 \endinput
5960 %%
5961 %% End of file `pdfx.sty'.
5962 % \end{macrocode}
5963 % \iffalse
5964 %</package>
5965 % \fi
5966 % \Finale
5967 % \PrintIndex
5968 % \let\realGlossaryParms\GlossaryParms \let\realsubitem\subitem
5969 % \long\def\GlossaryParms{\realGlossaryParms \def\hdpindex ##1##2{}%
5970 % \long\def\subitem ##1:\ ##2\pfill{\par\hangindent 30pt\hspace*{15pt}##2\hfil}}%
5971 % \PrintChanges
5972 % \endinput