On Tue, Jun 30, 2026 at 8:00 AM Sven Axelsson <[email protected]>
wrote:

>
> On Tue, 30 Jun 2026 at 16:39, Shane Brandes <[email protected]>
> wrote:
>
>> Is it possible to put all the variables in the main file to eliminate
>> that problem?
>>
>
> No, that is unfortunately not possible.
>

The way I do this is by putting the scores into variables themselves.  So
the book would look like this:

piece-one.ly:
%%%
pieceOne = \score {
  \new Staff { c'4 4 4 4 }
}
%%%

piece-two.ly:
%%%
pieceTwo = \score {
  \new Staff { d'4 4 4 4 }
}
%%%

book.ly
%%%
\version "2.26.0"
\include "vars.ily"
\include "piece-one.ly"
\include "piece-two.ly"

\book {
  \bookpart {
    \pieceOne
    \pieceTwo
  }
}
%%%

And an individual piece would look like this:

%%%
\version "2.26.0"
\include "vars.ily"
\include "piece-one.ly"

\pieceOne
%%%

--
Knute Snortum

Reply via email to