From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/91234 Path: news.gmane.org!not-for-mail From: Maggyero Newsgroups: gmane.comp.tex.context Subject: ConTeXt equivalent of \newmcodes@ Date: Mon, 27 Apr 2015 21:14:15 +0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1399742521==" X-Trace: ger.gmane.org 1430162105 13202 80.91.229.3 (27 Apr 2015 19:15:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Apr 2015 19:15:05 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Mon Apr 27 21:14:51 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YmoUS-0003d4-Fe for gctc-ntg-context-518@m.gmane.org; Mon, 27 Apr 2015 21:14:48 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9FB0B10237 for ; Mon, 27 Apr 2015 21:14:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tT7d-YCTeqNL for ; Mon, 27 Apr 2015 21:14:46 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 0976D1023C for ; Mon, 27 Apr 2015 21:14:23 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2EAE9101FC for ; Mon, 27 Apr 2015 21:14:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YTYWZTt_Nbqo for ; Mon, 27 Apr 2015 21:14:18 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 7C6ED101E8 for ; Mon, 27 Apr 2015 21:14:18 +0200 (CEST) Original-Received: from mail-ie0-x230.google.com (mail-ie0-x230.google.com [IPv6:2607:f8b0:4001:c03::230]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id t3RJEG5j024873 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 27 Apr 2015 21:14:17 +0200 Original-Received: by iejt8 with SMTP id t8so1792944iej.2 for ; Mon, 27 Apr 2015 12:14:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=IyZlTR01pE1rjLvu45gyYC4eV5t3lLLx7SEQQiaOoVE=; b=mTe0vjtkAF3O3o/Cujk5F5jQEHRaWKcVoCE6TxBfd5KYdZMhs48+DmKrXphS9SnLnq 3G0UwDZ3bPG/4b/tAEfnAlROhOHX1lebIrJ8otPSdMdxshkKV9F299pSMxsj8L7Q7s1b dl1EM25mQmbcz23Vdzp+cIDlX6uW+Zy+HBqFq7sYdr/h0xhnSSTlnkLdonxkHc+B6D6Y 1YEk0P4qs40PRdXGsnv9/91VDjhZGqM4B5PMvqWrwuFJzaGdrzrJsId9WbL+Oeor2BkK 1TeTGgR8oDkU45xal0xCtwqshYIvXV2q5RaaVyc+si/JfK1RdZtqWhBLkIwRn9B1hXE4 uhmw== X-Received: by 10.50.90.179 with SMTP id bx19mr15370229igb.43.1430162055712; Mon, 27 Apr 2015 12:14:15 -0700 (PDT) Original-Received: by 10.36.65.80 with HTTP; Mon, 27 Apr 2015 12:14:15 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4001:c03::230; country=US; latitude=38.0000; longitude=-97.0000; http://maps.google.com/maps?q=38.0000,-97.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01Ol7ehDr - 274769caf69f - 20150427 (trained as not-spam) Received-SPF: pass (filter4-ams.mf.surf.net: domain of maggyero@gmail.com designates 2607:f8b0:4001:c03::230 as permitted sender) receiver=filter4-ams.mf.surf.net; client-ip=2607:f8b0:4001:c03::230; envelope-from=; helo=mail-ie0-x230.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) 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:91234 Archived-At: --===============1399742521== Content-Type: multipart/alternative; boundary=047d7bea42944d58cd0514b98d26 --047d7bea42944d58cd0514b98d26 Content-Type: text/plain; charset=UTF-8 > Does \definemathcommand [xyz] [nolop] {xyz} do what you want? Not really if, instead of xyz, I want a name with hyphens, quotes, stars or colons. Compare the output of \definemathcommand[xyz][nolop]{fancy-function-name'*.:} in ConTeXt with the output of \DeclareMathOperator{\xyz}{fancy-function-name'*.:} in LaTeX. What I can do is \definemathcommand[xyz][nolop]{\kern\zeropoint\mfunction{fancy-function-name'*.:}} which gives the same result as \DeclareMathOperator, except for the hyphens and the star are converted into binary operators and the colon which is preceded by a space, since I didn't use \newmcodes@, that is why I asked how to implement the macro \newmcodes@ in ConTeXt, which is defined in LaTeX as \begingroup \catcode`\"=12 \gdef\newmcodes@{\mathcode`\'39\mathcode`\*42\mathcode`\."613A% \ifnum\mathcode`\-=45 \else \mathchardef\std at minus\mathcode`\-\relax \fi \mathcode`\-45\mathcode`\/47\mathcode`\:"603A\relax} \endgroup so that the following code can compile in ConTeXt: \definemathcommand[xyz][nolop]{\newmcodes@ \kern\zeropoint\mfunction{fancy-function-name'*.:}} Maggyero --047d7bea42944d58cd0514b98d26 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
>=C2=A0Does \definemathcommand [xyz] [nolop] {xyz} do w= hat you want?

Not really if, instead of xyz, I want a name w= ith hyphens, quotes, stars or colons. Compare the output of

<= /div>
\definemathcommand[xyz][nolop]{fancy-function-name'*.:}
=

in ConTeXt with the output of

= \DeclareMathOperator{\xyz}{fancy-function-name'*.:}

<= /div>
in LaTeX. What I can do is

\definemathco= mmand[xyz][nolop]{\kern\zeropoint\mfunction{fancy-function-name'*.:}}

which gives the same result as \DeclareMathOperator= , except for the hyphens and the star are converted into binary operators a= nd the colon which is preceded by a space, since I didn't use \newmcode= s@, that is why I asked how to implement the macro \newmcodes@ in ConTeXt, = which is defined in LaTeX as

\begingroup \cat= code`\"=3D12
=C2=A0 =C2=A0 \gdef\newmcodes@{\mathcode`\'= 39\mathcode`\*42\mathcode`\."613A%
=C2=A0 =C2=A0 \ifnum\math= code`\-=3D45 \else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \mathchardef\std a= t minus\mathcode`\-\relax
=C2=A0 =C2=A0 \fi
=C2=A0 =C2= =A0 \mathcode`\-45\mathcode`\/47\mathcode`\:"603A\relax}
\en= dgroup

so that the following code can compil= e in ConTeXt:

\definemathcommand[xyz][nolop]{\newm= codes@\kern\zeropoint\mfunction{fancy-function-name'*.:}}

Maggyero
--047d7bea42944d58cd0514b98d26-- --===============1399742521== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============1399742521==--