lilypond-user
[Top][All Lists]
Advanced

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

Re: Alphabetised table of contents?


From: Brent Annable
Subject: Re: Alphabetised table of contents?
Date: Fri, 23 Sep 2022 16:11:20 +1000

Thanks for all the tips everyone! I will look into these snippets. 

I do actually need to create multiple indices (alphabetical by first line and by tune name0, so maybe my dream won't be possible for the time being, but it's good to know this functionality exists.

Brent.

On Thu, 22 Sept 2022 at 04:49, Jean Abou Samra <jean@abou-samra.fr> wrote:
Le 21/09/2022 à 20:39, Valentin Petzel a écrit :
> Hello Jean,
>
> at least for me this code fails to change the order of the toc. The reason for
> this is that toc-markup does not in fact contain the markup, but the symbol
> under which the formatting markup is saved in layout.
>
> So I suppose you rather want to use the text property:
>
> (sorted-toc-alist
>             (sort toc-alist
>                   ;; Could use comparator-from-key in 2.23
>                   (lambda (item1 item2)
>                     (let ((mkup1 (assoc-get 'text (cdr item1)))
>                           (mkup2 (assoc-get 'text (cdr item2))))
>                        (string<?
>                        (markup->string mkup1)
>                        (markup->string mkup2))))))




Whoops, yes. Not sure how I didn't see that they weren't sorted.
Maybe I did a test and sent the wrong version? Weird. Anyway,
thanks for the correction.


reply via email to

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