page interaction in contents list entry
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? Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD
Am 2018-07-23 um 13:06 schrieb Henning Hraban Ramm
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
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
Am 2018-07-23 um 13:06 schrieb Henning Hraban Ramm
: 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@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 ___________________________________________________________________________________
\setupinteraction[state=start] \define[3]\ChapterTocEntry {\maxaligned{#2\hfill#3}} \setuplist [chapter] [alternative=interactive, before=\endgraf, after=\endgraf, command=\ChapterTocEntry] \usemodule[visual] \starttext \placelist[chapter][criterium=all] \dorecurse{5}{ \chapter{\fakewords{2}{7}} \dorecurse{5}{ \fakewords{10}{300}\par } } \stoptext Wolfgang Henning Hraban Ramm schrieb am 20.09.18 um 11:25:
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
: Am 2018-07-23 um 13:06 schrieb Henning Hraban Ramm
: 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@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 ___________________________________________________________________________________
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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
Thank you very much!
alternative=interactive
*without* interaction=anything
did the trick.
Everything else needed a lot more adjusting, since the ToC entries are also \item s (see thread "ToC as itemize" in May/June 2018).
Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD
Am 2018-09-20 um 17:26 schrieb Wolfgang Schuster
\setupinteraction[state=start]
\define[3]\ChapterTocEntry {\maxaligned{#2\hfill#3}}
\setuplist [chapter] [alternative=interactive, before=\endgraf, after=\endgraf, command=\ChapterTocEntry]
\usemodule[visual]
\starttext
\placelist[chapter][criterium=all]
\dorecurse{5}{ \chapter{\fakewords{2}{7}} \dorecurse{5}{ \fakewords{10}{300}\par } }
\stoptext
Wolfgang
Henning Hraban Ramm schrieb am 20.09.18 um 11:25:
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
: Am 2018-07-23 um 13:06 schrieb Henning Hraban Ramm
: 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@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 ___________________________________________________________________________________
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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
participants (2)
-
Henning Hraban Ramm
-
Wolfgang Schuster