On Thu, Jan 8, 2026 at 7:36 AM Gabriel Ellsworth
<[email protected]> wrote:
>
> Below is a better MWE, including a new markup command. (It is my first time 
> defining a new markup command, so please let me know if I can improve 
> anything there!)
>
>
> Summary of problems:
>
> Regarding Lyrics.VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding — 
> The default value of #0.5 causes collisions (even in measure 17), and 
> increasing it to #2.5, as I have done in this MWE, also causes a problem: The 
> lyrics uppercase F (m. 32) through uppercase Z (m. 52) are too far below 
> their related staves.
> LilyPond is not “seeing” the obvious collision in measure 25 between the note 
> head and the long fermata and padding appropriately. Why?

You explicity tell LilyPond that the long fermata has no size with the
 following line:

>>        (#:with-dimensions-from #:null ; % removing this line pushes lyrics 
>> too far below their relatedstaff

Since the long fermata has zero dimension, it cannot collide with anything else.

I think that it is possible to have the lyrics close to the bottom of
the notes if there is no fermata.  But if there is a fermata, and the
fermata is below the notes/staff, the rest of the lyrics on that line
will have the same baseline.

Consider the following example:

%%% SNIPPET BEGINS
\version "2.24.4"

\layout {
  \override Lyrics.VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding
= #0.5
  \override 
Lyrics.VerticalAxisGroup.nonstaff-relatedstaff-spacing.basic-distance
= #5
}

#(define-markup-command (squaremata layout props text) (markup?)
   "Place a long fermata (scripts.ulongfermata) centered above the given text,
    with baseline-skip of 2.2."
   (interpret-markup layout props
     (markup
      #:override (cons 'baseline-skip 2.2)
      #:override (cons 'direction 1)  ; equivalent to ,UP
      #:dir-column
      (#:center-align text
       #:center-align
       (;#:with-dimensions-from #:null ; % removing this line pushes
lyrics too far below their relatedstaff
        #:musicglyph "scripts.ulongfermata")))))

<<
  \relative {
    \repeat unfold 4 { c'1 } \break
    \repeat unfold 4 { c1 } \break
    \repeat unfold 5 { f } \break
    \repeat unfold 3 { f } \break
    \repeat unfold 4 { g } \break
    \repeat unfold 4 { g } \break
    g, f'
    \repeat unfold 100 { f }
  }
  \new Lyrics \with {
    \consists Text_engraver
  }{ \lyricmode {
    a
    \markup \squaremata b
    c d e f g h i j k
    \markup \squaremata l
    \markup \squaremata m
    n o p
    \markup \squaremata q
    r s t u v w x
    \markup \squaremata y
    z A B C D E F G H I J K L M
    N O P Q R S T U V W X Y Z
    }
  }
>>

%%% SNIPET ENDS

HTH,

Carl

Reply via email to