]> git.donarmstrong.com Git - lilypond.git/commitdiff
Book parts: ragged-bottom-last and book titles
authorNicolas Sceaux <nicolas.sceaux@free.fr>
Sat, 23 Aug 2008 18:51:03 +0000 (20:51 +0200)
committerNicolas Sceaux <nicolas.sceaux@free.fr>
Sat, 23 Aug 2008 18:51:03 +0000 (20:51 +0200)
When a book part has a \header block capable of generating a book
title, print the title, even if the part is not the first one.

Ragged-bottomize the last page of a book part when ragged-bottom-last
is true, even if the part is not the last one.

lily/book.cc
lily/page-breaking.cc
lily/paper-book.cc

index 700405f3142d6ff0cdd5c71cba1eda25f449fa78..aa00be1a02117a26af67569090445ae175720920 100644 (file)
@@ -128,8 +128,10 @@ Book::set_parent (Book *parent)
     }
   paper_->parent_ = parent->paper_;
 
-  if (header_ == SCM_EOL)
+  if ((header_ == SCM_EOL) && (scm_is_null (parent->bookparts_)))
     {
+      /* If this is the first part, and it has no header, copy the 
+       * parent header */
       header_ = ly_make_anonymous_module (false);
       if (ly_is_module (parent->header_))
         ly_module_copy (header_, parent->header_);
index a0aeddd43d41b26cae71abaa6c8a3bb2aca9cb55..1bc13ffc5fac1b22b15059d93ad40bb163ece0fd 100644 (file)
@@ -263,14 +263,14 @@ Page_breaking::make_pages (vector<vsize> lines_per_page, SCM systems)
   for (vsize i = 0; i < lines_per_page.size (); i++)
     {
       SCM page_num = scm_from_int (i + first_page_number);
-      SCM last = scm_from_bool (last_part && (i == lines_per_page.size () - 1));
-      SCM rag = scm_from_bool (ragged () || (to_boolean (last)
-                                            && ragged_last ()));
+      bool last_from_part = (i == lines_per_page.size () - 1);
+      SCM last_from_book = scm_from_bool (last_part && last_from_part);
+      SCM rag = scm_from_bool (ragged () || (last_from_part && ragged_last ()));
       SCM line_count = scm_from_int (lines_per_page[i]);
       SCM lines = scm_list_head (systems, line_count);
       SCM page = scm_apply_0 (make_page,
                              scm_list_n (book, lines, page_num,
-                                         rag, last, SCM_UNDEFINED));
+                                         rag, last_from_book, SCM_UNDEFINED));
 
       /* collect labels */
       for (SCM l = lines ; scm_is_pair (l)  ; l = scm_cdr (l))
index 43e2012043a8fd48ef10fb65c2e40ee0b9d4db28..dfd3f6257fa64f9d68d52332095d61564a1109e8 100644 (file)
@@ -381,18 +381,15 @@ Paper_book::get_system_specs ()
 {
   SCM system_specs = SCM_EOL;
   
-  if (ly_scm2bool (paper_->c_variable ("part-is-first")))
+  Stencil title = book_title ();
+  if (!title.is_empty ())
     {
-      Stencil title = book_title ();
-      if (!title.is_empty ())
-        {
-          SCM props = paper_->lookup_variable (ly_symbol2scm ("book-title-properties"));
-          Prob *ps = make_paper_system (props);
-          paper_system_set_stencil (ps, title);
-          
-          system_specs = scm_cons (ps->self_scm (), system_specs);
-          ps->unprotect ();
-        }
+      SCM props = paper_->lookup_variable (ly_symbol2scm ("book-title-properties"));
+      Prob *ps = make_paper_system (props);
+      paper_system_set_stencil (ps, title);
+      
+      system_specs = scm_cons (ps->self_scm (), system_specs);
+      ps->unprotect ();
     }
 
   SCM page_properties