3.2.5 File structure

A .ly file may contain any number of top-level expressions, where a top-level expression is one of the following:

The following example shows three things that may be entered at top level.

\layout {
  % Don't justify the output
  ragged-right = ##t
}

\header {
   title = "Do-re-mi"
}

{ c'4 d' e2 }

At any point in a file, any of the following lexical instructions can be entered:

Whitespace between items in the input stream is generally ignored, and may be freely omitted or extended to enhance readability. However, whitespace should always be used in the following circumstances to avoid errors:

See also

Learning Manual: How LilyPond input files work.

Notation Reference: Titles explained, The \layout block.


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