lilypond-user
[Top][All Lists]
Advanced

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

Re: Clickable table of contents


From: Álex R . Mosteo
Subject: Re: Clickable table of contents
Date: Mon, 07 May 2012 19:43:53 +0200
User-agent: KNode/4.8.3

Federico Bruni wrote:

> Il 04/05/2012 16:57, Álex R. Mosteo ha scritto:
>> I would also be interested on how to get automatically a ToC entry for
>> each song, I'm currently doing it like this:
>>
>> \tocItem \markup "Author - Song"
>> \bookpart {
>>    \header { title="Song" subtitle="Author" }
>>
>> which causes some nagging duplication. But this is secondary anyway.
> 
> Now I see why your title is not clickable: you must put \tocItem inside
> \bookpart:
> 
> markuplist \table-of-contents
> \pageBreak
> 
> \bookpart {
>    \header { title="Song" subtitle="Author" }
>    \tocItem \markup "Author - Song"
>    \score { c'1 }
> }

Thank you all for your answers and warnings. Indeed that was simple. That's 
enough for my present purposes, even if I have to write two times the titles 
(that was a minor nag).

This week-end I had settled on having a plain .tex file, and including the 
PDF for each song (generated from separate .ly files). The package pdfpages 
does it this way:

\includepdf[pages={-},addtotoc={1,section,1,Artist - Song,somelabel}]{file}

It's a bit more cumbersome (and still requires to duplicate the info). I'm 
too newbie to know, but maybe there are cases with reasons to go fully LaTeX 
and then this way would work (not that this is specific to lilypond, 
anyway).

BTW, lilypond-book barfed on my .lytex when including my .ly (which compiled 
fine with lilypond), but not when using inline snippets. I guess that is 
necessarily a bug in lilypond-book?

Cheers,
Álex.

> 
> 
> I don't know how to get automatically the ToC entry from the header.
> You probably have to fiddle with \fromproperty #'header:title
> 
> If you have a look at ly/toc-init.ly you see:
> 
> \paper {
>    tocItemMarkup = \markup \fill-line {
>      \fromproperty #'toc:text
>      \fromproperty #'toc:page
>    }
> }
> 
> You should find a way to tell lilypond to replace the content of
> #'toc:text This content is defined inside \tocitem \markup { here }
> 
> But this doesn't print anything:
> 
> \markuplist \table-of-contents
> \pageBreak
> 
> \bookpart {
>    \header { title="Song" subtitle="Author" }
>    \tocItem \markup \fill-line {
>      \fromproperty #'header:title
>      \fromproperty #'header:subtitle
>    }
>    \score { c'1 }
> }





reply via email to

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