Le 09/04/2021 à 13:59, Gilberto Agostinho a écrit :
Hi David,
On 09/04/2021 12:32, David Kastrup wrote:
Where does the documentation suggest that \center-align (and similar)
does anything to a single item? It aligns the things passed to it, not
their outside.
See the Text alignment section in
http://lilypond.org/doc/v2.23/Documentation/notation/formatting-text
it clearly makes use of a single item with \center-align.
Regardless of the documentation, would you be able to tell me what's
the best approach to centre a markup on a note, please? The solution I
found (last bar in my previous minimal example) seems very hacky to me
as it's mixing two things (\center-align and parent-alignment-x) for
the alignment.
Many thanks,
Gilberto
Hi,
What you are doing is more or less the proper
way. Objects have two parameters for alignment
because it should depend on both the extents of
the aligned object and its parent. This was
briefly discussed in this recent thread:
https://lists.gnu.org/archive/html/bug-lilypond/2021-02/msg00016.html
For what it's worth, you can do
center = \tweak parent-alignment-X 0 \tweak self-alignment-X 0 \etc
and then it's a matter of
{
d''1\center ^"III."
}
Best,
Jean