lilypond-user
[Top][All Lists]
Advanced

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

Re: Top margin


From: Sharon Rosner
Subject: Re: Top margin
Date: Tue, 19 Jan 2016 02:57:02 -0700 (MST)

After a few hours of experiments (and re-reading the docs) I have arrived at
a solution:

It turns that the header (and footers I guess) is always vertically
positioned according to the top-margin setting. So setting the top-margin
will determine the space between the top edge of the page and the top of the
header.

The position of the top staff relative to the top margin can be set using
the top-system-spacing alist. So in order to have the top line of the top
staff at a constant distance from the edge, the following is needed:

\paper {
  ...
  % distance of top of header from page's top edge
  top-margin = 10\mm
  ...
  % distance of top line of top staff from page's top edge
  top-staff-margin = 24.5\mm

  % set the basic distance of the top staff from the top margin
  % this formula takes into account the above settings, the current staff
size, and adds
  % 2 staff spaces, since the reference position of the staff is its center
line
  top-system-spacing #'basic-distance = #(+ (/ (- top-staff-margin
top-margin) staff-space) 2) 
  top-system-spacing #'minimum-distance = 0
  % set large negative padding in order to ignore the skyline
  top-system-spacing #'padding = -50
  % do not stretch the distance
  top-system-spacing #'stretchability = 0
  ...
}

So, basically with this technique there's only two values that need to be
changed in order to change the actual top margins (header and music) -
top-margin and top-staff-margin.

> Similarly, you should be able to fix the location of the bottom staff by
> setting the stretchability of last-bottom-spacing to zero.  And a similar
> note about the basic-distance of last-bottom-spacing also applies.

Yes, I guess the same could be done for the bottom staff.

Sharon



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Top-margin-tp186119p186155.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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