OK, I can use the workaround described in the documentation.
I am handling these scores like this now:
% In top level
\include "score-with-variables.ly"
\book { \bookpart { \score-with-variables-bookpart } }
% In score-with-variables.ly
score-with-variables-bookpart = \score { ... }
\score-with-variables-bookpart
That let me use the score separately as well as include it in a
book/bookpart.
Not the cleanest but as long as it works...
On Tue, 30 Jun 2026 at 16:25, Sven Axelsson <[email protected]> wrote:
> I have many files that each define a separate score. Sometimes I also
> want to combine them using book/bookpart like so:
>
> \book {
> \bookpart {
> \include "score1.ly"
> \include "score1.ly"
> }
> }
>
> and so on.
>
> However, as noted in
> https://lilypond.org/doc/v2.26/Documentation/notation/multiple-scores-in-a-book
> the include will fail if the score contains variables, which it sometimes
> does.
>
> What is the best workaround for this case, where I both want to render the
> score separately and include it in a bookpart?
>
> --
> *Sven Axelsson*
> ++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
> >++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
> +++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.
>
--
*Sven Axelsson*
++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
>++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
+++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.