ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Why aren't cross-references working in tabulate?
       [not found] <1782782343.2797033.1710532237466.ref@mail.yahoo.com>
@ 2024-03-15 19:50 ` Joel via ntg-context
  2024-03-15 20:25   ` [NTG-context] " Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Joel via ntg-context @ 2024-03-15 19:50 UTC (permalink / raw)
  To: Mailing List for ConTeXt Users; +Cc: Joel


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

When I run this code, \at{page}[xyz] is unable to find the cross reference:
\starttext%\reference[xyz]{}
\starttabulate[|lp(.33333\textwidth)|lp(.6666\textwidth)|]
\NC    \reference[xyz]{} \NC \NC\NR
\stoptabulate


\pagebreak

\at{page}[xyz]

\stoptext

The code does work when I uncomment line #2, revealing the cross-references work find when outside of a table.
I also tried using a TABLE environment instead and the result was similar, it wouldn't show the page number.
What am I doing wrong?
--Joel

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

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Why aren't cross-references working in tabulate?
  2024-03-15 19:50 ` [NTG-context] Why aren't cross-references working in tabulate? Joel via ntg-context
@ 2024-03-15 20:25   ` Wolfgang Schuster
  2024-03-15 21:16     ` Joel via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2024-03-15 20:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Joel via ntg-context

Joel via ntg-context schrieb am 15.03.2024 um 20:50:
> When I run this code, \at{page}[xyz] is unable to find the cross reference:
> 
> \starttext
> %\reference[xyz]{}
> \starttabulate[|lp(.33333\textwidth)|lp(.6666\textwidth)|]
> \NC    \reference[xyz]{} \NC \NC\NR

\NC \doifnotmode{*trialtypesetting}{\pagereference[xyz]} \NC \NC\NR

> \stoptabulate
> 
> 
> \pagebreak
> 
> \at{page}[xyz]
> 
> \stoptext
> 
> The code does work when I uncomment line #2, revealing the 
> cross-references work find when outside of a table.
> 
> I also tried using a TABLE environment instead and the result was 
> similar, it wouldn't show the page number.
> 
> What am I doing wrong?

Tabulate and natural tables process the table content multiple times and 
therefore you're setting the reference multiple times, to avoid this 
check for trialtypesetting mode and set the reference only when you're 
out of the mode.

@Hans: Can we add the check trialtypesetting check to \reference etc.?

\protected\def\strc_references_set_named_reference
- {\ifreferencing
+ {\iftrialtypesetting
+    \expandafter\gobblefourarguments
+  \orelse\ifreferencing
      \expandafter\strc_references_set_named_reference_indeed
    \else
      \expandafter\gobblefourarguments
    \fi}

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Why aren't cross-references working in tabulate?
  2024-03-15 20:25   ` [NTG-context] " Wolfgang Schuster
@ 2024-03-15 21:16     ` Joel via ntg-context
  0 siblings, 0 replies; 3+ messages in thread
From: Joel via ntg-context @ 2024-03-15 21:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Joel


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

 Thank you! The solution worked!

    On Friday, March 15, 2024 at 02:30:40 PM MDT, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:  
 
 Joel via ntg-context schrieb am 15.03.2024 um 20:50:
> When I run this code, \at{page}[xyz] is unable to find the cross reference:
> 
> \starttext
> %\reference[xyz]{}
> \starttabulate[|lp(.33333\textwidth)|lp(.6666\textwidth)|]
> \NC    \reference[xyz]{} \NC \NC\NR

\NC \doifnotmode{*trialtypesetting}{\pagereference[xyz]} \NC \NC\NR

> \stoptabulate
> 
> 
> \pagebreak
> 
> \at{page}[xyz]
> 
> \stoptext
> 
> The code does work when I uncomment line #2, revealing the 
> cross-references work find when outside of a table.
> 
> I also tried using a TABLE environment instead and the result was 
> similar, it wouldn't show the page number.
> 
> What am I doing wrong?

Tabulate and natural tables process the table content multiple times and 
therefore you're setting the reference multiple times, to avoid this 
check for trialtypesetting mode and set the reference only when you're 
out of the mode.

@Hans: Can we add the check trialtypesetting check to \reference etc.?

\protected\def\strc_references_set_named_reference
- {\ifreferencing
+ {\iftrialtypesetting
+    \expandafter\gobblefourarguments
+  \orelse\ifreferencing
      \expandafter\strc_references_set_named_reference_indeed
    \else
      \expandafter\gobblefourarguments
    \fi}

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki    : https://wiki.contextgarden.net
___________________________________________________________________________________
  

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

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-03-15 21:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1782782343.2797033.1710532237466.ref@mail.yahoo.com>
2024-03-15 19:50 ` [NTG-context] Why aren't cross-references working in tabulate? Joel via ntg-context
2024-03-15 20:25   ` [NTG-context] " Wolfgang Schuster
2024-03-15 21:16     ` 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).