18

I get an error when I try to include the fontspec package. Here is a minimum working example:

\documentclass{article}
\usepackage{fontspec}
\begin{document}
Hello
\end{document}

I'm trying to compile this using the following build command: lualatex --file-line-error-style "%f". Part of the output that I get is:

/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!

I would greatly appreciate any insight that you may have on this issue. I am using Linux Mint 16, with the standard texlive-luatex available in the repositories. Thank you.

Edit: upon request from user phg, here is the output from luaotfload-tool --version

luaotfload-tool version “2.3”
database version “2.207”
Lua interpreter: stock; version “Lua 5.2”

and 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

Thanks for the prompt feedback!

12
  • 4
    Try luaotfload-tool --update. Feb 21, 2014 at 7:14
  • 1
    I'm unable to replicate the problems you report. Which TeX distribution do you use, and which version of fontspec do you use? (Hint: the fontspec version information should be in the .log file produced when you compile your file.)
    – Mico
    Feb 21, 2014 at 7:44
  • 1
    Please paste the output of luaotfload-tool --version and luaotfload-tool --diagnose=environment,permissions. Feb 21, 2014 at 18:11
  • @MartinSchröder luaotfload-tool --update returns the output: luaotfload | db : Font names database not found, generating new one. luaotfload | db : This can take several minutes; please be patient. But running lualatex still returns the same error posted above. Feb 21, 2014 at 21:12
  • 1
    I just got the same error message. I am using MikTeX and Windows 7. But this time it is user account related: I succesfully compile with admin user but not with another.
    – Matti
    Sep 10, 2015 at 15:27

2 Answers 2

10

I have just faced the same problem and it turns out that the solution was to install the lmodern package. If I understand correctly this also installs the fonts-lmodern package which contains the missing font file lmroman10-regular that lualatex was complaining about. (lmodern seems to contain font files for pdfTeX)

The conclusion is that this is perhaps not a TeX problem but rather a package dependency problem in the Linux Mint distribution (I am on Linux Mint Debian Edition). Still it seems a bit weird that lualatex requires a font that is not even used in the document.

3
  • 2
    Under LuaLaTeX, if no (main) font is specified via an instruction such as \setmainfont, the default or fallback main text font that will be used is Latin Modern Roman, 10pt. If a different font isn't requested and if Latin Modern Roman font (family) apparently hasn't been installed correctly, there's actually nothing "weird" about LuaLaTeX complaining that it can't find the font it believes needs to be loaded. Incidentally, even though the lmodern package is meant to provide fonts for use by pdfLaTeX, LuaLaTeX can make use of those fonts as well.
    – Mico
    Apr 8, 2014 at 19:08
  • 1
    The thing is the problem happens even if \setmainfont is used in the preamble. Could it be that this does not set all fonts for the document (math fonts perhaps?) and thus the Latin Modern Roman fonts are still required?
    – kragol
    Apr 8, 2014 at 20:21
  • Oddly, I still get this error in Linux Mint 18, despite the claim at (bugs.debian.org/cgi-bin/bugreport.cgi?bug=853119) that it was fixed in Jan 2017.
    – Mirlan
    Apr 6, 2019 at 16:50
21

You might be missing a required package, try:

sudo apt-get install texlive-luatex

Then, try the update:

luaotfload-tool --update
1
  • 2
    This is the right answer. Sep 26, 2021 at 11:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .