ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: ConTeXt equivalent of \newmcodes@
Date: Mon, 27 Apr 2015 22:44:24 +0200	[thread overview]
Message-ID: <553E9FA8.4070409@wxs.nl> (raw)
In-Reply-To: <CAJ2CwZ2zN2bgfZTLaBJQK3EximDRM0cj51Z-U7i5h-+jhQApjQ@mail.gmail.com>

On 4/27/2015 9:14 PM, Maggyero wrote:
>  > 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'*.:}}

\definemathcommand[xyz][nolop]{\text{fancy-function-name'*.:}}

$\xyz^{\xyz}$


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2015-04-27 20:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 19:14 Maggyero
2015-04-27 20:44 ` Hans Hagen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-04-27 21:47 Maggyero
2015-04-27 13:20 Maggyero
2015-04-27 13:55 ` Aditya Mahajan
2015-04-26 22:13 Maggyero
2015-04-27  7:37 ` Hans Hagen

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=553E9FA8.4070409@wxs.nl \
    --to=pragma@wxs.nl \
    --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).