lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Center Table-of-Contents


From: Jean Abou Samra
Subject: Re: Center Table-of-Contents
Date: Sun, 13 Mar 2022 14:28:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0



Le 13/03/2022 à 14:21, Thomas Morley a écrit :
Am So., 13. März 2022 um 12:32 Uhr schrieb Valentin Petzel <valentin@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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]