lilypond-devel
[Top][All Lists]
Advanced

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

[PATCH] Re: PDF hyperlinks


From: Reinhold Kainhofer
Subject: [PATCH] Re: PDF hyperlinks
Date: Wed, 26 Jan 2011 14:08:04 +0100
User-agent: KMail/1.13.5 (Linux/2.6.35-24-generic; KDE/4.5.5; i686; ; )

Am Montag, 27. Dezember 2010, um 17:53:13 schrieb Dan Eble:
> On 2010-12-27, at 11:11 , Reinhold Kainhofer wrote:
> > I forgot to add that the link itself would then be implemented completely
> > similar to \with-url. So, the only non-trivial thing is really how to get
> > the information about where to place the label (as a DEST pdfmark) into
> > the ps backend.
> 
> Thanks.  I now have
>   \with-page-link #page-no { markup }
> and it actually works (for page-no=1 at least).
> 
> Next, to make it use labeled page references...

Thanks, Dan, for your prototype. I have now prepared a patch that includes 
your code into the lilypond distribution, and additionally uses it in the TOC 
markup (*), so all toc entries automatically link to the corresponding pages.

Here's the patch:
http://codereview.appspot.com/4112042

Please review!

Thanks,
Reinhold


(*) Actually, the link to the corresponding label is currently hardcoded, 
because I could not find a way to add the \with-link in the tocItemMarkup. The 
main problem seems to be that the label needs to be a symbol, so I can't 
retrieve it from the props via \fromproperty (which returns a markup). I have 
tried (after adding toc:label to the props in table-of-contents)

  tocItemMarkup = \markup \with-link \fromproperty #'toc:label \fill-line {
    \fromproperty #'toc:text \fromproperty #'toc:page
  }

as well as 

  tocItemMarkup = \markup \with-link #'toc:label \fill-line {
    \fromproperty #'toc:text \fromproperty #'toc:page
  }

Both of which don't work: The first because \fromproperty is a markup 
function, while \with-link requires the label symbol; and the second because 
toc:label is not directly defined as a variable, but rather has to be chain-
assoc-get'ed from the props... Any idea how to solve this and avoid hard-
coding the link?

-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org



reply via email to

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