Next: , Up: Page formatting


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.

Other languages: espaƱol.