[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Re: PDF hyperlinks
From: |
Carl Sorensen |
Subject: |
Re: [PATCH] Re: PDF hyperlinks |
Date: |
Wed, 26 Jan 2011 07:14:38 -0700 |
On 1/26/11 6:08 AM, "Reinhold Kainhofer" <address@hidden> wrote:
> 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
> }
>
What if you did
(define-markup-command (with-link layout props label arg)
(symbol-or-markup? markup?)
(let ((link-label (if (symbol? label)
label
(string->symbol (markup->string label)))))
You'd need to define symbol-or-markup? and markup->string, but you could
avoid hard-copying labels, I think.
HTH,
Carl