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
However, as soon as I add the lilypond block from here (examples), I get an error:
$ pandoc -i test/lp1.md --lua-filter=$(which lilypond.lua) --pdf-engine=lualatex --standalone -o test/lp1.pdf
Error running filter /nix/store/87wba0bq2w9icj63vd7m2ipl2fn1a866-pandoc-lua-filters-2021-11-05/share/pandoc/filters/lilypond.lua:
...lua-filters-2021-11-05/share/pandoc/filters/lilypond.lua:65: attempt to index a nil value (local 'fh')
stack traceback:
...lua-filters-2021-11-05/share/pandoc/filters/lilypond.lua:49: in upvalue 'generate_image'
...lua-filters-2021-11-05/share/pandoc/filters/lilypond.lua:83: in upvalue 'process_lilypond'
...lua-filters-2021-11-05/share/pandoc/filters/lilypond.lua:143: in function <...lua-filters-2021-11-05/share/pandoc/filters/lilypond.lua:138>
The same happens when I add a \break to any of the above code.
As I gleaned from the lua code, this probably means that the lilypond process errored out and dind't produce an image file. But if I put the verbatim contents of the failing code block in a separate file lptst.ly and then manually run lilypond, it generates a correct looking png file:
$ lilypond -o tst.png --png test/lptst.ly
GNU LilyPond 2.24.3 (running Guile 2.2)
Processing `test/lptst.ly'
Parsing...
test/lptst.ly:1: warning: no \version statement found, please add
\version "2.24.3"
for future compatibility
Interpreting music...[8][16]
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Converting to PNG...
Success: compilation successfully completed
The second topic:
I want to move things like ly-resolution=300 to the frontmatter (which should be possible according to the docs), but none of
I discovered that if I omit .ly-fragment, I'm able to do \break and the orginal appoggiaturas example also works (which has in the original test markdown also .ly-fragment however, so why would it pass the test there?).
Ultimately this could mean, that it would be good to be able to tweak the ly-fragment behaviour, or provide another mechanism that allows us a kind of default preamble that will be injected for each block, so we can avoid repeated setup boilerplate.
I just discovered
lilypond.lua
and it might be what I was looking for.However, I had some trouble getting it to work.
The following works well:
However, as soon as I add the
lilypond
block from here (examples), I get an error:The same happens when I add a
\break
to any of the above code.As I gleaned from the
lua
code, this probably means that thelilypond
process errored out and dind't produce an image file. But if I put the verbatim contents of the failing code block in a separate filelptst.ly
and then manually runlilypond
, it generates a correct lookingpng
file:The second topic:
I want to move things like
ly-resolution=300
to thefrontmatter
(which should be possible according to the docs), but none ofhad any effect.
The text was updated successfully, but these errors were encountered: