On Wed, 19 Nov 2025 at 13:18, Richard Shann <[email protected]> wrote:
>
> On Wed, 2025-11-12 at 15:33 +0000, Richard Shann wrote:
> > In this example, after a key signature change there seems to be
> > unnecessary extra space:
>
> I have tried to make no space at all with this:
>
> \version "2.25.18"
> {
>          g'1
>         \override KeySignature.extra-spacing-width = #'(+inf.0 . -
> inf.0) \key f \major a''
> }
>
> but that has no effect. So I still can't place the note a'' at the same
> distance from the key change as it would be from the barline if the key
> change wasn't there. Help!

Hello,

I am not sure what you are trying to achieve.
Anyway, you need to use \override Staff.KeySignature because
the Key_engraver is part of the Staff context.
I would have used \override Staff.KeySignature.extra-spacing-width = #'(0 .
0)
You can also have a look at the settings of \override
Staff.KeySignature.space-alist
\override Staff.KeySignature.space-alist = #'((ambitus extra-space . 1.15)
  (key-cancellation extra-space . 0.3)
  (time-signature extra-space . 1.15)
  (signum-repetitionis extra-space . 1.1)
  (staff-bar extra-space . 1.1)
  (cue-clef extra-space . 0.5)
  (optional-material-end-bracket extra-space . 1.0)
  (optional-material-start-bracket extra-space . 1.0)
  (right-edge extra-space . 0.5)
  (first-note shrink-space . 0))
https://lilypond.org/doc/v2.25/Documentation/internals/keysignature

Finally if you want the key signature to take no horizontal space at all,
then probably use
\override Staff.KeySignature.X-extent = #'(0 . 0)

Kind regards,
Xavier

Reply via email to