You quoted my draft from this thread, rather than that in the code.
Code: Select all
% GlassesOnSheetsMaxPerSheet: 6 default, USLegal => 9; A3 or USL2 => 13. For all on one sheet replace with "/GlassesOnSheetsMaxGlassesPerSheetInDefault 999 def".
/GlassesOnSheetsMaxPerSheet 6 /PaperType load dup /A3 eq exch /USL2 eq or {pop 13} if /PaperType load /USLegal eq {pop 9} if def
/GlassesOnSheets [
% For a custom arrangement replace the next line with something of the form "[0 1 2 3] [4 5 6 7 8 9] [10 11 12 13]"
% The code below spreads glasses evenly over the sheets, the one-larger sheets being last. For them to be early replace "floor" with "ceiling"; for them to be evenly distributed with "round".
<< /p Titles length GlassesOnSheetsMaxPerSheet div ceiling cvi /g 0 >> begin 0 1 p 1 sub {[exch p sub g Titles length sub exch div floor cvi {g /g g 1 add def} repeat]} for end
] def % /GlassesOnSheets
[/size]There are three relevant changes to the default definition of
GlassesOnSheets.
1. The default used to be take-it-or-leave-it. Now it has a parameter,
GlassesOnSheetsMaxPerSheet, which itself has a useful default. E.g.,
/GlassesOnSheetsMaxPerSheet 8 def, makes the default
GlassesOnSheets as few pages as possible, subject to the limit of ≤8 glasses per sheet ⇒ ⌈ (
Titles length) ÷ 8 ⌉ sheets). So
/GlassesOnSheetsMaxPerSheet 999 def will put all on ⌈ ε ⌉ = 1 sheet.
2. There is comment to help use or replace the default.
3. The code is less cryptic, and admits of (slight) alteration, as described in the comments.
The manual will be updated soon.