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.

--Joel

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


\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


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

maillist : ntg-context@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
___________________________________________________________________________________