I have a lua file that I would use in many of my TeX's documents, loading it with dofile().
I thought it was ok if I simply put it in the (local) texmf tree*, but this doesn't work. Instead I have the following error message :
LuaTeX error cannot open the mycode.lua: No such file or directory
Is there any nice solution ?
- I try to save the file in ~/Library/texmf, in ~/Library/texmf/tex, ~/Library/texmf/tex/latex and even in ~/Library/texmf/lua (I had to create the directory).
require()
?dofile()
?file.lua
in the same folder and loading withdofile("file.lua")
works, but I'd also be interested in a more general solution (especially sincedofile("/path/to/file.lua")
doesn't seem to work).require("fontspec.lua")
finds fontspec.lua in tex\latex\fontspec.