
嘗試使用某些時出現以下錯誤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 儲存庫中的 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
結果: