+ }
+ else if (Text_interface::is_markup_list (scm_car (s))
+ || unsmob_page_marker (scm_car (s)))
+ output_paper_book->add_score (scm_car (s));
+ else
+ assert (0);
+
+}
+
+/* Concatenate all score or book part outputs into a Paper_book
+ */
+Paper_book *
+Book::process (Output_def *default_paper,
+ Output_def *default_layout,
+ Paper_book *parent_part)
+{
+ Output_def *paper = paper_ ? paper_ : default_paper;
+
+ /* If top book, recursively check score errors */
+ if (!parent_part && error_found ())
+ return 0;
+
+ if (!paper)
+ return 0;
+
+ Paper_book *paper_book = new Paper_book ();
+ Real scale = scm_to_double (paper->c_variable ("output-scale"));
+ Output_def *scaled_bookdef = scale_output_def (paper, scale);
+ paper_book->paper_ = scaled_bookdef;
+ if (parent_part)
+ {
+ paper_book->parent_ = parent_part;
+ paper_book->paper_->parent_ = parent_part->paper_;
+ }
+ paper_book->header_ = header_;
+
+ if (scm_is_pair (bookparts_))
+ {
+ /* Process children book parts */
+ process_bookparts (paper_book, paper, default_layout);
+ }
+ else
+ {
+ /* Process scores */
+ /* Render in order of parsing. */
+ for (SCM s = scm_reverse (scores_); scm_is_pair (s); s = scm_cdr (s))
+ {
+ process_score (s, paper_book, default_layout);
+ }