Of the ubiquity of markup objects: Difference between revisions
Appearance
m New category Tags: Mobile edit Mobile web edit |
mNo edit summary |
||
| Line 1: | Line 1: | ||
Text objects are entered either as simple strings between double quotes or as <code>\markup</code> blocks that can accept a variety of advanced text formatting and graphical enhancements. | Text objects are entered either as simple strings between double quotes or as <code>\markup</code> blocks that can accept a variety of advanced text formatting and graphical enhancements. | ||
As such, markup blocks may be used | As such, markup blocks may be used | ||
* in any <code>TextScript</code> object (attached to notes with <code>-</code>, <code>^</code> or <code>_</code>) | * in any <code>TextScript</code> object (attached to notes with <code>-</code>, <code>^</code>, or <code>_</code>); | ||
* any <code>TextMark</code> introduced with the <code>\textMark</code> keyword, or <code>\textEndMark</code> command, or other similar objects such as MetronomeMark introduced with <code>\tempo</code> | * in any <code>TextMark</code> introduced with the <code>\textMark</code> keyword, or <code>\textEndMark</code> command, or other similar objects such as <code>MetronomeMark</code> introduced with <code>\tempo</code>; | ||
* as standalone markup blocks, entered at the top level outside of any <code>\score</code> block | * as standalone markup blocks, entered at the top level outside of any <code>\score</code> block; | ||
* in any definition inside the <code>\header</code> block (e.g. title, subtitle, composer) or in some variables defined inside the <code>\paper</code> block such as <code>evenHeaderMarkup</code> for page numbers. | * in any definition inside the <code>\header</code> block (e.g., title, subtitle, composer) or in some variables defined inside the <code>\paper</code> block such as <code>evenHeaderMarkup</code> for page numbers. | ||
<code>\markup</code> may additionally be used for lyrics, in chord names, and as dynamics. In fact, it is possible to use <code>\markup</code> to customize the appearance of virtually any object, as demonstrated in this example using various methods. | <code>\markup</code> may additionally be used for lyrics, in chord names, and as dynamics. In fact, it is possible to use <code>\markup</code> to customize the appearance of virtually any object, as demonstrated in this example using various methods. | ||
<lilypond version="2.24" full> | <lilypond version="2.24" full> | ||
% | % LSR Thanks to Aaron Hill | ||
% LSR https://lists.gnu.org/archive/html/lilypond-user/2019-01/msg00437.html | |||
\paper { | \paper { | ||
paper-width = 8\cm paper-height = 8\cm | paper-width = 8\cm | ||
paper-height = 8\cm | |||
} | } | ||
\header { | \header { | ||
title = \markup " | title = \markup "Title" | ||
tagline = \markup "(tagline)" | tagline = \markup "(tagline)" | ||
} | } | ||
| Line 26: | Line 28: | ||
dyn = #(make-dynamic-script #{ \markup \text "DynamicText" #}) | dyn = #(make-dynamic-script #{ \markup \text "DynamicText" #}) | ||
<< | |||
\new ChordNames \with { | |||
majorSevenSymbol = \markup "majorSevenSymbol" | |||
} \chordmode { c1:maj7 } | |||
\new Staff { | |||
\tempo \markup "MetronomeMark" | |||
\textMark \markup "TextMark" | |||
\once \override TupletNumber.text = \markup "TupletNumber" | |||
\tuplet 3/2 { | \tuplet 3/2 { | ||
\once \override NoteHead.stencil = #ly:text-interface::print | \once \override NoteHead.stencil = #ly:text-interface::print | ||
\once \override NoteHead.text = \markup \lower #0.5 "NoteHead" | \once \override NoteHead.text = \markup \lower #0.5 "NoteHead" | ||
c''8^\markup "TextScript" | c''8^\markup "TextScript" | ||
\once \override Rest.stencil = #(lambda (grob) | \once \override Rest.stencil = #(lambda (grob) | ||
(grob-interpret-markup grob #{ | (grob-interpret-markup grob #{ \markup "Rest" #})) | ||
r4 | r4 | ||
} | } | ||
} | |||
\new Lyrics \lyricmode { \markup "LyricText" 1 } | |||
\new Dynamics { s1\dyn } | |||
>> | |||
</lilypond> | </lilypond> | ||
Latest revision as of 17:32, 12 December 2025
Text objects are entered either as simple strings between double quotes or as \markup blocks that can accept a variety of advanced text formatting and graphical enhancements.
As such, markup blocks may be used
- in any
TextScriptobject (attached to notes with-,^, or_); - in any
TextMarkintroduced with the\textMarkkeyword, or\textEndMarkcommand, or other similar objects such asMetronomeMarkintroduced with\tempo; - as standalone markup blocks, entered at the top level outside of any
\scoreblock; - in any definition inside the
\headerblock (e.g., title, subtitle, composer) or in some variables defined inside the\paperblock such asevenHeaderMarkupfor page numbers.
\markup may additionally be used for lyrics, in chord names, and as dynamics. In fact, it is possible to use \markup to customize the appearance of virtually any object, as demonstrated in this example using various methods.
\version "2.24"
% LSR Thanks to Aaron Hill
% LSR https://lists.gnu.org/archive/html/lilypond-user/2019-01/msg00437.html
\paper {
paper-width = 8\cm
paper-height = 8\cm
}
\header {
title = \markup "Title"
tagline = \markup "(tagline)"
}
\markup "Top-level markup"
dyn = #(make-dynamic-script #{ \markup \text "DynamicText" #})
<<
\new ChordNames \with {
majorSevenSymbol = \markup "majorSevenSymbol"
} \chordmode { c1:maj7 }
\new Staff {
\tempo \markup "MetronomeMark"
\textMark \markup "TextMark"
\once \override TupletNumber.text = \markup "TupletNumber"
\tuplet 3/2 {
\once \override NoteHead.stencil = #ly:text-interface::print
\once \override NoteHead.text = \markup \lower #0.5 "NoteHead"
c''8^\markup "TextScript"
\once \override Rest.stencil = #(lambda (grob)
(grob-interpret-markup grob #{ \markup "Rest" #}))
r4
}
}
\new Lyrics \lyricmode { \markup "LyricText" 1 }
\new Dynamics { s1\dyn }
>>