我正在尝试使用包创建 xmp 元数据hyperxmp
。阅读文档后,我在前言中添加了以下内容:
\usepackage{hyperxmp}
\usepackage{hyperref}
\hypersetup{% Configurazione del pacchetto hyperref
pdfpagemode={UseOutlines},
bookmarksopen,
pdfstartview={FitH},
pdftitle={},
pdfauthor={},%
pdfauthortitle={},%
pdfsubject={Tesi di laurea},
pdfkeywords={},
pdfcopyright={},
pdflicenseurl={http://creativecommons.org/licenses/by-nc-nd/2.5/it/},
pdfcaptionwriter={},
pdfcontactaddress={},
pdfcontactcity=Lentini (SR)},
pdfcontactpostcode={},
pdfcontactcountry={,
pdfcontactphone={},
pdfcontactemail={},
pdfcontacturl={},
pdflang={it},
colorlinks=true,
breaklinks,
linkcolor={blue},
citecolor={red},
urlcolor={blue}
}
该字段显然是空白的,因为其中包含个人信息。无论如何,当我编译时,我收到此错误:
Package kvsetkeys Error: Undefined key `pdfcontactaddress' }
Package kvsetkeys Error: Undefined key `pdfcontactcity' }
Package kvsetkeys Error: Undefined key `pdfcontactpostcode' }
Package kvsetkeys Error: Undefined key `pdfcontactcountry' }
Package kvsetkeys Error: Undefined key `pdfcontactphone' }
Package kvsetkeys Error: Undefined key `pdfcontactemail' }
Package kvsetkeys Error: Undefined key `pdfcontacturl' }
答案1
您错过了{
:
pdfcontactcity=Lentini (SR)},
以及}
:
pdfcontactcountry={,
一旦更正,以下代码就可以编译:
\documentclass{article}
\usepackage{lipsum}
\usepackage{hyperxmp}
\usepackage{hyperref}
\hypersetup{% Configurazione del pacchetto hyperref
pdfpagemode={UseOutlines},
bookmarksopen,
pdfstartview={FitH},
pdftitle={},
pdfauthor={},%
pdfauthortitle={},%
pdfsubject={Tesi di laurea},
pdfkeywords={},
pdfcopyright={},
pdflicenseurl={http://creativecommons.org/licenses/by-nc-nd/2.5/it/},
pdfcaptionwriter={},
pdfcontactaddress={},
pdfcontactcity={Lentini (SR)},
pdfcontactpostcode={},
pdfcontactcountry={},
pdfcontactphone={},
pdfcontactemail={},
pdfcontacturl={},
pdflang={it},
colorlinks=true,
breaklinks,
linkcolor={blue},
citecolor={red},
urlcolor={blue}
}
\begin{document}
\lipsum
\end{document}
如果您\listfiles
在 之前添加\begin{document}
,tex 将提供使用的文件列表和版本。这是我得到的(miktex 2.9):
*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
lipsum.sty 2011/04/14 v1.2 150 paragraphs of Lorem Ipsum dummy text
hyperxmp.sty 2012/12/13 v2.2 Store hyperref metadata in XMP format
atenddvi.sty 2007/04/17 v1.1 At end DVI hook (HO)
zref-abspage.sty 2012/04/04 v2.24 Module abspage for zref (HO)
zref-base.sty 2012/04/04 v2.24 Module base for zref (HO)
ltxcmds.sty 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/error messages (HO)
kvsetkeys.sty 2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (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)
ifpdf.sty 2011/01/30 v2.3 Provides the ifpdf switch (HO)
auxhook.sty 2011/03/04 v1.3 Hooks for auxiliary files (HO)
atbegshi.sty 2011/10/05 v1.16 At begin shipout hook (HO)
zref-lastpage.sty 2012/04/04 v2.24 Module lastpage for zref (HO)
atveryend.sty 2011/06/30 v1.8 Hooks at the very end of document (HO)
kvoptions.sty 2011/06/30 v3.11 Key value format for package options (HO)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
pdfescape.sty 2011/11/25 v1.13 Implements pdfTeX's escape features (HO)
stringenc.sty 2011/12/02 v1.10 Convert strings between diff. encodings (HO)
intcalc.sty 2007/09/27 v1.1 Expandable calculations with integers (HO)
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
hyperref.sty 2012/11/06 v6.83m Hypertext links for LaTeX
hobsub-hyperref.sty 2012/04/25 v1.12 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty 2012/04/25 v1.12 Bundle oberdiek, subset generic (HO)
hobsub.sty 2012/04/25 v1.12 Construct package bundles (HO)
ifvtex.sty 2010/03/01 v1.5 Detect VTeX and its facilities (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 2011/06/24 v1.1 Wrapper for package hooks (HO)
xcolor-patch.sty 2011/01/30 xcolor patch
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)
pd1enc.def 2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
url.sty 2006/04/12 ver 3.3 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)
se-pdfdoc.def 2011/12/02 v1.10 stringenc: PDFDocEncoding
se-utf8.def 2011/12/02 v1.10 stringenc: UTF-8
color.sty 2005/11/14 v1.0j Standard LaTeX Color (DPC)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
supp-pdf.mkii
nameref.sty 2012/10/27 v2.43 Cross-referencing by name of section
gettitlestring.sty 2010/12/03 v1.4 Cleanup title references (HO)
请检查您是否也遇到了同样的问题。否则您可能需要更新您的 tex 发行版。