Overview of text markup commands - GNU LilyPond
Description: GNU LilyPond

Next: Font selection, Previous: Nested scores, Up: Text

#### 8.1.6 Overview of text markup commands

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

`\arrow-head` axis (integer) direction (direction) filled (boolean)
  produce an arrow head in specified direction and axis. Use the filled head if filled is specified.
`\beam` width (number) slope (number) thickness (number)
  Create a beam with the specified parameters.
`\bigger` arg (markup)
  Increase the font size relative to current setting
`\bold` arg (markup)
  Switch to bold font-series
`\box` arg (markup)
  Draw a box round arg. Looks at `thickness`, `box-padding` and `font-size` properties to determine line thickness and padding around the markup.
`\bracket` arg (markup)
  Draw vertical brackets around arg.
`\bracketed-y-column` indices (list) args (list of markups)
  Make a column of the markups in args, putting brackets around the elements marked in indices, which is a list of numbers.
`\caps` arg (markup)
  Set `font-shape` to `caps`.
`\center-align` args (list of markups)
  Put `args` in a centered column.
`\char` num (integer)
  Produce a single character, e.g. `\char #65` produces the letter 'A'.
`\circle` arg (markup)
  Draw a circle around arg. Use `thickness`, `circle-padding` and `font-size` properties to determine line thickness and padding around the markup.
`\column` args (list of markups)
  Stack the markups in args vertically. The property `baseline-skip` determines the space between each markup in args.
`\combine` m1 (markup) m2 (markup)
  Print two markups on top of each other.
`\dir-column` args (list of markups)
  Make a column of args, going up or down, depending on the setting of the `#'direction` layout property.
`\doubleflat`
  Draw a double flat symbol.
`\doublesharp`
  Draw a double sharp symbol.
`\draw-circle` radius (number) thickness (number) fill (boolean)
  A circle of radius radius, thickness thickness and optionally filled.
`\dynamic` arg (markup)
  Use the dynamic font. This font only contains s, f, m, z, p, and r. When producing phrases, like “più f”, the normal words (like “più”) should be done in a different font. The recommend font for this is bold and italic
`\epsfile` axis (number) size (number) file-name (string)
  Inline an EPS image. The image is scaled along axis to size.
`\fill-line` markups (list of markups)
  Put markups in a horizontal line of width line-width. The markups are spaced/flushed to fill the entire line. If there are no arguments, return an empty stencil.
`\filled-box` xext (pair of numbers) yext (pair of numbers) blot (number)
  Draw a box with rounded corners of dimensions xext and yext. For example,

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

  create 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 (ie sharp corners).
`\finger` arg (markup)
  Set the argument as small numbers.
`\flat`
  Draw a flat symbol.
`\fontsize` increment (number) arg (markup)
  Add increment to the font-size. Adjust baseline skip accordingly.
`\fraction` arg1 (markup) arg2 (markup)
  Make a fraction of two markups.
`\fret-diagram` definition-string (string)
  Example

            \markup \fret-diagram #"s:0.75;6-x;5-x;4-o;3-2;2-3;1-2;"

  for fret spacing 3/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 (in staff spaces). Default 0.05
    - 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 f: code.
  - Note: There is no limit to the number of fret indications per string.
`\fret-diagram-terse` definition-string (string)
  Make a fret diagram markup using terse string-based syntax.

  Example

            \markup \fret-diagram-terse #"x;x;o;2;3;2;"

  for 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.
`\fret-diagram-verbose` marking-list (list)
  Make a fret diagram containing the symbols indicated in marking-list

  For example,

              \markup \fret-diagram #'((mute 6) (mute 5) (open 4)
                   (place-fret 3 2) (place-fret 2 3) (place-fret 1 2))

  will produce a standard D chord diagram without fingering indications.

  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-stringto string end-string at fret fret-number
  (place-fret string-number fret-number finger-value)
    Place a fret playing indication on string string-number at fret fret-number with an optional fingering label finger-value. By default, the fret playing indicator is a solid dot. This can be changed by setting the value of the variable dot-color. 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.
`\fromproperty` symbol (symbol)
  Read the symbol from property settings, and produce a stencil from the markup contained within. If symbol is not defined, it returns an empty markup
`\general-align` axis (integer) dir (number) arg (markup)
  Align arg in axis direction to the dir side.
`\halign` dir (number) arg (markup)
  Set horizontal alignment. If dir is `-1`, then it is left-aligned, while `+1` is right. Values in between interpolate alignment accordingly.
`\hbracket` arg (markup)
  Draw horizontal brackets around arg.
`\hcenter-in` length (number) arg (markup)
  Center arg horizontally within a box of extending length/2 to the left and right.
`\hcenter` arg (markup)
  Align `arg` to its X center.
`\hspace` amount (number)
  This produces a invisible object taking horizontal space.

           \markup { A \hspace #2.0 B }

  will put extra space between A and B, on top of the space that is normally inserted before elements on a line.

`\huge` arg (markup)
  Set font size to +2.
`\italic` arg (markup)
  Use italic `font-shape` for arg.
`\justify-field` symbol (symbol)
`\justify` args (list of markups)
  Like wordwrap, but with lines stretched to justify the margins. Use `\override #'(line-width . X)` to set line-width, where X is the number of staff spaces.
`\justify-string` arg (string)
  Justify a string. Paragraphs may be separated with double newlines
`\large` arg (markup)
  Set font size to +1.
`\left-align` arg (markup)
  Align arg on its left edge.
`\line` args (list of markups)
  Put args in a horizontal line. The property `word-space` determines the space between each markup in args.
`\lookup` glyph-name (string)
  Lookup a glyph by name.
`\lower` amount (number) arg (markup)
  Lower arg, by the distance amount. A negative amount indicates raising, see also `\raise`.
`\magnify` sz (number) arg (markup)
  Set the font magnification for the its argument. In the following example, the middle A will be 10% larger:

           A \magnify #1.1 { A } A

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

`\markalphabet` num (integer)
  Make a markup letter for num. The letters start with A to Z and continues with double letters.
`\markletter` num (integer)
  Make a markup letter for num. The letters start with A to Z (skipping I), and continues with double letters.
`\medium` arg (markup)
  Switch to medium font-series (in contrast to bold).
`\musicglyph` glyph-name (string)
  This is converted to a musical symbol, e.g. `\musicglyph #"accidentals.0"` will select the natural sign from the music font. See The Feta font for a complete listing of the possible glyphs.
`\natural`
  Draw a natural symbol.
`\normal-size-sub` arg (markup)
  Set arg in subscript, in a normal font size.
`\normal-size-super` arg (markup)
  Set arg in superscript with a normal font size.
`\normal-text` arg (markup)
  Set all font related properties (except the size) to get the default normal text font, no matter what font was used earlier.
`\normalsize` arg (markup)
  Set font size to default.
`\note-by-number` log (number) dot-count (number) dir (number)
  Construct a note symbol, with stem. By using fractional values for dir, you can obtain longer or shorter stems.
`\note` duration (string) dir (number)
  This produces a note with a stem pointing in dir direction, with the duration for the note head type and augmentation dots. For example, `\note #"4." #-0.75` creates a dotted quarter note, with a shortened down stem.
`\null`
  An empty markup with extents of a single point
`\number` arg (markup)
  Set font family to `number`, which yields the font used for time signatures and fingerings. This font only contains numbers and some punctuation. It doesn't have any letters.
`\on-the-fly` procedure (symbol) arg (markup)
  Apply the procedure markup command to arg. procedure should take a single argument.
`\override` new-prop (pair) arg (markup)
  Add the first argument in to the property list. Properties may be any sort of property supported by font-interface and text-interface, for example

           \override #'(font-family . married) "bla"

`\pad-around` amount (number) arg (markup)
  Add padding amount all around arg.
`\pad-markup` padding (number) arg (markup)
  Add space around a markup object.
`\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
`\pad-x` amount (number) arg (markup)
  Add padding amount around arg in the X-direction.
`\postscript` str (string)
  This inserts str directly into the output as a PostScript command string. Due to technicalities of the output backends, different scales should be used for the TeX and PostScript backend, selected with `-f`.

  For the TeX backend, the following string prints a rotated text

           0 0 moveto /ecrm10 findfont
           1.75 scalefont setfont 90 rotate (hello) show

  The magical constant 1.75 scales from LilyPond units (staff spaces) to TeX dimensions.

  For the postscript backend, use the following

           gsave /ecrm10 findfont
            10.0 output-scale div
            scalefont setfont 90 rotate (hello) show grestore

`\put-adjacent` arg1 (markup) axis (integer) dir (direction) arg2 (markup)
  Put arg2 next to arg1, without moving arg1.
`\raise` amount (number) arg (markup)
  Raise arg, by the distance amount. A negative amount indicates lowering, see also `\lower`.

            c1^\markup { C \small \raise #1.0 \bold { "9/7+" }}

  The argument to `\raise` is the vertical displacement amount, measured in (global) staff spaces. `\raise` and `\super` raise objects in relation to their surrounding markups.

  If the text object itself is positioned above or below the staff, then `\raise` cannot be used to move it, since the mechanism that positions it next to the staff cancels any shift made with `\raise`. For vertical positioning, use the `padding` and/or `extra-offset` properties.

`\right-align` arg (markup)
  Align arg on its right edge.
`\roman` arg (markup)
  Set font family to `roman`.
`\sans` arg (markup)
  Switch to the sans serif family
`\score` score (unknown)
  Inline an image of music.
`\semiflat`
  Draw a semiflat.
`\semisharp`
  Draw a semi sharp symbol.
`\sesquiflat`
  Draw a 3/2 flat symbol.
`\sesquisharp`
  Draw a 3/2 sharp symbol.
`\sharp`
  Draw a sharp symbol.
`\simple` str (string)
  A simple text string; `\markup { foo }` is equivalent with `\markup { \simple #"foo" }`.
`\slashed-digit` num (integer)
  A feta number, with slash. This is for use in the context of figured bass notation
`\small` arg (markup)
  Set font size to -1.
`\smallCaps` text (markup)
  Turn `text`, which should be a string, to small caps.

           \markup \smallCaps "Text between double quotes"

`\smaller` arg (markup)
  Decrease the font size relative to current setting
`\stencil` stil (unknown)
  Stencil as markup
`\strut`
  Create a box of the same height as the space in the current font.
`\sub` arg (markup)
  Set arg in subscript.
`\super` arg (markup)

  Raising and lowering texts can be done with `\super` and `\sub`:

            c1^\markup { E "=" mc \super "2" }

`\teeny` arg (markup)
  Set font size to -3.
`\text` arg (markup)
  Use a text font instead of music symbol or music alphabet font.
`\tiny` arg (markup)
  Set font size to -2.
`\translate` offset (pair of numbers) arg (markup)
  This translates an object. Its first argument is a cons of numbers

           A \translate #(cons 2 -3) { B C } D

  This moves `B C' 2 spaces to the right, and 3 down, relative to its surroundings. This command cannot be used to move isolated scripts vertically, for the same reason that `\raise` cannot be used for that.

`\transparent` arg (markup)
  Make the argument transparent
`\triangle` filled (boolean)
  A triangle, filled or not
`\typewriter` arg (markup)
  Use `font-family` typewriter for arg.
`\upright` arg (markup)
  Set font shape to `upright`. This is the opposite of `italic`.
`\vcenter` arg (markup)
  Align `arg` to its Y center.
`\verbatim-file` name (string)
  Read the contents of a file, and include verbatimly
`\whiteout` arg (markup)
  Provide a white underground for arg
`\with-color` color (list) arg (markup)
  Draw arg in color specified by color
`\with-dimensions` x (pair of numbers) y (pair of numbers) arg (markup)
  Set the dimensions of arg to x and y.
`\with-url` url (string) arg (markup)
  Add a link to URL url around arg. This only works in the PDF backend.
`\wordwrap-field` symbol (symbol)
`\wordwrap` args (list of markups)
  Simple wordwrap. Use `\override #'(line-width . X)` to set line-width, where X is the number of staff spaces.
`\wordwrap-string` arg (string)
  Wordwrap a string. Paragraphs may be separated with double newlines

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

Other languages: English.
Using automatic language selection.