I was writing sheet music consisting of melody, chords and lyrics. To my surprise, the lyrics weren't aligned correctly under the notes. The file looked like correct Lilypond source code:
global = {
\time 3/4
\partial 4
}
theChords = \chordmode {
c4 | c2. | a2:m e4 | a2:m d4 | g2
}
melody = \relative c'' {
g8.( e16) | c4 e g | c2 e8. d16 | c4 e, fis | g2
}
theLyrics = \lyricmode {
O say can you see, by the dawn's ear -- ly light
}
\score {
\new ChoirStaff <<
\new ChordNames {
\global \theChords
}
\new Staff = "Melody" <<
\new Voice = "Melody" {
\global \melody
}
>>
\new Lyrics \lyricsto "Melody" {
\theLyrics
}
>>
}
However, it produced the following output: