Jérôme Plût <plut.jer...@gmail.com> writes: > Quinto Kalendas Augustas MMXV scripsit Kevin Barry : >> Hi Jerome, >> >> The most relevant part of the manuals for your question is probably here: >> http://lilypond.org/doc/v2.18/Documentation/notation/ >> changing-context-default-settings >> >> It should answer all of your questions (and there is even an example of how >> to >> store a \with block in a variable. > > Thanks for your answer. This explains \with a bit more for me. > However, \layout is still a mystery, even after reading through > http://lilypond.org/doc/v2.18/Documentation/notation/the-layout-block > . > > I have a few questions about \layout: > * why does, inside a \layout {} block, the macro \context behave > differently? Instead of \context Staff = "name", I now have to type > \context { \Staff }, which is surprising, and leads to:
\context is not a macro but a keyword. In layout definitions, this keyword has a different meaning than in music. In layout definitions, it means "a context definition follows". The first thing in the context definition is \Staff which means "copy the definition of Staff". > * is there a way to point to a specific staff to change the settings > only for this one? \layout { \context { \Staff = "name" } } > does not work, cf. example below: No. But you can define a new type of context: > \version "2.18.2" > reduce = \with { fontSize = #-3 } > \score { > \new StaffGroup << > \new Staff = "a" { a a a } Try \new StaffA { a a a } instead and then > \new Staff = "b" { b b b } > >> > \layout { \context { \Staff = "a" \reduce } } \layout { \context { \Staff \name "StaffA" \alias "Staff" } \context { \StaffGroup \accepts "StaffA" } } which will take the definition of Staff, reuse it for a context type called StaffA, will make sure that overrides for "Staff" will get accepted in "StaffA" as well, and will make StaffGroup contexts also accept StaffA contexts (you might want to have some other contexts accept it as well). > * is there a way, that I missed, to store in a variable a \with or a > \layout block, and then to apply this *to one element of a score > only*? The answer your mail pointed to applied it to the whole > score. > (Overcomplicated idea that might work: is it, for example, possible > to clone the Staff context into a SmallerStaff context, and to > change the settings for that one?) See above. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user