lilypond-user
[Top][All Lists]
Advanced

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

table-of-contents for multiple books per ly-file


From: Thomas Morley
Subject: table-of-contents for multiple books per ly-file
Date: Sat, 19 Nov 2022 14:43:54 +0100

Hi,

this is about #4227 "Tables of contents are not independent between \books"
https://gitlab.com/lilypond/lilypond/-/issues/4227

My previous workaround was to abuse the 'name entry in each toc-item,
i.e. I used a custom `tabel-of-contents'-markup-command filtering
`toc-items' for a certain name and only print the remaining ones per
book (ofcourse this made hierarchical indents impossible, which was
acceptable).

Alas, that 'name-entry is gone with:

commit 33ca296b8c71d0e30352653d2108445e3395b74e
Author: Jean Abou Samra <jean@abou-samra.fr>
Date:   Mon Jul 11 13:34:34 2022 +0200

    Fix possible naming conflicts in structured TOCs

    While the head of the path can refer to a nested node, the rest
    of the path is now interpreted by always looking up a direct
    child of the previous node. This fixes odd conflicts when
    several nested nodes have the same path, although it is still
    not possible (by design) to have a nested node called something,
    and then a root node called the same.

    Nonexistent nodes (trying to do \tocItem foo.bar before \tocItem foo)
    are no longer silent, but now emit a warning.

    This uses modification of hash tables instead of mutation of alists,
    so it also happens to fix #6302, caused by alist pairs being shared.

    Fixes #6302, #6384

Though, I can't use a modified version of the new code setting
`toc-items' because dong so in an own ly-file causes:
fatal error: call-after-session used after session start

So, #4227 persist and my workaround is gone...
Any idea how to make it work?

Here some basic code to play with:

\version "2.23.80"

\book {
  \markuplist \table-of-contents
  \tocItem \markup "bookI"
  { r1 }
}

\book {
  \markuplist \table-of-contents
  \tocItem \markup \italic "bookII"
  { r1 }
}

Thanks,
  Harm



reply via email to

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