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

Joel uaru99 at yahoo.com
Sat Mar 4 17:54:07 CET 2023

 To explain more simply, I've put \pagereference[sample] somewhere in a document. Intead of just printing the page number that appeared with \at{page}[sample], I'd like to print the section or subsection title of where that appeared.

    On Saturday, March 4, 2023 at 09:18:19 AM MST, Joel via ntg-context <ntg-context at ntg.nl> wrote:  
 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}}




\input knuth



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


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?

If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context at ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki    : https://contextgarden.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20230304/8b1eeb44/attachment.htm>

More information about the ntg-context mailing list