lilypond-user
[Top][All Lists]
Advanced

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

Re: page breaks related to header size


From: Joe Neeman
Subject: Re: page breaks related to header size
Date: Sun, 18 Nov 2007 10:59:04 +1100
User-agent: KMail/1.9.7

On Tue, 13 Nov 2007 18:27:16 Risto Vääräniemi wrote:
> Hi again,
>
> Paul's example looks very familiar. :-)
>
> On Mon, 12 Nov 2007 Joe Neeman-2 wrote:
> > If you can create a bad example without any titles, that example will
> > probably
> > still cause problems. If you can send such an example to the mailing
> > list, that would be helpful.
>
> Last night I spent a couple of hours of quality time trying to boil down my
> mystery score. I cut off the first page containing the header stuff. Even
> now it cannot be called a minimal example but I learned something in the
> process. The score now fits onto one page and I've enclosed it below.
>
> If I comment out the zero-size bottom-margin the last system is split onto
> two pages. That was expected but more follows. If I comment out the volta
> repeat at the same time the music fits again on one page. The example
> didn't work if the last system was not very full, hence the strange first
> voice. When the repeat sign is removed the system becomes less crowded and
> the stuff fits again on one system. On my original score the "page break
> limit" with the volta repeat was 8.3 mm and without the repeat 16 mm. I had
> to stop at 16 mm because that messed up the first page, which more tightly
> set.
>
> In addition, if the "SpacingSpanner #'spacing-increment" value in the Score
> block is removed the bottom-margin or the repeat don't have any special
> effects anymore.
>
> *Conclusion:*
> It seems that there's some kind of relationship with horizontal and
> vertical layout. I wonder if Lilypond leaves some kind of invisible
> remnants if a system is crammed too full and this causes mystical page
> breaks.

Lilypond tries to find a line- and page-breaking solution that gives 
reasonable results for both horizontal and vertical stretching. So yes, the 
horizontal and vertical layout affect each other (although you can prevent 
this by setting system-count = #some-number in the paper block).

The weird behaviour in your example is due to some strange interactions 
between the horizontal spacing and ragged-last-bottom. I don't see right now 
how to fix these interactions without breaking things, but I'll think about 
it.

Warning: long-winded explanation follows.

For the curious, here is the problem: the ideal (according to Lilypond) 
horizontal spacing takes up three systems. These three systems don't fit on 
one page, so lilypond considers putting 2 on the first page and 1 on the 
second page. The outcome of this is
Option 1:
 - horizontal spacing: as good as possible
 - vertical spacing:
    - first page: not so good -- there is a fair amount of extra space
    - second page: doesn't count because ragged-last-bottom = ##t

Then Lilypond considers the possibility of reducing the number of systems by 
1. Then the whole score fits on one page and we have:
Option 2:
- horizontal spacing: not as good as before
- vertical spacing:
  - first page: doesn't count because ragged-last-bottom = ##t

The decision as to which layout is better comes down to whether the badness in 
the first page of option 1 is worse than the badness in the horizontal 
spacing of option 2. As you increase bottom-margin, option 1 begins to look 
better and better, until it becomes better than option 2.

So you can see that the page spacing in this example isn't caused by lilypond 
thinking that things don't fit; it's caused by two competing solutions.

Joe

PS: Getting rid of the spacing-increment override causes the ideal horizontal 
spacing to take up only two systems, which prevents this whole mess.

PPS: For scores that are longer than a few lines, it is usually better to set 
ragged-last-bottom = ##f.

PPPS: In the next version, you will be able to set page-count = #some-number 
in the paper block, which should make these things easier to control.




reply via email to

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