当我尝试包含 fontspec 包时出现错误。这是一个最小工作示例:
\documentclass{article}
\usepackage{fontspec}
\begin{document}
Hello
\end{document}
我正在尝试使用以下构建命令来编译它:
lualatex --file-line-error-style "%f"
。我得到的部分输出是:
/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty:100: Font \EU2/lmr/m/n/
10=file:lmroman10-regular:script=latn;+trep;+tlig; at 10pt not loadable: metric
data not found or bad.
<to be read again>
relax
l.100 \fontencoding\encodingdefault\selectfont
?
/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty:100: Emergency stop.
<to be read again>
relax
l.100 \fontencoding\encodingdefault\selectfont
269 words of node memory still in use:
2 hlist, 1 rule, 1 kern, 1 attribute, 41 glue_spec, 1 attribute_list, 2 if_st
ack, 1 write, 1 dir nodes
avail lists: 2:8,3:1,4:1,6:2,9:2
/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty:100: ==> Fatal error o
ccurred, no output PDF file produced!
如果您能就此问题提供任何见解,我将不胜感激。我使用的是 Linux Mint 16,存储库中有标准的 texlive-luatex。谢谢。
编辑:根据用户 phg 的要求,以下是输出luaotfload-tool --version
luaotfload-tool version “2.3”
database version “2.207”
Lua interpreter: stock; version “Lua 5.2”
和luaotfload-tool --diagnose=environment,permissions
luaotfload | diagnose : Loading file hashes.
luaotfload | diagnose : =============== file permissions ==============
luaotfload | diagnose : Checking permissions of /home/alex/.texmf-var/luatex-cache/generic.
luaotfload | diagnose : Owner: 1000, group 1000, permissions rwxrwxr-x.
luaotfload | diagnose : Readable: ok.
luaotfload | diagnose : Writable: ok.
luaotfload | diagnose : Checking permissions of /home/alex/.texmf-var/luatex-cache/generic/names/.
luaotfload | diagnose : Owner: 1000, group 1000, permissions rwxrwxr-x.
luaotfload | diagnose : Readable: ok.
luaotfload | diagnose : Writable: ok.
luaotfload | diagnose : Checking permissions of /home/alex/.texmf-var/luatex-cache/generic/names/luaotfload-names.lua.
luaotfload | diagnose : Owner: 1000, group 1000, permissions rw-rw-rw-.
luaotfload | diagnose : Readable: ok.
luaotfload | diagnose : Writable: ok.
luaotfload | diagnose : Checking permissions of /home/alex/.texmf-var/luatex-cache/generic/names/luaotfload-names.luc.
luaotfload | diagnose : Owner: 1000, group 1000, permissions rw-rw-rw-.
luaotfload | diagnose : Readable: ok.
luaotfload | diagnose : Writable: ok.
luaotfload | diagnose : Checking permissions of /home/alex/.texmf-var/luatex-cache/generic/names/luaotfload-lookup-cache.lua.
luaotfload | diagnose : Owner: 1000, group 1000, permissions rw-rw-rw-.
luaotfload | diagnose : Readable: ok.
luaotfload | diagnose : Writable: ok.
luaotfload | diagnose : Checking permissions of /home/alex/.texmf-var/luatex-cache/generic/names/luaotfload-lookup-cache.luc.
luaotfload | diagnose : Owner: 1000, group 1000, permissions rw-rw-rw-.
luaotfload | diagnose : Readable: ok.
luaotfload | diagnose : Writable: ok.
luaotfload | diagnose : Everything appears to be in order, you may sleep well
感谢您的及时反馈!
答案1
我刚刚遇到了同样的问题,结果发现解决方案是安装lmodern
包。如果我理解正确的话,这还会安装包含lualatex 抱怨的fonts-lmodern
缺失字体文件的包。(似乎包含 pdfTeX 的字体文件)lmroman10-regular
lmodern
结论是,这可能不是 TeX 的问题,而是 Linux Mint 发行版中的包依赖性问题(我使用的是 Linux Mint Debian 版本)。不过,lualatex 需要一种文档中甚至没有使用的字体,这似乎有点奇怪。
答案2
您可能缺少所需的包,请尝试:
sudo apt-get install texlive-luatex
然后尝试更新:
luaotfload-tool --update