Le 13/03/2022 à 14:21, Thomas Morley a écrit :
Am So., 13. März 2022 um 12:32 Uhr schrieb Valentin Petzel <valen...@petzel.at>:
usually centering markups can be done like this:
[...]
\markup \fill-line {
\override #'(line-width . 60)
\column
\table-of-contents
}
[...]
This will work, unless the TOC will exceed one page.
Probably:
#(define-markup-list-command (tst layout props args)(markup-list?)
#:properties ((line-width))
(let* ((layout-lw (ly:output-def-lookup layout 'line-width))
(diff-lw (- layout-lw line-width)))
(map
(lambda (x) (ly:stencil-translate-axis x (/ diff-lw 2) X))
(interpret-markup-list layout props args))))
\markuplist
\override-lines #'(line-width . 60)
\tst \table-of-contents
Alternatively, how about:
\version "2.22.1"
\paper {
tocItemMarkup = \markup \fill-line { \override #'(line-width . 60)
\tocItemWithDotsMarkup }
}
\markuplist \table-of-contents
#(for-each (lambda (i) #{ \tocItem #(format #f "Piece ~a" i) #})
(iota 100))
{ c' }
Cheers,
Jean