ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to print the section number of a reference in ConTeXt?
       [not found] <1835667269.2373172.1677946593377.ref@mail.yahoo.com>
@ 2023-03-04 16:16 ` Joel via ntg-context
  2023-03-04 16:54   ` Joel via ntg-context
  0 siblings, 1 reply; 2+ messages in thread
From: Joel via ntg-context @ 2023-03-04 16:16 UTC (permalink / raw)
  To: Mailing List for ConTeXt Users; +Cc: Joel


[-- Attachment #1.1: Type: text/plain, Size: 1072 bytes --]

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



[-- Attachment #1.2: Type: text/html, Size: 1875 bytes --]

[-- Attachment #2: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to print the section number of a reference in ConTeXt?
  2023-03-04 16:16 ` How to print the section number of a reference in ConTeXt? Joel via ntg-context
@ 2023-03-04 16:54   ` Joel via ntg-context
  0 siblings, 0 replies; 2+ messages in thread
From: Joel via ntg-context @ 2023-03-04 16:54 UTC (permalink / raw)
  To: Mailing List for ConTeXt Users; +Cc: Joel


[-- Attachment #1.1: Type: text/plain, Size: 1933 bytes --]

 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
___________________________________________________________________________________
  

[-- Attachment #1.2: Type: text/html, Size: 3827 bytes --]

[-- Attachment #2: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-04 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1835667269.2373172.1677946593377.ref@mail.yahoo.com>
2023-03-04 16:16 ` How to print the section number of a reference in ConTeXt? Joel via ntg-context
2023-03-04 16:54   ` Joel via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).