lilypond-user
[Top][All Lists]
Advanced

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

Re:


From: ghe
Subject: Re:
Date: Sun, 12 May 2013 16:12:33 +0200 (CEST)
User-agent: Alpine 2.02 (DEB 1266 2009-07-14)


Thank you again, Thomas!


Well, you could do the following, although it might be not be the same as \hfill in Tex.


Indeed, there are a few differences, notably in the fact that the amount of space is not calculated automatically, and in the fact that it cannot be inserted between two elements (for example to put the final bar at the end of the staff instead of shortening the staff). But, as I said, it is already a good solution, and I think I will live with it.


\version "2.14.2"

spaceRight =
#(define-music-function (parser location space)(number?)
 (let* ((amount (+ space 0.5))
        (space-right `(extra-space . ,amount)))
 #{
    %% Maybe additional layout-objects must be affected!?
    \once \override Score.BarLine #'space-alist #'right-edge = #`(extra-space . 
,$space)
    \once \override Score.KeySignature #'space-alist #'right-edge = $space-right
    \once \override Score.KeyCancellation #'space-alist #'right-edge = 
$space-right
    \once \override Score.TimeSignature #'space-alist #'right-edge = 
$space-right
 #}))


hfill = \spaceRight #20

{
  %\spaceRight #30
  %\key d\major
  a4\( b c d~(
  %\breathe
  \hfill\break
  %\time 8/8
  %\clef alto
  %\key cis\major
  d4 b) c\) d \bar "|."
  \hfill
}


I see, I guess that the \once is there to prevent that the \spaceRight takes effect on all the staffs, which is indeed better. (But I don't understand why \override BarLine had to be changed.)

--ghe



reply via email to

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