Thanks. I've already got quite a baroque file structure, and was hoping to avoid having to add the \keepWithTag commands to a single one at the outer level. I'm sure to miss one somewhere... Oh well.
-------------------------
Thursday, November 21, 2019, 11:34:07 PM, Simon Albrecht wrote:
> Hi Peter,
> \keepWithTag and similar are music functions
> and take music as their
> second argument, that’s why they don’t work as you wish on \book or
> \bookpart level.
> There would certainly be ways to work around
> this using custom Scheme
> functions, but I use to think that it’s better to use standard tools
> here. Which means finding a clever arrangement
> of variables, includes,
> and separate .ly files, that allows you to
> avoid code duplication and
> still get clean ways of invoking the different output options.
> Perhaps it helps that \include works in a
> _very_ literal, ‘stupid’ way:
> You could theoretically do something like
> On 21.11.19 16:56, Peter Toye wrote:
>> Tags with multiple bookparts I want to produce two different outputs
>> from the same music which has several bookparts. Tagging would seem
>> ideal for this, but it seems that \keepWithTag is only valid within
>> \score {}. Oddly, Frescobaldi's auto-complete allows me to type it
>> both before the \book block and before the first \bookPart but then LP
>> gives an error:
>> error: wrong type for argument 2. Expecting music, found #<Book>
>> Is there any way round this? I certainly don't want to have two
>> different score blocks for each section.