[ << Spacing issues ] | [Top][Contents][Index][ ? ] | [ Changing defaults >> ] | ||
[ < Paper size ] | [ Up : Paper and pages ] | [ Vertical dimensions > ] |
4.1.2 Page formatting
Margins, headers, and footers and other layout variables are automatically set according to the paper size.
This section lists and describes a number of paper variables that may be altered.
Vertical dimensions | ||
Horizontal dimensions | ||
Other layout variables |
[ << Spacing issues ] | [Top][Contents][Index][ ? ] | [ Changing defaults >> ] | ||
[ < Page formatting ] | [ Up : Page formatting ] | [ Horizontal dimensions > ] |
Vertical dimensions
These variables are used to set different vertical dimensions on a page:
-
after-title-space
-
The amount of space between the title and the first system. Default:
5\mm
. -
before-title-space
-
Amount of space between the last system of the previous piece and the title of the next. Default:
10\mm
. -
between-system-padding
-
The minimum amount of white space that will always be present between the bottom-most symbol of one system, and the top-most of the next system. Default:
4\mm
.Increasing this will put systems whose bounding boxes almost touch farther apart.
-
between-system-space
-
The distance between systems. It is the ideal distance between the center of the bottom staff of one system and the center of the top staff of the next system. Default:
20\mm
.Increasing this value will provide a more even appearance of the page at the cost of using more vertical space.
-
between-title-space
-
Amount of space between consecutive titles (e.g., the title of the book and the title of a piece). Default:
2\mm
. -
bottom-margin
-
The margin between footer and bottom of the page. Default:
6\mm
. -
foot-separation
-
Distance between the bottom-most music system and the page footer. Default:
4\mm
. -
head-separation
-
Distance between the top-most music system and the page header. Default:
4\mm
. -
page-top-space
-
Distance from the top of the printable area to the center of the first staff. This only works for staves that are vertically small. Big staves are set with the top of their bounding box aligned to the top of the printable area. Default:
12\mm
. -
paper-height
-
The height of the page. Default: the height of the current paper size. For details, see Paper size.
-
top-margin
-
The margin between header and top of the page. Default:
5\mm
.
Selected Snippets
The header and footer are created by the functions make-footer and make-header, defined in \paper. The default implementations are in ly/paper-defaults.ly and ly/titling-init.ly.
The page layout itself is done by two functions in the \paper block, page-music-height and page-make-stencil. The former tells the line-breaking algorithm how much space can be spent on a page, the latter creates the actual page given the system to put on it.
You can define paper block values in Scheme. In that case mm, in, pt, and cm are variables defined in paper-defaults.ly with values in millimeters. That is why the value 2 cm must be multiplied in the example
\paper { #(define bottom-margin (* 2 cm)) }
Example:
\paper{ paper-width = 2\cm top-margin = 3\cm bottom-margin = 3\cm ragged-last-bottom = ##t }
This second example centers page numbers at the bottom of every page.
\paper { print-page-number = ##t print-first-page-number = ##t oddHeaderMarkup = \markup \fill-line { " " } evenHeaderMarkup = \markup \fill-line { " " } oddFooterMarkup = \markup { \fill-line { \bold \fontsize #3 \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string } } evenFooterMarkup = \markup { \fill-line { \bold \fontsize #3 \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string } } }
You can also define these values in Scheme. In that case mm
,
in
, pt
, and cm
are variables defined in
‘paper-defaults.ly’ with values in millimeters. That is why the
value must be multiplied in the example
\paper { #(define bottom-margin (* 2 cm)) }
The header and footer are created by the functions make-footer
and make-header
, defined in \paper
. The default
implementations are in ‘ly/paper-defaults.ly’ and
‘ly/titling-init.ly’.
The page layout itself is done by two functions in the
\paper
block, page-music-height
and
page-make-stencil
. The former tells the line-breaking algorithm
how much space can be spent on a page, the latter creates the actual
page given the system to put on it.
See also
Notation Reference: Vertical spacing between systems.
Snippets: Spacing.
[ << Spacing issues ] | [Top][Contents][Index][ ? ] | [ Changing defaults >> ] | ||
[ < Vertical dimensions ] | [ Up : Page formatting ] | [ Other layout variables > ] |
Horizontal dimensions
Note: If |
There are a few variables that determine the horizontal dimensions on a page:
-
horizontal-shift
-
The amount that all systems (including titles and system separators) are shifted to the right. Default:
0.0
. -
indent
-
The level of indentation for the first system in a score. Default:
paper-width
divided by14
, as determined byset-default-paper-size
orset-paper-size
. -
left-margin
-
The margin between the left edge of the page and the beginning of each system. Default:
10\mm
, as determined byset-default-paper-size
orset-paper-size
. -
line-width
-
The width of music systems. Default:
paper-width
minus20\mm
, as determined byset-default-paper-size
orset-paper-size
. -
paper-width
-
The width of the page. Default: the width of the current paper size. For details, see Paper size.
-
short-indent
-
The level of indentation for all systems in a score besides the first system. Default:
0
, as determined byset-default-paper-size
orset-paper-size
.
See also
Snippets: Spacing.
Known issues and warnings
The option right-margin
is defined but doesn’t set the
right margin yet. The value for the right margin has to be
defined by adjusting the values of left-margin
and
line-width
.
[ << Spacing issues ] | [Top][Contents][Index][ ? ] | [ Changing defaults >> ] | ||
[ < Horizontal dimensions ] | [ Up : Page formatting ] | [ Music layout > ] |
Other layout variables
These variables can be used to adjust page layout in general.
-
auto-first-page-number
-
The page breaking algorithm is affected by the first page number being odd or even. If set to true, the page breaking algorithm will decide whether to start with an odd or even number. This will result in the first page number remaining as is or being increased by one. Default:
##f
. -
blank-last-page-force
-
The penalty for ending the score on an odd-numbered page. Default:
0
. -
blank-page-force
-
The penalty for having a blank page in the middle of a score. This is not used by
ly:optimal-breaking
since it will never consider blank pages in the middle of a score. Default:5
. -
first-page-number
-
The value of the page number on the first page. Default:
#1
. -
page-breaking-between-system-padding
-
Tricks the page breaker into thinking that
between-system-padding
is set to something different than it really is. For example, if this variable is set to something substantially larger thanbetween-system-padding
, then the page-breaker will put fewer systems on each page. Default: unset. -
page-count
-
The number of pages to be used for a score. Default: unset.
-
page-limit-inter-system-space
-
If set to true, limits space between systems on a page with a lot of space left. Default:
##f
. For details, see Vertical spacing between systems. -
page-limit-inter-system-space-factor
-
The factor used by
page-limit-inter-system-space
. Default:1.4
. For details, see Vertical spacing between systems. -
page-spacing-weight
-
The relative importance of page (vertical) spacing and line (horizontal) spacing. High values will make page spacing more important. Default:
#10
. -
print-all-headers
-
If set to true, this will print all headers for each \score in the output. Normally only the piece and opus header variables are printed. Default:
##f
. -
print-first-page-number
-
If set to true, a page number is printed on the first page. Default:
##f
. -
print-page-number
-
If set to false, page numbers are not printed. Default:
##t
. -
ragged-bottom
-
If set to true, systems will not spread vertically across the page. This does not affect the last page. Default:
##f
.This should be set to true for pieces that have only two or three systems per page, for example orchestral scores.
-
ragged-last
-
If set to true, the last system in the score will not fill the line width. Instead the last system ends at its natural horizontal length. Default:
##f
. -
ragged-last-bottom
-
If set to false, systems will spread vertically across the last page. Default:
##t
.Pieces that amply fill two pages or more should have this set to true.
It also affects the last page of book parts, ie parts of a book created with
\bookpart
blocks. -
ragged-right
-
If set to true, systems will not fill the line width. Instead, systems end at their natural horizontal length. Default:
##f
.If the score has only one system, the default value is
##t
. -
system-separator-markup
-
A markup object that is inserted between systems. This is often used for orchestral scores. Default: unset.
The markup command
\slashSeparator
is provided as a sensible default, for example -
system-count
-
The number of systems to be used for a score. Default: unset.
See also
Snippets: Spacing.
Known issues and warnings
The default page header puts the page number and the instrument
field from the \header
block on a line.
The titles (from the \header{}
section) are treated as a
system, so ragged-bottom
and ragged-last-bottom
will
add space between the titles and the first system of the score.
[ << Spacing issues ] | [Top][Contents][Index][ ? ] | [ Changing defaults >> ] | ||
[ < Horizontal dimensions ] | [ Up : Page formatting ] | [ Music layout > ] |
Other languages: espaƱol.