Hello Valentin,

I was trying your patch (attached, for reference) on a self-built
lilypond today. It does indeed help with my use case (ragged-bottom =
##t), so thanks for that. I would appreciate if this patch could be
included in lilypond.

The only exception is when there is a song with more than 1 page
directly following a 1-page song where the latter started on an even
page. In this case, the last line of the 1-page song is still put on the
odd page so that the "more-pages" song can start on the next even page.

I would prefer a blank page (or a "This page is intentionally left
blank." page) in this case, instead of tearing apart the short song on
the page before.

For this I have for now added an empty \markup{} after all scores as a
work-around. I.e. if lilypond wants to put something on the odd page, it
will put the empty \markup{} on the odd page.

Is there a better solution? I tried experimenting with \if (to show
"This page is intentionally left blank" only if I set a custom variable
to ##t for a specific score), but I couldn't figure out how to make this
work.

> Am Donnerstag, dem 24.02.2022 um 00:43 +0100 schrieb Valentin Petzel:
> 
> > It might also be sensible to add a small demerit depending on the 
> > free whitespace to enforce a more even distribution of whitespace.

Since I am not a lilypond developer with knowledge about the internals,
I was not able to follow this suggestion. I did a look around in page-
turn-page-breaking.cc, but couldn't find a place where this demerit
would have to be added.

So, as it seems my limited knowledge about lilypond development will not
help in fixing the shortcomings from your patch, unfortunately.
Hopefully it could still be considered.


Thanks & Best,
Johannes
From 76700c375f7f1d04527395ce2e5a745744e14667 Mon Sep 17 00:00:00 2001
From: Valentin Petzel <valen...@petzel.at>
Date: Thu, 24 Feb 2022 00:43:07 +0100
Subject: [PATCH] page-turn-breaking: Add small demerit for more pages

---
 lily/page-turn-page-breaking.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lily/page-turn-page-breaking.cc b/lily/page-turn-page-breaking.cc
index 28a65c66df..eba0a537c2 100644
--- a/lily/page-turn-page-breaking.cc
+++ b/lily/page-turn-page-breaking.cc
@@ -126,7 +126,7 @@ Page_turn_page_breaking::put_systems_on_pages (vsize start, vsize end,
   ret.system_count_ = result.systems_per_page_;
 
   ret.too_many_lines_ = all_lines_stretched (configuration);
-  ret.demerits_ = result.demerits_;
+  ret.demerits_ = result.demerits_ + static_cast<Real>(ret.page_count_) / 1000;
   if (start > 0)
     ret.demerits_ += state_[start - 1].demerits_;
 
-- 
2.39.2

Reply via email to