From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/91236 Path: news.gmane.org!not-for-mail From: Maggyero Newsgroups: gmane.comp.tex.context Subject: ConTeXt equivalent of \newmcodes@ Date: Mon, 27 Apr 2015 23:47:25 +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="===============1121735220==" X-Trace: ger.gmane.org 1430171298 11504 80.91.229.3 (27 Apr 2015 21:48:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Apr 2015 21:48:18 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Mon Apr 27 23:48:06 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 1Ymqsl-0005dH-MR for gctc-ntg-context-518@m.gmane.org; Mon, 27 Apr 2015 23:48:03 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E1CDE103C1 for ; Mon, 27 Apr 2015 23:47:57 +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 5fh2q2C_ETUa for ; Mon, 27 Apr 2015 23:47:57 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 5E2061023A for ; Mon, 27 Apr 2015 23:47:35 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 39617101FC for ; Mon, 27 Apr 2015 23:47:31 +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 DPZIb-im9EWv for ; Mon, 27 Apr 2015 23:47:30 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 88CCF101E8 for ; Mon, 27 Apr 2015 23:47:27 +0200 (CEST) Original-Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id t3RLlPYt009971 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 27 Apr 2015 23:47:26 +0200 Original-Received: by igbyr2 with SMTP id yr2so75430304igb.0 for ; Mon, 27 Apr 2015 14:47:25 -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=hlT6pauyc9K3khtcZBz1RjeRhRBhCSMRCq8hl5vHh3I=; b=Su7BddKu65Yr3iDwUZYSaFx2HviDHmM0kBclDy7JddrhuuaPKKochZJFkG+EjzU+rq 1mzghh4jStAmD2r9DqQOJezqC8y8zLFOo6XuMP2P+ej1N3UBwiOzA3Ojq0acHSu4P9b7 4t4X7xD0/JDI/jowX+eXjdG+eP6U9bWuNGaXAh2g5ol/fMbZemDucvQqKIPy3cPCU+/l w7nPWdJyGBMoeE68uplnH50sTSpoHKQwCFbAS3oGH2s9zL0+c9q7o2ZiynfGeOBXxWVN HNyRU92anwFMG8VYSQzplPjrSBJoMZJLg0hrTN2ouaxVwkG6TVKxbax9hG6EjNut4bN6 zVQg== X-Received: by 10.107.156.69 with SMTP id f66mr16398189ioe.36.1430171245315; Mon, 27 Apr 2015 14:47:25 -0700 (PDT) Original-Received: by 10.36.65.80 with HTTP; Mon, 27 Apr 2015 14:47:25 -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:c05::22b; 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: 03Ol9Lq14 - 0df9ad15c318 - 20150427 (trained as not-spam) Received-SPF: pass (filter3-ams.mf.surf.net: domain of maggyero@gmail.com designates 2607:f8b0:4001:c05::22b as permitted sender) receiver=filter3-ams.mf.surf.net; client-ip=2607:f8b0:4001:c05::22b; envelope-from=; helo=mail-ig0-x22b.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:91236 Archived-At: --===============1121735220== Content-Type: multipart/alternative; boundary=001a1140bc960b8ecb0514bbb1bb --001a1140bc960b8ecb0514bbb1bb Content-Type: text/plain; charset=UTF-8 > \definemathcommand[xyz][nolop]{\text{fancy-function-name'*.:}} The problem with this solution is that the font of the operator becomes the normal text font whereas I want to use the standard math upright font (so \mfunction + \kern\zeropoint + \newmathcodes is the way to go). For instance with \setupbodyfont[sansserif] the operator name becomes sans serif, which I don't want. I only need to make this code compile: \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 \definemathcommand[xyz][nolop]{\newmcodes@ \kern\zeropoint\mfunction{fancy-function-name'*.:}} \starttext \xyz \stoptext How can I do that? The compilation fails at the \ifnum condition. Isn't \ifnum a ConTeXt macro? Maggyero --001a1140bc960b8ecb0514bbb1bb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
> \definemathcommand[xyz][nolop]{\text{fancy-function-n= ame'*.:}}

The problem with this solution is that the= font of the operator becomes the normal text font whereas I want to use th= e standard math upright font (so \mfunction + \kern\zeropoint + \newmathcod= es is the way to go). For instance with \setupbodyfont[sansserif] the opera= tor name becomes sans serif, which I don't want.

I only need to make this code compile:

\be= gingroup \catcode`\"=3D12
=C2=A0 =C2=A0 \gdef\newmcodes@{\ma= thcode`\'39\mathcode`\*42\mathcode`\."613A%
=C2=A0 =C2= =A0 \ifnum\mathcode`\-=3D45 \else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \ma= thchardef\std at minus\mathcode`\-\relax
=C2=A0 =C2=A0 \fi
<= div>=C2=A0 =C2=A0 \mathcode`\-45\mathcode`\/47\mathcode`\:"603A\relax}=
\endgroup

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

\starttext
\xyz
\stoptext=

How can I do that? The compilation fails at the \= ifnum condition. Isn't \ifnum a ConTeXt macro?


Maggyero
--001a1140bc960b8ecb0514bbb1bb-- --===============1121735220== 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= --===============1121735220==--