[NTG-context] How to print the section number of a reference in ConTeXt?

Joel uaru99 at yahoo.com
Sat Mar 4 17:16:33 CET 2023


I've set a \pagereference in a chapter, and want to print its chapter title and page number, ex.

"You can find more information in "Fish" on p. 1" (where "Fish" is the title of the chapter or section).
I've tried looking all through the wiki, thinking this was a basic feature, but couldn't get anything to work. I even tried my own custom macros, see below, but strangely, it won't give me the correct title, it tells me the title of the current chapter, instead of the title in which the reference was placed:


\define[1]\dropref{%    \textreference[#1]{\expanded{\currentstructuretitle}}
}


\starttext

\startchapter[title=Fish]

\dropref{hello}

\input knuth

\stopchapter

\startchapter[title=Whales]

You can more information at \at{page}[hello] in \at{chapter}[hello] or \about[hello].

\stopchapter

\stoptext
Strangely both at commands give the correct information, but \about doesn't.

How do I place a reference somewhere in a text, then later tell which chapter title and page number that reference appeared in?
--Joel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20230304/49a5ef17/attachment.htm>


More information about the ntg-context mailing list