From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/97448 Path: news.gmane.org!.POSTED!not-for-mail From: Antoine Cailliau Newsgroups: gmane.comp.tex.context Subject: Re: Formula numbering conversion Date: Mon, 27 Feb 2017 19:22:43 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5552636955784027782==" X-Trace: blaine.gmane.org 1488219818 31332 195.159.176.226 (27 Feb 2017 18:23:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Feb 2017 18:23:38 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Feb 27 19:23:31 2017 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciPxG-00077c-Iq for gctc-ntg-context-518@m.gmane.org; Mon, 27 Feb 2017 19:23:26 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0CD55834D7; Mon, 27 Feb 2017 19:23:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OFN97nv9HEV6; Mon, 27 Feb 2017 19:23:18 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 65002834DA; Mon, 27 Feb 2017 19:23:18 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id AEF2A834D7 for ; Mon, 27 Feb 2017 19:23:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8W8kPK90AFvP for ; Mon, 27 Feb 2017 19:23:16 +0100 (CET) Original-Received: from mail-it0-f49.google.com (mail-it0-f49.google.com [209.85.214.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 3A72F834D2 for ; Mon, 27 Feb 2017 19:23:06 +0100 (CET) Original-Received: by mail-it0-f49.google.com with SMTP id h10so63485369ith.1 for ; Mon, 27 Feb 2017 10:23:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=k3x9H1wKEb3NIlfIZoKrv+d3HL2faomJLwzfd4A93AM=; b=G40STqAlQR5pvLnk1Qhuw3fTjJkeEmRYxxTOwUmglshS5O/KuUCoH/+06uaXm1LDhp b7QjC9dgnTiQOZbczoH8/Irmxgxxj1MwhofqDRY0ASDoA07miEvWFAt0dQukSB90MSku rjFrh830tspoNP8OPfxHAEL6XS+u/QbuMbPONpraeFooa3Ga5XvcFv3m7v2CHf22MIL9 CZ3M3aNyzAvCnmmVqzqQac5qB3jfCcToQ1O3eEY/zAEBSYNNKpE/uP3B3slQvc35itN/ 8HumEgdRVWCVN6ZZWebYjxqvfgJBNAX4QUz/TTHLZTl7Mrvl/4nu1xr6UeiAyTXxxqU7 Y1Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=k3x9H1wKEb3NIlfIZoKrv+d3HL2faomJLwzfd4A93AM=; b=m+zvSSh4CaQMG/8Pxp9zwYJ+WiNao5FKIji02UFr92y1oycXQm1npxKB9BWKXImcXO StJLO0nVcdYYtEESU5zn4ds1IiLwbwepdY7wjziF23Jg7IYHoXrop++KKpOvKhR+la42 gNsfps9iM9LSVC/p8ThH1uuDRhYj3XmwmG/vDHYKmLphHr0fo/UDd1w4qB1ARoa5JukF xfBjnoKXzeM5BpU0wrvUPXCdKg/ySok9/N2/m7lYK39+MEHO2a8h5rHtOm2C8v8+mwf5 rFlq1t9d1gvjyWKRJ4Cvn47ATIEkrZNbvzfHbe69S0L2BmQeBlI2CEkR0v2rlVuYIFyW 6Y/A== X-Gm-Message-State: AMke39lwKfM9324g+2wGpMWH2Tj4NKA2VZo2KUirjqCgRPk2POUuGJIGX8QBHuqQWXkAYcNb0YjoIDrlo9YTjA== X-Received: by 10.36.116.7 with SMTP id o7mr16142182itc.31.1488219784443; Mon, 27 Feb 2017 10:23:04 -0800 (PST) Original-Received: by 10.107.133.31 with HTTP; Mon, 27 Feb 2017 10:22:43 -0800 (PST) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:97448 Archived-At: --===============5552636955784027782== Content-Type: multipart/alternative; boundary=001a114a9af49996160549872b2f --001a114a9af49996160549872b2f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=3Ddummyconversion] > \placeformula[#1]} > > \starttext > \placeformulatag[tag]{test} \startformula > E =3D 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=3Da] > \placeformula[test] > \startformula E =3D 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=3Da] > \placeformula[test] > \startformula E =3D 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 wrote: > Thanks. > > I updated the wiki. > > On 27 February 2017 at 17:18, Pablo Rodriguez 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=E2=80=99s numberconversion (as it reads in =E2=80=9CConTeXt Commands= =E2=80=9D): >> >> \setupformulas[numberconversion=3Dgreek] >> \setupbodyfont[dejavu] >> \starttext >> \placeformula[test] >> \startformula E =3D 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 t= o >> 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 >> ____________________________________________________________ >> _______________________ > > > --001a114a9af49996160549872b2f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I try to replicate the following : https://mailman.ntg.nl/p= ipermail/ntg-context/2006/021038.html (i.e. the equivalent of \tag in l= atex/amsmath). More precisely this:
%------------------------8<--------------------------
= \def\placeformulatag%
=C2=A0 =C2=A0{\dosingleempty\doplaceformulatag}\def\doplaceformulatag[#1]#2%
=C2=A0 =C2=A0{\let\normalstopformula\stop= formula
=C2=A0 =C2=A0 \def\stopformula%
=C2=A0 =C2=A0 =C2=A0{\normals= topformula
=C2=A0 =C2=A0 =C2=A0 \restorenumber[formula]
=C2=A0 =C2=A0= =C2=A0 \egroup
=C2=A0 =C2=A0 =C2=A0 \let\stopformula\normalstopformula}=
=C2=A0 =C2=A0 =C2=A0 \bgroup
=C2=A0 =C2=A0 =C2=A0 \savenumber[formul= a]
=C2=A0 =C2=A0 =C2=A0 \def\dummyconversion##1{#2}
=C2=A0 =C2=A0 =C2= =A0 \defineconversion[dummyconversion][\dummyconversion]
=C2=A0 =C2=A0 = =C2=A0 \setupformulas[conversion=3Ddummyconversion]
=C2=A0 =C2=A0 =C2=A0= \placeformula[#1]}

\starttext
\placeformulatag[tag]{test} \start= formula
=C2=A0 =C2=A0E =3D mc^2
\stopformula
See \in formula[tag] = for a tagged formula
\stoptext
%----------------------------8<----= ---------------------

However, the followin= g (simpler) code produce an "Undefined control sequence" when usi= ng \in command.

\starttext
{
=C2=A0 \def\a#1{test}
=C2=A0 \definec= onversion[a][\a]
=C2=A0 \setupformulae[numberconversion=3Da]
=C2=A0 \= placeformula[test]
=C2=A0 \startformula E =3D mc^2 \stopformula
}
= This is my reference: \in{formula}[test].
\stoptext

The following code, does not produce the error, but is no= t practical for the reproducing the \tag command.

\starttext
{
=C2=A0 \def\a#1{test}<= br>=C2=A0 \defineconversion[a][\a]
=C2=A0 \setupformulae[numberconversio= n=3Da]
=C2=A0 \placeformula[test]
=C2=A0 \startformula E =3D mc^2 \st= opformula
=C2=A0 This is my reference: \in{formula}[test].
}
\stop= text

What am I doing wrong? I guess the com= mand \a is no longer defined when the compiler hit \in but how can I ensure= that such local definition stay accessible ?

Than= k you in advance,

Antoine C.

<= /div>

On 27 = February 2017 at 17:28, Antoine Cailliau <antoinecailliau@gmail.co= m> wrote:
= Thanks.=C2=A0

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 equati= ons.
> However, this still use numerals for the equations.
> [...]
> Is this a bug ? Is it the correct way to change the numbering ?<= br>
Hi Antoine,

it=E2=80=99s numberconversion (as it reads in =E2=80=9CConTeXt Commands=E2= =80=9D):

=C2=A0 =C2=A0 \setupformulas[numberconversion=3Dgreek]
=C2=A0 =C2=A0 \setupbodyfont[dejavu]
=C2=A0 =C2=A0 \starttext
=C2=A0 =C2=A0 \placeformula[test]
=C2=A0 =C2=A0 \startformula E =3D mc^2 \stopformula
=C2=A0 =C2=A0 \stoptext

BTW, if this is wrong documented in the wiki, please correct it for<= br> future reference.

Pablo
--
http:/= /www.ousia.tk
_________________________________________________________________= __________________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listin= fo/ntg-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/cont= ext-mirror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
_________________________________________________________________= __________________


--001a114a9af49996160549872b2f-- --===============5552636955784027782== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============5552636955784027782==--