A.1 Text markup commands

The following commands can all be used inside \markup { }.


A.1.1 Font markup

\abs-fontsize size (number) arg (markup)

Use size as the absolute font size (in points) to display arg.

This function adjusts the baseline-skip and word-space properties accordingly.

\markup {
  default text font size
  \hspace #2
  \abs-fontsize #16 { text font size 16 }
  \hspace #2
  \abs-fontsize #12 { text font size 12 }
}
[image of music]

Used properties:

  • baseline-skip (3)
  • word-space (0.6)
\bold arg (markup)

Print arg with a bold face.

\markup {
  default
  \hspace #2
  \bold bold
}
[image of music]

The code \markup \bold … is a shorthand for \markup \override #'(font-series . bold) … – using the more verbose form, it is possible to obtain nuances such as semi-bold, if the text font has such variants. Refer to the documentation for the font-series properties (User backend properties).

\box arg (markup)

Draw a box around arg.

This function looks at the thickness, box-padding, and font-size properties to determine the line thickness and padding around the markup.

\markup {
  \override #'(box-padding . 0.5)
  \box \line { V. S. }
}
[image of music]

Note that the box does not horizontally displace its argument. Use markup commands like \left-align or \table to make LilyPond realign it.

\markup {
  \override #'(box-padding . 1.5)
  \column {
    "text"
    \box "text"
    \left-align \box "text"
  }
}
[image of music]

Used properties:

  • box-padding (0.2)
  • font-size (0)
  • thickness (1)
\caps arg (markup)

Print arg in (fake) small caps.

This function is a copy of the \smallCaps command.

\markup {
  default
  \hspace #2
  \caps {
    Text in small caps
  }
}
[image of music]

Use \fontCaps for real small caps (if the font provides it).

\dynamic arg (markup)

Print arg using the (music) font for dynamics.

This font only contains letters f, m, n, p, r, s, and z. When producing phrases like ‘più f’, the normal words (like ‘più’) should be done in a different font. The recommended font for this is bold and italic.

\markup {
  \dynamic {
    sfzp
  }
}
[image of music]
\figured-bass arg (markup)

Set arg as small numbers for figured bass.

Specially slashed digits can be achieved with a trailing backslash (for numbers 6, 7, and 9) or a trailing plus (for numbers 2, 4, and 5).13

The use of a backslash is in analogy to \figuremode (see Entering figured bass). Note that to get a backslash character in markup it must be escaped by doubling it. Additionally, it must be put into double quotes.

\markup {
  \figured-bass {
    2 3 4+ 7 "9\\"
  }
}
[image of music]
\finger arg (markup)

Set arg as small numbers for fingering instructions.

\markup {
  \finger {
    1 2 3 4 5
  }
}
[image of music]
\fontCaps arg (markup)

Print arg in small caps.

This command sets the font-variant property to small-caps.

Unlike \smallCaps, which merely uses capital letters at a smaller font size, this uses the actual variant of the font for small caps. (As a consequence, if you configure a custom text font, this command has no effect if that font does not have a small caps variant.)

\markup \fontCaps "Small caps"
[image of music]
\fontsize increment (number) arg (markup)

Increase current font size by increment to print arg.

This function adjusts the baseline-skip and word-space properties accordingly.

\markup {
  default
  \hspace #2
  \fontsize #-1.5 smaller
}
[image of music]

Used properties:

  • baseline-skip (2)
  • word-space (1)
  • font-size (0)
\huge arg (markup)

Set font size to value 2 to print arg.

\markup {
  default
  \hspace #2
  \huge huge
}
[image of music]
\italic arg (markup)

Print arg in italics.

This command sets the font-shape property to italic.

\markup {
  default
  \hspace #2
  \italic italic
}
[image of music]
\large arg (markup)

Set font size to value 1 to print arg.

\markup {
  default
  \hspace #2
  \large large
}
[image of music]
\larger arg (markup)

Increase current font size by 1 to print arg.

This function adjusts the baseline-skip and word-space properties accordingly.

\markup {
  default
  \hspace #2
  \larger larger
}
[image of music]
\magnify sz (number) arg (markup)

Magnify current font by factor sz to print arg.

\markup {
  default
  \hspace #2
  \magnify #1.5 {
    50% larger
  }
}
[image of music]

Note that magnification only works if a font name is explicitly selected. Use \fontsize otherwise.

\normal-size-sub arg (markup)

Set arg in subscript with a normal font size.

\markup {
  default
  \normal-size-sub {
    subscript in standard size
  }
}
[image of music]

Used properties:

  • font-size (0)
\normal-size-super arg (markup)

Set arg in superscript with a normal font size.

\markup {
  default
  \normal-size-super {
    superscript in standard size
  }
}
[image of music]

Used properties:

  • font-size (0)
\normal-text arg (markup)

Print arg with default text font.

This resets all font-related properties (except the size), no matter what font was used earlier.

\markup {
  \huge \bold \sans \fontCaps {
    huge bold sans caps
    \hspace #2
    \normal-text {
      huge normal
    }
    \hspace #2
    as before
  }
}
[image of music]
\normal-weight arg (markup)

Switch to normal weight (in contrast to bold) to print arg.

This command sets the font-series property to normal.

\markup {
  \bold {
    some bold text
    \hspace #2
    \normal-weight {
      normal font series
    }
    \hspace #2
    bold again
  }
}
[image of music]
\normalsize arg (markup)

Set font size to default (i.e., to value 0) to print arg.

\markup {
  \teeny {
    this is very small
    \hspace #2
    \normalsize {
      normal size
    }
    \hspace #2
    teeny again
  }
}
[image of music]
\number arg (markup)

Print arg using the (music) font for numbers.

This font also contains symbols for figured bass, some punctuation, spaces of various widths, some letters and text variants of accidentals. Use \dynamic to access the (very small number of) letters. For accidentals you might use \number in combination with Unicode characters to access the text representation forms of accidental glyphs, as the following table shows.

[image of music]

To get accidentals protected against overrides of font-name it is preferable to use \text-doubleflat, \text-flat, \text-natural, \text-sharp, \text-doublesharp or the general \text-accidental for the text variants of accidentals.

The appearance of digits in the Emmentaler font can be controlled with four OpenType features: ‘tnum’, ‘cv47’, ‘ss01’, and ‘kern’, which can be arbitrarily combined.

tnum

If off (which is the default), glyphs ‘zero’ to ‘nine’ have no left and right side bearings. If on, the glyphs all have the same advance width by making the bearings non-zero.

cv47

If on, glyphs ‘four’ and ‘seven’ have shorter vertical strokes. Default is off.

ss01

If on, glyphs ‘zero’ to ‘nine’ have a fatter design, making them more readable at small sizes. Default is off.

kern

If on (which is the default), provide pairwise kerning between (most) glyphs.

\markuplist
  \number
  \fontsize #4.5
  \override #'((padding . 2)
               (baseline-skip . 4)
               (box-padding . 0)
               (thickness . 0.1))
  \table #'(-1 -1 -1 -1) {
      0123456789 \box 147 \concat { \box 1 \box 4 \box 7 }
    \normal-text \normalsize "(time signatures)"
    \override #'(font-features .("cv47")) {
      0123456789 \box 147 \concat { \box 1 \box 4 \box 7 } }
    \normal-text \normalsize "(alternatives)"
    \override #'(font-features .("tnum" "cv47" "-kern")) {
      0123456789 \box 147 \concat { \box 1 \box 4 \box 7 } }
    \normal-text \normalsize "(fixed-width)"
    \override #'(font-features . ("tnum" "cv47" "ss01")) {
      0123456789 \box 147 \concat { \box 1 \box 4 \box 7 } }
    \normal-text \normalsize "(figured bass)"
    \override #'(font-features . ("cv47" "ss01")) {
      0123456789 \box 147 \concat { \box 1 \box 4 \box 7 } }
    \normal-text \normalsize "(fingering)"
  }
[image of music]

See also the markup commands \figured-bass and \finger, which set the font features accordingly.

\overtie arg (markup)

Overtie arg.

\markup \line {
  \overtie "overtied"
  \override #'((offset . 5) (thickness . 1))
  \overtie "overtied"
  \override #'((offset . 1) (thickness . 5))
  \overtie "overtied"
}
[image of music]

Used properties:

  • shorten-pair ((0 . 0))
  • height-limit (0.7)
  • direction (1)
  • offset (2)
  • thickness (1)
\replace replacements (list) arg (markup)

Use replacements to replace strings in arg.

Each (key . value) pair of the replacements alist specifies what should be replaced; key gets replaced by value. Note the quasiquoting syntax with a backquote in the second example.

\markup \replace #'(("2nd" . "Second"))
  "2nd time"
\markup \replace
  #`(("2nd" . ,#{ \markup \concat { 2 \super nd } #}))
  \center-column {
    \line { Play only }
    \line { the 2nd time }
  }
[image of music]

Used properties:

  • replacement-alist
\sans arg (markup)

Print arg with a sans-serif font.

This command sets the font-family property to sans.

\markup {
  default
  \hspace #2
  \sans {
    sans serif
  }
}
[image of music]
\serif arg (markup)

Print arg with a serif font.

This command sets the font-family property to serif.

\markup {
  \sans \bold {
    sans serif, bold
    \hspace #2
    \serif {
      text in serif font
    }
    \hspace #2
    return to sans
  }
}
[image of music]
\simple str (string)

Print string str.

\markup \simple "x" is equivalent to \markup "x". This command was previously used internally, but no longer is, and is being kept for backward compatibility only.

\small arg (markup)

Set font size to value -1 to print arg.

\markup {
  default
  \hspace #2
  \small small
}
[image of music]
\smallCaps arg (markup)

Print arg in (fake) small caps.

Unlike \fontCaps, which uses the actual small caps variant of the current font, this fakes small caps by using capital letters at a smaller font size. It can thus be used for fonts that don’t have a small caps variant.

\markup {
  default
  \hspace #2
  \smallCaps {
    Text in small caps
  }
}
[image of music]
\smaller arg (markup)

Decrease current font size by 1 to print arg.

This function adjusts the baseline-skip and word-space properties accordingly.

\markup {
  \fontsize #3.5 {
    large text
    \hspace #2
    \smaller { smaller text }
    \hspace #2
    large text
  }
}
[image of music]
\sub arg (markup)

Set arg in subscript.

\markup { \concat { H \sub 2 O } }
[image of music]

Ssee also \super.

Used properties:

  • font-size (0)
\super arg (markup)

Set arg in superscript.

\markup { E = \concat { mc \super 2 } }
[image of music]

See also \sub.

Used properties:

  • font-size (0)
\teeny arg (markup)

Set font size to value -3 to print arg.

\markup {
  default
  \hspace #2
  \teeny teeny
}
[image of music]
\tie arg (markup)

Add a horizontal bow at the bottom or top of arg.

This function uses make-tie-stencil to create the bow; it looks at the thickness and offset properties to determine the line thickness and vertical offset, respectively. The added bow fits the extent of arg; use the shorten-pair property to modify this. The direction property may be set explicitly using override or direction modifiers, or implicitly by using voiceOne, etc.

\markup {
  \override #'(direction . 1)
  \tie "above"
  \override #'(direction . -1)
  \tie "below"
}
[image of music]

See also \undertie and \overtie, which are shorthands for this function.

Used properties:

  • shorten-pair ((0 . 0))
  • height-limit (0.7)
  • direction (1)
  • offset (2)
  • thickness (1)
\tiny arg (markup)

Set font size to value -2 to print arg.

\markup {
  default
  \hspace #2
  \tiny tiny
}
[image of music]
\typewriter arg (markup)

Print arg in typewriter.

This command sets the font-family property to typewriter, also switching off the ‘liga’ OpenType feature to disable ligatures like ‘ff’ or ‘fi’.

\markup {
  "default fi ff"
  \hspace #2
  \typewriter "typewriter fi ff"
}
[image of music]
\underline arg (markup)

Underline arg.

This function looks at the property thickness to determine the line thickness, at offset to determine the line’s vertical offset from arg, and at underline-skip to determine the distance of additional lines from the others.

The underline-shift property is used to make subsequent calls work correctly. Overriding it makes little sense since it would end up adding the provided value to the one of offset.

\markup \justify-line {
  \underline "underlined"
  \override #'(offset . 5)
  \override #'(thickness . 1)
  \underline "underlined"
  \override #'(offset . 1)
  \override #'(thickness . 5)
  \underline "underlined"
  \override #'(offset . 5)
  \override #'(underline-skip . 4)
  \underline \underline \underline "underlined thrice"
}
[image of music]

Used properties:

  • underline-skip (2)
  • underline-shift (0)
  • offset (2)
  • thickness (1)
\undertie arg (markup)

Print a tie under arg.

\markup \line {
  \undertie "undertied"
  \override #'((offset . 5) (thickness . 1))
  \undertie "undertied"
  \override #'((offset . 1) (thickness . 5))
  \undertie "undertied"
}
[image of music]

Used properties:

  • shorten-pair ((0 . 0))
  • height-limit (0.7)
  • direction (1)
  • offset (2)
  • thickness (1)
\upright arg (markup)

Print arg upright.

This command is the opposite of \italic; it sets the font-shape property to upright.

\markup {
  \italic {
    italic text
    \hspace #2
    \upright {
      upright text
    }
    \hspace #2
    italic again
  }
}
[image of music]
\volta-number arg (markup)

Set arg in a font appropriate for volta numbers.

\markup \volta-number "4."
[image of music]
\with-string-transformer transformer (procedure) arg (markup)

Apply string transformer function transformer to arg.

Whenever a string is interpreted inside arg, function transformer is called first, and its result is then interpreted. The arguments passed to transformer are the output definition, the property alist chain, and the markup arg. See New markup command definition about the two first arguments.

\markup \with-string-transformer
  #(lambda (layout props str)
     (string-upcase str))
  \concat { "abc" \larger "def" }
[image of music]

A.1.2 Markup for text alignment

\abs-hspace amount (number)

Create an invisible object taking up absolute horizontal space of amount points.

\markup {
  one
  \abs-hspace #20
  two
  \abs-hspace #40
  three
}
[image of music]

See also \hspace.

\abs-vspace amount (number)

Create an invisible object taking up absolute vertical space of amount points.

\markup {
    \center-column {
    one
    \abs-vspace #20
    two
    \abs-vspace #40
    three
  }
}
[image of music]

See also \vspace.

\align-on-other axis (non-negative, exact integer) other-dir (boolean-or-number) other (markup) self-dir (boolean-or-number) self (markup)

Align markup self on markup other along axis.

This function uses self-dir and other-dir for mutual alignment of self and other, respectively, translating self as requested relative to its surroundings. other is not printed.

If self-dir or other-dir is #f, use the reference point of self or other, respectively.

\markup \column {
  12
  \align-on-other #X #RIGHT 12
                     #LEFT 12345
  \align-on-other #X #RIGHT 123
                     #LEFT \fermata
  123
  \align-on-other #X #RIGHT 123
                     ##f \fermata
}
[image of music]
\center-align arg (markup)

Align arg to its X center.

\markup {
  \column {
    one
    \center-align two
    three
  }
}
[image of music]
\center-column args (markup list)

Put args into a centered column.

See also \column.

\markup {
  \center-column {
    one
    two
    three
  }
}
[image of music]

Used properties:

  • baseline-skip
\column args (markup list)

Stack the markups in args vertically.

The property baseline-skip determines the space between markups in args (to be more precise, the space between the baselines of the markups).

\markup {
  \column {
    one
    two
    three
  }
}
[image of music]

The baseline of the output of \column is the baseline of its first line.

Used properties:

  • baseline-skip
\combine arg1 (markup) arg2 (markup)

Print arg1, then print arg2 on top of it.

Note: \combine cannot take a list of markups enclosed in curly braces as an argument; for this purpose use \overlay instead.

\markup {
  \fontsize #5
  \override #'(thickness . 2)
  \combine
    \draw-line #'(0 . 4)
    \arrow-head #Y #DOWN ##f
}
[image of music]
\concat args (markup list)

Concatenate args in a horizontal line, without spaces in between.

Strings are concatenated on the input level, allowing ligatures. For example, \concat { "f" "i" } is equivalent to "fi".

\markup {
  \concat {
    one two three
  }
}
[image of music]
\dir-column args (markup list)

Make a column of args.

Depending on the setting of the direction layout property, the arguments are stacked upwards or downwards.

\markup {
  \override #`(direction . ,UP)
  \dir-column {
    going up
  }
  \hspace #1
  \dir-column {
    going down
  }
  \hspace #1
  \override #'(direction . 1)
  \dir-column {
    going up
  }
}
[image of music]

The baseline of the output of \dir-column is the baseline of its first line.

Used properties:

  • baseline-skip
  • direction
\fill-line args (markup list)

Put markups args into a horizontal line.

The markups are spaced or flushed to fill the entire line. If there are no arguments, return an empty stencil.

The width of the horizontal line can be modified by overriding the line-width property.

\markup {
  \column {
    \fill-line {
      Words evenly spaced across the page
    }
    \null
    \fill-line {
      \line { Text markups }
      \line {
        \italic { evenly spaced }
      }
      \line { across the page }
    }
    \null
    \override #'(line-width . 50)
    \fill-line {
      Width explicitly specified
    }
  }
}
[image of music]

Used properties:

  • line-width (#f)
  • word-space (0.6)
  • text-direction (1)
\fill-with-pattern space (number) dir (direction) pattern (markup) left (markup) right (markup)

Put left and right at the start and end of a line, respectively, and fill the space inbetween with repeated pattern markups.

Patterns are spaced apart by space and aligned to direction dir. The width of the line is given by the line-width property.

\markup \column {
  "right-aligned:"
  \fill-with-pattern #1 #RIGHT . first right
  \fill-with-pattern #1 #RIGHT . second right
  \null
  "center-aligned:"
  \fill-with-pattern #1.5 #CENTER - left right
  \null
  "left-aligned:"
  \override #'(line-width . 50) {
    \fill-with-pattern #2 #LEFT : left first
    \fill-with-pattern #2 #LEFT : left second
  }
}
[image of music]

Used properties:

  • line-width
  • word-space
\general-align axis (integer) dir (number) arg (markup)

Align arg in axis direction to the dir side.

\markup {
  \column {
    one
    \general-align #X #LEFT two
    three
    \null
    one
    \general-align #X #CENTER two
    three
    \null
    \line {
      one
      \general-align #Y #UP two
      three
    }
    \null
    \line {
      one
      \general-align #Y #3.2 two
      three
    }
  }
}
[image of music]
\halign dir (number) arg (markup)

Print arg with horizontal alignment set to dir.

If dir is -1, arg is left-aligned, while +1 makes it right-aligned. Values inbetween interpolate the alignment accordingly.

\markup {
  \column {
    one
    \halign #LEFT two
    three
    \null
    one
    \halign #CENTER two
    three
    \null
    one
    \halign #RIGHT two
    three
    \null
    one
    \halign #-5 two
    three
  }
}
[image of music]
\hcenter-in length (number) arg (markup)

Center arg horizontally within a box of extending length/2 to the left and right.

\new StaffGroup <<
  \new Staff {
    \set Staff.instrumentName = \markup {
      \hcenter-in #12 Oboe
    }
    c''1
  }
  \new Staff {
    \set Staff.instrumentName = \markup {
      \hcenter-in #12 Bassoon
    }
    \clef tenor
    c'1
  }
>>
[image of music]
\hspace amount (number)

Create an invisible object taking up amount horizontal space.

\markup {
  one
  \hspace #2
  two
  \hspace #8
  three
}
[image of music]

amount can be also a negative value, which can be best visualized as if the current drawing point gets moved to the left.

\markup \concat {
  \hspace #4
  \column {
    \box \concat { AAAA \hspace #4 }
    \box \concat { AAAA \hspace #-4 }
    \box \concat { \hspace #4 AAAA }
    \box \concat { \hspace #-4 AAAA }
  }
}
[image of music]

See also \abs-hspace.

\justify args (markup list)

Print args as lines aligned both at the left and the right.

Like \wordwrap, but with lines stretched to justify the margins. Use \override #'(line-width . X) to set the line width; X is the number of staff spaces.

\markup {
  \justify {
    Lorem ipsum dolor sit amet, consectetur adipisicing elit,
    sed do eiusmod tempor incididunt ut labore et dolore
    magna aliqua.  Ut enim ad minim veniam, quis nostrud
    exercitation ullamco laboris nisi ut aliquip ex ea
    commodo consequat.
  }
}
[image of music]

The baseline of the output of \justify is the baseline of its first line.

Used properties:

  • text-direction (1)
  • word-space
  • line-width (#f)
  • baseline-skip
\justify-field symbol (symbol)

Justify the data that has been assigned to symbol.

\header {
  title = "My title"
  myText = "Lorem ipsum dolor sit amet, consectetur
    adipisicing elit, sed do eiusmod tempor incididunt
    ut labore et dolore magna aliqua.  Ut enim ad minim
    veniam, quis nostrud exercitation ullamco laboris
    nisi ut aliquip ex ea commodo consequat."
}

\paper {
  bookTitleMarkup = \markup {
    \column {
      \fill-line { \fromproperty #'header:title }
      \null
      \justify-field #'header:myText
    }
  }
}

\markup {
  \null
}
[image of music]
\justify-line args (markup list)

Put markups args into a horizontal line.

The markups are spread to fill the entire line and separated by equal space. If there are no arguments, return an empty stencil.

The width of the horizontal line can be modified by overriding the line-width property.

\markup {
  \justify-line {
    Constant space between neighboring words
  }
}
[image of music]

Used properties:

  • line-width (#f)
  • word-space (0.6)
  • text-direction (1)
\justify-string arg (string)

Print string arg as lines aligned both at the left and the right.

Paragraphs are indicated by double newlines. Use \override #'(line-width . X) to set the line width; X is the number of staff spaces.

\markup {
  \override #'(line-width . 40)
  \justify-string "Lorem ipsum dolor sit amet, consectetur
      adipisicing elit, sed do eiusmod tempor incididunt ut
      labore et dolore magna aliqua.


      Ut enim ad minim veniam, quis nostrud exercitation
      ullamco laboris nisi ut aliquip ex ea commodo
      consequat.


      Excepteur sint occaecat cupidatat non proident, sunt
      in culpa qui officia deserunt mollit anim id est
      laborum"
}
[image of music]

The baseline of the output of \justify-string is the baseline of its first line.

Used properties:

  • text-direction (1)
  • word-space
  • line-width
  • baseline-skip
\left-align arg (markup)

Align arg on its left edge.

\markup {
  \column {
    one
    \left-align two
    three
  }
}
[image of music]
\left-column args (markup list)

Put args into a left-aligned column.

\markup {
  \left-column {
    one
    two
    three
  }
}
[image of music]

Used properties:

  • baseline-skip
\line args (markup list)

Put args into a horizontal line.

The property word-space determines the space between markups in args. For right-to-left scripts like Hebrew, text-direction should be set to -1.

\markup
  \override #'(word-space . 3)
  \column {
    \line { "A B" "C D" "E F" }
    \override #'(text-direction . -1)
    \line { "A B" "C D" "E F" }
  }
[image of music]

Used properties:

  • text-direction (1)
  • word-space
\lower amount (number) arg (markup)

Lower arg by the distance amount.

A negative amount indicates raising; see also \raise.

The argument to \lower is the vertical displacement amount, measured in (global) staff spaces, which is independent of the markup’s current font size. If you need vertical movement that takes the font size into account, use \translate-scaled instead.

This function is normally used to move one element inside of a markup relative to the other elements. When using it on the whole markup, bear in mind that spacing mechanisms that place the markup itself on the page could cancel this shift. Consider using grob properties such as padding, Y-offset, or extra-offset, or spacing variables such as markup-system-spacing.

\markup {
  one
  \lower #3 two
  three
}
[image of music]
\overlay args (markup list)

Take a list of markups args and combine them.

\markup {
  \fontsize #5
  \override #'(thickness . 2)
  \overlay {
    \draw-line #'(0 . 4)
    \arrow-head #Y #DOWN ##f
    \translate #'(0 . 4) \arrow-head #Y #UP ##f
  }
}
[image of music]
\pad-around amount (number) arg (markup)

Add padding amount all around arg.

Identical to function \pad-markup.

\markup {
  \box {
    default
  }
  \hspace #2
  \box {
    \pad-around #0.5 {
      padded
    }
  }
}
[image of music]
\pad-markup amount (number) arg (markup)

Add padding amount all around arg.

Identical to function \pad-around.

\markup {
  \box {
    default
  }
  \hspace #2
  \box {
    \pad-markup #1 {
      padded
    }
  }
}
[image of music]
\pad-to-box x-ext (pair of numbers) y-ext (pair of numbers) arg (markup)

Make arg take at least x-ext, y-ext space.

\markup {
  \box {
    default
  }
  \hspace #4
  \box {
    \pad-to-box #'(0 . 10) #'(0 . 3) {
      padded
    }
  }
}
[image of music]
\pad-x amount (number) arg (markup)

Add padding amount around arg in the X direction.

\markup {
  \box {
    default
  }
  \hspace #4
  \box {
    \pad-x #2 {
      padded
    }
  }
}
[image of music]
\put-adjacent axis (integer) dir (direction) arg1 (markup) arg2 (markup)

Put arg2 next to arg1 along axis to the dir side, without moving arg1.

\markup \column {
  text
  \put-adjacent #X #LEFT text *
  text
}
[image of music]
\raise amount (number) arg (markup)

Raise arg by the distance amount.

A negative amount indicates lowering, see also \lower.

The argument to \raise is the vertical displacement amount, measured in (global) staff spaces, which is independent of the markup’s current font size. If you need vertical movement that takes the font size into account, use \translate-scaled instead.

This function is normally used to move one element inside of a markup relative to the other elements. When using it on the whole markup, bear in mind that spacing mechanisms that place the markup itself on the page could cancel this shift. Consider using grob properties such as padding, Y-offset, or extra-offset, or spacing variables such as markup-system-spacing.

\markup { C \small \bold \raise #1.0 9/7+ }
[image of music]
\right-align arg (markup)

Align arg on its right edge.

\markup {
  \column {
    one
    \right-align two
    three
  }
}
[image of music]
\right-column args (markup list)

Put args into a right-aligned column.

\markup {
  \right-column {
    one
    two
    three
  }
}
[image of music]

Used properties:

  • baseline-skip
\rotate ang (number) arg (markup)

Rotate arg by ang degrees around its center.

\markup {
  default
  \hspace #2
  \rotate #45
  \line {
    rotated 45°
  }
}
[image of music]
\translate offset (pair of numbers) arg (markup)

Translate arg relative to its surroundings.

offset is a pair of numbers representing the displacement in the X and Y axes. See also \translate-scaled.

This function is normally used to move one element inside of a markup relative to the other elements. When using it on the whole markup, bear in mind that spacing mechanisms that place the markup itself on the page could cancel this shift. Consider using grob properties such as padding, X-offset, Y-offset or extra-offset, or spacing variables such as markup-system-spacing.

\markup {
  *
  \translate #'(2 . 3)
    \line { translated two spaces right, three up }
}
[image of music]
\translate-scaled offset (pair of numbers) arg (markup)

Translate arg by offset, scaling the offset by the font size.

This function is normally used to move one element inside of a markup relative to the other elements. When using it on the whole markup, bear in mind that spacing mechanisms that place the markup itself on the page could cancel this shift. Consider using grob properties such as padding, X-offset, Y-offset or extra-offset, or spacing variables such as markup-system-spacing.

See also \translate.

\markup {
  \fontsize #5 {
    * \translate #'(2 . 3) translate
    \hspace #2
    * \translate-scaled #'(2 . 3) translate-scaled
  }
}
[image of music]

Used properties:

  • font-size (0)
\vcenter arg (markup)

Align arg to its Y center.

\markup {
  one
  \vcenter two
  three
}
[image of music]
\vspace amount (number)

Create an invisible object taking up vertical space of amount multiplied by 3.

\markup {
    \center-column {
    one
    \vspace #1
    two
    \vspace #3
    three
  }
}
[image of music]

amount can be also a negative value, which can be best visualized as if the current drawing point gets moved up.

\markup {
  \vspace #1
  \box \column { AAAA \vspace #0.4 }
  \box \column { AAAA \vspace #-0.4 }
  \box \column { \vspace #0.4 AAAA }
  \box \column { \vspace #-0.4 AAAA }
}
[image of music]

See also \abs-vspace.

\wordwrap args (markup list)

Print args as left-aligned lines.

This function provides simple word-wrap. Use \override #'(line-width . X) to set the line width; X is the number of staff spaces.

\markup {
  \wordwrap {
    Lorem ipsum dolor sit amet, consectetur adipisicing elit,
    sed do eiusmod tempor incididunt ut labore et dolore
    magna aliqua.  Ut enim ad minim veniam, quis nostrud
    exercitation ullamco laboris nisi ut aliquip ex ea
    commodo consequat.
  }
}
[image of music]

The baseline of the output of \wordwrap is the baseline of its first line.

Used properties:

  • text-direction (1)
  • word-space
  • line-width (#f)
  • baseline-skip
\wordwrap-field symbol (symbol)

Word-wrap the data that has been assigned to symbol.

\header {
  title = "My title"
  myText = "Lorem ipsum dolor sit amet, consectetur
    adipisicing elit, sed do eiusmod tempor incididunt ut
    labore et dolore magna aliqua.  Ut enim ad minim
    veniam, quis nostrud exercitation ullamco laboris nisi
    ut aliquip ex ea commodo consequat."
}

\paper {
  bookTitleMarkup = \markup {
    \column {
      \fill-line { \fromproperty #'header:title }
      \null
      \wordwrap-field #'header:myText
    }
  }
}

\markup {
  \null
}
[image of music]
\wordwrap-string arg (string)

Print string arg as left-aligned lines.

Paragraphs are indicated by double newlines. Use \override #'(line-width . X) to set the line width; X is the number of staff spaces.

\markup {
  \override #'(line-width . 40)
  \wordwrap-string "Lorem ipsum dolor sit amet,
      consectetur adipisicing elit, sed do eiusmod tempor
      incididunt ut labore et dolore magna aliqua.


      Ut enim ad minim veniam, quis nostrud exercitation
      ullamco laboris nisi ut aliquip ex ea commodo
      consequat.


      Excepteur sint occaecat cupidatat non proident,
      sunt in culpa qui officia deserunt mollit anim id
      est laborum"
}
[image of music]

The baseline of the output of \wordwrap-string is the baseline of its first line.

Used properties:

  • text-direction (1)
  • word-space
  • line-width
  • baseline-skip

A.1.3 Graphical markup

\arrow-head axis (integer) dir (direction) filled (boolean)

Print an arrow head along axis in direction dir.

Fill the head if filled is set to #t.

\markup {
  \fontsize #5 {
    \general-align #Y #DOWN {
      \arrow-head #Y #UP ##t
      \arrow-head #Y #DOWN ##f
      \hspace #2
      \arrow-head #X #RIGHT ##f
      \arrow-head #X #LEFT ##f
    }
  }
}
[image of music]
\beam width (number) slope (number) thickness (number)

Draw a beam with given width, slope, and thickness.

\markup {
  \beam #5 #1 #2
}
[image of music]
\bracket arg (markup)

Draw vertical brackets around arg.

\markup {
  \bracket {
    \note {2.} #UP
  }
}
[image of music]
\circle arg (markup)

Draw a circle around arg.

Use properties thickness, circle-padding, and font-size to set the line thickness and padding around the markup.

\markup {
  \circle {
    Hi
  }
}
[image of music]

Used properties:

  • circle-padding (0.2)
  • font-size (0)
  • thickness (1)
\draw-circle radius (number) thickness (number) filled (boolean)

Draw a circle with given radius and thickness.

Fill the circle if filled is set to #t.

\markup {
  \draw-circle #2 #0.5 ##f
  \hspace #2
  \draw-circle #2 #0 ##t
}
[image of music]
\draw-dashed-line dest (pair of numbers)

Draw a dashed line along vector dest.

Properties on and off give the length of a dash and the space between two dashes, respectively; phase shortens the first dash by the given amount.

If the full-length property is set to #t (which is the default), the value of property off (and on under some boundary conditions) gets adjusted so that there is neither whitespace at the end of the line nor the last dash truncated.

\markup {
  \override #'((on . 0.3) (off . 0.5))
  \draw-dashed-line #'(6 . 2)

  \draw-dashed-line #'(6 . 2)

  \override #'(full-length . #f)
  \draw-dashed-line #'(6 . 2)

  \override #'(phase . 0.5)
  \draw-dashed-line #'(6 . 2)

  \override #'((full-length . #f) (phase . 0.5))
  \draw-dashed-line #'(6 . 2)
}
[image of music]

Used properties:

  • full-length (#t)
  • phase (0)
  • off (1)
  • on (1)
  • thickness (1)
\draw-dotted-line dest (pair of numbers)

Draw a dotted line along vector dest.

Property off gives the space between two dots; its value gets adjusted so that the first and last dot exactly start and end the line, respectively. phase shifts all dots along the vector by the given amount.

\markup {
  \draw-dotted-line #'(5.1 . 2.3)
  \override #'((thickness . 2) (off . 0.2))
  \draw-dotted-line #'(5.1 . 2.3)
}
[image of music]

Used properties:

  • phase (0)
  • off (1)
  • thickness (1)
\draw-hline

Draw a horizontal line.

The property span-factor sets the length of the line as a multiple of the line-width property.

\markup {
  \column {
    \draw-hline
    \override #'(span-factor . 1/3)
    \draw-hline
  }
}
[image of music]

Used properties:

  • span-factor (1)
  • line-width
  • thickness (1)
\draw-line dest (pair of numbers)

Draw a line along vector dest.

\markup {
  \draw-line #'(4 . 4)
  \override #'(thickness . 5)
  \draw-line #'(-3 . 0)
}
[image of music]

Used properties:

  • thickness (1)
\draw-squiggle-line sq-length (number) dest (pair of numbers) eq-end? (boolean)

Draw a squiggled line along vector dest.

sq-length is the length of the first bow; this value gets always adjusted so that an integer number of squiggles is printed. If eq-end? is set to #t, the squiggled line ends with a bow in the same direction as the starting one.

The appearance of the squiggled line may be customized by overriding the thickness, angularity, height, and orientation properties.

\markup
  \column {
    \draw-squiggle-line #0.5 #'(6 . 0) ##t
    \override #'(orientation . -1)
    \draw-squiggle-line #0.5 #'(6 . 0) ##t
    \draw-squiggle-line #0.5 #'(6 . 0) ##f
    \override #'(height . 1)
    \draw-squiggle-line #0.5 #'(6 . 0) ##t
    \override #'(thickness . 5)
    \draw-squiggle-line #0.5 #'(6 . -2) ##t
    \override #'(angularity . 2)
    \draw-squiggle-line #0.5 #'(6 . 2) ##t
  }
[image of music]

Used properties:

  • orientation (1)
  • height (0.5)
  • angularity (0)
  • thickness (0.5)
\ellipse arg (markup)

Draw an ellipse around arg.

Use properties thickness, x-padding, y-padding, and font-size to set the line thickness and padding around the markup.

This is the same as function \oval but with different padding defaults.

\markup {
  \ellipse {
    Hi
  }
}
[image of music]

Used properties:

  • y-padding (0.2)
  • x-padding (0.2)
  • font-size (0)
  • thickness (1)
\epsfile axis (number) size (number) file-name (string)

Inline an image file-name, scaled along axis to size.

See \image for details on this command; calling

\markup \epsfile axis size file-name

is the same as

\markup
  \override #'(background-color . #f)
  \image axis size file-name
\filled-box xext (pair of numbers) yext (pair of numbers) blot (number)

Draw a box of dimensions xext and yext, with rounded corners given by blot.

For example,

\filled-box #'(-.3 . 1.8) #'(-.3 . 1.8) #0

creates a box extending horizontally from -0.3 to 1.8 and vertically from -0.3 up to 1.8, with corners formed from a circle of diameter 0 (i.e., sharp corners).

\markup {
  \filled-box #'(0 . 4) #'(0 . 4) #0
  \filled-box #'(0 . 2) #'(-4 . 2) #0.4
  \combine
    \filled-box #'(1 . 8) #'(0 . 7) #0.2
    \with-color #white
      \filled-box #'(3.6 . 5.6) #'(3.5 . 5.5) #0.7
}
[image of music]
\hbracket arg (markup)

Draw horizontal brackets around arg.

\markup {
  \hbracket {
    \line {
      one two three
    }
  }
}
[image of music]
\image axis (number) size (number) file-name (string)

Inline an image file-name, scaled along axis to size.

The image format is determined based on the extension of file-name, which should be .png for a PNG image, or .eps for an EPS image (.PNG and .EPS are allowed as well).

EPS files are only supported in the PostScript backend – for all output formats –, and in the Cairo backend – when creating PostScript or EPS output.

If the image has transparency, it will appear over a colored background with the color specified by the background-color property, which defaults to "white".

To disable the colored background, set background-color to #f. For EPS images, this always works (where EPS images work in the first place). On the other hand, for PNG images, it works in the Cairo backend (which can output all supported formats), as well as in the SVG backend, but not in the PostScript backend, which is the default. See Advanced command-line options for LilyPond for how to activate the Cairo backend.

Use \withRelativeDir as a prefix to file-name if the file should be found relative to the input file.

Used properties:

  • background-color ("white")
\oval arg (markup)

Draw an oval around arg.

Use properties thickness, x-padding, y-padding, and font-size to set the line thickness and padding around the markup.

This is the same as function \ellipse but with different padding defaults.

\markup {
  \oval {
    Hi
  }
}
[image of music]

Used properties:

  • y-padding (0.75)
  • x-padding (0.75)
  • font-size (0)
  • thickness (1)
\parenthesize arg (markup)

Draw parentheses around arg.

This is useful for parenthesizing a column containing several lines of text.

\markup {
  \parenthesize
  \column {
    foo
    bar
  }
  \override #'(angularity . 2)
  \parenthesize
  \column {
    bah
    baz
  }
}
[image of music]

Used properties:

  • width (0.25)
  • line-thickness (0.1)
  • thickness (1)
  • size (1)
  • padding
  • angularity (0)
\path thickness (number) commands (list)

Draw a path with line thickness according to the directions given in commands.

commands is a list of lists where the car of each sublist is a drawing command and the cdr comprises the associated arguments for each command.

There are seven commands available to use in commands: moveto, rmoveto, lineto, rlineto, curveto, rcurveto, and closepath. Note that the commands that begin with ‘r’ are the relative variants of the other three commands. You may also use the standard SVG single-letter equivalents: moveto = M, lineto = L, curveto = C, closepath = Z. The relative commands are written lowercase: rmoveto = r, rlineto = l, rcurveto = c.

The commands moveto, rmoveto, lineto, and rlineto take 2 arguments, namely the X and Y coordinates of the destination point.

The commands curveto and rcurveto create cubic Bézier curves, and take 6 arguments; the first two are the X and Y coordinates for the first control point, the second two are the X and Y coordinates for the second control point, and the last two are the X and Y coordinates for the destination point.

The closepath command takes zero arguments and closes the current subpath in the active path.

Line-cap styles and line-join styles may be customized by overriding the line-cap-style and line-join-style properties, respectively. Available line-cap styles are butt, round, and square. Available line-join styles are miter, round, and bevel.

The property filled specifies whether or not the path is filled with color.

samplePath =
  #'((lineto -1 1)
     (lineto 1 1)
     (lineto 1 -1)
     (curveto -5 -5 -5 5 -1 0)
     (closepath))

\markup \scale #'(2 . 2) {
  \path #0.25 #samplePath

  \override #'(line-join-style . miter)
  \path #0.25 #samplePath

  \override #'(filled . #t)
  \path #0.25 #samplePath
}
[image of music]

Used properties:

  • filled (#f)
  • line-join-style (round)
  • line-cap-style (round)
\polygon points (list of number pairs)

A polygon delimited by the list of points.

Property extroversion defines how the shape of the polygon is adapted to its thickness: if it is 0, the polygon is traced as-is. If it is -1, the outer side of the line is just on the given points. If set to 1, the line has its inner side on the points. The thickness property controls the thickness of the line; for filled polygons, this means the diameter of the blot.

regularPentagon =
  #'((1 . 0) (0.31 . 0.95) (-0.81 . 0.59)
     (-0.81 . -0.59) (0.31 . -0.95))

\markup \scale #'(2 . 2) {
  \polygon #'((-1 . -1) (0 . -3) (2 . 2) (1 . 2))
  \override #'(filled . #f)
    \override #'(thickness . 2)
      \combine
        \with-color #(universal-color 'blue)
          \polygon #regularPentagon
        \with-color #(universal-color 'vermillion)
          \override #'(extroversion . 1)
            \polygon #regularPentagon
}
[image of music]

Used properties:

  • thickness (1)
  • filled (#t)
  • extroversion (0)
\postscript str (string)

Insert str directly into the output as a PostScript command string.

This command is meant as a last resort. Almost all needs are better fulfilled by other markup commands (see, for example, \path and \draw-line). If you do use this command, keep the following points in mind:

  • \postscript does not work in SVG output.
  • Only a subset of the PostScript language is supported during the conversion from PostScript to PDF.
  • There are no stability guarantees on the details of how LilyPond produces its own output (i.e., the context into which the PostScript code is inserted). They may change substantially across versions.
  • LilyPond cannot understand the shape of the drawing, leading to suboptimal spacing. Usually, it is necessary to explicitly set up dimensions with a command like \with-dimensions.
  • Depending on how you install LilyPond, the version of the PostScript interpreter (Ghostscript) can vary, and some of its features may be disabled.

str is processed with the following constraints.

  • The string is embedded into the (intermediate) output file with the PostScript commands
    gsave currentpoint translate 0.1 setlinewidth
    

    before and

    grestore
    

    after it.

  • After these preceding commands (i.e., currentpoint translate) the origin of the current transformation is the reference point of \postscript. Scale and rotation of the current transformation reflect the global staff line distance and (if applied) other transformation markup commands (e.g., \scale and \rotate) encapsulating the \postscript command.
  • The current point is set to the coordinate (0, 0).
  • If an unwanted line appears at the beginning of your PostScript code, you are probably missing a call to newpath.
ringsps = "
  0.15 setlinewidth
  0.9 0.6 moveto
  0.4 0.6 0.5 0 361 arc
  stroke
  1.0 0.6 0.5 0 361 arc
  stroke
  "

rings = \markup {
  \with-dimensions #'(-0.2 . 1.6) #'(0 . 1.2)
  \postscript #ringsps
}

\relative c'' {
  c2^\rings
  a2_\rings
}
[image of music]
\rounded-box arg (markup)

Draw a box with rounded corners around arg.

This function looks at properties thickness, box-padding, and font-size to determine the line thickness and padding around the arg. The corner-radius property defines the radius of the round corners (default value is 1).

c4^\markup {
  \rounded-box {
    Overtura
  }
}
c,8. c16 c4 r
[image of music]

Note that the box does not horizontally displace its argument. Use markup commands like \left-align or \table to make LilyPond realign it.

\markup {
  \override #'(box-padding . 1.5)
  \column {
    "text"
    \rounded-box "text"
    \left-align \rounded-box "text"
  }
}
[image of music]

Used properties:

  • box-padding (0.5)
  • font-size (0)
  • corner-radius (1)
  • thickness (1)
\scale factor-pair (pair of numbers) arg (markup)

Scale arg.

factor-pair is a pair of numbers representing the scaling factor of the X and Y axes. Negative values may be used to produce mirror images.

\markup {
  \line {
    \scale #'(2 . 1)
    stretched
    \scale #'(1 . -1)
    mirrored
  }
}
[image of music]
\triangle filled (boolean)

Draw a triangle.

Fill the triangle if filled is set to #t.

The appearance can be controlled with properties extroversion, font-size, and thickness.

\markup {
  \triangle ##t
  \triangle ##f
  \override #'(font-size . 5)
  \override #'(thickness . 5) {
    \override #'(extroversion . 1)
    \triangle ##f
    \override #'(extroversion . -1)
    \triangle ##f
  }
}
[image of music]

Used properties:

  • thickness (1)
  • font-size (0)
  • extroversion (0)
\with-url url (string) arg (markup)

Add a link to URL url around arg.

This only works in the PDF backend.14

\markup {
  \with-url "https://lilypond.org/" {
    LilyPond ... \italic {
      music notation for everyone
    }
  }
}
[image of music]

A.1.4 Markup for music and musical symbols

\accidental alteration (an exact rational number)

Select an accidental glyph for alteration, given as a rational number.

Use \text-accidental instead if you need glyph representation forms that fit and align well with text.

\markup {
  text
  \tiny { \accidental #1/2 \accidental #-1/2 }
  text
  \tiny { \text-accidental #1/2 \text-accidental #-1/2 }
  text
}
[image of music]

Used properties:

  • alteration-glyph-name-alist
\bar-line strg (string)

Print a bar line in markup.

The allowed characters for input string strg are ‘;|.:!S[]{}’, having the same meaning as with the \bar command. The additional characters ‘{’ and ‘}’ denote left and right braces, respectively.

The output is vertically centered.

Changes of font-size are respected.

The default of height is 4 staff-space units. Apart from the bracket tips of a bracket bar line and the segno bar line all other bar lines are scaled with height. We don’t scale bracket tips and segno to meet the behaviour of SystemStartBracket and the segno barline.

\bar-line is further customizable by overriding dot-count and dash-count for dotted and dashed bar lines. The values for hair-thickness, kern and thick-thickness are customizable as well; defaults are the same as the values of the corresponding BarLine grob properties.

\markup {
   \override #'(word-space . 2)
   \column {
      \line {
        Examples
        \fontsize #-5 \translate-scaled #'(0 . 2) {
          \bar-line ":|.|:"
          \bar-line ";!S!;"
          \bar-line "]{|}["
        }
      }
      \line {
        Examples
        \fontsize #0 \translate-scaled #'(0 . 2) {
          \bar-line ":|.|:"
          \bar-line ";!S!;"
          \bar-line "]{|}["
        }
      }
      \line {
        Examples
        \fontsize #5 \translate-scaled #'(0 . 2) {
          \bar-line ":|.|:"
          \bar-line ";!S!;"
          \bar-line "]{|}["
        }
      }
   }
}
[image of music]

Used properties:

  • thick-thickness (6.0)
  • kern (3.0)
  • hair-thickness (1.9)
  • dash-count (5)
  • dot-count (4)
  • height (4)
  • font-size (0)
\coda

Draw a coda sign.

\markup {
  \coda
}
[image of music]
\compound-meter time-sig (number or pair)

Draw a numeric time signature based on time-sig.

time-sig can be a single number, a pair of numbers, a simple list, or a list of lists, as the following example demonstrates.

\markuplist {
  \override #'(baseline-skip . 4.5)
  \override #'(padding . 4.5)
  \table #'(-1 -1) {
    "Single number"  \compound-meter #3
    "Conventional"   \line {
                       \compound-meter #'(4 . 4) or
                       \compound-meter #'(4 4)
                     }
    "Subdivided"     \compound-meter #'(2 3 5 8)
    "Alternating"    \line {
                       \compound-meter #'((2) (3)) or
                       \compound-meter #'((2 3 8) (3 4))
                     }
  }
}
[image of music]

Setting the denominator-style property to note prints denominators as a note and dots when exact representation is possible. Example:

\markup {
  \override #'(denominator-style . note)
  \line {
    \compound-meter #'(2 2) or
    \compound-meter #'(4 1/2) or
    \compound-meter #'((2 8/3) (3 4)) but not
    \compound-meter #'(8 20)
  }
}
[image of music]

The nested-fraction-mixed property controls whether fractional parts are printed as mixed numbers or as common fractions. Example:

\markup {
  \override #'(nested-fraction-mixed . #f)
  \compound-meter #'(5/2 4) or
  \override #'(nested-fraction-mixed . #t)
  \compound-meter #'(5/2 4)
}
[image of music]

The nested-fraction-orientation property controls how nested fractions are arranged. Supported values are horizontal and vertical. Example:

\markup {
  \override #'(nested-fraction-orientation . horizontal)
  \compound-meter #'(5/2 4) or
  \override #'(nested-fraction-orientation . vertical)
  \compound-meter #'(5/2 4)
}
[image of music]

The nested-fraction-relative-font-size property controls the size of the numerals in nested fractions. Recommended values are -5.5 and 0. Using large numerals may take precedence over related properties. Example:

\markup {
  \override #'(nested-fraction-relative-font-size . -5.5)
  \compound-meter #'(5/2 4) or
  \override #'(nested-fraction-relative-font-size . 0)
  \compound-meter #'(5/2 4)
}
[image of music]

Used properties:

  • note-staff-position (-2)
  • note-head-style (())
  • note-flag-style (())
  • note-dots-direction (0)
  • nested-fraction-relative-font-size (())
  • nested-fraction-orientation (default)
  • nested-fraction-mixed (#t)
  • font-size (0)
  • denominator-style (default)
\customTabClef num-strings (integer) staff-space (number)

Draw a clef in sans-serif style for a tablature with num-strings lines spaced by staff-space.

This markup command is used to implement \clef moderntab within a TabStaff context.

\markup {
  \customTabClef #4 #1
}
[image of music]
\doubleflat

Draw a double flat symbol.

\markup {
  \doubleflat
}
[image of music]
\doublesharp

Draw a double sharp symbol.

\markup {
  \doublesharp
}
[image of music]
\fermata

Create a fermata glyph.

If property direction is DOWN, use an inverted glyph.

Note that within music, one would normally use the \fermata articulation instead of a markup.

{ c''1^\markup \fermata d''1_\markup \fermata }

\markup { \fermata \override #`(direction . ,DOWN) \fermata }
[image of music]

Used properties:

  • direction (1)
\flat

Draw a flat symbol.

\markup {
  \flat
}
[image of music]
\multi-measure-rest-by-number length (non-negative, exact integer)

Return a multi-measure rest symbol for length measures.

If the number of measures is greater than the number given by expand-limit a thick horizontal line is printed. For every multi-measure rest lasting more than one measure a number is printed on top. However, if property multi-measure-rest-number is set to #t, this number gets suppressed.

\markup {
  Multi-measure rests may look like
  \multi-measure-rest-by-number #12
  or
  \override #'(multi-measure-rest-number . #f)
    \multi-measure-rest-by-number #7
  (church rests)
}
[image of music]

Used properties:

  • multi-measure-rest-number (#t)
  • width (8)
  • expand-limit (10)
  • hair-thickness (2.0)
  • thick-thickness (6.6)
  • word-space
  • style (())
  • font-size (0)
\musicglyph glyph-name (string)

Print music symbol glyph-name.

See The Emmentaler font for a complete listing of the possible glyph names.

\markup {
  \musicglyph "f"
  \musicglyph "rests.2"
  \musicglyph "clefs.G_change"
}
[image of music]
\natural

Draw a natural symbol.

\markup {
  \natural
}
[image of music]
\note duration (duration) dir (number)

Draw a note of given duration with a stem pointing into direction dir.

duration gives the note head type and augmentation dots; dir controls both the direction and length of the stem.

See also function \note-by-number.

\markup {
  \note {4..} #UP
  \hspace #2
  \override #'(style . cross)
  \note {4..} #0.75
  \hspace #2
  \note {\breve} #0
}
[image of music]

Used properties:

  • style (())
  • dots-direction (0)
  • flag-style (())
  • font-size (0)
\note-by-number log (number) dot-count (number) dir (number)

Draw a note of length log, with dot-count dots and a stem pointing into direction dir.

By using fractional values for dir, longer or shorter stems can be obtained.

Ancient note-head styles (via the style property, see Note head styles) get mensural-style flags by default; use flag-style to override this. Supported flag styles are default, old-straight-flag, modern-straight-flag, flat-flag, stacked, mensural, and neomensural. The last flag style is the same as mensural and provided for convenience.

\markup {
  \note-by-number #3 #0 #DOWN
  \hspace #2
  \note-by-number #1 #2 #0.8
  \hspace #2
  \override #'(style . petrucci)
  \note-by-number #3 #0 #UP
  \hspace #2
  \override #'(flag-style . modern-straight-flag)
  \note-by-number #4 #0 #DOWN
}
[image of music]

Used properties:

  • style (())
  • dots-direction (0)
  • flag-style (())
  • font-size (0)
\rest duration (duration)

Return a rest symbol with length duration.

If the multi-measure-rest property is set to #t, a multi-measure rest symbol may be returned. In this case the duration needs to be entered as { 1*N } to get a multi-measure rest for N bars. Actually, only the scaling factor (i.e., the number after ‘*’) determines the length; the basic duration is disregarded.

See also functions \rest-by-number and \multi-measure-rest-by-number for more information on the used properties.

\markup {
  Rests:
  \hspace #2
  \rest { 4.. }
  \hspace #2
  \rest { \breve }
  \hspace #2
  Multi-measure rests:
  \override #'(multi-measure-rest . #t)
  {
    \hspace #2
    \rest { 1*7 }
    \hspace #2
    \rest { 1*12 }
  }
}
[image of music]

Used properties:

  • multi-measure-rest-number (#t)
  • width (8)
  • expand-limit (10)
  • hair-thickness (2.0)
  • thick-thickness (6.6)
  • word-space
  • style (())
  • font-size (0)
  • style (())
  • ledgers ((-1 0 1))
  • font-size (0)
\rest-by-number log (integer) dot-count (integer)

Draw a rest of length log, with dot-count dots.

For duration logs that appear in the ledgers property, rest symbols with ledger lines are selected.

\markup {
  \rest-by-number #3 #2
  \hspace #2
  \rest-by-number #0 #1
  \hspace #2
  \rest-by-number #-1 #0
  \hspace #2
  \override #'(ledgers . ())
  \rest-by-number #-1 #0
}
[image of music]

Used properties:

  • style (())
  • ledgers ((-1 0 1))
  • font-size (0)
\rhythm music (music)

Draw embedded rhythmic pattern as specified by music.

\relative {
  \tempo \markup {
    Swing
    \hspace #0.4
    \rhythm { 8[ 8] } = \rhythm { \tuplet 3/2 { 4 8 } }
  }
  b8 g' c, d ees d16 ees d c r8
}
[image of music]

Within \rhythm, there is no time signature and no division in measures (as with \cadenzaOn, see Unmetered music). Beaming must be added explicitly with the syntax explained in Manual beams.

\markup {
  The rhythmic pattern \rhythm { 16[ 8 16] } is
  a type of syncopation.
}
[image of music]

\stemDown can be used to flip the stems.

\markup \rhythm { \stemDown 8 16 8 }
[image of music]

\rhythm works by creating a StandaloneRhythmVoice context, which is enclosed in a StandaloneRhythmStaff context, which is enclosed in a StandaloneRhythmScore context. It is possible to apply global tweaks to the output by using a \layout block.

\layout {
  \context {
    \StandaloneRhythmVoice
    \xNotesOn
  }
}

\markup \rhythm { 8 16 8 }
[image of music]

Used properties:

  • font-size (-2)
\score score (score)

Inline an image of music as specified by score.

The reference point (usually the middle staff line) of the lowest staff in the top system is placed on the baseline.

No page breaks and no MIDI output, i.e., both \pageBreak commands and \midi{} blocks get ignored.

\markup {
  Text before the score.
  \score {
    \new PianoStaff <<
      \new Staff \relative c' {
        \key f \major
        \time 3/4
        \mark \markup { Allegro }
        f2\p( a4)
      }
      \new Staff \relative c {
        \clef bass
        \key f \major
        \time 3/4
        f8( a c a c a
      }
    >>

    \layout {
      indent = 0.0\cm
    }
  }
  Text after the score.
}
[image of music]

Used properties:

  • baseline-skip
\segno

Draw a segno symbol.

\markup {
  \segno
}
[image of music]
\semiflat

Draw a semiflat symbol.

\markup {
  \semiflat
}
[image of music]
\semisharp

Draw a semisharp symbol.

\markup {
  \semisharp
}
[image of music]
\sesquiflat

Draw a 3/2 flat symbol.

\markup {
  \sesquiflat
}
[image of music]
\sesquisharp

Draw a 3/2 sharp symbol.

\markup {
  \sesquisharp
}
[image of music]
\sharp

Draw a sharp symbol.

\markup {
  \sharp
}
[image of music]
\text-accidental alteration (an exact rational number)

Select an accidental glyph for alteration (given as a rational number) that aligns well with text.

\markup {
  text
  \tiny { \text-accidental #1/2 \text-accidental #-1/2 }
  text
}
[image of music]

Used properties:

  • alteration-glyph-name-alist
\text-doubleflat

Draw a double flat symbol for text.

\markup {
  \text-doubleflat
}
[image of music]
\text-doublesharp

Draw a double sharp symbol for text.

\markup {
  \text-doublesharp
}
[image of music]
\text-flat

Draw a flat symbol for text.

\markup {
  \text-flat
}
[image of music]
\text-natural

Draw a natural symbol for text.

\markup {
  \text-natural
}
[image of music]
\text-sharp

Draw a sharp symbol for text.

\markup {
  \text-sharp
}
[image of music]
\tied-lyric str (string)

Replace ‘~’ tilde symbols with tie characters in str.

\markup \column {
  \tied-lyric
    "Siam navi~all'onde~algenti Lasciate~in abbandono"
  \tied-lyric
    "Impetuosi venti I nostri~affetti sono"
  \tied-lyric
    "Ogni diletto~e scoglio Tutta la vita~e~un mar."
}
[image of music]

Used properties:

  • word-space
\varcoda

Draw a varcoda sign.

\markup {
  \varcoda
}
[image of music]

A.1.5 Conditional markup

\if condition? (procedure) argument (markup)

Test condition?, and only insert argument if it is true.

The condition is provided as a procedure taking an output definition and a property alist chain. The procedure is applied, and its result determines whether to print the markup. This command is most useful inside oddHeaderMarkup or similar. Here is an example printing page numbers in bold:

\paper {
  oddHeaderMarkup =
    \markup \fill-line {
      ""
      \if #print-page-number
           \bold \fromproperty #'page:page-number-string
    }
  evenHeaderMarkup =
    \markup \fill-line {
      \if #print-page-number
           \bold \fromproperty #'page:page-number-string
      ""
    }
}
\unless condition? (procedure) argument (markup)

Test condition?, and only insert argument if it is false.

This function is similar to \if; the following example shows how to print the copyright notice on all pages but the last instead of just the first page.

\paper {
  oddFooterMarkup = \markup {
    \unless #on-last-page-of-part \fill-line {
      \fromproperty #'header:copyright
    }
  }
}

\header {
  copyright = "© LilyPond Authors. License: GFDL."
  tagline = "© LilyPond Authors.  Documentation placed
under the GNU Free Documentation License
version 1.3."
}

A.1.6 Instrument-specific markup

\fret-diagram definition-string (string)

Make a (guitar) fret diagram based on definition-string.

For example, say

\markup \fret-diagram "s:1.25;6-x;5-x;4-o;3-2;2-3;1-2;"
[image of music]

for fret spacing 5/4 of staff space, D chord diagram.

Syntax rules for definition-string:

  • − Diagram items are separated by semicolons.
  • − Possible items:
    • s:number – Set the fret spacing of the diagram (in staff spaces). Default: 1.
    • t:number – Set the line thickness (relative to normal line thickness). Default: 0.5.
    • h:number – Set the height of the diagram in frets. Default: 4.
    • w:number – Set the width of the diagram in strings. Default: 6.
    • f:number – Set fingering label type (0 = none, 1 = in circle on string, 2 = below string). Default: 0.
    • d:number – Set radius of dot, in terms of fret spacing. Default: 0.25.
    • p:number – Set the position of the dot in the fret space. 0.5 is centered; 1 is on lower fret bar, 0 is on upper fret bar. Default: 0.6.
    • c:string1-string2-fret – Include a barre mark from string1 to string2 on fret.
    • string-fret – Place a dot on string at fret. If fret is ‘o’, string is identified as open. If fret is ‘x’, string is identified as muted.
    • string-fret-fingering – Place a dot on string at fret, and label with fingering as defined by the f: code.
  • − Note: There is no limit to the number of fret indications per string.

Used properties:

  • thickness (0.5)
  • fret-diagram-details
  • size (1.0)
  • align-dir (-0.4)
\fret-diagram-terse definition-string (string)

Make a fret diagram markup using terse string-based syntax.

For example,

\markup \fret-diagram-terse "x;x;o;2;3;2;"
[image of music]

displays a D chord diagram.

Syntax rules for definition-string:

  • Strings are terminated by semicolons; the number of semicolons is the number of strings in the diagram.
  • Mute strings are indicated by ‘x’.
  • Open strings are indicated by ‘o’.
  • A number indicates a fret indication at that fret.
  • If there are multiple fret indicators desired on a string, they should be separated by spaces.
  • Fingerings are given by following the fret number with a ‘-’ followed by the finger indicator, e.g., ‘3-2’ for playing the third fret with the second finger.
  • Where a barre indicator is desired, follow the fret (or fingering) symbol with -( to start a barre and -) to end the barre.

Used properties:

  • thickness (0.5)
  • fret-diagram-details
  • size (1.0)
  • align-dir (-0.4)
\fret-diagram-verbose marking-list (pair)

Make a fret diagram containing the symbols indicated in marking-list.

The following example produces a standard D chord diagram without fingering indications.

\markup \scale #'(1.5 . 1.5)
  \fret-diagram-verbose
    #'((mute 6) (mute 5) (open 4)
       (place-fret 3 2) (place-fret 2 3) (place-fret 1 2))
[image of music]

Possible elements in marking-list:

(mute string-number)

Place a small ‘x’ at the top of string string-number.

(open string-number)

Place a small ‘o’ at the top of string string-number.

(barre start-string end-string fret-number)

Place a barre indicator (much like a tie) from string start-string to string end-string at fret fret-number.

(capo fret-number)

Place a capo indicator (a large solid bar) across the entire fretboard at fret location fret-number. Also, set fret fret-number to be the lowest fret on the fret diagram.

(place-fret string-number fret-number [finger-value] [color-modifier] [color] ['parenthesized ['default-paren-color]])

Place a fret playing indication on string string-number at fret fret-number with an optional fingering label finger-value, an optional color modifier color-modifier, an optional color color, an optional parenthesis 'parenthesized and an optional paranthesis color 'default-paren-color.

By default, the fret playing indicator is a solid dot. This can be globally changed by setting the value of the property dot-color or for a single dot by setting the value of color. The dot can be parenthesized by adding 'parenthesized. By default the color for the parenthesis is taken from the dot. Adding 'default-paren-color will take the parenthesis color from the global dot-color property; as a fallback black will be used. Setting color-modifier to inverted inverts the dot color for a specific fingering.

The values for string-number, fret-number, and the optional finger should be entered first in that order. The order of the other optional arguments does not matter. If the finger part of the place-fret element is present, finger-value will be displayed according to the setting of the variable finger-code. There is no limit to the number of fret indications per string.

\markup \scale #'(1.5 . 1.5)
  \fret-diagram-verbose #'(
    (place-fret 6 3 1 red parenthesized default-paren-color)
    (place-fret 5 3 1 inverted)
    (place-fret 4 5 2 blue parenthesized)
    (place-fret 3 5 3 blue)
    (place-fret 2 5 4 blue)
    (place-fret 1 3 1 inverted)
  )
[image of music]

Used properties:

  • thickness (0.5)
  • fret-diagram-details
  • size (1.0)
  • align-dir (-0.4)
\harp-pedal definition-string (string)

Make a harp pedal diagram containing the symbols indicated in definition-string.

Possible elements in definition-string:

^

pedal is up

-

pedal is neutral

v

pedal is down

|

vertical divider line

o

the following pedal should be circled (indicating a change)

\markup \harp-pedal "^-v|--ov^"
[image of music]

The function also checks whether the string has the typical form of three pedals, then the divider, and then the remaining four pedals, printing a warning otherwise (without preventing the non-standard order).

Use the size property to control the overall size, and the thickness property for the line thickness of the horizontal line and the divider.

The remaining configuration is done via the harp-pedal-details property; it contains the following elements:

box-offset

vertical shift of the box center for up/down pedals

box-width

box width

box-height

box height

space-before-divider

spacing between two boxes before the divider

space-after-divider

spacing between two boxes after the divider

\markup {
  \override #'((size . 1.5)
               (harp-pedal-details . ((box-width . 1)
                                      (box-offset . 2))))
  \harp-pedal "^-v|--ov^"
}
[image of music]

For global modification of harp-pedal-details, i.e., outside of the current \markup block, you can also use code similar to

\override Voice.TextScript.harp-pedal-details.box-width = 1

Used properties:

  • thickness (0.5)
  • harp-pedal-details (())
  • size (1.2)
\woodwind-diagram instrument (symbol) user-draw-commands (list)

Make a woodwind-instrument diagram for instrument using user-draw-commands.

user-draw-commands is a list of alists, specifying the left-hand keys, the elements on the central column, and the right-hand keys. For example, this diagram

\markup \woodwind-diagram
  #'oboe #'((lh . (d ees))
            (cc . (five3qT1q))
            (rh . (gis)))
[image of music]

shows an oboe with the left-hand d key, left-hand ees key, and right-hand gis key depressed, while the five-hole of the central column effectuating a trill between 1/4 and 3/4 is closed.

The following instruments are supported:

  • − piccolo
  • − flute
  • − oboe
  • − clarinet
  • − bass-clarinet
  • − saxophone
  • − bassoon
  • − contrabassoon

To see all of the callable keys for a given instrument, include the function call (print-keys 'instrument) in your .ly file, where instrument is the instrument whose keys you want to print.

Certain keys allow for special configurations. The entire gamut of configurations possible is as follows:

1q

1/4 covered

1h

1/2 covered

3q

3/4 covered

R

ring depressed

F

fully covered; the default if no state put

Additionally, these configurations can be used in trills. So, for example, three3qTR effectuates a trill between 3/4 full and ring depressed on the three hole. As another example, threeRT effectuates a trill between R and open, whereas threeTR effectuates a trill between open and shut. To see all of the possibilities for all of the keys of a given instrument, invoke (print-keys-verbose 'instrument).

Lastly, substituting an empty list for the pressed-key alist results in a diagram with all of the keys drawn but none filled, for example

\markup \woodwind-diagram #'flute #'()
[image of music]

Used properties:

  • woodwind-diagram-details (())
  • font-size (0)
  • graphical (#t)
  • thickness (0.1)
  • size (1)

A.1.7 Accordion registers

\discant name (string)

Generate a discant accordion register symbol for name.

To make it available,

#(use-modules (lily accreg))

is required near the top of your input file.

The register names in the default \discant register set have been modeled after the numeric Swiss notation (as depicted in http://de.wikipedia.org/wiki/Register_%28Akkordeon%29), omitting the slashes and dropping leading zeros.

The string name is basically a three-digit number with the lowest digit specifying the number of 16’ reeds, the tens the number of 8’ reeds, and the hundreds specifying the number of 4’ reeds. Without modification, the specified number of reeds in 8’ is centered in the symbol. Newer instruments may have registrations where 8’ can be used either within or without a tone chamber, ‘cassotto’. Notationally, the central dot then indicates use of cassotto. One can suffix the tens’ digits ‘1’ and ‘2’ with ‘+’ or ‘-’ to indicate clustering the dots at the right or left, respectively, rather than centered.

Some examples are

[image of music]

Used properties:

  • font-size (0)
\freeBass name (string)

Generate a free bass/converter accordion register symbol for the usual two-reed layout as given by name.

To make it available,

#(use-modules (lily accreg))

is required near the top of your input file.

Available registrations are

[image of music]

Used properties:

  • font-size (0)
\stdBass name (string)

Generate a standard bass accordion register symbol for name.

To make it available,

#(use-modules (lily accreg))

is required near the top of your input file.

The default bass register definitions have been modeled after the article http://www.accordions.com/index/art/stradella.shtml originally appearing in Accord Magazine.

The underlying register model is

[image of music]

This kind of overlapping arrangement is common for Italian instruments though the exact location of the octave breaks differ.

When not composing for a particular target instrument, using the five-reed definitions makes more sense than using a four-reed layout: in that manner, the ‘Master’ register is unambiguous. This is rather the rule in literature bothering about bass registrations at all.

Available registrations are

[image of music]

Used properties:

  • font-size (0)
\stdBassIV name (string)

Generate a standard bass accordion register symbol for name.

To make it available,

#(use-modules (lily accreg))

is required near the top of your input file.

The main use is for four-reed standard bass instruments with reedbank layout

[image of music]

Notable instruments are Morino models with MIII (the others are five-reed instead) and the Atlantic IV. Most of those models have three register switches. Some newer Morinos with MIII might have five or even seven.

The prevalent three-register layout uses the middle three switches ‘Tenor’, ‘Master’, ‘Soft Bass’. Note that the sound is quite darker than the same registrations of ‘c,’-based instruments.

Available registrations are

[image of music]

Used properties:

  • font-size (0)
\stdBassV name (string)

Generate a standard bass accordion register symbol for name.

To make it available,

#(use-modules (lily accreg))

is required near the top of your input file.

The main use is for five-reed standard bass instruments with reedbank layout

[image of music]

This tends to be the bass layout for Hohner’s Morino series without converter or MIII manual.

With the exception of the rather new 7-register layout, the highest two chord reeds are usually sounded together. Older instruments offer 5 or 3 bass registers. The Tango VM offers an additional ‘Solo Bass’ setting that mutes the chord reeds. The symbol on the register buttons of the Tango VM would actually match the physical five-octave layout reflected here, but it is not used in literature.

Composers should likely prefer the five-reed versions of these symbols. The mismatch of a four-reed instrument with five-reed symbols is easier to resolve for the player than the other way round.

Available registrations are

[image of music]

Used properties:

  • font-size (0)
\stdBassVI name (string)

Generate a standard bass accordion register symbol for six-reed basses as given by name.

To make it available,

#(use-modules (lily accreg))

is required near the top of your input file.

This is primarily the register layout for the Hohner “Gola” model. The layout is

[image of music]

The registers are effectively quite similar to that of \stdBass. An additional bass reed at alto pitch is omitted for esthetical reasons from the ‘Master’ setting, so the symbols are almost the same except for the ‘Alto/Soprano’ register with bass notes at Alto pitch and chords at Soprano pitch.

Available registrations are

[image of music]

Used properties:

  • font-size (0)

A.1.8 Other markup commands

\annotate-moving arg (markup)

Indicate \vspace and \hspace movement with an arrow.

The arrow changes its size and thickness depending on the printed length; the maximum size of the arrow head can be controlled with the size property. If size exceeds a third of the length of the final arrow, it falls back to that third.

Note that the arrows do not reflect the actual extents of the objects created by \vspace and \hspace; you might use \box for that.

\markup
  \column {
    \line { left \annotate-moving \hspace #4 right }
    \line { left \annotate-moving \hspace #-4 right }
    \line {
      \column {
        top \override #'(size . 0.6) \annotate-moving \vspace #4/3 bottom
      }
      \column {
        top \override #'(size . 2.0) \annotate-moving \vspace #-4/3 bottom
      }
    }
  }
[image of music]

Used properties:

  • size (1)
  • color ("red")
\append-to-tag tag (symbol) more (markup) arg (markup)

Append more to all markup in var arg tagged with tag.

It works similar to \appendToTag for music, but only with markups.

tagged = \markup {
  \tag #'foo A
  \tag #'bar B
}

\markup { \append-to-tag #'foo postfoo \tagged }
[image of music]

Used properties:

  • tags-with-appends-alist (())
\auto-footnote mkup (markup) note (markup)

Have footnote note act as an annotation to the markup mkup.

\markup {
  \auto-footnote a b
  \override #'(padding . 0.2)
  \auto-footnote c d
}
[image of music]

The footnote will be annotated automatically.

Used properties:

  • padding (0.0)
  • raise (0.5)
\backslashed-digit num (integer)

Print number num with the Emmentaler font, crossed through with a backslash.

This is for use in the context of figured bass notation.

\markup {
  \backslashed-digit #5
  \hspace #2
  \override #'(thickness . 3)
  \backslashed-digit #7
}
[image of music]

Used properties:

  • thickness (1.6)
  • font-size (0)
\char num (integer)

Produce a single Unicode character with code num.

Characters encoded in hexadecimal format require the prefix #x.

\markup {
  \char #65 \char ##x00a9
}
[image of music]
\eyeglasses

Prints out eyeglasses, indicating strongly to look at the conductor.

\markup { \eyeglasses }
[image of music]
\first-visible args (markup list)

Use the first markup in args that yields a non-empty stencil and ignore the rest.

\markup {
  \first-visible {
    \fromproperty #'header:composer
    \italic Unknown
  }
}
[image of music]
\footnote mkup (markup) note (markup)

Have footnote note act as an annotation to the markup mkup.

\markup {
  \footnote a b
  \override #'(padding . 0.2)
  \footnote c d
}
[image of music]

The footnote will not be annotated automatically.

\fraction arg1 (markup) arg2 (markup)

Make a fraction of markups arg1 and arg2.

\markup {
  π  \fraction 355 113
}
[image of music]

Used properties:

  • font-size (0)
\fromproperty symbol (symbol)

Read symbol from the property settings and produce a stencil from the markup contained within.

If symbol is not defined or is not a markup, return an empty markup.

Currently, the following properties can be accessed.

  • Within a \paper block defining titles, headers, or footers, or within a \header block: all fields from the \header block (that produce markup) are available, with header: as a name prefix.
  • Within a \paper block defining headers or footers: the current page number (symbol page:page-number-string).
  • Within the tocItemMarkup paper variable (or in custom-made Scheme code that uses function add-toc-item!) defining a table of contents entry: the entry’s text and page number are available as toc:text and toc:page, respectively. An entry’s indentation markup is available as toc:indent.
\header {
  myTitle = "myTitle"
  title = \markup {
    from
    \italic
    \fromproperty #'header:myTitle
  }
}
\markup {
  \null
}
[image of music]
\keep-with-tag tags (symbol list or symbol) arg (markup)

Keep markup from arg that is untagged or tagged with tags.

All other parts of arg that are using a different tag are replaced with empty stencils. It works similar to \keepWithTag for music, but only with markups.

tagged = \markup {
  untagged
  \tag #'foo A
  \tag #'bar B
}

\markup { \keep-with-tag #'bar \tagged }
\markup { \keep-with-tag #'foo \tagged }
[image of music]

Used properties:

  • tags-to-keep (())
\left-brace size (number)

Print a brace from the music font, of height size (in points).

\markup {
  \left-brace #35
  \hspace #2
  \left-brace #45
}
[image of music]
\lookup glyph-name (string)

Print a brace glyph with name glyph-name.

This is a historical command; \left-brace (which looks up the glyph by absolute size and is independent of the font size) is recommended instead.

\markup \lookup "brace200"
[image of music]
\markalphabet num (integer)

Make a markup letter for num.

The letters start with A to Z and continue with double letters.

\markup {
  \markalphabet #8
  \hspace #2
  \markalphabet #26
}
[image of music]
\markletter num (integer)

Make a markup letter for num.

The letters start with A to Z (skipping letter I), and continue with double letters.

\markup {
  \markletter #8
  \hspace #2
  \markletter #26
}
[image of music]
\null

An empty markup with extents of a single point.

\markup {
  \null
}
[image of music]
\on-the-fly procedure (procedure) arg (markup)

Apply the procedure markup command to arg.

procedure takes the same arguments as interpret-markup and returns a stencil.

\override new-prop (pair) arg (markup)

Add the argument new-prop to the property list for printing arg.

In general, any property may be overridden that is part of font-interface (font-interface), text-interface (text-interface), or instrument-specific-markup-interface (instrument-specific-markup-interface). Additionally, various markup commands listen to other properties, too, as described in a markup function’s documentation.

new-prop is either a single alist pair or a non-empty list of alist pairs.

\markup {
  \undertie "undertied"
  \override #'(offset . 15)
  \undertie "offset undertied"
  \override #'((offset . 15) (thickness . 3))
  \undertie "offset thick undertied"
}
[image of music]

Add a link to a score’s page page-number around arg.

This only works in the PDF backend.

\markup {
  \page-link #2 { \italic { This links to page 2... } }
}
[image of music]
\page-ref label (symbol) gauge (markup) default (markup)

Print a page number reference.

label is the label set on the referenced page (using \label or \tocItem), gauge a markup used to estimate the maximum width of the page number, and default the value to display when label is not found.

If the current book or bookpart is set to use roman numerals for page numbers, the reference will be formatted accordingly – in which case the gauge’s width may require additional tweaking.

Used properties:

  • x-align (1)
\pattern count (non-negative, exact integer) axis (non-negative, exact integer) space (number) pattern (markup)

Print a pattern markup count times.

Patterns are spaced apart by space (defined as for \hspace or \vspace, respectively) and distributed on axis.

\markup \column {
  "Horizontally repeated:"
  \pattern #7 #X #2 \flat
  \null
  "Vertically repeated:"
  \pattern #3 #Y #0.5 \flat
}
[image of music]
\property-recursive symbol (symbol)

Print out a warning when header field markup in symbol contains some recursive markup definition.

\push-to-tag tag (symbol) more (markup) arg (markup)

Prepend more to all markup in arg tagged with tag.

It works similar to \pushToTag for music, but only with markups.

tagged = \markup {
  \tag #'foo A
  \tag #'bar B
}

\markup { \push-to-tag #'foo prefoo \tagged }
[image of music]

Used properties:

  • tags-with-pushes-alist (())
\qr-code width (non-negative number) str (string)

Insert a QR code for string str, usually a URL, with a given width.

\markup \vcenter {
  \center-column { Engraved with LilyPond }
  \hspace #1.5
  \qr-code #10.0 "https://lilypond.org"
}
[image of music]

The error-correction-level property can be set to one of the symbols low, medium, quarter, or high. The higher the level of error correction is, the more the QR code contains redundancy, potentially helping detectors, e.g., in poor lighting conditions; however, a higher correction level also makes the code denser.

\markup \vcenter {
  \center-column { Engraved with LilyPond }
  \hspace #1.5
  \override #'(error-correction-level . high)
    \qr-code #10.0 "https://lilypond.org"
}
[image of music]

The quiet-zone-size property specifies the width of the “quiet zone”, namely the white area around the QR code. It is expressed as a multiple of the width of one little square inside the QR code. Use at least 4 for best results.

Used properties:

  • quiet-zone-size (4)
  • error-correction-level (low)
\remove-with-tag tags (symbol list or symbol) arg (markup)

Remove markup from arg that is tagged with tags.

The removed markup is replaced with empty stencils. It works similar to \removeWithTag for music, but only with markups.

tagged = \markup {
  \tag #'foo A
  \tag #'bar B
}

\markup { \remove-with-tag #'foo \tagged }
\markup { \remove-with-tag #'bar \tagged }
[image of music]

Used properties:

  • tags-to-remove (())
\right-brace size (number)

A music brace in point size size, rotated 180 degrees.

\markup {
  \right-brace #45
  \hspace #2
  \right-brace #35
}
[image of music]
\slashed-digit num (integer)

Print number num with the Emmentaler font, crossed through with a slash.

This is for use in the context of figured bass notation.

\markup {
  \slashed-digit #5
  \hspace #2
  \override #'(thickness . 3)
  \slashed-digit #7
}
[image of music]

Used properties:

  • thickness (1.6)
  • font-size (0)
\stencil stil (stencil)

Use stencil stil as markup.

\markup {
  \stencil #(make-circle-stencil 2 0 #t)
}
[image of music]
\strut

Create a box of the same height as the space in the current font.

\tag tags (symbol list or symbol) arg (markup)

Tag markup arg with tag.

tag can be one or multiple tags. This allows later on to reference arg; for example, to remove it or to add markup before or after the tagged markup. It works similar to \tag for music, but only with markups.

tagged = \markup {
  \tag #'foo A
  \tag #'bar B
}

\markup { \keep-with-tag #'bar \tagged }
\markup { \keep-with-tag #'foo \tagged }
[image of music]

Used properties:

  • tags-with-appends-alist (())
  • tags-with-pushes-alist (())
  • tags-to-remove (())
  • tags-to-keep (())
\transparent arg (markup)

Make arg transparent.

\markup {
  \transparent {
    invisible text
  }
}
[image of music]
\verbatim-file name (string)

Read the contents of file name and include it verbatim.

\markup {
  \verbatim-file "en/included/simple.ly"
}
[image of music]

Use \withRelativeDir as a prefix to name if the file should be found relative to the input file.

\whiteout arg (markup)

Provide a white background for arg.

The shape of the white background is determined by the style property. The default is box which produces a rectangle. rounded-box produces a rounded rectangle, and outline approximates the outline of the markup.

The color of the background can be controlled with the color property, defaulting to "white".

\markup {
  \combine
    \filled-box #'(-1 . 62) #'(-3 . 4) #1
    \override #'(line-width . 60)
      \fill-line {
        \override #'(thickness . 1.5)
          \whiteout box
        \override #'((style . rounded-box) (thickness . 3))
          \whiteout rounded-box
        \override #'((style . outline) (thickness . 3))
          \whiteout outline
        \override #'((color . "red") (style . outline))
          \whiteout red-outline
      }
}
[image of music]

Used properties:

  • color ("white")
  • thickness (())
  • style (box)
\with-color col (color) arg (markup)

Use color col to draw arg.

See Coloring objects for valid color specifications.

\markup {
  \with-color #red red
  \hspace #2
  \with-color #green green
  \hspace #2
  \with-color "#0000ff" blue
}
[image of music]
\with-dimension axis (integer) val (pair of numbers) arg (markup)

Set the dimension of arg along axis to val.

If axis is equal to X, set the horizontal dimension. If axis is equal to Y, set the vertical dimension.

\with-dimension-from axis (integer) arg1 (markup) arg2 (markup)

Print arg2 but replace the dimension along axis with the one from arg1.

If axis is set to X, replace the horizontal dimension. If axis is set to Y, replace the vertical dimension.

\with-dimensions x (pair of numbers) y (pair of numbers) arg (markup)

Set the horizontal and vertical dimensions of arg to x and y.

\with-dimensions-from arg1 (markup) arg2 (markup)

Print arg2 with the horizontal and vertical dimensions of arg1.

Add a link to the page holding label label around arg.

This only works in the PDF backend.

\markup {
  \with-link #'label {
    \italic { This links to the page
               containing the label... }
  }
}
\with-outline outline (markup) arg (markup)

Print arg with the outline and dimensions of outline.

The outline is used by skylines to resolve collisions (not for whiteout).

\with-true-dimension axis (integer) arg (markup)

Give arg its actual dimension (extent) on axis.

Sometimes, the extents of a markup’s printed ink differs from the default extents. The main case is if glyphs are involved. By default, the extents of a glyph are based on the glyph’s metrics (i.e., a default vertical and horizontal size for the glyph), which, for various reasons, are often not identical to its bounding box (i.e., the smallest rectangle that completely encompasses the glyph’s outline) – in most cases, the outline protrudes the box spanned up by the metrics.

\markup {
  text
  \fontsize #10
  \override #'((box-padding . 0) (thickness . 0.2))
  \box
    \musicglyph "scripts.trill"
  text
}
[image of music]

For purposes other than setting text, this behavior may not be wanted. You can use \with-true-dimension in order to give the markup its actual printed extent.

\markup {
  text
  \fontsize #10
  \override #'((box-padding . 0) (thickness . 0.2))
  \box
    \with-true-dimension #X
    \musicglyph "scripts.trill"
  text
}
[image of music]
\with-true-dimensions arg (markup)

Give arg its actual dimensions (extents).

Calling

\markup \with-true-dimensions arg

is short for

\markup
  \with-true-dimension #X
  \with-true-dimension #Y
  arg

i.e., \with-true-dimensions has the effect of \with-true-dimension on both axes.


Footnotes

(13)

Internally, this works by activating the ‘dlig’ OpenType feature of the Emmentaler font.

(14)

Due to technical limitations the link doesn’t work here in the Notation Reference.


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