ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Maggyero <maggyero@gmail.com>
To: ntg-context@ntg.nl
Subject: ConTeXt equivalent of \newmcodes@
Date: Mon, 27 Apr 2015 21:14:15 +0200	[thread overview]
Message-ID: <CAJ2CwZ2zN2bgfZTLaBJQK3EximDRM0cj51Z-U7i5h-+jhQApjQ@mail.gmail.com> (raw)


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

> 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

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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2015-04-27 19:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 19:14 Maggyero [this message]
2015-04-27 20:44 ` Hans Hagen
  -- 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=CAJ2CwZ2zN2bgfZTLaBJQK3EximDRM0cj51Z-U7i5h-+jhQApjQ@mail.gmail.com \
    --to=maggyero@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).