lilypond-devel
[Top][All Lists]
Advanced

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

Page turn breaking blank pages


From: Nicolas Sceaux
Subject: Page turn breaking blank pages
Date: Sun, 14 Dec 2008 13:08:49 +0100

Joe,

I'm trying to produce separate parts for an opera, using the combination
of page-turn-breaking and bookparts. This gives good results, however,
the page-turn page breaking algorithm adds blank pages at some places,
for instance, just before the last page of a bookpart, which gives an
awkward result:
 _4_  _5_    _6_  _7_    _8_
|===||===|  |===||   |  |===|  (then the beginning of the next part on
|===||===|  |===||   |  |===|  the following odd page)
|===||===|  |===||   |  |===|
 ---  ---    ---  ---    ---

whereas the following would be more pleasing:
 _4_  _5_    _6_  _7_
|===||===|  |===||===|   (then the beginning of the next part on the
|===||===|  |===||===|   following even page, or possibly on the next
|===||===|  |===||===|   odd page after leaving a blank page)
 ---  ---    ---  ---

(pages 1 to 3 are in another bookpart, containing title page and contents)

When patching the code as follows, the blank page is not added:

diff --git a/lily/page-turn-page-breaking.cc b/lily/page-turn-page- breaking.cc
index e239cc2..665385b 100644
--- a/lily/page-turn-page-breaking.cc
+++ b/lily/page-turn-page-breaking.cc
@@ -125,12 +125,7 @@ Page_turn_page_breaking::calc_subproblem (vsize ending_breakpoint) int p_num = robust_scm2int (book_->paper_->c_variable ("first- page-number"), 1);
       if (start > 0)
         {
- /* except possibly for the first page, enforce the fact that first_page_number_
-            should always be even (left hand page).
-            TODO: are there different conventions in right-to-left languages?
-         */
p_num = state_[start-1].first_page_number_ + state_[start-1].page_count_;
-         p_num += p_num % 2;
         }

       Line_division min_division;
@@ -252,10 +247,6 @@ Page_turn_page_breaking::make_pages (vector<Break_node> const &soln, SCM systems
     {
       for (vsize j = 0; j < soln[i].page_count_; j++)
        lines_per_page.push_back (soln[i].system_count_[j]);
-
- if (i + 1 < soln.size () && (soln[i].first_page_number_ + soln[i].page_count_) % 2)
-       /* add a blank page */
-       lines_per_page.push_back (0);
     }

   /* this should only actually modify first-page-number if

But I imagine that this deleted code serves a good purpose.
Would it be reasonnable to add an option for not adding blank pages,
for instance a paper variable 'page-turn-breaking-no-blank-pages, to
avoid blank pages being added when the user does not want them?

Nicolas





reply via email to

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