> I have a situation with a lot of transposing instruments and some > key changes. I have disabled key cancellations, but of course they > are necessary if the new key has no sharps or flats. When naturals > are required, they push key signatures to the right, even though the > two will never appear together. > > I had an idea to set the X-extent of KeyCancellation to zero > (commented in the file), but I am not sure if this is robust.
This is a known issue, see https://gitlab.com/lilypond/lilypond/-/issues/6520 There you can also find a link to a work-around. Werner