1

I want to create a pdf according to the PDF/A-1b standard with xelatex and pdfx but I get an error message now when I add my metadata.

Using XMP template file: pdfa.xmp
! Argument of " has an extra }.
<inserted text> 
                \par 
l.769  \includexmp{\xmp@template}

!  ==> Fatal error occurred, no output PDF file produced!

This is a minimal example:

\documentclass[twoside,a4paper,DIV15,parskip=off,9pt]{scrbook}
\usepackage[T1]{fontenc} % is oriented to output, that is, what fonts to use for printing characters (first load fontenc)
\usepackage[utf8]{inputenc} % allows the user to input accented characters directly from the keyboard
\usepackage{libertine} % libertine font as pbk (=Garamond font, ugm) substitution
\renewcommand{\familydefault}{pbk} % to change the headers and body texts
\usepackage[sc]{mathpazo} % palatino font as pbk (=Optima font, pbk) substitution

% ------
% Clickable URLs
\usepackage[
linktocpage=false,      % no page numbers are clickable
colorlinks=false,       % no color
breaklinks=true,        % break URLs
bookmarks,              % creates bookmarks in pdf
hyperfootnotes=true,    % clickable footnotes
pdfborder={0 0 0},      % for removing borders around links
bookmarksnumbered=true, % If Acrobat bookmarks are requested, include section numbers.
bookmarksopen=false,    % If Acrobat bookmarks are requested, show them with all the subtrees expanded.
%hidelinks=true,
%linkcolor=blue,
%citecolor=blue,
%urlcolor=blue
pdfpagemode={UseOutlines}, % show pdf bookmarks (indices) on startup; does not function all the time
pdftitle={Stammbaum der Familie Neumann}, % title
pdfauthor={Sebastian Neumann}, % author
pdfkeywords={Genealogy, Family tree, Neumann}, % subject of the document
pdfsubject={Stammbaum, Neumann, Genealogie}, % list of keywords
pdfmenubar=true,        % make PDF viewer’s menu bar visible
pdfpagelabels]
{hyperref}
%\usepackage{url} % Urls become clickable
\urlstyle{same} % Font style same as text style
%\urlstyle{rm}

%-------
% Optimization for PDF/A-1b Standard
\usepackage{xmpincl} % to read in xmpdata
\usepackage[a-1b]{pdfx}
\includexmp{/path/to/foo.xmpdata}

\begin{document}
foobar
\end{document}

My xmpdata looks like this. I have create it according to the pdfx manual here, page 3-4:

\Title{title}
\Author{me}
\Keywords{keyword1\sep keyword2\sep keyword3}
\Subject{bla\sep bla\sep bla}
\Publisher{}
\Copyright{a copyright statement}
\CopyrightURL{test}
\Copyrighted{True}
\PublicationType{book}
\Volume{1}

What do I do wrong?

Edit:

I changed the code below the hyperref. This is now my minimal example:

\documentclass[twoside,a4paper,DIV15,parskip=off,9pt]{scrbook}
\usepackage[T1]{fontenc} % is oriented to output, that is, what fonts to use for printing characters (first load fontenc)
\usepackage[utf8]{inputenc} % allows the user to input accented characters directly from the keyboard
\usepackage{libertine} % libertine font as pbk (=Garamond font, ugm) substitution
\renewcommand{\familydefault}{pbk} % to change the headers and body texts
\usepackage[sc]{mathpazo} % palatino font as pbk (=Optima font, pbk) substitution

% ------
% Clickable URLs
\usepackage[
linktocpage=false,      % no page numbers are clickable
colorlinks=false,       % no color
breaklinks=true,        % break URLs
bookmarks,              % creates bookmarks in pdf
hyperfootnotes=true,    % clickable footnotes
pdfborder={0 0 0},      % for removing borders around links
bookmarksnumbered=true, % If Acrobat bookmarks are requested, include section numbers.
bookmarksopen=false,    % If Acrobat bookmarks are requested, show them with all the subtrees expanded.
%hidelinks=true,
%linkcolor=blue,
%citecolor=blue,
%urlcolor=blue
pdfpagemode={UseOutlines}, % show pdf bookmarks (indices) on startup; does not function all the time
pdftitle={Stammbaum der Familie Neumann}, % title
pdfauthor={Sebastian Neumann}, % author
pdfkeywords={Genealogy, Family tree, Neumann}, % subject of the document
pdfsubject={Stammbaum, Neumann, Genealogie}, % list of keywords
pdfmenubar=true,        % make PDF viewer’s menu bar visible
pdfpagelabels]
{hyperref}
%\usepackage{url} % Urls become clickable
\urlstyle{same} % Font style same as text style
%\urlstyle{rm}

%-------
% Optimization for PDF/A-1b Standard
\usepackage[a-1b]{pdfx}

\usepackage{filecontents}
\begin{filecontents}{\jobname.xmpdata}
\Title{title}
\Author{me}
\Keywords{keyword1\sep keyword2\sep keyword3}
\Subject{bla\sep bla\sep bla}
\Publisher{test}
\Copyright{a copyright statement}
\CopyrightURL{test}
\Copyrighted{True}
\PublicationType{book}
\Volume{1}
\end{filecontents}

Everything is now in one file.

Edit:

This is my output.

 *File List*
 scrbook.cls    2015/10/03 v3.19a KOMA-Script document class (book)
scrkbase.sty    2015/10/03 v3.19a KOMA-Script package (KOMA-Script-dependent ba
sics and keyval usage)
 scrbase.sty    2015/10/03 v3.19a KOMA-Script package (KOMA-Script-independent 
basics and keyval usage)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
scrlfile.sty    2015/10/03 v3.19a KOMA-Script package (loading files)
tocbasic.sty    2015/10/03 v3.19a KOMA-Script package (handling toc-files)
   size9.clo    1999/11/11 v1.4a NON-Standard LaTeX file (size option)
typearea.sty    2015/10/03 v3.19a KOMA-Script package (type area)
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
inputenc.sty    2015/03/17 v1.2c Input encoding file
    utf8.def    2015/09/07 v1.1p UTF-8 support for inputenc
   t1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
  ot1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
  omsenc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
libertine.sty    2014/11/25 (Bob Tennent) Supports Libertine and Biolinum fonts
 for all LaTeX engines.
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
 xkeyval.sty    2014/12/03 v2.7a package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
textcomp.sty    2005/09/27 v1.99g Standard LaTeX package
  ts1enc.def    2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
  ts1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
mweights.sty    2013/07/21 (Bob Tennent) Support package for multiple-weight fo
nt packages. 
 fontenc.sty
fontaxes.sty    2014/03/23 v1.0d Font selection axes
LinLibertine_I.tex
mathpazo.sty    2005/04/12 PSNFSS-v9.2a Palatino w/ Pazo Math (D.Puga, WaS) 
hyperref.sty    2012/11/06 v6.83m Hypertext links for LaTeX
hobsub-hyperref.sty    2012/05/28 v1.13 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty    2012/05/28 v1.13 Bundle oberdiek, subset generic (HO)
  hobsub.sty    2012/05/28 v1.13 Construct package bundles (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
  ifvtex.sty    2010/03/01 v1.5 Detect VTeX and its facilities (HO)
 intcalc.sty    2007/09/27 v1.1 Expandable calculations with integers (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty    2011/11/25 v1.13 Implements pdfTeX's escape features (HO)
bigintcalc.sty    2012/04/08 v1.3 Expandable calculations on big integers (HO)
  bitset.sty    2011/01/30 v1.1 Handle bit-vector datatype (HO)
uniquecounter.sty    2011/01/30 v1.2 Provide unlimited unique counter (HO)
letltxmacro.sty    2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
 hopatch.sty    2012/05/28 v1.2 Wrapper for package hooks (HO)
xcolor-patch.sty    2011/01/30 xcolor patch
atveryend.sty    2011/06/30 v1.8 Hooks at the very end of document (HO)
atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)
refcount.sty    2011/10/16 v3.4 Data extraction from label references (HO)
 hycolor.sty    2011/01/30 v1.7 Color options for hyperref/bookmark (HO)
 auxhook.sty    2011/03/04 v1.3 Hooks for auxiliary files (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
  pd1enc.def    2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
 hpdftex.def    2012/11/06 v6.83m Hyperref driver for pdfTeX
rerunfilecheck.sty    2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
    pdfx.sty    2015/02/17 v1.5.3 PDF/X and PDF/A support (CVR/HTH/RRM/PS)
   puenc.def    2012/11/06 v6.83m Hyperref: PDF Unicode definition (HO)
    8bit.def    2008/03/30 v1.1d Input encoding file
    8bit.def    2008/03/30 v1.1d Input encoding file
    utf8.def    2015/09/07 v1.1p UTF-8 support for inputenc
   t1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
  ot1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
  omsenc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
  ts1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
    utf8.def    2015/09/07 v1.1p UTF-8 support for inputenc
   t1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
  ot1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
  omsenc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
  ts1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
 xmpincl.sty    2008/05/10 v2.2 Include XMP data in pdflatex
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
    8bit.def    2008/03/30 v1.1d Input encoding file
filecontents.sty    2011/10/08 v1.3 Create an external file from within a LaTeX
 document
  ts1cmr.fd    2014/09/29 v2.5h Standard LaTeX font definitions
   t1pbk.fd    2001/06/04 font definitions for T1/pbk.
 nameref.sty    2012/10/27 v2.43 Cross-referencing by name of section
gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)

Edit3:

Oh, I do now realise that I started with pdflatex, but later migrated the project to xelatex!

4
  • 1
    This is older: pdfx.sty 2015/02/17 v1.5.3 PDF/X and PDF/A support (CVR/HTH/RRM/PS) I have 1.5.6 of this month and year. Can you try updating the package? – jon Feb 11 '16 at 21:30
  • I just updated pdfx to the same version. I get the same error. Is it possible that pdfx does not work well with xetex? – Til Hund Feb 11 '16 at 22:49
  • Absolutely! I apologize for not noticing that from the title of your question. However, if you are using XeTeX, then you should not be using inputenc or fontenc, but fontspec (which is why, I suppose, I assumed you were using pdfTeX). Of course, if I try to compile with xelatex, I get many, many errors beyond the one you name. Anyway, the documentation explicitly says that it works with pdfTeX and LuaTeX – jon Feb 12 '16 at 2:28
  • I have to apologize, jon, I have not realised myself that I was migrating from pdfTeX to xelatex. I am going to further migrate to LuaTeX, I guess. Thanks again for your guidance! – Til Hund Feb 12 '16 at 14:07
3

You are mixing xmpincl and pdfx expectations about how the XMP file will be found and created. The command \includexmp is from xmpincl, and pdfx wants nothing to do with it. pdfx provides a simplified interface, but it has strict requirements:

  1. Your .xmpdata file must have the same name as the main .tex file (if using the filecontents package, then use \jobname.xmpdata as the file name);

  2. You don't actually load the .xmpdata file, which means it must be in the same directory as the main .tex file; and

  3. You do not need to load xmpincl explicitly, and gain nothing from doing so.

If I comply with these pointers, your example file works for me.

Edit OK, so the above file may not be quite minimal, but it still works for me. For convenience, I'm posting below the exact file I used, which includes the \listfiles command so that we can compare file versions. From the error message you provide, I think you may have an outdated version of the file (version 1.3, perhaps?)

\listfiles
\documentclass[twoside,a4paper,DIV15,parskip=off,9pt]{scrbook}
\usepackage[T1]{fontenc} % is oriented to output, that is, what fonts to use for printing characters (first load fontenc)
\usepackage[utf8]{inputenc} % allows the user to input accented characters directly from the keyboard
\usepackage{libertine} % libertine font as pbk (=Garamond font, ugm) substitution
\renewcommand{\familydefault}{pbk} % to change the headers and body texts
\usepackage[sc]{mathpazo} % palatino font as pbk (=Optima font, pbk) substitution

% ------
% Clickable URLs
\usepackage[
linktocpage=false,      % no page numbers are clickable
colorlinks=false,       % no color
breaklinks=true,        % break URLs
bookmarks,              % creates bookmarks in pdf
hyperfootnotes=true,    % clickable footnotes
pdfborder={0 0 0},      % for removing borders around links
bookmarksnumbered=true, % If Acrobat bookmarks are requested, include section numbers.
bookmarksopen=false,    % If Acrobat bookmarks are requested, show them with all the subtrees expanded.
%hidelinks=true,
%linkcolor=blue,
%citecolor=blue,
%urlcolor=blue
pdfpagemode={UseOutlines}, % show pdf bookmarks (indices) on startup; does not function all the time
pdftitle={Stammbaum der Familie Neumann}, % title
pdfauthor={Sebastian Neumann}, % author
pdfkeywords={Genealogy, Family tree, Neumann}, % subject of the document
pdfsubject={Stammbaum, Neumann, Genealogie}, % list of keywords
pdfmenubar=true,        % make PDF viewer’s menu bar visible
pdfpagelabels]
{hyperref}
%\usepackage{url} % Urls become clickable
\urlstyle{same} % Font style same as text style
%\urlstyle{rm}

%-------
% Optimization for PDF/A-1b Standard
\usepackage[a-1b]{pdfx}

\usepackage{filecontents}% NOTE: I'd still put this before `pdfx` as advised....
\begin{filecontents}{\jobname.xmpdata}
\Title{title}
\Author{me}
\Keywords{keyword1\sep keyword2\sep keyword3}
\Subject{bla\sep bla\sep bla}
\Publisher{test}
\Copyright{a copyright statement}
\CopyrightURL{test}
\Copyrighted{True}
\PublicationType{book}
\Volume{1}
\end{filecontents}

\begin{document}
foobar
\end{document}

Running pdflatex on the file gives me this list of files (incidentally, this is another reason for an MWE: reduce extraneous bloat in questions and answers):

 *File List*
 scrbook.cls    2015/10/03 v3.19a KOMA-Script document class (book)
scrkbase.sty    2015/10/03 v3.19a KOMA-Script package (KOMA-Script-dependent ba
sics and keyval usage)
 scrbase.sty    2015/10/03 v3.19a KOMA-Script package (KOMA-Script-independent 
basics and keyval usage)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
scrlfile.sty    2015/10/03 v3.19a KOMA-Script package (loading files)
tocbasic.sty    2015/10/03 v3.19a KOMA-Script package (handling toc-files)
   size9.clo    1999/11/11 v1.4a NON-Standard LaTeX file (size option)
typearea.sty    2015/10/03 v3.19a KOMA-Script package (type area)
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
inputenc.sty    2015/03/17 v1.2c Input encoding file
    utf8.def    2015/12/03 v1.1r UTF-8 support for inputenc
   t1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ot1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  omsenc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
libertine.sty    2014/11/25 (Bob Tennent) Supports Libertine and Biolinum fonts
 for all LaTeX engines.
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
 xkeyval.sty    2014/12/03 v2.7a package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
textcomp.sty    2005/09/27 v1.99g Standard LaTeX package
  ts1enc.def    2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
  ts1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
mweights.sty    2013/07/21 (Bob Tennent) Support package for multiple-weight fo
nt packages. 
 fontenc.sty
fontaxes.sty    2014/03/23 v1.0d Font selection axes
LinLibertine_I.tex
mathpazo.sty    2005/04/12 PSNFSS-v9.2a Palatino w/ Pazo Math (D.Puga, WaS) 
hyperref.sty    2012/11/06 v6.83m Hypertext links for LaTeX
hobsub-hyperref.sty    2012/05/28 v1.13 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty    2012/05/28 v1.13 Bundle oberdiek, subset generic (HO)
  hobsub.sty    2012/05/28 v1.13 Construct package bundles (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
  ifvtex.sty    2010/03/01 v1.5 Detect VTeX and its facilities (HO)
 intcalc.sty    2007/09/27 v1.1 Expandable calculations with integers (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty    2011/11/25 v1.13 Implements pdfTeX's escape features (HO)
bigintcalc.sty    2012/04/08 v1.3 Expandable calculations on big integers (HO)
  bitset.sty    2011/01/30 v1.1 Handle bit-vector datatype (HO)
uniquecounter.sty    2011/01/30 v1.2 Provide unlimited unique counter (HO)
letltxmacro.sty    2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
 hopatch.sty    2012/05/28 v1.2 Wrapper for package hooks (HO)
xcolor-patch.sty    2011/01/30 xcolor patch
atveryend.sty    2011/06/30 v1.8 Hooks at the very end of document (HO)
atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)
refcount.sty    2011/10/16 v3.4 Data extraction from label references (HO)
 hycolor.sty    2011/01/30 v1.7 Color options for hyperref/bookmark (HO)
 auxhook.sty    2011/03/04 v1.3 Hooks for auxiliary files (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
  pd1enc.def    2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
 hpdftex.def    2012/11/06 v6.83m Hyperref driver for pdfTeX
rerunfilecheck.sty    2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
    pdfx.sty    2016/02/04 v1.5.6 PDF/X and PDF/A support (CVR/HTH/RRM/PS)
   puenc.def    2012/11/06 v6.83m Hyperref: PDF Unicode definition (HO)
stringenc.sty    2011/12/02 v1.10 Convert strings between diff. encodings (HO)
  l8uenc.def
se-pdfdoc.def    2011/12/02 v1.10 stringenc: PDFDocEncoding
    8bit.def    2008/03/30 v1.1d Input encoding file
tx-pdfx-xmpmetadata.xmpdata
    8bit.def    2008/03/30 v1.1d Input encoding file
    utf8.def    2015/12/03 v1.1r UTF-8 support for inputenc
   t1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ot1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  omsenc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ts1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
    utf8.def    2015/12/03 v1.1r UTF-8 support for inputenc
   t1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ot1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  omsenc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ts1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
    utf8.def    2015/12/03 v1.1r UTF-8 support for inputenc
   t1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ot1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  omsenc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ts1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
    utf8.def    2015/12/03 v1.1r UTF-8 support for inputenc
   t1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ot1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  omsenc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ts1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
    utf8.def    2015/12/03 v1.1r UTF-8 support for inputenc
   t1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ot1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  omsenc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ts1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
    utf8.def    2015/12/03 v1.1r UTF-8 support for inputenc
   t1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ot1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  omsenc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ts1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
 xmpincl.sty    2008/05/10 v2.2 Include XMP data in pdflatex
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
    8bit.def    2008/03/30 v1.1d Input encoding file
filecontents.sty    2011/10/08 v1.3 Create an external file from within a LaTeX
 document
  ts1cmr.fd    2014/09/29 v2.5h Standard LaTeX font definitions
   t1pbk.fd    2001/06/04 font definitions for T1/pbk.
 nameref.sty    2012/10/27 v2.43 Cross-referencing by name of section
gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)
tx-pdfx-xmpmetadata.out
tx-pdfx-xmpmetadata.out
 ***********

So, my pdfx is version 1.5.6 from 2016. The previous version on CTAN looks like it was 1.3 from 2008.

9
  • Thank you very much, jon, for your reply. I tried to fix the issue as you told me, s. new minimal example above. I still get an error I do not understand: Argument of " has an extra }. and leading text: \includexmp{\xmp@template}, Syntax Error: Couldn't find trailer dictionary and Syntax Error: Couldn't read xref table. Do I still miss something obvious here? – Til Hund Feb 11 '16 at 17:40
  • 1
    @TilHund -- Hmm, OK. let me look into this. Note that the normal advice is (if using filecontents package) to write/create \jobname.xmpdata before loading pdfx (I have not tried to learn why that is the advice). – jon Feb 11 '16 at 18:28
  • Thanks, Jon, for looking into this. I just pasted my list output above. Looks pretty much the same to me. I am on Archlinux, where I get the latest texlive versions often in a timely manner, too. I think I have to check my python code which generates part of the above latex code. – Til Hund Feb 11 '16 at 21:24
  • 1
    @TilHund -- Is LuaTeX not an option? I use it and pdfTeX exclusively (though I do use XeTeX when answering questions here and to toy with things), and have never felt the lack. – jon Feb 12 '16 at 15:25
  • 1
    @TilHund -- In my experience, you'll hardly notice a difference (other than compilation speed). There are a few XeTeX-only packages, but far more LuaTeX-only ones (I think). – jon Feb 12 '16 at 15:36
1

There are 2 reasons for using filecontents or filecontents* before the \usepackage[..options..]{pdfx}.

  1. pdfx.sty processes the metadata as part of loading the package. Thus you want \jobname.xmpdata to be available on disk when pdfx.sty is being loaded, so its information can be read and interpreted at that time. If the .xmpdata file has not been written at that time, you will need to run LaTeX again to get that information, which in itself is no problem as you'll normally be running LaTeX many times before your job is complete. However, any change to the metadata in that filecontents environment will then take 2 runs of LaTeX before it appears within the PDF. So doing the filecontents first can reduce the overall amount of work required.

  2. The meaning of bytes within the filecontents* environment, hence affect just what gets written to disk as \jobname.xmpdata. Packages such as inputenc can make certain bytes active, so be written out as the expansions of macros rather than as the raw bytes themselves. This can completely screw-up the processing in pdfx.sty to generate UTF-8 from information supplied using other encodings. The advice is to put \begin{filecontents*}{\jobname.xmpdata} before the \documentclass line, which may cause various packages to be loaded, so that nothing else in LaTeX can affect what goes into the .xmpdata file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.