bug-lilypond
[Top][All Lists]
Advanced

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

Fwd: 2 Table of contents in same source file


From: Thomas Morley
Subject: Fwd: 2 Table of contents in same source file
Date: Sat, 13 Dec 2014 10:08:49 +0100

I tried to cc bug, but was rejected in first try.
Second attempt.

See thread:
http://lilypond.1069038.n5.nabble.com/2-Table-of-contents-in-same-source-file-td169322.html


---------- Forwarded message ----------
From: Thomas Morley <address@hidden>
Date: 2014-12-13 10:02 GMT+01:00
Subject: Re: 2 Table of contents in same source file
To: Helge Kruse <address@hidden>
Cc: Les Editions Valmajour <address@hidden>,
address@hidden, Liste EN <address@hidden>


2014-12-11 6:28 GMT+01:00 Helge Kruse <address@hidden>:
> This looks like a bug for me. The toc-item-list holds the items inside
> toc-init,ly but there is no mean to reset the list.
>
> Could you move the two \book in separates files that \include the original
> content. In that case you have only one \book per file.
>
> Regards, Helge


Hi,

as Helge wrote the toc-items are accumalated per file.

The toc-item-list is cleared after one _entire_ session, so that
lilypond book-1.ly book-2.ly
will cause no bleed over.
(try to comment the line
  (call-after-session (lambda () (set! toc-item-list '())))
in toc-init.ly to force such a bleed over)

Though, there is no mechanism in place to clear that list after one of
several books in the same ly-file.
Pity to say, it's beyond my depth to provide such a mechanism.
Looks like a bug for me too.

As a workaround I extended the code from toc-init.ly
Now you could (and should) specify the book you refer to while calling
\tocItem and add an override to table-of-contents

Syntax-example:

\include "my-toc-init.ly"

\book {

 \markuplist \override #'(name . book-1) \table-of-contents

  \score {
    \tocItem #'book-1 \markup test1.1
    \layout {}
  }
  \score {
    \tocItem #'book-1 \markup test1.2
    \layout {}
  }
  \score {
    \tocItem #'book-1 \markup test1.3
    \layout {}
  }
}

Example-file and my-toc-init.ly attached

Please note:
Doing it this way call-after-session gives a (not surprising) error,
so I had to comment this line.
Ofcourse now you may experience bleed overs while compiling multiple
ly-files, if you _not_ specify the book.

HTH,
  Harm

Attachment: toc-test.ly
Description: Text Data

Attachment: my-toc-init.ly
Description: Text Data


reply via email to

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