The conclusion of [1], on how to put nicely cropped png or svg images into individual files with specified file names, was to wrap each score in a \book block with an individual \bookOutputName, as shown in that message.

Since I have 1000+ such scores, each conveniently created by a scheme function, it should be easy to just add the book wrapper inside that function.  The first step was beginning like this MWE:

\version "2.24.1"
scr =
#(define-scheme-function (mus) (ly:music?)
    #{
      %\book {
        \score { #mus }
      %}
    #} )
\scr { c'' }

But un-commenting the two lines above generates "error: bad expression type".

Adding -lDEBUG didn't explain more.  Does that error mean \book is forbidden here?

How can I include a \book wrapper (and \bookOutputName) in my score function?

Thx,
Jeff

[1] https://lists.gnu.org/archive/html/lilypond-user/2023-03/msg00417.html


Reply via email to