Node: Page layout, Previous: Line breaking, Up: Global layout



Page layout

The most basic settings influencing the spacing are indent and linewidth. They are set in the \paper block. They control the indentation of the first line of music, and the lengths of the lines.

If raggedright is set to true in the \paper block, then the lines are justified at their natural length. This useful for short fragments, and for checking how tight the natural spacing is.

The page layout process happens outside the LilyPond formatting engine: variables controlling page layout are passed to the output, and are further interpreted by lilypond wrapper program. It responds to the following variables in the \paper block. The variable textheight sets the total height of the music on each page. The spacing between systems is controlled with interscoreline, its default is 16pt. The distance between the score lines will stretch in order to fill the full page interscorelinefill is set to a positive number. In that case interscoreline specifies the minimum spacing.

If the variable lastpagefill is defined, systems are evenly distributed vertically on the last page. This might produce ugly results in case there are not enough systems on the last page. The lilypond-book command ignores lastpagefill. See lilypond-book manual for more information.

Page breaks are normally computed by TeX, so they are not under direct control of LilyPond. However, you can insert a commands into the .tex output to instruct TeX where to break pages. This is done by setting the between-systems-strings on the NonMusicalPaperColumn where the system is broken. An example is shown in input/regression/between-systems.ly. The predefined command \newpage also does this.

To change the paper size, you must first set the papersize paper variable variable as in the example below. Set it to the strings a4, letter, or legal. After this specification, you must set the font as described above. If you want the default font, then use the 20 point font.

             \paper{ papersize = "a4" }
             \include "paper16.ly"
     

The file paper16.ly will now include a file named a4.ly, which will set the paper variables hsize and vsize (used by lilypond-book and lilypond).

Predefined commands

\newpage.

See also

Invoking lilypond, input/regression/between-systems.ly, and NonMusicalPaperColumn.

Bugs

LilyPond has no concept of page layout, which makes it difficult to reliably choose page breaks in longer pieces.


This page is for LilyPond-2.0.1 (stable-branch).

Report errors to <bug-lilypond@gnu.org>.