ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Use a counter in a reference?
@ 2020-04-13 20:13 Kevin Kenan
  2020-04-13 20:20 ` Thomas A. Schmitz
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Kenan @ 2020-04-13 20:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I have a need to tag elements in a text in a way that they are sequentially numbered and can have references to refer to them. Something like:


    Here is some \tag[tagref]{\bf text} that is tagged.
    .
    .
    .
    Refer to tag \tagnumber[tagref] on page \at[tagref].


What is the best way to do this in ConTeXt? I’ve got a counter for tag number, but I’m not sure how to use \reference so that it uses my tag number. For instance:


    \definecounter[myTagCounter]
    .
    .
    .
    \reference[tagref]{\rawcountervalue[myTagCounter]}


Doesn’t work. But perhaps I’m going about this incorrectly? 

Thanks in advance!
-kk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Use a counter in a reference?
  2020-04-13 20:13 Use a counter in a reference? Kevin Kenan
@ 2020-04-13 20:20 ` Thomas A. Schmitz
  2020-04-19 12:39   ` Kevin Kenan
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas A. Schmitz @ 2020-04-13 20:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/13/20 10:13 PM, Kevin Kenan wrote:
> I have a need to tag elements in a text in a way that they are sequentially numbered and can have references to refer to them. Something like:
> 
> 
>      Here is some \tag[tagref]{\bf text} that is tagged.
>      .
>      .
>      .
>      Refer to tag \tagnumber[tagref] on page \at[tagref].
> 
> 
> What is the best way to do this in ConTeXt? I’ve got a counter for tag number, but I’m not sure how to use \reference so that it uses my tag number. For instance:
> 
> 
>      \definecounter[myTagCounter]
>      .
>      .
>      .
>      \reference[tagref]{\rawcountervalue[myTagCounter]}
> 
> 
> Doesn’t work. But perhaps I’m going about this incorrectly?
> 
> Thanks in advance!

Are you looking for this: 
https://wiki.contextgarden.net/Command/definelabel ?

HTH

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Use a counter in a reference?
  2020-04-13 20:20 ` Thomas A. Schmitz
@ 2020-04-19 12:39   ` Kevin Kenan
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Kenan @ 2020-04-19 12:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

The label mechanism worked great.

Thanks!

-kk

> On Apr 13, 2020, at 1:20 PM, Thomas A. Schmitz <thomas.schmitz@uni-bonn.de> wrote:
> 
> On 4/13/20 10:13 PM, Kevin Kenan wrote:
>> I have a need to tag elements in a text in a way that they are sequentially numbered and can have references to refer to them. Something like:
>>     Here is some \tag[tagref]{\bf text} that is tagged.
>>     .
>>     .
>>     .
>>     Refer to tag \tagnumber[tagref] on page \at[tagref].
>> What is the best way to do this in ConTeXt? I’ve got a counter for tag number, but I’m not sure how to use \reference so that it uses my tag number. For instance:
>>     \definecounter[myTagCounter]
>>     .
>>     .
>>     .
>>     \reference[tagref]{\rawcountervalue[myTagCounter]}
>> Doesn’t work. But perhaps I’m going about this incorrectly?
>> Thanks in advance!
> 
> Are you looking for this: https://wiki.contextgarden.net/Command/definelabel <https://wiki.contextgarden.net/Command/definelabel> ?
> 
> HTH
> 
> Thomas
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ <https://bitbucket.org/phg/context-mirror/commits/>
> wiki     : http://contextgarden.net <http://contextgarden.net/>
> ___________________________________________________________________________________


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

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

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2020-04-19 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 20:13 Use a counter in a reference? Kevin Kenan
2020-04-13 20:20 ` Thomas A. Schmitz
2020-04-19 12:39   ` Kevin Kenan

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).