使用 xelatex 和 pdfx 添加 xmp 元数据时出错

使用 xelatex 和 pdfx 添加 xmp 元数据时出错

我想根据 PDF/A-1b 标准创建一个 pdf,xelatex但是pdfx当我添加元数据时,我收到一条错误消息。

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!

这是一个最小的例子:

\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}

我的 xmpdata 看起来像这样。我根据 pdfx 手册创建了它这里,第 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}

我做错了什么?

编辑:

我更改了下面的代码hyperref。这是我的最小示例:

\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}

现在所有内容都在一个文件中。

编辑

这是我的输出。

 *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)

编辑3:

哦,我现在意识到我开始时是这样的pdflatex,但后来将项目迁移到了xelatex

答案1

您正在混合xmpinclpdfx期望如何找到和创建 XMP 文件。该命令\includexmp来自xmpincl,并且pdfx不想与它有任何关系。pdfx提供了一个简化的界面,但它有严格的要求:

  1. 您的.xmpdata文件必须与主文件同名.tex(如果使用filecontents包,则用作\jobname.xmpdata文件名);

  2. 您实际上并没有加载该.xmpdata文件,这意味着它必须与主文件位于同一目录中.tex;并且

  3. 您不需要xmpincl明确加载,并且这样做也不会获得任何好处。

如果我遵循这些指示,您的示例文件对我来说就有用。

编辑好的,上面的文件可能不是非常小,但对我来说仍然有效。为方便起见,我在下面发布了我使用的确切文件,其中包括命令,\listfiles以便我们可以比较文件版本。从您提供的错误消息来看,我认为您可能拥有该文件的过时版本(可能是 1.3 版?)

\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}

运行pdflatex该文件会给我这个文件列表(顺便说一句,这也是 MWE 的另一个原因:减少问题和答案中多余的膨胀):

 *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
 ***********

因此,我的pdfx是 2016 年的 1.5.6 版本。CTAN 上的先前版本看起来它是 2008 年的 1.3 版。

答案2

filecontents使用或的原因有两个filecontents* \usepackage[..options..]{pdfx}

  1. pdfx.sty在加载包的过程中处理元数据。因此,您希望\jobname.xmpdata在磁盘上可用什么时候 pdfx.sty正在加载,因此此时可以读取和解释其信息。如果此时文件.xmpdata尚未写入,则需要再次运行 LaTeX 以获取该信息,这本身没有问题,因为在完成作业之前,您通常会多次运行 LaTeX。但是,在该filecontents环境中对元数据的任何更改都需要运行 2 次 LaTeX 才能显示在 PDF 中。因此,执行filecontents第一次可以减少所需的总体工作量。

  2. 环境中字节的含义filecontents*会影响写入磁盘的内容\jobname.xmpdata。诸如 之类的包inputenc可以使某些字节处于活动状态,因此应将其写为宏的扩展,而不是原始字节本身。这可能会完全破坏 中的处理,pdfx.sty以从使用其他编码提供的信息生成 UTF-8。建议将\begin{filecontents*}{\jobname.xmpdata} \documentclass行可能会导致加载各种包,以便 LaTeX 中的任何其他内容都不会影响.xmpdata文件中的内容。

相关内容