fontenc lualatex 未定义控制序列。\xdef\@fontenc@load@list{\@fontenc@load@list

fontenc lualatex 未定义控制序列。\xdef\@fontenc@load@list{\@fontenc@load@list

我在使用 lualatex 进行编译时遇到问题。我正在使用 MikTex,并已完全卸载它,重新安装,更新所有软件包,添加我使用的其他软件包,并验证管理员和用户软件包都已更新,手动更新所有格式。有人有什么建议吗?我只在使用 LuaLaTeX 和 MikTeX 时遇到此问题。我在使用 TeXLive 时没有遇到此问题 - 但这是一个较旧的安装,在 MiKTeX 安装工作正常之前我不想更改它,因此如果升级,TeXLive 可能会或可能不会工作。这是最近的失败。我使用 Unicode 字体进行编译,因此我需要 LuaLaTeX 或 XeLaTeX,但更喜欢 LuaLaTeX(我在使用 XeLaTeX 时遇到了另一个问题,与此无关)。谢谢。

我明白了

!Undefined control sequence
l.115 \xdef\@fontenc@load@list{\@fontenc@load@list

使用 lualatex 进行编译时。我已将范围缩小到包含 fontenc 包(我不直接执行此操作,unicode-math 会执行此操作)。测试文件为:

\documentclass{article}
\usepackage{fontenc}
\begin{document}
\end{document}

日志文件是:

This is LuaTeX, Version 1.12.0 (MiKTeX 2.9.7300 64-bit)  (format=lualatex 2020.1.4)  1 MAR 2020 08:19
 restricted system commands enabled.
**test2.tex
(./test2.tex
LaTeX2e <2019-10-01> patch level 3
Lua module: luaotfload-main 2020-02-02 3.12 luaotfload entry point
Lua module: luaotfload-init 2020-02-02 3.12 luaotfload submodule / initializatio
n
Lua module: lualibs 2020-02-02 2.70 ConTeXt Lua standard libraries.
Lua module: lualibs-extended 2020-02-02 2.70 ConTeXt Lua libraries -- extended c
ollection.
Lua module: luaotfload-log 2020-02-02 3.12 luaotfload submodule / logging
Lua module: luaotfload-parsers 2020-02-02 3.12 luaotfload submodule / filelist
Lua module: luaotfload-configuration 2020-02-02 3.12 luaotfload submodule / conf
ig file reader
luaotfload | conf : Root cache directory is C:/Users/Administrator/AppData/Local
/MiKTeX/2.9/luatex-cache/generic-dev/names.
luaotfload | init : Loading fontloader “fontloader-2020-01-26.lua†from kpse
-resolved path “c:/bin/MiKTeX/tex/luatex/luaotfload/fontloader-2020-01-26.lua
â€.
Lua-only attribute luaotfload@state = 2
Lua-only attribute luaotfload@noligature = 3
Lua-only attribute luaotfload@syllabe = 4
luaotfload | init : Context OpenType loader version “3.11â€
Inserting `luaotfload.node_processor' at position 1 in `pre_linebreak_filter'.
Inserting `luaotfload.node_processor' at position 1 in `hpack_filter'.
Lua module: luaotfload-loaders 2020-02-02 3.12 luaotfload submodule / callback h
andling
Inserting `luaotfload.define_font' at position 1 in `define_font'.
Lua module: luaotfload-database 2020-02-02 3.12 luaotfload submodule / database
Lua module: luaotfload-unicode 2020-02-02 3.12 luaotfload submodule / Unicode he
lpers
Lua module: luaotfload-colors 2020-02-02 3.12 luaotfload submodule / color
Lua-only attribute luaotfload_color_attribute = 5
Lua module: luaotfload-resolvers 2020-02-02 3.12 luaotfload submodule / resolver
s
luaotfload | conf : Root cache directory is C:/Users/Administrator/AppData/Local
/MiKTeX/2.9/luatex-cache/generic-dev/names.
Lua module: luaotfload-features 2020-02-02 3.12 luaotfload submodule / features
Lua module: luaotfload-letterspace 2020-02-02 3.12 luaotfload submodule / color
Lua module: luaotfload-embolden 2020-02-02 3.12 luaotfload submodule / color
Lua module: luaotfload-notdef 2020-02-02 3.12 luaotfload submodule / color
Lua module: luaotfload-auxiliary 2020-02-02 3.12 luaotfload submodule / auxiliar
y functions
Inserting `luaotfload.aux.set_sscale_dimens' at position 1 in `luaotfload.patch_
font'.
Inserting `luaotfload.aux.set_font_index' at position 2 in `luaotfload.patch_fon
t'.
Inserting `luaotfload.aux.patch_cambria_domh' at position 3 in `luaotfload.patch
_font'.
Inserting `luaotfload.aux.fixup_fontdata' at position 1 in `luaotfload.patch_fon
t_unsafe'.
Inserting `luaotfload.aux.set_capheight' at position 4 in `luaotfload.patch_font
'.
Inserting `luaotfload.aux.set_xheight' at position 5 in `luaotfload.patch_font'.
Lua module: luaotfload-fallback 2020-02-02 3.12 luaotfload submodule / fallback
Lua module: luaotfload-multiscript 2020-02-02 3.12 luaotfload submodule / multis
cript
Lua module: luaotfload-script 2020-02-02 3.12 luaotfload submodule / Script help
ers
Lua module: luaotfload-tounicode 2020-02-02 3.12 luaotfload submodule / tounicod
e
Inserting `luaotfload.rewrite_fontname' at position 6 in `luaotfload.patch_font'
. (c:/bin/MiKTeX/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(c:/bin/MiKTeX/tex/latex/base/size10.clo
File: size10.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
luaotfload | db : Font names database loaded from C:/Users/Administrator/AppData
/Local/MiKTeX/2.9/luatex-cache/generic-dev/names/luaotfload-names.luc)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(c:/bin/MiKTeX/tex/latex/base/fontenc.sty
Package: fontenc 2020/02/11 v2.0o Standard LaTeX package

! Undefined control sequence.
l.115 \xdef\@fontenc@load@list{\@fontenc@load@list

? x


Here is how much of LuaTeX's memory you used:
 427 strings out of 493864
 100000,106986 words of node,token memory allocated 346 words of node memory still in use:
   1 hlist, 1 rule, 1 dir, 3 kern, 1 glyph, 3 attribute, 44 glue_spec, 3 attribu
te_list, 1 write nodes
   avail lists: 2:8,3:1,4:1,5:2,7:2,9:3
 5202 multiletter control sequences out of 65536+200000
 15 fonts using 723367 bytes
 24i,0n,19p,131b,40s stack positions out of 5000i,500n,10000p,200000b,50000s

warning  (pdf backend): no pages of output.

PDF statistics: 0 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 131072)
 1 words of extra memory for PDF output out of 10000 (max. 100000000)

更新:这是使用 pdflatex 的 .log 文件。它是补丁级别 5。

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 2.9.7300 64-bit) (preloaded format=pdflatex 2020.3.1)  1 MAR 2020 23:21
entering extended mode
**./test2.tex
(test2.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-02-25> (c:\bin\MiKTeX\tex/latex/base\article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(c:\bin\MiKTeX\tex/latex/base\size10.clo
File: size10.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
)
\c@part=\count167
\c@section=\count168
\c@subsection=\count169
\c@subsubsection=\count170
\c@paragraph=\count171
\c@subparagraph=\count172
\c@figure=\count173
\c@table=\count174
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen134
)
(c:\bin\MiKTeX\tex/latex/base\fontenc.sty
Package: fontenc 2020/02/11 v2.0o Standard LaTeX package
)
(c:\bin\MiKTeX\tex/latex/l3backend\l3backend-pdfmode.def
File: l3backend-pdfmode.def 2020-02-23 L3 backend support: PDF mode
\l__kernel_color_stack_int=\count175
\l__pdf_internal_box=\box45
) (test2.aux)
\openout1 = `test2.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.

(test2.aux) ) 
Here is how much of TeX's memory you used:
 572 strings out of 481311
 7697 string characters out of 2924405
 237403 words of memory out of 3000000
 16144 multiletter control sequences out of 15000+200000
 532338 words of font info for 24 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 25i,1n,19p,146b,36s stack positions out of 5000i,500n,10000p,200000b,50000s

No pages of output.
PDF statistics:
 0 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

答案1

此问题似乎是由格式文件 lualatex.fmt 位于两个位置引起的。一个位置正在更新,另一个位置未更新。不幸的是,第二个位置可能先被读取,导致格式不同步。这种情况可能是由于在不同时间为单个用户和多个用户安装 MiKTeX 造成的。如果格式文件不存在,将自动重新生成。

对我而言有效的解决方案是找到 c:\Users 下 lualatex.fmt 文件的所有实例并将其删除。我还发现其他格式文件可能位于多个位置,因此最好的办法是删除特定用户(如果为多个用户安装)或所有用户(如果为单个用户安装)的所有格式文件。对我来说,dvilualatex.fmt、xelatex.fmt、pdflatex.fmt 和 latex.fmt 也位于两个位置,但其他格式文件则不位于两个位置。除了 dvilualatex.fmt,其他文件都没有不同步。

以防万一出现其他问题,我将再次卸载 MiKTeX,但删除 c:\Users...\MiKTeX* 下剩余的所有内容。然后我将重新安装、更新所有软件包,添加我使用的额外软件包。然后我将检查格式是否需要更新,如果需要,则更新所有格式。

这会花费我一些时间,但如果我发现任何新内容,我会更新这个答案。

更新:卸载时我小心地删除了 MiKTeX 的所有痕迹。然后当我重新安装时,一切都正常了。没有初始格式文件。创建它们时,它们是在 c:\users\[user] 目录中创建的,而不是在 c:\users\all users 目录中创建的。我确实为所有用户安装了,并在控制台中验证了这一点,控制台显示这是一个“共享”安装。

这基本证实了(对我而言)问题在于卸载程序未能完全删除安装的所有痕迹。这反过来又导致使用不同选项重新安装,从而引起冲突。

我使用 XeLaTeX 时遇到的问题是我的错误(正如我所怀疑的那样)并且与这个问题无关。

相关内容