LilyPond will do page layout, setting margins and adding headers and footers to each page.
The default layout responds to the following settings in the
\paper block.
firstpagenumber- The value of the page number of the first page. Default is 1.
printfirstpagenumber- If set to true will print the page number in the first page. Default is false.
hsize- The width of the page.
vsize- The height of the page.
topmargin- Margin between header and top of the page.
bottommargin- Margin between footer and bottom of the page.
leftmargin- Margin between the left side of the page and the beginning of the music.
linewidth- The length of the systems.
headsep- Distance between top-most music system and the page header.
footsep- Distance between bottom-most music system and the page footer.
raggedbottom- If set to true, systems will not be spread across the page.
This should be set false for pieces that have only two or three systems per page, for example orchestral scores.
raggedlastbottom- If set to false, systems will be spread to fill the last page.
Pieces that amply fill two pages or more should have this set to true.
betweensystemspace- This dimensions determines 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.
Increasing this will provide a more even appearance of the page at the cost of using more vertical space.
betweensystempadding- This dimension is the minimum amount of white space that will always be present between the bottom most symbol of one system, and the topmost of the next system.
Increasing this will put systems whose bounding boxes almost touch farther apart.
aftertitlespace- Amount of space between title and the first system.
beforetitlespace- Amount of space between last system of the previous piece and the title of the next.
betweentitlespace- Amount of space between consecutive titles (e.g., the title of the book and the title of piece).
Example:
\paper{
hsize = 2\cm
topmargin = 3\cm
bottommargin = 3\cm
raggedlastbottom = ##t
}
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's why the
value has to be multiplied in the example above.
\paper {
#(define bottommargin (* 2 cm))
}
The default footer is empty, except for the first page, where it the
copyright field from \header is inserted, and the last
page, where tagline from \header is added. The default
tagline is “Engraved by LilyPond (version)”.1
The header and footer are created by the functions make-footer
and make-header, defined in \paper. The default
implementations are in scm/page-layout.scm.
The following settings influence the header and footer layout.
printpagenumber- this boolean controls whether a pagenumber is printed.
The page layout itself is done by two functions in the
\paper, 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.
Examples: input/test/page-breaks.ly
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 instrument
field from the \header block on a line.
This page is for LilyPond-2.4.5 (stable-branch).