首先,如果这个问题因为“太本地化”而偏离主题,我深表歉意,但我不确定哪里是提问的最佳地点。
我在 Windows 7 上运行 TeX Live 2014,截至今天早上已完全更新。这是我的 MWE:
% !TEX TS-program = xelatex
% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage{ebgaramond}
\begin{document}
Hello, World!
\end{document}
这给了我这个(部分)日志:
! LaTeX error: "kernel/misplaced-equals-sign"
!
! Misplaced equals sign in key-value input 81
!
! See the LaTeX3 documentation for further information.
!
! For immediate help type H <return>.
!...............................................
l.81 {EBGaramond12}
有问题的 l.81 似乎来自 ebgaramond.sty 的这一部分:
\setmainfont
[ Numbers = {\ebgaramond@figurealign,\ebgaramond@figurestyle},
UprightFont = *-Regular ,
ItalicFont = *-Italic ,
BoldFont = *-Regular ,
BoldItalicFont = *-Italic ,
]
{EBGaramond12}
对于 EBGaramond 问题,我通常会与 Bob Tennent 交谈,但不禁觉得这个案例有些不同。
请提供线索,或建议其他有用的诊断方法。我不知道思考我的安装已损坏,因为我三天前从 ISO 全新安装,而tlmgr update --all
今天早上才进行了一次安装。
下面是\listfiles
:
*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)
ebgaramond.sty 2014/07/02 (Bob Tennent) Style file for EB Garamond fonts.
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/05/25 v2.7 package option processing (HA)
xkeyval.tex 2014/05/25 v2.7 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
fontspec.sty 2014/06/21 v2.4a Font selection for XeLaTeX and LuaLaTeX
expl3.sty 2014/06/10 v5105 L3 programming layer (loader)
expl3-code.tex 2014/06/10 v5105 L3 programming layer
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
l3xdvipdfmx.def
xparse.sty 2014/06/10 v5105 L3 Experimental document command parser
fontspec-patches.sty 2014/06/21 v2.4a Font selection for XeLaTeX and LuaLaTe
X
fontspec-xetex.sty 2014/06/21 v2.4a Font selection for XeLaTeX and LuaLaTeX
fontenc.sty
eu1enc.def 2010/05/27 v0.1h Experimental Unicode font encodings
eu1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty 2011/09/09 v0.981 provides access to latin accents and many oth
er characters in Unicode lower plane
eu1lmss.fd 2009/10/30 v1.6 Font defs for Latin Modern
graphicx.sty 2014/04/25 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
xetex.def 2014/04/28 v4.01 LaTeX color/graphics driver for XeTeX (RRM/JK)
fontspec.cfg
ebgaramond12.fontspec
ebgaramond12.fontspec
ebgaramond12.fontspec
ebgaramond12.fontspec
ebgaramond12.fontspec
ebgaramond12.fontspec
ebgaramond12.fontspec
ts1cmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions
t3cmr.fd 2001/12/31 TIPA font definitions
*******
以下是 .log 中的实际文件路径:
(d:/Programs/TeX.Live/texmf-dist/tex/latex/base/article.cls
(d:/Programs/TeX.Live/texmf-dist/tex/latex/base/size10.clo
(d:/Programs/TeX.Live/texmf-dist/tex/latex/ebgaramond/ebgaramond.sty
(d:/Programs/TeX.Live/texmf-dist/tex/generic/ifxetex/ifxetex.sty
(d:/Programs/TeX.Live/texmf-dist/tex/generic/oberdiek/ifluatex.sty
(d:/Programs/TeX.Live/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(d:/Programs/TeX.Live/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(d:/Programs/TeX.Live/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(d:/Programs/TeX.Live/texmf-dist/tex/generic/xkeyval/keyval.tex))
(d:/Programs/TeX.Live/texmf-dist/tex/latex/base/textcomp.sty
(d:/Programs/TeX.Live/texmf-dist/tex/latex/base/ts1enc.def
(d:/Programs/TeX.Live/texmf-dist/tex/latex/fontspec/fontspec.sty
(d:/Programs/TeX.Live/texmf-dist/tex/latex/l3kernel/expl3.sty
(d:/Programs/TeX.Live/texmf-dist/tex/latex/l3kernel/expl3-code.tex
(d:/Programs/TeX.Live/texmf-dist/tex/latex/etex-pkg/etex.sty
(d:/Programs/TeX.Live/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
(d:/Programs/TeX.Live/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(d:/Programs/TeX.Live/texmf-dist/tex/latex/fontspec/fontspec-patches.sty
) (d:/Programs/TeX.Live/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(d:/Programs/TeX.Live/texmf-dist/tex/latex/base/fontenc.sty
(d:/Programs/TeX.Live/texmf-dist/tex/latex/euenc/eu1enc.def
(d:/Programs/TeX.Live/texmf-dist/tex/latex/euenc/eu1lmr.fd
(d:/Programs/TeX.Live/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(d:/Programs/TeX.Live/texmf-dist/tex/latex/tipa/t3enc.def
(d:/Programs/TeX.Live/texmf-dist/tex/latex/euenc/eu1lmss.fd
(d:/Programs/TeX.Live/texmf-dist/tex/latex/graphics/graphicx.sty
(d:/Programs/TeX.Live/texmf-dist/tex/latex/graphics/graphics.sty
(d:/Programs/TeX.Live/texmf-dist/tex/latex/graphics/trig.sty
(d:/Programs/TeX.Live/texmf-dist/tex/latex/latexconfig/graphics.cfg
(d:/Programs/TeX.Live/texmf-dist/tex/xelatex/xetex-def/xetex.def
(d:/Programs/TeX.Live/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(d:/Programs/TeX.Live/texmf-dist/tex/latex/ebgaramond/ebgaramond12.fontspec)
(d:/Programs/TeX.Live/texmf-dist/tex/latex/ebgaramond/ebgaramond12.fontspec)
(d:/Programs/TeX.Live/texmf-dist/tex/latex/ebgaramond/ebgaramond12.fontspec)
(d:/Programs/TeX.Live/texmf-dist/tex/latex/ebgaramond/ebgaramond12.fontspec)
(d:/Programs/TeX.Live/texmf-dist/tex/latex/ebgaramond/ebgaramond12.fontspec)
(d:/Programs/TeX.Live/texmf-dist/tex/latex/ebgaramond/ebgaramond12.fontspec)
(d:/Programs/TeX.Live/texmf-dist/tex/latex/ebgaramond/ebgaramond12.fontspec)
(d:/Programs/TeX.Live/texmf-dist/tex/latex/base/ts1cmr.fd
(d:/Programs/TeX.Live/texmf-dist/tex/latex/tipa/t3cmr.fd
下面是ebgaramond12.fontspec
。看起来无害:
\defaultfontfeatures{
Extension = .otf
UprightFont = *-Regular ,
ItalicFont = *-Italic ,
BoldFont = *-Regular ,
BoldItalicFont = *-Italic
}
答案1
该fontspec
包允许“集合”(参见文档中的第 6.2 节):.fontspec
可以写入和存储包含字体定义的文件。但是,fontspec
小写查找文件时的参数.fontspec
,因此
\setmainfont{EBGaramond12}
查找的文件是ebgaramond12.fontspec
。更棘手的是,ebgaramond
软件包的分发版包含EBGaramond12.fontspec
。在区分大小写的文件系统中,不会加载该文件,因为不会查找该文件;相反,不区分大小写的文件系统 (Windows) 会找到它,并且确实会获得条目
ebgaramond12.fontspec
在文件列表中。
唉,该文件除了命名不当之外,还包含语法错误:
\defaultfontfeatures{
Extension = .otf ,% <---------------- MISSING COMMA!
UprightFont = *-Regular ,
ItalicFont = *-Italic ,
BoldFont = *-Regular ,
BoldItalicFont = *-Italic
}
如果我在工作目录中复制EBGaramond12.fontspec
,ebgaramond12.fontspec
我会收到与您相同的错误消息。只要我添加缺失的逗号(如上所示),此错误就会消失。