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, 14 May 2012 11:03:18 +0200
User-agent: KNode/4.8.3

Svetlana wrote:

> Hi!
> 
> I have similar task of making a mostly notes and a few of text in my book
> and here is my solution. 1) Process lilypond files with eps backend
> (lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts myfile.ly)
> - this gives pdfs (along with eps) for every SINGLE page of your scores.
> 2) use the following code to put generated pdfs to your latex file:
> \addcontentsline{toc}{chapter}{The title} \noindent
> \includegraphics[width=170mm]{myfile.pdf}
> 
> This approach saves all advantages vs lilypond-book and has some
> advantages vs pdfpages (I've used it before): 1) Page numbering is done in
> latex, no need to alter them in each lilypond file. 2) You can include not
> so full page of notes and add some text after it in latex, not in lilypond
> - so you win much better text formatting options
> 
> One big disadvantage of it - I can't use ragged-right scores in my book,
> they all have different widths.

Thanks, Svetlana, it looks like another trick to keep up the sleeve.

Alex.

> 
> Best wishes, Svetlana.
> 
> 
> 
> 07.05.2012, 21:43, "Álex R. Mosteo" <address@hidden>:
>> 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 }
>>> }
>>
>> _______________________________________________
>> lilypond-user mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user





reply via email to

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