lilypond-user
[Top][All Lists]
Advanced

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

Re: Is there a simple way to add a vertical line separator between colum


From: Aaron Hill
Subject: Re: Is there a simple way to add a vertical line separator between columns?
Date: Fri, 22 Oct 2021 15:48:31 -0700
User-agent: Roundcube Webmail/1.4.9

On 2021-10-22 10:42 am, Kevin Cole wrote:
The subject line pretty much says it all:

I have two columns of additional verse lyrics to a song following the
score, and I'm wondering if there's a simple way  to add a vertical
line centered between them that is as "tall" as the two columns of
lyrics.

I'm still pretty new to LilyPond, hence the "simple". ;-)

The simplest option is to manually insert a \draw-line command.

%%%%
\markup \concat {
 \left-column { "Lorem ipsum" "dolor sit amet," }
 \hspace #2 \raise #1 \draw-line #'(0 . -4) \hspace #2
 \left-column { consectetur "adipiscing elit." }
}
%%%%

If you want something more automated, you could use a custom markup command like this:

%%%%
#(define-markup-command
  (line-between layout props left right)
  (markup? markup?)
  #:properties ((padding 0.5))
  (let* ((left-sten (interpret-markup layout props left))
         (left-yex (ly:stencil-extent left-sten Y))
         (right-sten (interpret-markup layout props right))
         (right-yex (ly:stencil-extent right-sten Y))
         (combined-yex (interval-union left-yex right-yex))
         (offset (car combined-yex))
         (height (interval-length combined-yex)))
   (interpret-markup layout props #{
    \markup \concat {
     #left \hspace #padding
     \raise #offset \draw-line #(cons 0 height)
     \hspace #padding #right
    } #} )))

\markup
\override #'(padding . 3)
\line-between
 \left-column { "Lorem ipsum" "dolor sit amet," }
 \left-column { consectetur "adipiscing elit." }
%%%%


-- Aaron Hill



reply via email to

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