lilypond-user
[Top][All Lists]
Advanced

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

Re: Markup spacing issue


From: Thomas Morley
Subject: Re: Markup spacing issue
Date: Mon, 16 Sep 2013 12:14:00 +0200

2013/9/16 Noeck <address@hidden>:
>
>> You most probably want to use \null instead of \hspace.  And you
>> probably will be interested in this snippet:
>> http://github.com/openlilylib/snippets/blob/master/templates/adjustable-centered-stanzas.ily
>>
>> best,
>> Janek
>
> That is a very useful snippet. Thanks!
>
> Cheers,
> Joram
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user

Hi Joram,

I didn't look at Janek's link, though you might be interested in the
markup-command 'compensate-indent' I wrote some time ago.
Shouldn't be too hard to adept it, though it works even right now.

\version "2.17.26" %"2.16.0"

#(define-markup-command (compensate-indent layout props arg)(markup?)
#:properties ((add-space  0)
              (stack-dir RIGHT))
  (let* ((amount (+ add-space (ly:output-def-lookup layout 'indent)))
         (lst (if (= stack-dir RIGHT)
                  (list (make-hspace-markup amount) arg)
                  (reverse (list (make-hspace-markup amount) arg))))
         (mrkp (make-concat-markup lst)))
  (interpret-markup layout props mrkp)))


\markup
  \override #'(add-space . -5 )
  \box
    \fill-line {
            \box
              \compensate-indent
                 \column {
                   "Trägt die schönsten bunten Schleifen,"
                 }
            \box
            \override #'(stack-dir . -1)
              \compensate-indent
                \column {
                  "Hat das Jahr genug vom Tanzen,"
                }
    }

Delete the \box-command, only inserted for better viewing what happens.


HTH,
  Harm



reply via email to

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