On Mon, 2025-10-13 at 10:25 +0100, Richard Shann wrote:
> On Sun, 2025-10-12 at 17:50 +0200, Andreas Schneider wrote:
> > I would like to create a table of contents from the (simple) titles
> > of 
> > all movements in a score. That is, I would like Denemo to generate 
> > Lilypond output similar to the one in attached file. How can I 
> > accomplish that?
> 
> Does this do what you want?

That version only did single word titles :( it needs quotes:

%8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
(d-PushPosition)
(while (d-PreviousMovement))
(let ((tag "SimpleToc"))
        (let loop ()
                (define title (d-DirectiveGet-header-data "MTitles"))
                (if title
                        (begin
                                (set! title (assq-ref (eval-string title) 
'title))
                                (if title
                                        (begin
                                                (d-DirectivePut-score-prefix 
tag "\\markuplist \\table-of-contents\n")
                                                
(d-DirectivePut-movementcontrol-prefix tag (string-append "\\tocItem \\markup 
\"" title "\"\n")))
                                        (d-WarningDialog (_ "No title for this 
movement"))))
                        (d-WarningDialog (_ "No (simple) titles for this 
movement")))
                (if (d-NextMovement)
                        (loop))))
(d-PopPosition)         
%8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><

Richard

> 
> %8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> (d-PushPosition)
> (while (d-PreviousMovement))
> (let ((tag "SimpleToc"))
>         (let loop ()
>                 (define title (d-DirectiveGet-header-data "MTitles"))
>                 (if title
>                         (begin
>                                 (set! title (assq-ref (eval-string
> title) 'title))
>                                 (if title
>                                         (begin
>                                                 (d-DirectivePut-
> score-prefix tag "\\markuplist \\table-of-contents\n")
>                                                 (d-DirectivePut-
> movementcontrol-prefix tag (string-append "\\tocItem \\markup " title
> "\n")))
>                                         (d-WarningDialog (_ "No title
> for this movement"))))
>                         (d-WarningDialog (_ "No (simple) titles for
> this movement")))
>                 (if (d-NextMovement)
>                         (loop))))
> (d-PopPosition)                         
> 
> %8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> 
> Richard
> 
> 
> > 
> > Andreas
> 
> 

Reply via email to