[NTG-context] page interaction in contents list entry

Henning Hraban Ramm texml at fiee.net
Thu Sep 20 11:25:18 CEST 2018


Still the same problem:
I can’t get a page link in my custom ToC.
What’s wrong?

----- >8 -----
\setupinteraction[state=start]

\define[3]\ChapterTocEntry{%
  % #1-3 is not used, #1/2 are empty, #3 is page number
  \currentlistentrytitle\hfill%
%%% goto doesn’t create a link here:
  {\goto{\currentlistentrypagenumber}[page(\currentlistentrypagenumber)]}
%%%
  %\at{}[\structurelistvariable{reference}]
  % #3 = \currentlistentrypagenumber
  \par
}

\setuplist[chapter][%
  alternative=command,
  interaction=pagenumber,
  textcolor=black,
  before=,
  inbetween=,
  after=,
 command=\ChapterTocEntry,
]

\usemodule[visual]

\starttext

\placelist[chapter][criterium=all]

\dorecurse{5}{
  \chapter{\fakewords{2}{7}}
  \dorecurse{5}{
    \fakewords{10}{300}\par
  }
}

\stoptext
----- 8< -----

Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

Am 2018-07-26 um 16:22 schrieb Henning Hraban Ramm <texml at fiee.net>:

> Am 2018-07-23 um 13:06 schrieb Henning Hraban Ramm <texml at fiee.net>:
> 
>> Dear wizards,
>> 
>> in a list command (i.e. \setuplist[command=\MyCmd]) I use \currentlistentrypagenumber to show the page number.
>> Now I’d like to make this a link, like in a normal ToC. I didn’t find a suitable command. Is there one?
> 
> From the sources (strc-ref.mkvi) it looks like
> \goto{\currentlistentrypagenumber}[page(\currentlistentrypagenumber)]
> should do the trick.
> It does show the right page number, but doesn’t make it a link.
> While
> \goto{something}{page(30)}
> works; i.e. it creates a link to page 30 of the PDF, even if the displayed page number (user page?) is different.
> 
> Is this an expansion problem?
> 
> Greetlings, Hraban
> ---
> https://www.fiee.net
> http://wiki.contextgarden.net
> https://www.dreiviertelhaus.de
> GPG Key ID 1C9B22FD
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________



More information about the ntg-context mailing list