\version "2.11.34" \header { title = "TOC problems" composer = "Reinhold Kainhofer" } \header { instrument = "Flauto" } % This definition to automatically add piece titles to the TOC does not work: % \paper { % scoreTitleMarkup = \markup { \column { % \fill-line { % \fontsize #3 \bold \fromproperty #'header:piece % \tocItem \markup { \fromproperty #'header:piece } % \fromproperty #'header:opus % }}} % } IKyrieFl = \relative c' { % I don't want to have to add \tocItem manually to all similar definitions... % How can I do this? \tocItem \markup { "Kyrie" } \repeat unfold 14 { c1\break } } IKyrieFlStaff = \context Staff = IKyrieFlSt << \context Voice = IKyrieFlVoice { \IKyrieFl } \set Staff.instrumentName = "Flauto" \set Staff.shortInstrumentName = "Fl." >> IKyrieScoreFl =\score { << \IKyrieFlStaff >> \header { piece = "Kyrie" } } IIGloriaFl = \relative c' { \tocItem \markup { "Gloria" } \repeat unfold 15 { c1\break } } IIGloriaFlStaff = \context Staff = IKyrieFlSt << \context Voice = IIGloriaFlVoice { \IIGloriaFl } \set Staff.instrumentName = "Flauto" \set Staff.shortInstrumentName = "Fl." >> IIGloriaScoreFl =\score { << \IIGloriaFlStaff >> \header { piece = "Gloria" } } \markuplines \table-of-contents \pageBreak % This works, but is way too cumbersome for huge pieces: % \tocItem \markup { "Kyrie 1" } \score{ \IKyrieScoreFl } % \tocItem \markup { "Gloria 1" } \score{ \IIGloriaScoreFl }