Text marks

Text marks are textual objects that, unlike text scripts (see section Text scripts), are not printed over notes but between notes, often aligned to a bar line.

Note: Older LilyPond versions used the \mark command for text marks, even though it is primarily intended for rehearsal marks (see section Rehearsal marks). The \textMark and \textEndMark commands are better suited for text marks with regard to their default settings as well as the ability to have several text marks at the same moment. It is therefore recommended to use \textMark and \textEndMark instead of \mark "Text" or \mark \markup …. Note that if converting code that uses \mark for text marks, overrides using RehearsalMark should be changed to TextMark.

Before using text marks, it is recommended to seek a more specific command, if available. For text that identifies a section, use \sectionLabel (see section Section labels). For jump instructions, use \jump (see section Manual repeat marks). These commands have different default layout settings, and they create separate objects which can be styled differently from generic text marks in style sheets.

A text mark is entered using either \textMark or \textEndMark. The \textMark command draws a left-aligned mark.

\fixed c'' {
  \textMark "Fl. 1 solo"
  c4 e g2
  \textMark "A due"
  e4 g c'2
}

[image of music]

If a line break occurs at the point \textMark is used, the text appears on the next system.

\fixed c'' {
  \textMark "Fl. 1 solo"
  c4 e g2
  \break
  \textMark "A due"
  e4 g c'2
}

[image of music]

Unlike \textMark, \textEndMark creates a right-aligned mark. If it occurs on a line break, it is printed on the preceding system.

\fixed c' {
  \repeat volta 2 {
    c4 e8 f g2
    e4 f8 g c'2
    \textEndMark "ad lib"
  }
  \break
  c'4 8 8 4 8 8
  c'1
}

[image of music]

Complex text formatting may be added using a \markup block (see section Formatting text).

\relative {
  <c' e>1
  \textMark \markup { \italic { colla parte } }
  <d f>2 <e g>
  <c f aes>1
}

[image of music]

The \markLengthOn and \markLengthOff commands (see section Metronome marks) can also be used on text marks.

{
  \mark \default
  c'2 2
  \textEndMark "long mark text"
  \markLengthOn
  2 2
  \mark \default
  2 2
  \textEndMark "long mark text"
}

[image of music]

Text marks may be printed below the staff.

\fixed c' {
  c4 g c'8 b c4 e' c' c2
  c4 g c'8 b c4 e' c' g2
  e'4 c' c'8 b c'4
  g4 c' c2~ c1
  \tweak direction #DOWN
    \tweak font-size -1
      \textEndMark "Composed on November 13th, 2020"
}

[image of music]

There can be several text marks at the same moment. Their stacking order can be overridden using the outside-staff-priority property (see section Vertical collision avoidance). Alternatively, a single text mark with \markup \column { … } can achieve the same effect.

\fixed c' {
  \repeat volta 2 {
    c4 g c'8 b c4 e' c' c2
    \textEndMark "ad lib."
    \tweak outside-staff-priority 1200
      \tweak font-size -1
        \textEndMark "2nd time a due"
  }
}

[image of music]

The alignment of a text mark can be changed.

{
  c'8 8 8 8 8 8 8 8
  \textMark \markup \column {
    \line { Left-aligned mark }
    \line { (default for \concat { \typewriter "\\textMark" ) } }
  }
  d'8 8 8 8 8 8 8 8
}

{
  c'8 8 8 8 8 8 8 8
  \tweak self-alignment-X #CENTER
    \textMark "Centered mark"
  d'8 8 8 8 8 8 8 8
}

{
  c'8 8 8 8 8 8 8 8
  \tweak self-alignment-X #RIGHT
    \textMark \markup \right-column {
      \line { Right-aligned mark }
      \line { (default for \concat { \typewriter "\\textEndMark" ) } }
    }
  d'8 8 8 8 8 8 8 8
}

[image of music]

Predefined commands

\textMark, \textEndMark, \markLengthOn, \markLengthOff.

Selected Snippets

Printing marks on every staff

Although rehearsal and text marks are normally only printed above the topmost staff, they may also be printed on every staff.

\score {
  <<
    \new Staff { \mark \default c''1 \textMark "molto" c'' }
    \new Staff { \mark \default c'1 \textMark "molto" c' }
  >>
  \layout {
    \context {
      \Score
      \remove Mark_engraver
      \remove Text_mark_engraver
      \remove Staff_collecting_engraver
    }
    \context {
      \Staff
      \consists Mark_engraver
      \consists Text_mark_engraver
      \consists Staff_collecting_engraver
    }
  }
}

[image of music]

See also

Notation Reference: Metronome marks, Rehearsal marks, Section labels, Formatting text, Music notation inside markup, The Emmentaler font.

Snippets: Text.

Internals Reference: TextMarkEvent, Text_mark_engraver, TextMark.


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