--- /dev/null
+\version "2.13.1"
+
+\header {
+ texidoc = "The max-systems-per-page variable prevents more
+than a given number of systems from being on a page. Titles
+are not counted as systems. \noPageBreak can override
+max-systems-per-page in unusual situations."
+ title = "Title"
+}
+
+#(set-default-paper-size "a6")
+
+\book {
+ \paper {
+ max-systems-per-page = 1
+ }
+
+ { c'1 \break c'1 \break \noPageBreak c'1 \break c'1 }
+}
\ No newline at end of file
\header {
texidoc = "The min-systems-per-page variable forces each page to have
-a minimum number of systems. Titles do not count as systems here.
-
-This exposes a bug with the current implementation; min-systems-per-page
-is not honored if to do so we would need uneven line breaking."
- title = "Example"
+a minimum number of systems. Titles do not count as systems here."
+ title = "Title"
}
-\paper {
- min-systems-per-page = 5
-}
+\book {
+ \paper {
+ min-systems-per-page = 5
+ }
-{ \repeat unfold 11 { c'1 } \pageBreak \repeat unfold 6 { c'1 } }
\ No newline at end of file
+ { \repeat unfold 11 { c'1 } \pageBreak \repeat unfold 6 { c'1 } }
+}
\ No newline at end of file
the desire not to overfill a page."
}
-\paper {
- min-systems-per-page = 20
-}
+\book {
+ \paper {
+ min-systems-per-page = 20
+ }
-\repeat unfold 21 { c'1 }
\ No newline at end of file
+ \repeat unfold 21 { c'1 }
+}
\ No newline at end of file
--- /dev/null
+\version "2.13.1"
+
+\header {
+ texidoc = "The systems-per-page variable forces a certain number of systems
+per page. Titles are not counted as systems."
+ title = "Title"
+}
+
+#(set-default-paper-size "a6")
+
+\book {
+ \paper {
+ systems-per-page = 3
+ }
+
+ { \repeat unfold 3 { c'1 } \pageBreak \repeat unfold 3 { c'1 } }
+}
\ No newline at end of file
}
if (page_count == 1 || scm_is_integer (forced_page_count))
- progress_indication (_f ("[%d, %d pages]", (int) end, (int) page_count));
+ progress_indication (_f ("[%d: %d pages]", (int) end, (int) page_count));
else
- progress_indication (_f ("[%d, %d or %d pages]", (int) end, (int) page_count-1, (int)page_count));
+ progress_indication (_f ("[%d: %d or %d pages]", (int) end, (int) page_count-1, (int)page_count));
/* try a smaller number of systems than the ideal number for line breaking */
Line_division bound = ideal_line_division;
{
vector<vsize> systems_per_page;
- message (_f ("Solving %d page-breaking chunks...", last_break_position ()-1));
+ message (_f ("Solving %d page-breaking chunks...", last_break_position ()));
for (vsize end = 1; end <= last_break_position (); ++end)
{
vector<vsize> chunk_systems = solve_chunk (end);
res.systems_per_page_.push_back (line - page_first_line);
- // Don't say that the force is infinite even if it is: if we were told to
- // put a certain number of systems on a page then we will, even if it's bad.
- res.force_.push_back (min (space.force_, BAD_SPACING_PENALTY));
+ res.force_.push_back (space.force_);
res.penalty_ += cached_line_details_[line-1].page_penalty_;
+ if (system_count_on_this_page != systems_per_page_)
+ {
+ res.penalty_ += TERRIBLE_SPACING_PENALTY;
+ res.system_count_status_ |= ((system_count_on_this_page < systems_per_page_))
+ ? SYSTEM_COUNT_TOO_FEW : SYSTEM_COUNT_TOO_MANY;
+ }
+
page_first_line = line;
}
/* Recalculate forces for the last page because we know now that is
really the last page. */
space.resize (page_height (first_page_num + page, true));
- res.force_.back () = min(space.force_, BAD_SPACING_PENALTY);
+ res.force_.back () = space.force_;
return finalize_spacing_result (configuration, res);
}