[icon]

GNU LilyPond

Welcome to the home of the GNU Music Typesetter

What is LilyPond
General information
Simple examples
Complex examples
Download
GNU/Linux binaries
Windows
Source code
Documentation
Tutorial
Manual
Glossary
other ...

Support
Mailing lists
Search
WikiWiki
FAQs

External sites
lilypond.org/development
lilypond.org/stable
ftp.lilypond.org
Mutopia
Other music online

Node:Text markup, Next:, Previous:Font selection, Up:Tuning output



Text markup

LilyPond has an internal mechanism to typeset texts. You can form text markup expressions by composing scheme expressions in the following way.

 \relative c' {
    \fatText
    a^#"upright"
    b_#'(bold "bold")
    c^#'(italic "italic")
    d_#'((bold italic) "ff")
    e^#'(dynamic "ff")
    f_#'(lines "one" (bold "two"))
    g^#'(music "noteheads-2" ((raise . 2.4) "flags-u3"))
  }

[picture of music]

Normally, the Scheme markup text is stored in the text property of a grob. Formally, it is defined as follows:

text: string | (head? text+)
head: markup | (markup+)
markup-item: property | abbrev
property: (key . value)
abbrev: columns lines roman music bold italic named super sub
        overstrike text finger volta timesig mmrest mark script
        large Large dynamic

The markup is broken down and converted into a list of grob properties, which are prepended to the property list. The key-value pair is a grob property. A list of properties available is included in the generated documentation for Text_interface .

The following abbreviations are currently defined:

columns
horizontal mode: set all text on one line (default)
lines
vertical mode: set every text on a new line
roman
select roman font
music
selects the Feta font (the standard font for music notation glyphs), and uses named lookup
bold
select bold series
italic
select italic shape
named
lookup by character name
text
plain text lookup (by character value)
super
superscript
sub
subscript
overstrike
the next text or character overstrikes this one
finger
select fingering number fontstyle
volta
select volta number fontstyle
timesig
select time signature number fontstyle
mmrest
select multi measure rest number fontstyle
mark
select mark number fontstyle
script
select scriptsize roman fontstyle
large
select large roman fontstyle
Large
select Large roman fontstyle
dynamic
select dynamics fontstyle

One practical application of complicated markup is to fake a metronome marking:

#(define note '(columns
  (music "noteheads-2" ((kern . -0.1) "flags-stem"))))
#(define eight-note `(columns ,note ((kern . -0.1)
  (music ((raise . 3.5) "flags-u3")))))
#(define dotted-eight-note
  `(columns ,eight-note (music "dots-dot")))

\score {
  \notes\relative c'' {
    a1^#`((columns (font-relative-size . -1)) ,dotted-eight-note " = 64")
  }
  \paper {
    linewidth = -1.
    \translator{
      \ScoreContext
      TextScript \override #'font-shape = #'upright
    }
  }
}

[picture of music]

Go back to index of LilyPond.

Please send GNU LilyPond questions and comments to lilypond-user@gnu.org.

Please send comments on these web pages to lilypond@packages.debian.org

Copyright (c) 1997--2001 Han-Wen Nienhuys and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from LilyPond-1.4.12 (stable-branch) by

Anthony Fok <lilypond@packages.debian.org>, Tue Mar 12 01:35:39 2002 HKT.