0

I get an error that looks like my code doesn't find some Lua module(s) even from a Lua file in the same directory.

git/uliska/diss/latexstuff/ulDissLua.lua:14: module './template-config.lua' not
 found:
    no field package.preload['./template-config.lua']
    [kpse lua searcher] file not found: './template-config.lua'
    [kpse C searcher] file not found: './template-config.lua'
    no file '/usr/local/lib/lua/5.3/.so'
    no file '/usr/local/lib/lua/5.3/loadall.so'
    no file './.so'.
\loadLuaFunctions ...ua.lua") or "ulDissLua.lua")}

The file would define and return a Lua table. L. 14 assigns that table to a variable. As there are no messages relating to anything within that file I assume it really doesn't find that file to even start parsing it. Well, I thought require would first look in the current directory, then at a given path and finally in a search path. So I'm surprised because template-config.lua is within the calling file's directory. However, a few lines earlier in the terminal output I see === Package selnolig, Version 0.302, Date 2015/10/26 ===. Might this indicate that the problem occurs while reading the selnolig package? Otherwise, how would I require a file from the same directory?

uli_1973
  • 1,920
  • the point is not the directory of the file, but the directory you used to start the compilation. – Ulrike Fischer Apr 06 '22 at 13:47
  • Please let us know if the test document \documentclass[english,ngerman]{article} \usepackage{fontspec,babel,selnolig} \begin{document} shelfful Auflaufform \end{document} compiles successfully, i.e., if it suppresses the f-f and f-l ligatures in question. – Mico Apr 06 '22 at 14:17
  • https://tex.stackexchange.com/questions/639877/not-finding-lua-modules?noredirect=1#comment1594878_639877 It did compile successfully by producing a PDF but (correctly) not removing the ligatures. – uli_1973 Apr 06 '22 at 18:41
  • If you have the debug Lua library available you could try to determine your current file's path and add that to the package.path (not sure whether things work this way in LuaTeX, that's what would be possible in standard-Lua). – Skillmon Apr 06 '22 at 20:06
  • @uli_1973 - I'm afraid I don't understand your claim that it's correct not to remove the ligatures in shelfful and Auflaufform. Please clarify. – Mico Apr 07 '22 at 04:55
  • @Mico ligatures are not to be used when the two letters are the borders of different syllables. So in "Auf-lauf-form" the "fl" and "ff" have to be separate letters and no ligature. Although not being as confident in English typography I assume the same is true for "shelfful". – uli_1973 Apr 08 '22 at 09:30
  • @uli_1973 - So now I'm really confused: You seem to agree that the ligatures in Auflaufform and shelfful should be removed, yet you've also written that selnolig "correctly does not remove" the ligatures. (For sure, when compiling the test document I supplied on my system, selnolig does remove the ligated glyphs and uses unligated glyph pairs instead.) Am I missing something? – Mico Apr 08 '22 at 09:55
  • Sorry, I was sloppy. "Auflaufform" and "shelfful" indeed should have no ligatures, and selnolig should remove the default ligatures. The PDF types correctly, so obviously the test document is compiled correctly, and without warnings. So clearly my problem doesn't stem from a bug in that package. – uli_1973 Apr 08 '22 at 10:05

0 Answers0