lilypond-devel
[Top][All Lists]
Advanced

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

Re: feature-request / doc-actualization (right-margin)


From: Maximilian Albert
Subject: Re: feature-request / doc-actualization (right-margin)
Date: Tue, 28 Jul 2009 00:49:45 +0900

2009/7/27 Werner <address@hidden>:
>> Are the two sentences in "Known issues and warnings" in the Horizontal
>> dimensions section clear enough?
>
> Sorry - I hadn't seen this. It is clear. So the doc is OK.
> But the feature-request to provide right-margin remains.

Wondering why this is so difficult that it has been an issue for such
a long time, I took a look at scm/page.scm and played around with the
code there. It turned out that it's relatively easy to make Lilypond
take the setting for right-margin into account (see attached patch)
but I ran into the following problems:

1) The code in scm/page.scm is able to test whether left-margin and/or
right-margin was specified by the user in the \paper block (if this
isn't the case, the value is #f). However, the same doesn't seem to be
true for line-width because this variable _always_ has a value (i.e.,
it cannot be undefined like the other two). Thus I cannot check
whether both the left+right margins *and* the line-width were
specified by the user. As Werner pointed out, we should print a
warning in this case and discard one of the values. BTW, how can I
find out which of the values was specified last in the .ly file so
that that's the one taken into account?

2) With the attached patch, the following works as expected.

=== BEGIN CODE ===

\paper {
  left-margin  = 2 \cm
  right-margin = 3 \cm
}

\relative c' { \repeat unfold 100 { f } }

=== END CODE ===

When adding the line

   line-width = 10 \cm

to the \paper block it still kinda "works" (the line-width value is
simply discarded so that the margins are as specified). Interestingly,
however, the value of line-width still has an effect on the *spacing*
of the notes. Namely, the notes are spaced as if the line-width were
truly 10cm but then the line gets stretched to account for the margin
values. How can this be avoided? Or is it even a feature rather than a
bug? (I can imagine that some users might want to make use of this to
achieve tighter or wider spacing, although I'm not sure that's a good
idea.)

Thanks for any help,
Max

Attachment: right_margin.patch
Description: Text Data


reply via email to

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