ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Taco Hoekwater <taco@docwolves.nl>
Subject: Re: weird pdf bookmarks question
Date: Thu, 31 May 2012 12:29:35 +0200	[thread overview]
Message-ID: <4FC7480F.8070800@wxs.nl> (raw)
In-Reply-To: <407D5DDE-EEF7-4937-BBF2-C5552B1486C2@docwolves.nl>

On 31-5-2012 11:23, Taco Hoekwater wrote:
> Hi all,
>
> I have a question about PDF bookmarks. My Document goes like this (heavily simplified):
>
> \setupinteraction[state=start]
> \placebookmarks[chapter,section][chapter,section]
> \setupinteractionscreen[option=bookmark]
> \starttext
> \chapter[item1]{Overview}
> \startitemize
> \item[item4] bla
> \stopitemize
> \chapter[item2]{Two}
> Greetings!
> \chapter[item3]{Three}
> I don't know
> \chapter{Four}
> Oh no.
> \stoptext
>
> Now, what I would really like is if the link in the bookmarks for 'Four' jumps to the first
> page (where the 'item4' reference target lives) instead of to the fourth page (where the
> chapter header lives).

technically we can have links as booksmarks but then the question is 
what interface to use

> The question is: is this possible, and if yes, how? To further complicate things, this
> is an old project that uses mkii, so lua-based solutions are not helpful.

lucky me that mkii is frozen

> Thanks in advance for any pointers,

maybe mess around with lists .. but what is really needed is some 
overload of a page .. here's a starting point

\def\RemapBookmarkPage#1#2%
   {\setvalue{RemapBookmarkPage:#1}{#2}}

\let\normaldoPDFbookmark\doPDFbookmark

\def\doPDFbookmark#1#2#3#4#5%
 
{\normaldoPDFbookmark{#1}{#2}{#3}{\executeifdefined{RemapBookmarkPage:#4}{#4}}{#5}}

\RemapBookmarkPage{4}{1}

Of course one needs to hook earlier into code but the principle is the same.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


      reply	other threads:[~2012-05-31 10:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31  9:23 Taco Hoekwater
2012-05-31 10:29 ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FC7480F.8070800@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    --cc=taco@docwolves.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).