2

I updated my TeXLive distribution with the TeXLive utility that comes with MacTeX. However, I cannot get lualatex to run. Regardless of the document, after calling lualatex test.tex (say) I get the error message:

 (./texsx.tex[\directlua]:1: module 'lualatexquotejobname.lua' not
 found: no field package.preload['lualatexquotejobname.lua'] [kpse lua
 searcher] file not found: 'lualatexquotejobname.lua' [kpse C searcher]
 file not found: 'lualatexquotejobname.lua' no file
 '/usr/local/lib/lua/5.2/lualatexquotejobname.so' no file
 '/usr/local/lib/lua/5.2/loadall.so' no file
 './lualatexquotejobname.so' stack traceback: [C]: in function
 'require' [\directlua]:1: in main chunk. <everyjob> \directlua
 {require("lualatexquotejobname.lua")}

Unfortunately, I could not fix this with any of the posts found on this forum, or somewhere else. Am I missing something obvious? Has anybody a fix for this?

David Carlisle
  • 757,742
  • Do you need the standalone Lua app? (Version 5.2.x, right?) What happens if you uninstall it completely and then recompile your TeX document? – Mico Jan 02 '18 at 03:37
  • @Mico I don't need know anything about this app. Or are you saying I have to install something? And I have installed the whole texlive distribution from scratch. And the "missing" file is there: $ kpsewhich lualatexquotejobname.lua /usr/local/texlive/2017/texmf-dist/tex/latex/latexconfig/lualatexquotejobname.lua –  Jan 02 '18 at 03:54
  • I'm a MacTeX2017 user as well; separately, I also have Lua 5.3.4 on my system. For sure, though, my copy of LuaLaTeX never attempts to search for anything in /usr/local/lib/lua/. All I can surmise is that something went wrong in your MacTeX2017 installation. All I can suggest (sorry I wasn't clear enough before) is that you uninstall the standalone Lua app and then start over. Clearly, LuaLaTeX shouldn't be searching for lualatexquotejobname.lua anywhere below /usr/local/lib/lua/. – Mico Jan 02 '18 at 04:43
  • 2
    can you show the full log (including luatex startup banners) and also what is which luatex (or the mac equivalent) are you sure you are running the texlive 2017 luatex? – David Carlisle Jan 02 '18 at 09:15
  • 1
    The instruction \directlua{require("lualatexquotejobname.lua")} is part of \everyjob in the lualatex format. It seems that \directlua is calling /usr/local/bin/lua instead of the embedded one, or that some environment variable is improperly set. – egreg Jan 02 '18 at 11:29
  • @DavidCarlisle Thank you so much! I guess you found the reason: $which lualatex /opt/local/bin/lualatex $ which xelatex /Library/TeX/texbin/xelatex But there is a version of lualatex under /Library/TeX/texbin/ as well. I have never installed lualatex separately, so I dunno where the version in /opt/... comes from. –  Jan 02 '18 at 11:34
  • @egreg Seems like you're right.Thank you so much! When I compile with /Library/TeX/texbin/lualatex, everything works fine. Do you know by chance which environment variable this is? –  Jan 02 '18 at 11:38
  • 2
    @marmot Argh! You have something installed with MacPorts! I have long removed any trace of it from my machines. – egreg Jan 02 '18 at 11:40
  • @egreg How did you remove this properly? (If I remove the lualatex under /opt/... by hand, it just does no longer get found.) (And I am not aware of having installed LaTeX related things with MacPorts, but of course it might have come with another tool.) –  Jan 02 '18 at 11:47
  • 3
    @marmot Tell MacPorts to uninstall luatex. Then, when you have some time, uninstall MacPorts. – egreg Jan 02 '18 at 11:49

1 Answers1

4

My problem was solved by comments by David Carlisle and @egreg, whom I really wish to thank at this point. This post is just for the records, in case someone else runs into similar problems. Apparently, lualatex got installed by another package manager. In my case, there was a version under

/opt/local/bin/lualatex 

After removing this version (and starting a new shell), the correct version

/Library/TeX/texbin/lualatex 

gets invoked and the documents run through.