* Vertical spacing inside a system::
* Vertical spacing between systems::
* Explicit staff and system positioning::
-* Two-pass vertical spacing::
* Vertical collision avoidance::
@end menu
@rlsr{Spacing}.
-@node Two-pass vertical spacing
-@subsection Two-pass vertical spacing
-
-@warning{Two-pass vertical spacing is deprecated and will be removed in
-a future version of LilyPond. Systems are now stretched automatically
-in a single pass. See @ref{Vertical spacing inside a system}.}
-
-In order to automatically stretch systems so that they should fill the
-space left on a page, a two-pass technique can be used:
-
-@enumerate
-@item In the first pass, the amount of vertical space used to increase
-the height of each system is computed and dumped to a file.
-@item In the second pass, spacing inside the systems are
-stretched according to the data in the page layout file.
-@end enumerate
-
-The @code{ragged-bottom} property adds space between systems, while
-the two-pass technique adds space between staves inside a system.
-
-To allow this behavior, a @code{tweak-key} variable has to be set in
-each score @code{\layout} block, and the tweaks included in each score
-music, using the @code{\scoreTweak} music function.
-
-@quotation
-@verbatim
-%% include the generated page layout file:
-\includePageLayoutFile
-
-\score {
- \new StaffGroup <<
- \new Staff <<
- %% Include this score tweaks:
- \scoreTweak "scoreA"
- { \clef french c''1 \break c''1 }
- >>
- \new Staff { \clef soprano g'1 g'1 }
- \new Staff { \clef mezzosoprano e'1 e'1 }
- \new Staff { \clef alto g1 g1 }
- \new Staff { \clef bass c1 c1 }
- >>
- \header {
- piece = "Score with tweaks"
- }
- %% Define how to name the tweaks for this score:
- \layout { #(define tweak-key "scoreA") }
-}
-@end verbatim
-@end quotation
-
-For the first pass, the @code{dump-tweaks} option should be set to
-generate the page layout file.
-
-@example
-lilypond -dbackend=null -d dump-tweaks <file>.ly
-lilypond <file>.ly
-@end example
-
-
-@seealso
-Snippets:
-@rlsr{Spacing}.
-
-
@node Vertical collision avoidance
@subsection Vertical collision avoidance
-%% see comment for page-layout-parser definition below.
-includePageLayoutFile =
-#(define-music-function (parser location) ()
- (_i "Include the file @var{<basename>-page-layout.ly}. Deprecated as
-part of two-pass spacing.")
- (if (not (ly:get-option 'dump-tweaks))
- (let ((tweak-filename (format #f "~a-page-layout.ly"
- (ly:parser-output-name parser))))
- (if (access? tweak-filename R_OK)
- (begin
- (ly:message "Including tweak file ~a" tweak-filename)
- (set! page-layout-parser (ly:parser-clone parser))
- (ly:parser-parse-string page-layout-parser
- (format #f "\\include \"~a\""
- tweak-filename))))))
- (make-music 'SequentialMusic 'void #t))
-
instrumentSwitch =
#(define-music-function
(parser location name) (string?)
-%% Parser used to read page-layout file (see includePageLayoutFile
-%% above), and then retreive score tweaks (see scoreTweak below).
-#(define page-layout-parser #f)
-
%% pageBreak and pageTurn are music functions (iso music indentifiers),
%% because music identifiers are not allowed at top-level.
pageBreak =
(ly:music-compress music
(ly:make-moment (car fraction) (cdr fraction))))
-%% see comment for page-layout-parser definition above.
-scoreTweak =
-#(define-music-function (parser location name) (string?)
- (_i "Include the score tweak, if exists.")
- (if (and page-layout-parser (not (ly:get-option 'dump-tweaks)))
- (let ((tweak-music (ly:parser-lookup page-layout-parser
- (string->symbol name))))
- (if (ly:music? tweak-music)
- tweak-music
- (make-music 'SequentialMusic)))
- (make-music 'SequentialMusic)))
-
setBeatGrouping =
#(define-music-function (parser location grouping) (pair?)
(_i "Set the beat grouping in the current time signature to
\version "2.12.0"
\paper {
-
- %%% WARNING
- %%%
- %%% If you add any new dimensions, don't forget to update
- %%% the dimension-variables variable. See paper.scm.
-
- unit = #(ly:unit)
- mm = 1.0
- in = 25.4
- pt = #(/ in 72.27)
- cm = #(* 10 mm)
-
- print-page-number = ##t
-
- %%
- %% 20pt staff, 5 pt = 1.75 mm
- %%
-
- output-scale = #1.7573
-
- #(define-public book-title (marked-up-title 'bookTitleMarkup))
- #(define-public score-title (marked-up-title 'scoreTitleMarkup))
-
- %%
- %% ugh. hard coded?
- %%
-
- #(layout-set-absolute-staff-size (* 20.0 pt))
-
-
- #(define-public score-title-properties
- '((is-title . #t)
- (is-book-title . #f)
- ))
- #(define-public book-title-properties
- '((is-title . #t)
- (is-book-title . #t)
- ))
-
- %% Note: these are not scaled; they are in staff-spaces.
- between-system-spacing = #'((space . 12) (minimum-distance . 8) (padding . 1))
- between-scores-system-spacing = #'((space . 14) (minimum-distance . 8) (padding . 1))
- after-title-spacing = #'((space . 2) (padding . 0.5))
- before-title-spacing = #'((space . 5) (padding . 0.5))
- between-title-spacing = #'((space . 1) (padding . 0.5))
- top-system-spacing = #'((space . 1) (padding . 1) (min-distance . 0))
- top-title-spacing = #'((space . 1) (padding . 1) (min-distance . 0))
- bottom-system-spacing = #'((space . 1) (padding . 1) (min-distance . 0) (stretchability . 5))
-
- ragged-bottom = ##f
-
- %%
- %% looks best for shorter scores.
- %%
- ragged-last-bottom= ##t
-
- %%
- %% settings for the page breaker
- %%
- blank-last-page-force = 0
- blank-after-score-page-force = 2
- blank-page-force = 5
-
- %%
- %% To limit space between systems on a page with a lot of space left
- %%
- page-limit-inter-system-space = ##f
- page-limit-inter-system-space-factor = 1.4
-
- #(define font-defaults
- '((font-encoding . fetaMusic)))
-
- %%
- %% the font encoding `latin1' is a dummy value for Pango fonts
- %%
- #(define text-font-defaults
- `((font-encoding . latin1)
- (baseline-skip . 3)
- (word-space . 0.6)))
-
- #(define page-breaking ly:optimal-breaking)
-
- #(define write-page-layout (ly:get-option 'dump-tweaks))
- #(define system-maximum-stretch-procedure
- (lambda (line)
- (if (stretchable-line? line)
- (let ((height (line-height line)))
- (/ (* height height) 80.0))
- 0.0)))
-
-% #(define page-music-height default-page-music-height )
-% #(define page-make-stencil default-page-make-stencil )
-
- #(define make-header (marked-up-headfoot 'oddHeaderMarkup 'evenHeaderMarkup))
- #(define make-footer (marked-up-headfoot 'oddFooterMarkup 'evenFooterMarkup))
- #(set-paper-dimension-variables (current-module))
-
- \include "titling-init.ly"
-
- top-margin = 5 \mm
- bottom-margin = 6 \mm
- head-separation = 4 \mm
- foot-separation = 4 \mm
-
- first-page-number = #1
- print-first-page-number =##f
- }
+ %%% WARNING
+ %%%
+ %%% If you add any new dimensions, don't forget to update
+ %%% the dimension-variables variable. See paper.scm.
+
+ unit = #(ly:unit)
+ mm = 1.0
+ in = 25.4
+ pt = #(/ in 72.27)
+ cm = #(* 10 mm)
+
+ print-page-number = ##t
+
+ %%
+ %% 20pt staff, 5 pt = 1.75 mm
+ %%
+
+ output-scale = #1.7573
+
+ #(define-public book-title (marked-up-title 'bookTitleMarkup))
+ #(define-public score-title (marked-up-title 'scoreTitleMarkup))
+
+ %%
+ %% ugh. hard coded?
+ %%
+
+ #(layout-set-absolute-staff-size (* 20.0 pt))
+
+
+ #(define-public score-title-properties
+ '((is-title . #t)
+ (is-book-title . #f)))
+ #(define-public book-title-properties
+ '((is-title . #t)
+ (is-book-title . #t)))
+
+ %% Note: these are not scaled; they are in staff-spaces.
+ between-system-spacing = #'((space . 12) (minimum-distance . 8) (padding . 1))
+ between-scores-system-spacing = #'((space . 14) (minimum-distance . 8) (padding . 1))
+ after-title-spacing = #'((space . 2) (padding . 0.5))
+ before-title-spacing = #'((space . 5) (padding . 0.5))
+ between-title-spacing = #'((space . 1) (padding . 0.5))
+ top-system-spacing = #'((space . 1) (padding . 1) (min-distance . 0))
+ top-title-spacing = #'((space . 1) (padding . 1) (min-distance . 0))
+ bottom-system-spacing = #'((space . 1) (padding . 1) (min-distance . 0) (stretchability . 5))
+
+ ragged-bottom = ##f
+
+ %%
+ %% looks best for shorter scores.
+ %%
+ ragged-last-bottom = ##t
+
+ %%
+ %% settings for the page breaker
+ %%
+ blank-last-page-force = 0
+ blank-after-score-page-force = 2
+ blank-page-force = 5
+
+ %%
+ %% To limit space between systems on a page with a lot of space left
+ %%
+ page-limit-inter-system-space = ##f
+ page-limit-inter-system-space-factor = 1.4
+
+ #(define font-defaults
+ '((font-encoding . fetaMusic)))
+
+ %%
+ %% the font encoding `latin1' is a dummy value for Pango fonts
+ %%
+ #(define text-font-defaults
+ `((font-encoding . latin1)
+ (baseline-skip . 3)
+ (word-space . 0.6)))
+
+ #(define page-breaking ly:optimal-breaking)
+
+ #(define make-header (marked-up-headfoot 'oddHeaderMarkup 'evenHeaderMarkup))
+ #(define make-footer (marked-up-headfoot 'oddFooterMarkup 'evenFooterMarkup))
+ #(set-paper-dimension-variables (current-module))
+
+ \include "titling-init.ly"
+
+ top-margin = 5 \mm
+ bottom-margin = 6 \mm
+ head-separation = 4 \mm
+ foot-separation = 4 \mm
+
+ first-page-number = #1
+ print-first-page-number =##f
+}