lyluatex.
lua:1278: attempt to index a nil value
stack traceback:
.../uliska/texmf/tex/luatex/git-latex/lyluatex/lyluatex.lua:1278: in function
'write_latex'
.../uliska/texmf/tex/luatex/git-latex/lyluatex/lyluatex.lua:1193: in function
'process'
[\directlua]:1: in main chunk.
\ly@compilescore ...directlua {ly.score:process()}
l.7 \lilypond{ #(ly:message "Foo") }
?
The issue is that the LilyPond code produces no score. Of course this is erroneous input but we should handle it more gracefully with a meaningful message and not attempt to index a nil value.
The underlying issue is that by default LilyPond will not produce a PDF when there is no content:
will produce files - with the PDF being empty, without extent, and that seems to be where we get a nil value somewhere. [NOTE: I currently have no LilyPond 2.18 installed so I'm not sure if that behaves identically.]
I'm not sure about the best remedy. Probably there should be another check in is_compiled() or when checking the bounding box. From the program flow it should of course be when checking for the existence of the PDF, but maybe when checking the bounding box we have better information about the issue.
@uliska I just pushed a fix for this issue: I'm leaving the possibility to include empty scores, as it could be the result of conditional formatting etc. but I raise a warning.
Somehow related to #237 LilyPond snippets that erroneously produce no score trigger an interesting side effect that we should handle gracefully.
will fail with
The issue is that the LilyPond code produces no score. Of course this is erroneous input but we should handle it more gracefully with a meaningful message and not
attempt to index a nil value
.The underlying issue is that by default LilyPond will not produce a PDF when there is no content:
But
will produce files - with the PDF being empty, without extent, and that seems to be where we get a
nil
value somewhere. [NOTE: I currently have no LilyPond 2.18 installed so I'm not sure if that behaves identically.]I'm not sure about the best remedy. Probably there should be another check in
is_compiled()
or when checking the bounding box. From the program flow it should of course be when checking for the existence of the PDF, but maybe when checking the bounding box we have better information about the issue.