Arjen Bax wrote:

TiagoM <tiagomorin <at> gmail.com> writes:


How can one align a \markup with the center of the notehead instead of it's
left edge?

Use \halign:

\version "2.10.20"
{
 c''^\markup{\halign #0 "Centered"}
}

See
http://lilypond.org/doc/v2.10/Documentation/user/lilypond/Overview-of-text-markup-commands#Overview-of-text-markup-commands
In that case, I would rather propose
c''^\markup{\hcenter "Centered" }
or
\override TextScript #'self-alignment-X = #CENTER c''^"Centered"

However, if I understand correctly, the question was about the
alignment point of the note, not of the text itself. You can get
it centered on the note head by the setting:

\override TextScript #'X-offset =#(ly:make-simple-closure
                     `(,+
,(ly:make-simple-closure (list ly:self-alignment-interface::centered-on-x-parent)) ,(ly:make-simple-closure (list ly:self-alignment-interface::x-aligned-on-self))))

I recommend you to use copy/paste to insert this into your file,
since it's very critical to get all backwards quote marks and commas
correct.

  /Mats



_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to