lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to automatically left-align rehearsal marks at the beginning of


From: Pierre Perol-Schneider
Subject: Re: how to automatically left-align rehearsal marks at the beginning of a line
Date: Thu, 16 Oct 2014 07:08:20 +0200

2014-10-15 18:33 GMT+02:00 Thomas Morley <address@hidden>:
 
how about:

\version "2.19.13"

\layout {
  \context {
    \Score
    \override RehearsalMark.self-alignment-X =
      #(lambda (grob)
        (let* ((break-dir (ly:item-break-dir grob)))
          (case break-dir
            ((-1) RIGHT)   ;; end-of-line -> right alignedd
            ((1) LEFT)     ;; begin-of-line -> left-aligned
            (else CENTER)  ;; otherwise -> center-aligned
            )))
  }
}

\relative c'' {
  c1
  \tweak break-visibility #end-of-line-visible
  \mark "this should be right aligned" |
  \break
  c1
  \mark "this should be center aligned"
  c1
  \mark "this should be left aligned" |
  \break
  c1
}

Well done Harm, very elegant !



reply via email to

[Prev in Thread] Current Thread [Next in Thread]