Conditional \book - possible?

Michael Scheer <[email protected]> Fri, 3 Jul 2026 19:39:54 +0200
Newsgroups gmane.comp.gnu.lilypond.general
Message-ID <[email protected]>
Hi Lilypond users,

I want to have Lilypond print an additional book with a specific filename if a
variable is set. But the following logic does not print the book, it does
nothing. What am I not seeing?

Thx

%%% SNIPPET START %%%
publishMode = 1
[...]
#(if (= publishMode 1)
  #{
    \book {
      [...]
    }
  #}
)
%%% SNIPPET START %%%