[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PDF bookmark questions
From: |
Lukas-Fabian Moser |
Subject: |
Re: PDF bookmark questions |
Date: |
Wed, 2 Feb 2022 08:14:37 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
Hi Nate,
Am 01.02.22 um 22:11 schrieb Nate Whetsell:
I’m trying to add PDF bookmarks (to display in PDF readers) to a collection of
studies. I’m having three issues:
1. If several studies appear on the same page, the bookmarks appear in reverse
order.
2. The bookmarks seem to navigate to the *page* on which a study appears, not
the study itself.
3. It doesn’t seem to be possible to add PDF bookmarks without also using
`\markuplist \table-of-contents` to add a table of content.
Below is an example illustrating the issues I’m having. Is there a way to
create PDF bookmarks without using `\markuplist \table-of-contents`, have them
appear in the expected order, and have them navigate to the expected position?
Forgive me for barging in without having something to contribute to your
actual question:
```
\version "2.22.0"
\book {
\markuplist \table-of-contents
#(do ((study-number 1 (1+ study-number)))
((> study-number 15))
(let ((header (make-module)))
(module-define! header 'piece (number->string study-number))
(let* (
(score (scorify-music #{
\new Staff <<
\tocItem \markup { #(number->string study-number) }
\new Voice { c' }
>>
#})))
(begin
(ly:score-set-header! score header)
(add-score score)))))
}
```
Are you aware that you can do almost all of this using LilyPond syntax?
\version "2.22.0"
\book {
\markuplist \table-of-contents
#(do ((study-number 1 (1+ study-number)))
((> study-number 15))
(add-score
#{
\score {
\header {
piece = #(number->string study-number)
}
\new Staff <<
\tocItem \markup { #(number->string study-number) }
\new Voice { c' }
>>
}
#}))
}
Lukas