You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Module lyluatex Info: Compiling score tmp-ly/504130eafb16e7b481f300c28c1a5064 wi
th LilyPond executable 'c:/Program Files (x86)/LilyPond/usr/bin/lilypond.exe'. o
n input line 21
...Data/Local/Programs/MiKTeX/scripts/lyluatex/lyluatex.lua:119: bad argument #2
to 'gsub' (string/function/table expected)
stack traceback:
[C]: in function 'string.gsub'
...Data/Local/Programs/MiKTeX/scripts/lyluatex/lyluatex.lua:119: in upvalue 'ex
tract_includepaths'
...Data/Local/Programs/MiKTeX/scripts/lyluatex/lyluatex.lua:816: in method 'lil
ypond_cmd'
...Data/Local/Programs/MiKTeX/scripts/lyluatex/lyluatex.lua:1151: in method 'ru
n_lilypond'
...Data/Local/Programs/MiKTeX/scripts/lyluatex/lyluatex.lua:1115: in method 'pr
ocess'
[\directlua]:1: in main chunk.
\ly@compilescore ...directlua {ly.score:process()}
In the function extract_includepaths, you need to replace the block starting at local cfd with the following code:
local cfd = Score.currfiledir or ""
if cfd == "" then
warn("Score.currfiledir is empty; using default './'")
cfd = "./"
end
if lib.tex_engine.dist == 'MiKTeX' then
cfd = cfd:gsub('^$', '.\\')
else
cfd = cfd:gsub('^$', './')
end
I found this after printing the contents of those two arguments. The currentfiledir one was null. For me this solved it. In the picture, the green commented code is the stuff you need to replace.
@jperon First of all thank you for this amazing resource! Its just what I need to for my new songbook.
I believe this bug is only relevant to miktex, but it would be great (if you confirm it was the cause) if the solution could be added to the repo.
`Module lyluatex Info: Compiling score tmp-ly/504130eafb16e7b481f300c28c1a5064 wi
th LilyPond executable 'c:/Program Files (x86)/LilyPond/usr/bin/lilypond.exe'. o
n input line 21
...Data/Local/Programs/MiKTeX/scripts/lyluatex/lyluatex.lua:119: bad argument #2
to 'gsub' (string/function/table expected)
stack traceback:
[C]: in function 'string.gsub'
...Data/Local/Programs/MiKTeX/scripts/lyluatex/lyluatex.lua:119: in upvalue 'ex
tract_includepaths'
...Data/Local/Programs/MiKTeX/scripts/lyluatex/lyluatex.lua:816: in method 'lil
ypond_cmd'
...Data/Local/Programs/MiKTeX/scripts/lyluatex/lyluatex.lua:1151: in method 'ru
n_lilypond'
...Data/Local/Programs/MiKTeX/scripts/lyluatex/lyluatex.lua:1115: in method 'pr
ocess'
[\directlua]:1: in main chunk.
\ly@compilescore ...directlua {ly.score:process()}
l.21 \end{lilypond}`
A full description is written on
https://tex.stackexchange.com/questions/727209/lylualatex-lilypond-error-when-compiling-with-miktex
The text was updated successfully, but these errors were encountered: