[NTG-context] Placing extra bookmarks?

Bruce Horrocks ntg at scorecrow.com
Wed Dec 2 00:10:49 CET 2020

On 1 Dec 2020, at 16:37, Henning Hraban Ramm <texml at fiee.net> wrote:
>> Am 01.12.2020 um 15:36 schrieb Bruce Horrocks <ntg at scorecrow.com>:
>> I have \placebookmarks[chapter] in my doc and all is fine except that I'd like to force an extra bookmark at the top of the list that jumps to the cover page. However there is no chapter title, or other built in style on the cover.
>> I tried inserting \bookmark[chapter]{The Cover} but nothing happened - no error, no bookmark.
>> Any suggestions please? There's no need to bookmark to a specific point - just going to page 1 would be enough.
> Did you enable interactions? \setupinteractions[state=start]
> But when I recently tried to manually set some bookmarks instead of visible chapter titles, I also didn’t get any; didn’t investigate further yet.

Thanks for the suggestion, but I already had \setupinteraction[state=start] set. (Note 'interaction' - no 's')

I eventually found a previous thread on the mailing list archive.

From that I was able to add the following to my document setup:

  \definehead [Bookmark] [title] 
    [ placehead=empty,

And then in the text where I want each extra bookmark to appear I use:

  \Bookmark[title={The text of the bookmark}]
This works but is a bit of a kludge because it assumes that you aren't using 'title' sections in your document already. If you are then they will all appear in the PDF bookmarks.

Also note that the bookmark is inserted at the chapter/title level. If you want a sub-bookmark then you need to add another custom heading, viz:

  \definehead [SubBookmark] [subject] 
    [ placehead=empty,

and add it into the \placebookmarks list:


and invoke it using:

  \SubBookmark[title={A sub-bookmark}]

In the PDF, this will be nested under the previous higher-level bookmark.

Given that this is a kludge, and that the \bookmark command doesn't seem to work at all, perhaps it can be resurrected into a new form, something like:


  - n is the level 1, 2, 3 etc
  - (optional) focus overrides \setupinteraction (assuming PDF allows it)
  - text is the text to show 

and have this insert a bookmark at that point, regardless of whatever the heading mechanism is doing?

Bruce Horrocks
Hampshire, UK

More information about the ntg-context mailing list