Setting the paper size

‘A4’ is the default value when no explicit paper size is set. However, there are two functions that can be used to change it:

set-default-paper-size
#(set-default-paper-size "quarto")

which must always be placed at the top-level scope, and

set-paper-size
\paper {
  #(set-paper-size "tabloid")
}

which must always be placed in a \paper block.

If the set-default-paper-size function is used in the top-level scope, it must come before any \paper block. set-default-paper-size sets the paper size for all pages, whereas set-paper-size only sets the paper size for the pages that the \paper block applies to. For example, if the \paper block is at the top of the file, then it applies the paper size to all pages. If the \paper block is inside a \book, then the paper size applies only to that book.

When the set-paper-size function is used, it must be placed before any other functions used within the same \paper block. See Automatic scaling to paper size.

Paper sizes are defined in file scm/paper.scm; see Predefined paper sizes for a complete list.

Both set-default-paper-size and set-paper-size also accept a quoted number pair as its argument to set a custom paper size. For example,

#(set-default-paper-size '(cons (* 100 mm) (* 50 mm)))

sets the paper width and height to 100mm and 50mm, respectively.

Possible units are in (inches), cm (centimeters), mm (millimeters), pt (points), and bp (big points).

If the symbol 'landscape is added to the paper size function as a second argument, pages are rotated by 90 degrees, and wider line widths are set accordingly.

#(set-default-paper-size "a6" 'landscape)

Swapping the paper dimensions without having the print rotated (like when printing to postcard size, or creating graphics for inclusion rather than a stand-alone document) can be achieved by appending ‘landscape’ to the name of the paper size itself:

#(set-default-paper-size "a6landscape")

When the paper size ends with an explicit ‘landscape’ or ‘portrait’, the presence of a 'landscape symbol only affects print orientation, not the paper dimensions used for layout.

See also

Notation Reference: Automatic scaling to paper size, Predefined paper sizes.

Installed Files: scm/paper.scm.


LilyPond Notation Reference v2.25.17 (development-branch).