Bonjour,
j'essaie d'adapter le dernier exemple de cette page (https://lilypond.org/doc/v2.23/Documentation/notation/table-of-contents) dans le contexte suivant :
un book pour partitions en a4 portrait et un autre pour partitions en a5 paysage
quelques musiques transposées dans des bookparts différents
Pour le premier book j'obtiens le résultat escompté. Pour la table des matières est répétée,les entrées du premier book précédant celles du second
Merci d'avance pour votre aide
Capture d'écran
Le Code
\version "2.23.11"
\paper {
indent = 0\mm
ragged-last-bottom = ##t
ragged-last = ##f
% markup-system-spacing = #'((basic-distance . 18)
% (minimum-distance . 8)
% (padding . 1))
tocActMarkup = \markup \large \column {
\hspace #1
\fill-line { \null \italic \fromproperty #'toc:text \null }
\hspace #1
}
tocItemMarkup = \markup
\fill-line {
\fill-with-pattern #1.5 #CENTER .
\line {
\hspace #-4 %% Cancelling the first level's tocIndentMarkup
\fromproperty #'toc:indent \fromproperty #'toc:text
\hspace #2
}
\fromproperty #'toc:page
}
tocTitleMarkup =
\markup {
\column {
\vspace #3
\fill-line { \fontsize #9 "Music Title" }
\fill-line { \fontsize #3 "Music from Someone" }
}
}
}
tocAct =
#(define-music-function (label text) (symbol-list-or-symbol? markup?)
(add-toc-item! 'tocActMarkup text label))
\header { tagline = ##f }
basse = { \clef "bass" \repeat unfold 4 { c1 } }
tenor = { \repeat unfold 4 { e'1 } }
trompette = { \repeat unfold 4 { bes'1 } }
accords = \chordmode { c1:7 }
\book {
\paper {
#(set-paper-size "a4")
print-first-page-number = ##f
}
#(define output-suffix "a4")
\bookpart {
\paper { line-width = 13.0\cm }
\markuplist \table-of-contents
}
\bookpart {
\header { subtitle = "For C Instruments" }
\tocAct CaIV \markup { "For C Instruments" }
\tocItem \markup { \underline "Trumpet Part" }
\score {
<<
\new ChordNames { \accords }
\new Staff \with { instrumentName = Trumpet } \trompette
}
}
\bookpart {
\header { subtitle = "For C Instruments" }
\tocItem \markup { \underline "Tenor Part" }
\score {
<<
\new ChordNames { \accords }
\new Staff \with { instrumentName = Tenor } \tenor
}
}
\bookpart {
\header { subtitle = "For C Instruments" }
\tocItem \markup { \underline "Bass Part" }
\score {
<<
\new ChordNames { \accords }
\new Staff \with { instrumentName = Bass } \basse
}
}
\bookpart {
\header { subtitle = \markup \concat { "For B" \flat " Instruments" } }
\tocAct BbaIV \markup \concat { "For B" \flat " Instruments" }
\tocItem \markup { \underline "Trumpet Part" }
\score {
<<
\new ChordNames { \transpose c d \accords }
\new Staff \with { instrumentName = Trumpet } \transpose c d \trompette
}
}
\bookpart {
\header { subtitle = \markup \concat { "For B" \flat " Instruments" } }
\tocItem \markup { \underline "Tenor Part" }
\score {
<<
\new ChordNames { \transpose c d \accords }
\new Staff \with { instrumentName = Tenor } \transpose c d \tenor
}
}
\bookpart {
\header { subtitle = \markup \concat { "For E" \flat " Instruments" } }
\tocAct EbaIV \markup \concat { "For E" \flat " Instruments" }
\tocItem \markup { \underline "Trumpet Part" }
\score {
<<
\new ChordNames { \transpose c a \accords }
\new Staff \with { instrumentName = Trumpet } \transpose c a \trompette
}
}
\bookpart {
\header { subtitle = \markup \concat { "For E" \flat " Instruments" } }
\tocItem \markup { \underline "Tenor Part" }
\score {
<<
\new ChordNames { \transpose c a \accords }
\new Staff \with { instrumentName = Tenor } \transpose c a \tenor
}
}
}
\book {
\paper {
#(set-paper-size "a5landscape")
print-first-page-number = ##f
}
#(define output-suffix "a5")
\bookpart {
\paper { line-width = 13.0\cm }
\markuplist \table-of-contents
}
\bookpart {
\header { subtitle = "For C Instruments" }
\tocAct CaV \markup { "For C Instruments" }
\tocItem \markup { \underline "Trumpet Part" }
\score {
<<
\new ChordNames { \accords }
\new Staff \with { instrumentName = Trumpet } \trompette
}
}
\bookpart {
\header { subtitle = "For C Instruments" }
\tocItem \markup { \underline "Tenor Part" }
\score {
<<
\new ChordNames { \accords }
\new Staff \with { instrumentName = Tenor } \tenor
}
}
\bookpart {
\header { subtitle = "For C Instruments" }
\tocItem \markup { \underline "Bass Part" }
\score {
<<
\new ChordNames { \accords }
\new Staff \with { instrumentName = Bass } \basse
}
}
\bookpart {
\header { subtitle = \markup \concat { "For B" \flat " Instruments" } }
\tocAct BbaV \markup \concat { "For B" \flat " Instruments" }
\tocItem \markup { \underline "Trumpet Part" }
\score {
<<
\new ChordNames { \transpose c d \accords }
\new Staff \with { instrumentName = Trumpet } \transpose c d \trompette
}
}
\bookpart {
\header { subtitle = \markup \concat { "For B" \flat " Instruments" } }
\tocItem \markup { \underline "Tenor Part" }
\score {
<<
\new ChordNames { \transpose c d \accords }
\new Staff \with { instrumentName = Tenor } \transpose c d \tenor
}
}
\bookpart {
\header { subtitle = \markup \concat { "For E" \flat " Instruments" } }
\tocAct EbaV \markup \concat { "For E" \flat " Instruments" }
\tocItem \markup { \underline "Trumpet Part" }
\score {
<<
\new ChordNames { \transpose c a \accords }
\new Staff \with { instrumentName = Trumpet } \transpose c a \trompette
}
}
\bookpart {
\header { subtitle = \markup \concat { "For E" \flat " Instruments" } }
\tocItem \markup { \underline "Tenor Part" }
\score {
<<
\new ChordNames { \transpose c a \accords }
\new Staff \with { instrumentName = Tenor } \transpose c a \tenor
}
}
}
···
--
Vincent Gay
Envoyé depuis mon saxo-phone :)
[https://myrealbook.vintherine.org/](https://myrealbook.vintherine.org/) - [http://photos.vintherine.org/](http://photos.vintherine.org/)