4.1.1 The \paper block

The \paper block can appear within a \book block, but not within a \score block. Settings in a \paper block apply to the entire book, which may include multiple scores. Settings that can appear in a \paper block include:

The set-paper-size function is discussed in the next section, Paper size and automatic scaling. The \paper variables that deal with page layout are discussed in later sections. The markup definitions that deal with headers, footers, and titles are discussed in Custom titles headers and footers.

Most \paper variables will only work in a \paper block. The few that will also work in a \layout block are listed in The \layout block.

Except when specified otherwise, all \paper variables that correspond to distances on the page are measured in millimeters, unless a different unit is specified by the user. For example, the following declaration sets top-margin to ten millimeters:

\paper {
  top-margin = 10
}

To set it to 0.5 inches, use the \in unit suffix:

\paper {
  top-margin = 0.5\in
}

The available unit suffixes are \mm, \cm, \in, and \pt. These units are simple values for converting from millimeters; they are defined in ‘ly/paper-defaults-init.ly’. For the sake of clarity, when using millimeters, the \mm is typically included in the code, even though it is not technically necessary.

It is also possible to define \paper values using Scheme. The Scheme equivalent of the above example is:

\paper {
  #(define top-margin (* 0.5 in))
}

Vedi anche

Notation Reference: Paper size and automatic scaling, Custom titles headers and footers, The \layout block.

Installed Files: ‘ly/paper-defaults-init.ly’.


Other languages: English, deutsch, español, français, 日本語.
About automatic language selection.

LilyPond — Guida alla Notazione