ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: Rik Kabel via ntg-context <ntg-context@ntg.nl>
Cc: Hans Hagen <j.hagen@xs4all.nl>
Subject: Re: Convertnumber with \ref[number] fails in MkIV, works in LMTX
Date: Tue, 6 Dec 2022 22:54:16 +0100	[thread overview]
Message-ID: <6478e989-6221-be24-fdc8-86512bf5c2be@xs4all.nl> (raw)
In-Reply-To: <af044666-34ed-b4f4-70f6-122ca71792f5@rik.users.panix.com>

On 12/6/2022 10:04 PM, Rik Kabel via ntg-context wrote:
> 
> On 2022-12-06 15:32, Hans Hagen via ntg-context wrote:
>> On 12/6/2022 9:06 PM, Rik Kabel via ntg-context wrote:
>>> \definelabel[X][text=]
>>> \startTEXpage[offset=1cm]
>>>    \X\X[a]\X[b]\X\par
>>>    \convertnumber{R}{\ref[number][a]}
>>>    \convertnumber{G}{\ref[number][b]}
>>> \stopTEXpage
>>
>> maybe like this:
>>
>> \definelabel[X][text=]
>>
>> \startTEXpage[offset=1cm]
>>   (\X)
>>   (\X[a])
>>   (\X[b])
>>   (\X)
>>   \par
>>   \doifelsereferencefound {a}
>>     {\convertnumber{number}{\currentreferencenumber}}
>>     {}
>>   \par
>>   \doifelsereferencefound {a}
>>     {\convertnumber{R}{\currentreferencenumber}}
>>     {}
>>   \par
>>   \doifelsereferencefound {b}
>>     {\convertnumber{G}{\currentreferencenumber}}
>>     {}
>> \stopTEXpage
>>
>> -----------------------------------------------------------------
>>                                           Hans Hagen | PRAGMA ADE
>>
> Perfect! Thank you.
> 
> It looks like \currentreference number is initially empty, and when 
> \doifelsereferencefound succeeds it is set to that value, and remains 
> set to that value until another \doifelsereferencefound is encountered. 
> If \doifelsereferencefound fails, \currentreference is again empty. Is 
> that correct?
yes, btw, there are some more \currentreference* available

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------

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

      reply	other threads:[~2022-12-06 21:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28  1:47 Rik Kabel via ntg-context
2021-10-28  2:58 ` Rik Kabel via ntg-context
2021-10-28  6:56   ` Hans Hagen via ntg-context
2021-10-28 17:59     ` Rik Kabel via ntg-context
2022-01-19 17:39   ` Rik Kabel via ntg-context
2022-12-06 20:06     ` Rik Kabel via ntg-context
2022-12-06 20:32       ` Hans Hagen via ntg-context
2022-12-06 21:04         ` Rik Kabel via ntg-context
2022-12-06 21:54           ` Hans Hagen via ntg-context [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6478e989-6221-be24-fdc8-86512bf5c2be@xs4all.nl \
    --to=ntg-context@ntg.nl \
    --cc=j.hagen@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).