left and right margins.
* Documentation/user/changing-defaults.itely (Page layout):
Explain the leftmargin option.
* Rename a few dashed functions in and scm/page-layout.scm and
scm/paper.scm not to have dashes.
+2004-07-25 Pedro Kroger <kroeger@pedrokroeger.net>
+
+ * scm/paper.scm (set-paper-dimensions): Preliminary support for
+ left and right margins.
+
+ * Documentation/user/changing-defaults.itely (Page layout):
+ Explain the leftmargin option.
+
2004-07-25 Han-Wen Nienhuys <hanwen@xs4all.nl>
* input/test/lyrics-melisma-variants.ly (texidoc): new file.
Margin between header and top of the page
@item bottommargin
Margin between footer and bottom of the page
+@item leftmargin
+ Margin between the left side of the page and the beginning of the music.
+@item linewidth
+ The length of the paper line.
@item headsep
Distance between top-most music system and the page header
@item footsep
@}
@end example
-You can also define these values in scheme. Please note that if you
-define @code{topmargin}, @code{bottommargin}, @code{headsep}, and
-@code{footsep} in scheme you have to insert a dash so they become
-@code{top-margin}, @code{bottom-margin}, @code{head-sep}, and
-@code{foot-sep}.
+You can also define these values in scheme. In that case @code{mm},
+@code{in}, @code{pt} and @code{cm} are variables defined in
+@file{book-paper-defaults.ly} with values in millimeters. That's why the
+value has to be multiplied in the example above.
@example
\bookpaper@{
- #(define bottom-margin (* 2 cm))
+ #(define bottommargin (* 2 cm))
@}
@end example
-@c is this explanations really necessary?
-In that case @code{mm}, @code{in}, @code{pt} and @code{cm} are variables
-defined in @file{book-paper-defaults.ly} with values in
-millimeters. That's why the value has to be multiplied in the example
-above.
+
+@refbugs
+
+The option rightmargin is defined but doesn't set the right margin
+yet. The value for the right margin has to be defined adjusting the
+values of the leftmargin and linewidth.
The default page header puts the page number and the @code{instrument}
field from the @code{\header} block on a line.
"Printable area for music and titles; matches default-page-make-stencil."
(let*
((h (- (ly:output-def-lookup paper 'vsize)
- (ly:output-def-lookup paper 'top-margin)
- (ly:output-def-lookup paper 'bottom-margin)))
- (head (page-headfoot paper scopes number 'make-header 'head-sep UP last?))
- (foot (page-headfoot paper scopes number 'make-footer 'foot-sep DOWN last?)))
+ (ly:output-def-lookup paper 'topmargin)
+ (ly:output-def-lookup paper 'bottommargin)))
+ (head (page-headfoot paper scopes number 'make-header 'headsep UP last?))
+ (foot (page-headfoot paper scopes number 'make-footer 'footsep DOWN last?)))
(- h (if (ly:stencil? head)
(interval-length (ly:stencil-extent head Y))
0)
(define-public (default-page-make-stencil lines paper scopes number last? )
"Construct a stencil representing the page from LINES. "
(let*
- ((top-margin (ly:output-def-lookup paper 'top-margin))
+ ((topmargin (ly:output-def-lookup paper 'topmargin))
;; TODO: naming vsize/hsize not analogous to TeX.
- (hsize (ly:output-def-lookup paper 'hsize))
- (left-margin (/ (- hsize
- (ly:output-def-lookup paper 'linewidth)) 2))
+ (leftmargin (ly:output-def-lookup paper 'leftmargin))
+ (rightmargin (ly:output-def-lookup paper 'rightmargin))
(vsize (ly:output-def-lookup paper 'vsize))
+ (hsize (ly:output-def-lookup paper 'hsize))
(bottom-edge (- vsize
- (ly:output-def-lookup paper 'bottom-margin)))
+ (ly:output-def-lookup paper 'bottommargin)))
- (head (page-headfoot paper scopes number 'make-header 'head-sep UP last?))
- (foot (page-headfoot paper scopes number 'make-footer 'foot-sep DOWN last?))
+ (head (page-headfoot paper scopes number 'make-header 'headsep UP last?))
+ (foot (page-headfoot paper scopes number 'make-footer 'footsep DOWN last?))
(line-stencils (map ly:paper-system-stencil lines))
(height-proc (ly:output-def-lookup paper 'page-music-height))
(music-height (height-proc paper scopes number last?))
(/ spc-left (length stretchable-lines))))
(page-stencil (ly:make-stencil '()
- (cons left-margin hsize)
- (cons (- top-margin) 0)))
+ (cons leftmargin hsize)
+ (cons (- topmargin) 0)))
(was-title #t))
(set! page-stencil (ly:stencil-combine-at-edge
(+ (- bottom-edge) (- (car (ly:stencil-extent foot Y)))))
))))
- (ly:stencil-translate page-stencil (cons left-margin 0))
+ (ly:stencil-translate page-stencil (cons leftmargin 0))
))
'(pt mm cm in staffheight staff-space
linewidth indent hsize vsize
staffspace linethickness ledgerlinethickness
- blotdiameter interscoreline))
+ blotdiameter interscoreline leftmargin rightmargin))
))
(define-public (set-global-staff-size sz)
(module-define! m 'indent (/ w 14))
;; page layout - what to do with (printer specific!) margin settings?
- (module-define! m 'top-margin (* 5 mm))
- (module-define! m 'bottom-margin (* 6 mm))
- (module-define! m 'head-sep (* 4 mm))
- (module-define! m 'foot-sep (* 4 mm))))
+ (module-define! m 'topmargin (* 5 mm))
+ (module-define! m 'bottommargin (* 6 mm))
+ (module-define! m 'headsep (* 4 mm))
+ (module-define! m 'footsep (* 4 mm))
+ (module-define! m 'leftmargin (* 10 mm))
+ (module-define! m 'rightmargin (* 10 mm))))
(define (internal-set-paper-size module name)
(let* ((entry (assoc name paper-alist))