Hello Valentin,
thanks for your help!
I try to explain better what I need to do. Suppose that my score is divided into three sections. The first one has not only notes, but a title too.
I need to render the sections all together or individually. The first obvious way to do that is write the score in the form:
%%%%%
\markup { "My-Title" }
{
% SECTION 1 (title + notes)
{ c'1 c' d' d'\pageBreak }
%SECTION 2
{ c'1 c' d' d'\sustainOn\pageBreak }
%SECTION 3
{ c'1 c'\sustainOff d' d' }
}
%%%%%
and then comment or comment out parts of the score that I don't need to render. So, for example, if I need to render only section 2, I would comment section 3 and section 1 but I have to comment the markup block separately as well: this is unwanted, because the markup belongs to section 1 context. Instead, it would be more appropriate to exclude automatically the markup block when section one is not included.
Note that putting the sections into separate files, as you suggested, does not solve the problem: instead of commenting blocks of code, I would have to exclude both the file associated to the markup and the file associated to section 1, if I want to render section 2.
Now, if I try to by-pass the problem with a \book context, I can embed the markup into section 1:
%%%%%
\book {
% SECTION 1 (title + notes)
\markup { "My-Title" }
{ c'1 c' d' d'\pageBreak }
%SECTION 2
{ c'1 c' d' d'\sustainOn\pageBreak }
%SECTION 3
{ c'1 c'\sustainOff d' d' }
}
%%%%%
In this way, I could embed the markup into section 1, but it won't work for another reason: the presence of the pedal needs that all the sections belong to the same context. Note too that if I tweak sections of a score into separate scores, I would have a logical mismatch between the syntax used for blocks of code and what that blocks of code effectively represent, which is unwanted too.
Hope this is more clear. Unfortunately the problem is tricky (and I hope I'm wrong, so that there is already a right approach for it)
Best,
Paolo