Re: Conditional \book - possible?
David Kastrup <[email protected]> Fri, 03 Jul 2026 20:42:12 +0200
| Newsgroups | gmane.comp.gnu.lilypond.general |
|---|---|
| Organization | Organization?!? |
| Message-ID | <[email protected]> |
Michael Scheer <[email protected]> writes: > 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 %%% The resulting value of # at top level is ignored because assignment-like function calls might return something that could be interpreted. So at top level, you need to state explicitly "please interpret the value" by writing $(if ...) instead of #(if ...) -- David Kastrup