1.8.1 Writing text

This section introduces different ways of adding text to a score.

Note: To write accented and special text (such as characters
from other languages), simply insert the characters directly into
the LilyPond file. The file must be saved as UTF-8. For more
information, see Text encoding.

Text scripts

Simple “quoted text” indications may be added to a score, as
demonstrated in the following example. Such indications may be
manually placed above or below the staff, using the syntax described
in Direction and placement.

a8^"pizz." g f e a4-"scherz." f

This syntax is actually a shorthand; more complex text formatting may be
added to a note by explicitly using a \markup block, as described
in Formatting text.

By default, text indications do not influence the note spacing. However,
their widths can be taken into account: in the following example, the
first text string does not affect spacing, whereas the second one does.

Text spanners

Some performance indications, e.g., rallentando or
accelerando, are written as text and are extended over
multiple notes with dotted lines. Such objects, called
“spanners”, may be created from one note to another using the
following syntax:

The string to be printed is set through object properties. By default
it is printed in italic characters, but different formatting can be
obtained using \markup blocks, as described in
Formatting text.

Postfix functions for custom crescendo text spanners. The spanners
should start on the first note of the measure. One has to use
-\mycresc, otherwise the spanner start will rather be assigned to the
next note.

Such objects are only typeset above the top staff of the score;
depending on whether they are specified at the end or the middle of a
bar, they can be placed above the bar line or between notes. When
specified at a line break, the mark will be printed at the beginning of
the next line.

\mark "Allegro"
c1 c
\mark "assai" \break
c c

Predefined commands

\markLengthOn,
\markLengthOff.

Selected Snippets

Printing marks at the end of a line

Marks can be printed at the end of the current line, instead of the
beginning of the following line. In such cases, it might be preferable
to align the right end of the mark with the bar line.

Separate text blocks can be spread over multiple pages,
making it possible to print text documents or books entirely
within LilyPond. This feature, and the specific syntax it
requires, are described in Multi-page markup.

Predefined commands

\markup,
\markuplist.

Selected Snippets

Stand-alone two-column markup

Stand-alone text may be arranged in several columns using
\markup commands: