我在尝试使用某些pdfa-1b东西:
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/pgf/frontendlayer/tikz/lib
raries/tikzlibrarytopaths.code.tex))) (./chronosyschr.tex)) (./longtable.sty) (./arydshln.sty) (./xmpincl.sty
(/usr/local/texlive/2015basic/texmf-dist/tex/latex/base/ifthen.sty))
! Missing $ inserted.
<inserted text>
$
l.274 \includexmp{pdfa-1b}
?
我的.tex 文件中的代码如下:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% XMP data
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{xmpincl}
\providecommand{\xmpProducer}{LaTeX2e}
\providecommand{\xmpOrg}{MyOrg}
\providecommand{\xmpTitle}{\ttitle}
\providecommand{\xmpAuthor}{\tauthor, [email protected]}
\providecommand{\xmpKeywords}{\tkeywordsEn}
\includexmp{pdfa-1b}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% pdfInfo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pdfinfo{%
/Title (\ttitle)
/Author (\tauthor, [email protected])
/Subject (\ttitleEn)
/Keywords (\tkeywordsEn)
/ModDate (\pdfcreationdate)
/Trapped /False
}
XMP 元数据示例(或XMP 预定义架构) 除了 license.XMP 之外,在文档中不容易找到。但实际使用示例和最佳实践缺少更完整的元数据。
我正在尝试使用 GitHub repo 中的 pdfa-1b.xmp 文件: https://github.com/bencomp/pdfx-ext/blob/master/pdfa-1b.xmp (因为我们学院提供的任何内容都不编译;并将其内容放入https://www.pdflib.com/knowledge-base/xmp-metadata/free-xmp-validator/转身无效)。
并且所有广泛的文档都缺乏基本的工作示例...或者可能只是查看了错误的 pdfa-1b 文档/包...
提前感谢您的任何有用的答案。
答案1
该xmpincl
包可以与手册中提供的 xmp 文件一起使用(参见https://www.ctan.org/tex-archive/macros/latex/contrib/xmpincl?lang=en,从.dtx文件末尾复制xmp是最简单的)。
但是,该pdfa-1b.xmp
文件包含一些带有 的条件@
,因此您需要用 和 来包围它们\includexmp
。\makeatletter
在\makeatother
我的系统上,由于某种原因,该\ifx \@empty
构造不起作用(执行了 else 子句),我在 xmp 文件中用 替换了它,\ifx \undefined
这样就可以正常工作。
梅威瑟:
\documentclass{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% XMP data
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{xmpincl}
\providecommand{\xmpProducer}{LaTeX2e}
\providecommand{\xmpOrg}{MyOrg}
\providecommand{\xmpTitle}{MyTitle}
\providecommand{\xmpAuthor}{MyAuthor, [email protected]}
\providecommand{\xmpKeywords}{MyKeywords}
\providecommand{\xmpSubject}{MySubject}
\providecommand{\xmpCreatorTool}{\pdftexbanner}
\providecommand{\convDate}{\pdfcreationdate}
\makeatletter
\includexmp{pdfa-1b}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% pdfInfo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pdfinfo{%
/Title (MyTitle)
/Author (MyAuthor, [email protected])
/Subject (MySubject)
/Keywords (MyKeywords)
/ModDate (\pdfcreationdate)
/Trapped /False
}
\begin{document}
Hello, world!
\end{document}
修改后的片段pdfa-1b.xmp
:
\ifx\xmpJournalnumber\undefined\relax\else<prism:issn>\xmpJournalnumber</prism:issn>\fi
\ifx\xmpVolume\undefined\relax\else<prism:volume>\xmpVolume</prism:volume>\fi
\ifx\xmpIssue\undefined\relax\else<prism:number>\xmpIssue</prism:number>\fi
结果: