Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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!

share|improve this question
1  
Try luaotfload-tool --update. –  Martin Schröder Feb 21 at 7:14
    
Welcome to Tex.SX! –  Adam Liter Feb 21 at 7:21
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 at 7:44
1  
Please paste the output of luaotfload-tool --version and luaotfload-tool --diagnose=environment,permissions. –  phg Feb 21 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. –  castle-bravo Feb 21 at 21:12

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer
    
Welcome to TeX.SX! –  Heiko Oberdiek Apr 8 at 19:04
1  
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 at 19:08
    
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 at 20:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.