Titles
Titles and headers
Adding the current date to a score
With a little Scheme code, the current date can easily be added to a
score.
% first, define a variable to hold the formatted date:
date = #(strftime "%d-%m-%Y" (localtime (current-time)))
% use it in the title block:
\header {
= "Including the date!"
= \date
}
\score {
\relative c'' {
c4 c c c
}
}
% and use it in a \markup block:
\markup {
\date
}
Aligning and centering instrument names
The horizontal alignment of instrument names is tweaked by changing the
Staff.InstrumentName.self-alignment-X
property. The
\layout
variables indent
and short-indent
define
the space in which the instrument names are aligned before the first
and the following systems, respectively.
\paper { left-margin = 3\cm }
\score {
\new StaffGroup <<
\new Staff \with {
\override InstrumentName.self-alignment-X = #LEFT
instrumentName = \markup \left-column {
"Left aligned"
"instrument name"
}
shortInstrumentName = "Left"
}
{ c''1 \break c''1 }
\new Staff \with {
\override InstrumentName.self-alignment-X = #CENTER
instrumentName = \markup \center-column {
Centered
"instrument name"
}
shortInstrumentName = "Centered"
}
{ g'1 g'1}
\new Staff \with {
\override InstrumentName.self-alignment-X = #RIGHT
instrumentName = \markup \right-column {
"Right aligned"
"instrument name"
}
shortInstrumentName = "Right"
}
{ e'1 e'1 }
>>
\layout {
ragged-right = ##t
indent = 4\cm
short-indent = 2\cm
}
}
Demonstrating all headers
All header fields with special meanings.
\header {
= "copyright"
= "title"
= "subtitle"
= "composer"
= "arranger"
= "instrument"
= "meter"
= "opus"
= "piece"
= "poet"
= "All header fields with special meanings."
= "public domain"
enteredby = "jcn"
source = "urtext"
}
\layout {
ragged-right = ##f
}
\score {
\relative c'' { c1 | c | c | c }
}
\score {
\relative c'' { c1 | c | c | c }
\header {
= "localtitle"
= "localsubtitle"
= "localcomposer"
= "localarranger"
= "localinstrument"
metre = "localmetre"
= "localopus"
= "localpiece"
= "localpoet"
= "localcopyright"
}
}
Outputting the version number
It is possible to print the version number of LilyPond in markup.
\markup { Processed with LilyPond version #(lilypond-version) }