Hello Valentin,
> My suggestion to getting around this would be the tell Lilypond that > the clef stencil is in fact narrower than it actually is, which will > allow the Clef stencil to protrude arbitrarily much: [...] Thanks! Interestingly, the clef still gets some extra horizontal space, which is especially undesirable for `\afterGrace`. This extra space can be suppressed by setting ``` \once\override Staff.Clef.space-alist.staff-bar = #'(extra-space . 0) ``` but this moves the clef too near to the bar line. I'm rather inclined to count the behaviour of `space-alist` for clefs as a buglet: It doesn't make sense allowing the clef to move 'under' other notes in different staves while its `space-alist` values are applied globally to all staves. The best (optical) solution that I have found so far is to disable `X-extent` completely, shifting the clef to the left using `extra-offset`. > Alternatively you may try to use \afterGrace to insert the \clef > before the bar line, although this would probably require some > manual spacing too. This doesn't work at all: `\afterGrace` doesn't accept a clef, as the image shows. ``` \markup "no clef change" \relative c' { << { \afterGrace f1 { e16[ f] } | g1 } { 1 | 1 } >> } \markup "lambda for X-extent" \relative c' { << { \afterGrace f1 { e16[ f] } | g1 } { 1 \once\override Staff.Clef.X-extent = #(lambda (grob) (let* ((stc (ly:grob-property grob 'stencil)) (ext (ly:stencil-extent stc X)) (mod-ext (cons (cdr ext) (cdr ext)))) mod-ext)) \clef "bass" | c,1 } >> } \markup "X-extent = ##f and extra-offset" \relative c' { << { \afterGrace f1 { e16[ f] } | g1 } { 1 \once\override Staff.Clef.X-extent = ##f \once\override Staff.Clef.extra-offset = #'(-2.9 . 0) \clef "bass" | c,1 } >> } \markup "clef change in \afterGrace" \relative c' { << \new Staff { \afterGrace f1 { e16[ f] } | g1 } \new Staff { \afterGrace 1 { s8 \clef "bass" } | c,1 } >> } ``` Werner