Hi Harm, On Sat, Jul 2, 2016 at 10:43 AM, Thomas Morley <thomasmorle...@gmail.com> wrote: > 2016-07-01 20:43 GMT+02:00 Br. Gabriel-Marie | SSPX <brgabr...@sspx.org>: >> Because stanza numbers only appear on the first line. Using instrumentName >> to label verse numbers provides automatic numbering on every line. It >> wasn't my idea, actually, credit for that goes to Thomas Morley a few >> issues ago in Vol 163:issue 95. It works quite well. >> >> On 7/1/2016 1:30 PM, lilypond-user-requ...@gnu.org wrote: >>> >>> Why not use StanzaNumbers instead of instrumentName to label verse >>> numbers? > > > Meanwhile I tried to make StanzaNumber at every line-begin work, see attached. > Though, it's stacking workarounds, thus pretty expensive. > At least it _is_ possible, even now. > Maybe someone steps in futher improving it.
It is possible to check the break status of the NonMusicalPaperColumn to the left of the StanzaNumber. This eliminates the need to filter a list of all grobs on the line. First, you need the StanzaNumber's column. Then you can get its left neighbor (which is needed b/c the stanza's column is a PaperColumn and won't carry useful break info.). If the neighbor is non-musical and right-broken, we're at the start of the line. &===================== #(define (at-line-beginning? grob) (let* ((col (ly:item-get-column grob)) (ln (ly:grob-object col 'left-neighbor))) (not (and (eq? #t (ly:grob-property ln 'non-musical)) (= 1 (ly:item-break-dir ln)))))) #(define (keep-stanza-number-at-line-begin grob) (if (at-line-beginning? grob) (ly:grob-suicide! grob))) &==================== The override to use would be: %==================== \override StanzaNumber.after-line-breaking = #keep-stanza-number-at-line-begin &==================== I don't know how infallible this is :) Hope this is useful! David _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user