Preventing long \mark objects to stretch a measure: Difference between revisions
Appearance
Import snippet from LSR |
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series |
||
| Line 1: | Line 1: | ||
When you put a long \markup text in a \mark object, LilyPond stretches the measure to encompass the complete markup. This can be avoided by overriding the 'X-extent property of the RehearsalMark object, as demonstrated in this snippet. | When you put a long \markup text in a \mark object, LilyPond stretches the measure to encompass the complete markup. This can be avoided by overriding the 'X-extent property of the RehearsalMark object, as demonstrated in this snippet. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
%% http://lsr.di.unimi.it/LSR/Item?id=301 | %% http://lsr.di.unimi.it/LSR/Item?id=301 | ||
Revision as of 18:51, 16 November 2025
When you put a long \markup text in a \mark object, LilyPond stretches the measure to encompass the complete markup. This can be avoided by overriding the 'X-extent property of the RehearsalMark object, as demonstrated in this snippet.
\version "2.24"
%% http://lsr.di.unimi.it/LSR/Item?id=301
\paper{
indent = 0
}
\new PianoStaff <<
\new Staff {
\override Score.RehearsalMark.self-alignment-X = #left
R1 R1
\mark \markup { "long markup with default horizontal extent" }
R1*2
}
\new Staff {
\repeat unfold 16 {
\clef F
c4
}
}
>>
\new PianoStaff <<
\new Staff {
\override Score.RehearsalMark.self-alignment-X = #left
R1 R1
\mark \markup { "long markup with default horizontal extent" }
\override Score.RehearsalMark.X-extent = #'(0 . 0)
R1*2
}
\new Staff {
\repeat unfold 16 {
\clef F
c4
}
}
>>