ASCII aliases

A list of ASCII aliases for special characters can be included:

\paper {
  #(include-special-characters)
}

\markup "&flqq; – &OE;uvre incomplète… &frqq;"

\score {
  \new Staff { \repeat unfold 9 a'4 }
  \addlyrics {
    This is al -- so wor -- kin'~in ly -- rics: –_&OE;…
  }
}

\markup \column {
  "The replacement can be disabled:"
  "– &OE; …"
  \override #'(replacement-alist . ()) "– &OE; …"
}

[image of music]

You can also make your own aliases, either globally:

\paper {
  #(add-text-replacements!
    '(("100" . "hundred")
      ("dpi" . "dots per inch")))
}
\markup "A 100 dpi."

[image of music]

or locally:

\markup \replace #'(("100" . "hundred")
                    ("dpi" . "dots per inch")) "A 100 dpi."

[image of music]

The replacement is not necessarily a string; it can be an arbitrary markup. On the syntax level, this requires using Scheme quasi-quoting syntax, with a backtick ‘`’ instead of a quote ‘'’ to write the alist.

\markup \replace
  #`(("2nd" . ,#{ \markup \concat { 2 \super nd } #})) "2nd time"

[image of music]

Aliases themselves are not further processed for replacements.

See also

Notation Reference: List of special characters.

Installed Files: ly/text-replacements.ly.


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