ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Antoine Cailliau <antoinecailliau@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Formula numbering conversion
Date: Thu, 2 Mar 2017 07:59:03 +0100	[thread overview]
Message-ID: <CAKX8Tc4oBKPFcuhtcQXD0Fga0Otf2cfOMP-Ygn2iSzzFpVG3zA@mail.gmail.com> (raw)
In-Reply-To: <CAKX8Tc5ad7sHm9qrCH_5VQYCTeM9XnSKGsUYqD-U2_fhMmsiyA@mail.gmail.com>


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

Does anyone have a tip for me? I really want these tags in my document.

Many thanks in advance,

On 27 February 2017 at 19:22, Antoine Cailliau <antoinecailliau@gmail.com>
wrote:

> I try to replicate the following : https://mailman.ntg.nl/
> pipermail/ntg-context/2006/021038.html (i.e. the equivalent of \tag in
> latex/amsmath). More precisely this:
>
>> %------------------------8<--------------------------
>> \def\placeformulatag%
>>    {\dosingleempty\doplaceformulatag}
>> \def\doplaceformulatag[#1]#2%
>>    {\let\normalstopformula\stopformula
>>     \def\stopformula%
>>      {\normalstopformula
>>       \restorenumber[formula]
>>       \egroup
>>       \let\stopformula\normalstopformula}
>>       \bgroup
>>       \savenumber[formula]
>>       \def\dummyconversion##1{#2}
>>       \defineconversion[dummyconversion][\dummyconversion]
>>       \setupformulas[conversion=dummyconversion]
>>       \placeformula[#1]}
>>
>> \starttext
>> \placeformulatag[tag]{test} \startformula
>>    E = mc^2
>> \stopformula
>> See \in formula[tag] for a tagged formula
>> \stoptext
>> %----------------------------8<-------------------------
>
>
> However, the following (simpler) code produce an "Undefined control
> sequence" when using \in command.
>
> \starttext
>> {
>>   \def\a#1{test}
>>   \defineconversion[a][\a]
>>   \setupformulae[numberconversion=a]
>>   \placeformula[test]
>>   \startformula E = mc^2 \stopformula
>> }
>> This is my reference: \in{formula}[test].
>> \stoptext
>
>
> The following code, does not produce the error, but is not practical for
> the reproducing the \tag command.
>
>>
>> \starttext
>> {
>>   \def\a#1{test}
>>   \defineconversion[a][\a]
>>   \setupformulae[numberconversion=a]
>>   \placeformula[test]
>>   \startformula E = mc^2 \stopformula
>>   This is my reference: \in{formula}[test].
>> }
>> \stoptext
>
>
> What am I doing wrong? I guess the command \a is no longer defined when
> the compiler hit \in but how can I ensure that such local definition stay
> accessible ?
>
> Thank you in advance,
>
> Antoine C.
>
>
> On 27 February 2017 at 17:28, Antoine Cailliau <antoinecailliau@gmail.com>
> wrote:
>
>> Thanks.
>>
>> I updated the wiki.
>>
>> On 27 February 2017 at 17:18, Pablo Rodriguez <oinos@gmx.es> wrote:
>>
>>> On 02/27/2017 04:55 PM, Antoine Cailliau wrote:
>>> > The following code is documented to change the numbering of the
>>> equations.
>>> > However, this still use numerals for the equations.
>>> > [...]
>>> > Is this a bug ? Is it the correct way to change the numbering ?
>>>
>>> Hi Antoine,
>>>
>>> it’s numberconversion (as it reads in “ConTeXt Commands”):
>>>
>>>     \setupformulas[numberconversion=greek]
>>>     \setupbodyfont[dejavu]
>>>     \starttext
>>>     \placeformula[test]
>>>     \startformula E = mc^2 \stopformula
>>>     \stoptext
>>>
>>> BTW, if this is wrong documented in the wiki, please correct it for
>>> future reference.
>>>
>>> Pablo
>>> --
>>> http://www.ousia.tk
>>> ____________________________________________________________
>>> _______________________
>>> 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/list
>>> info/ntg-context
>>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>>> wiki     : http://contextgarden.net
>>> ____________________________________________________________
>>> _______________________
>>
>>
>>
>

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

[-- Attachment #2: Type: text/plain, Size: 492 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
___________________________________________________________________________________

      reply	other threads:[~2017-03-02  6:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27 15:55 Antoine Cailliau
2017-02-27 16:18 ` Pablo Rodriguez
2017-02-27 16:28   ` Antoine Cailliau
2017-02-27 18:22     ` Antoine Cailliau
2017-03-02  6:59       ` Antoine Cailliau [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=CAKX8Tc4oBKPFcuhtcQXD0Fga0Otf2cfOMP-Ygn2iSzzFpVG3zA@mail.gmail.com \
    --to=antoinecailliau@gmail.com \
    --cc=ntg-context@ntg.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).