From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/91442 Path: news.gmane.org!not-for-mail From: Maggyero Newsgroups: gmane.comp.tex.context Subject: Changing font for math function Date: Wed, 13 May 2015 17:51:54 +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="===============0915164369==" X-Trace: ger.gmane.org 1431532423 19433 80.91.229.3 (13 May 2015 15:53:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 May 2015 15:53:43 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed May 13 17:53:24 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 1YsYyJ-0002nP-TL for gctc-ntg-context-518@m.gmane.org; Wed, 13 May 2015 17:53:24 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 319C01020F for ; Wed, 13 May 2015 17:53:23 +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 tHyjgZqVUPWr for ; Wed, 13 May 2015 17:53:20 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 3F9851022A for ; Wed, 13 May 2015 17:52:11 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EA7C0101E8 for ; Wed, 13 May 2015 17:52:06 +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 d3vmOIzdvN2n for ; Wed, 13 May 2015 17:52:04 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 449F6101E6 for ; Wed, 13 May 2015 17:52:04 +0200 (CEST) Original-Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id t4DFpt6D010506 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 13 May 2015 17:52:01 +0200 Original-Received: by iecmd7 with SMTP id md7so35984553iec.1 for ; Wed, 13 May 2015 08:51:54 -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=zh2P3YBPD811pzGORNoh2ao+eh1Mbl1lURXj6p3N5oU=; b=mjzONNwPaOvp+wkLdxqiXrQcnVpwdLsCtRkoUui26yLz++8Tdtrqhy83olAl2WUvrD foB+OeVU1okDz2h/Cp2Qp/R/RzGGSKIFred0EwdEfQZlVtTsOylPC6hNH58W4oG/9nBj sfLrHOpPHzrwlSShslT9o/G/5A3GywaZ50Xe/3pE5Tcb4dF9jpDyk2W6Qf0pWqtoUzZ4 jqhYoxKdvEax4A/WwIJeonMRplLeKq5a8kQNe8GgjX+GbB0PGR5DYsSLO+dV6sfyyRrK gkLBDsR67sE867hQFTpf2fYJJqMMGkiEcjgBZu6FquZeokPyNJHfdfXW/RidNRr896U4 mZMw== X-Received: by 10.42.51.199 with SMTP id f7mr4525494icg.58.1431532314386; Wed, 13 May 2015 08:51:54 -0700 (PDT) Original-Received: by 10.36.65.80 with HTTP; Wed, 13 May 2015 08:51:54 -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::234; country=US; region=Iowa; city=Council Bluffs; latitude=41.2324; longitude=-95.8762; http://maps.google.com/maps?q=41.2324,-95.8762&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TOrrPTjc - 5db8f9570d91 - 20150513 (trained as not-spam) Received-SPF: pass (filter2-til.mf.surf.net: domain of maggyero@gmail.com designates 2607:f8b0:4001:c03::234 as permitted sender) receiver=filter2-til.mf.surf.net; client-ip=2607:f8b0:4001:c03::234; envelope-from=; helo=mail-ie0-x234.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:91442 Archived-At: --===============0915164369== Content-Type: multipart/alternative; boundary=20cf302237891567dc0515f89725 --20cf302237891567dc0515f89725 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > Hans Hagen: > mfunction will stay as it is also needed for tagged pdf and exporting > (basically it's an apply math function thing) so if something else is > needed another name/mechanism have to be made (with appropriate tagging) > the label itself is a special case as it's optional (and is just there > for cultural differences as not all countries use the english names) > so, \rho_{\mathlabel{air}} is something different then, some kind of > multi-character variable? Actually no, it has nothing to do with ConTeXt label texts (that is why I removed the word 'text' in it to avoid the confusion), \mathlabel was just a name that I gave to encompass two different things that are usually typeset the same way (upright): the names of functions (\mfunction) and the names often used in the subscripts of variables. But after some thought and your new suggestion (\mtext) for the latter case, I find that my 'mathlabel' is misleading and that it is better for the user to keep them separate (with \mfunction AND \mtext), and it gives him more control. > Hans Hagen: > \unexpanded\def\mtext#1{\text{\usemathematicsstyleandcolor\c!textstyle\c!te= xtcolor#1}} > which can be used as: > $x^{\mtext{effe}}$ > and obeys > \setupmathematics[textstyle=3Dbold, textcolor=3Ddarkgreen] Perfect! Not only \mtext is short but also very meaningful and symmetrical with \mfunction, therefore easy to memorize. I totally agree with that new definition. QUESTION 1. =E2=80=94 Did you include the \text command as well in the defi= nition of your new \mfunction (like below)? 1st DEFINITION of \mfunction. =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \unexpanded\def\mfunction#1{\text{\usemathematicsstyleandcolor\c!functionst= yle\c!functioncolor#1}} =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 Because like in \mtext, the \text command is ESSENTIAL (for the function names to have the mathcodes, kerning and ligatures of the text mode instead of the ones of the math mode). > Hans Hagen: > next beta: when one of the stylealternatives text mode else mathmode > (default nothing =3D=3D mathupright) > Aditya Mahajan: > The default should be \mathupright (as is the case in amstex and latex, and probably also plaintex). No, I strongly disagree. Yes it should be upright by default, but it should always be in TEXT mode, even by default, that is why I used the \text command in the definition of \mfunction. \mathupright in math mode doesn't solve the problems of mathcodes, kerning and ligatures (if you want call your function 'AVL' or 'low-frequency' for instance, the result is terrible with \mathupright: the space between A and V is too large and the hyphen between w and f becomes a minus sign binary operator=E2=80=94try $\mathupright{AVL}$ and $\mathupright{low-frequency}$). \text{\rm\tf} does. Consequently \rm\tf should be the default functionstyle and textstyle in \setupmathematics. (And Aditya, don't forget that \mathupright is just a macro for \rm\tf in math mode.) So now, let us see what the user have to write to get a math function and a math text (usually used as the subscript of a variable): =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \setupmathematics[functionstyle=3Dbold, functioncolor=3Dred, textstyle=3Dbo= ld, textcolor=3Dgreen] \starttext $\mathnolop{\mfunction{Arsinh}} x\ \text{and}\ n_{\mtext{air}}$. \stoptext =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 The syntax is okay but a bit complicated since the symmetry is not perfect (\mtext vs \mathnolop{\mfunction}). Symmetry is important in a user interface so I think the user expects simply \mtext and \mfunction (not \mathnolop{\mfunction}). Therefore we need to wrap this \mathnolop in \mfunction. And the possibility to choose \mathop (synonym: \mathlimop) instead of \mathnolop=E2=80=94which should be the default=E2=80=94should be= given to the user with an optional argument. To keep it consistent with the ConTeXt syntax, the optional argument should be [op] (synonym: [limop]). So let us redefine our \mfunction. 2nd DEFINITION of \mfunction. =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \unexpanded\def\mfunction{\dosingleempty\domfunction} \def\domfunction[#1]#2% {\iffirstargument \doifelse{#1}{op}{\normalmathop{\text{\usemathematicsstyleandcolor\c!funct= ionstyle\c!functioncolor#2}}}{\doifelse{#1}{limop}{\normalmathop{\text{\use= mathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}}{\normalmathop= {\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}\nol= imits}} \else \normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functio= ncolor#2}}\nolimits \fi} =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 Notice in that new definition that we use \normalmathop instead of \mathop because the \mathop in ConTeXt uses a modified version of the normal \mathop (the latter is renamed \normalmathop by ConTeXt) that converts the serif font style command \rm to the math font style command \mf, which as a result makes \rm without effect in \setupmathematics[functionstyle=3D\rm] a= s I came to realize after some testing. Indeed, ConTeXt has currently the following lines in math-ini.mkiv: \let\normalmathop\mathop \unexpanded\def\mathop {\normalmathop \bgroup \let\rm\mf \let\nexttoken=3D} QUESTION 2. =E2=80=94 By the way, why this conversion of \rm to \mf inside = \mathop atoms (\let\rm\mf)? So with the new definition for \mfunction, the user can now simply and elegantly write this: =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \setupmathematics[functionstyle=3Dbold, functioncolor=3Dred, textstyle=3Dbo= ld, textcolor=3Dgreen] \starttext $\mfunction{Arsinh} x\ \text{and}\ n_{\mtext{air}}$. \stoptext =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 With that new \mfunction, ConTeXt users now have an equivalent macro to the LaTeX \operatorname macro of the amsopn package, which I think was very missing. Now, let us look at how the user can DEFINE his math function. A. With the 1st definition of \mfunction (the one that doesn't include \mathnolop or \mathop), the user can write this (notice again that we use \normalmathop \nolimits instead of \mathnolop=E2=80=94or equivalently [nolo= p]=E2=80=94to avoid the conversion of \rm to \mf that would make \setupmathematics[functionstyle=3D\rm] without effect): =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \definemathcommand[arsinh]{\normalmathop{\mfunction{Arsinh}}\nolimits} \setupmathematics[functionstyle=3Dbold, functioncolor=3Dred, textstyle=3Dbo= ld, textcolor=3Dgreen] \starttext $\arsinh x\ \text{and}\ n_{\mtext{air}}$. \stoptext =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 or, alternatively this (if the user wants also to define a label text for his function): =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \setupmathlabeltext[arsinh=3DArsinh] \definemathcommand[arsinh]{\normalmathop{\mfunctionlabeltext{arsinh}}\nolim= its} \setupmathematics[functionstyle=3Dbold, functioncolor=3Dred, textstyle=3Dbo= ld, textcolor=3Dgreen] \starttext $\arsinh x\ \text{and}\ n_{\mtext{air}}$. \stoptext =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 assuming that \mfunctionlabeltext is defined the following way (which I think is already the case in the last beta). 1st DEFINITION of \mfunctionlabeltext. =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \unexpanded\def\mfunctionlabeltext#1{\mfunction{\mathlabeltext{#1}}} =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 Thus with the 1st definition of \mfunction (and \mfunctionlabeltext), the definition of a math function for the user is a bit complicated (he has to write \normalmathop \nolimits in addition to \mfunction or \mfunctionlabeltext, unless Hans decides to remove \let\rm\mf from his redefinition of \mathop in which case the user just has to add the optional argument [nolop] instead of the verbose and hard to remember \normalmathop \nolimits). B. With the 2nd definition of \mfunction (the one that includes \mathnolop or \mathop), the user can write this: =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \definemathcommand[arsinh]{\mfunction{Arsinh}} \setupmathematics[functionstyle=3Dbold, functioncolor=3Dred, textstyle=3Dbo= ld, textcolor=3Dgreen] \starttext $\arsinh x\ \text{and}\ n_{\mtext{air}}$. \stoptext =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 or, alternatively this (if the user wants also to define a label text for his function): =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \setupmathlabeltext[arsinh=3DArsinh] \definemathcommand[arsinh]{\mfunctionlabeltext{arsinh}} \setupmathematics[functionstyle=3Dbold, functioncolor=3Dred, textstyle=3Dbo= ld, textcolor=3Dgreen] \starttext $\arsinh x\ \text{and}\ n_{\mtext{air}}$. \stoptext =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 assuming that \mfunctionlabeltext is defined the following way (the additional optional argument is for that of \mfunction). 2nd DEFINITION of \mfunctionlabeltext. =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \unexpanded\def\mfunctionlabeltext{\dosingleempty\domfunctionlabeltext} \def\domfunctionlabeltext[#1]#2% {\iffirstargument \mfunction[#1]{\mathlabeltext{#2}} \else \mfunction{\mathlabeltext{#2}} \fi} =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 Thus with the 2nd definition of \mfunction (and \mfunctionlabeltext), the definition of a math function for the user is easier (no need to write \normalmathop \nolimits since it is taken into account in \mfunction, and Hans doesn't have to remove \let\rm\mf from his redefinition of \mathop). It confirms that the 2nd definition of \mfunction (and \mfunctionlabeltext) is the way to go. However the command \mfunctionlabeltext is unnecessary and inconsistent with the other ConTeXt command \labeltext since it has a style attached to it, so may confuse the user. The direct command \mathlabeltext (the math equivalent of \labeltext) should be preferred. Therefore I think Hans should remove \mfunctionlabeltext from math-ini.mkiv and the user should use \mfunction{\mathlabeltext } when needed: =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \setupmathlabeltext[arsinh=3DArsinh] \definemathcommand[arsinh]{\mfunction{\mathlabeltext{arsinh}}} \setupmathematics[functionstyle=3Dbold, functioncolor=3Dred, textstyle=3Dbo= ld, textcolor=3Dgreen] \starttext $\arsinh x\ \text{and}\ n_{\mtext{air}}$. \stoptext =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 But we can go a little further in user friendliness by wrapping the \mfunction in a new macro, that we should name \definemathfunction to be consistent with the other macros (\definemathcommand, \definemathsymbol, \definemathcharacter, etc.). The possibility to choose between \mathop (synonym: \mathlimop) and \mathnolop=E2=80=94which should be the default=E2= =80=94is once more given to the user with the optional argument [op] (synonym: [limop]) to be consistent with the ConTeXt syntax. The macro is defined as follows. DEFINITION of \definemathfunction. =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \unexpanded\def\definemathfunction{\dodoubleempty\dodefinemathfunction} \def\dodefinemathfunction[#1][#2]#3% {\ifsecondargument \definemathcommand[#1]{\mfunction[#2]{#3}} \else \definemathcommand[#1]{\mfunction{#3}} \fi} =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 Notice that we use again \normalmathop for the same reasons as before. That new \definemathfunction macro now allows the user to write this: =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \definemathfunction[arsinh]{arsinh} \setupmathematics[functionstyle=3Dbold, functioncolor=3Dred, textstyle=3Dbo= ld, textcolor=3Dgreen] \starttext $\arsinh x\ \text{and}\ n_{\mtext{air}}$. \stoptext =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 or, alternatively this (if the user wants also to define a label text for his function): =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \setupmathlabeltext[arsinh=3DArsinh] \definemathfunction[arsinh]{\mathlabeltext{arsinh}} \setupmathematics[functionstyle=3Dbold, functioncolor=3Dred, textstyle=3Dbo= ld, textcolor=3Dgreen] \starttext $\arsinh x\ \text{and}\ n_{\mtext{air}}$. \stoptext =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 With that new \definemathfunction, ConTeXt users now have an equivalent macro to the LaTeX \DeclareMathOperator macro of the amsopn package, which I think was very missing as well. The math functions defined in math-def.mkiv should of course use \mfunction{\mathlabeltext } instead of the old \mfunctionlabeltext, or the new macro \definemathfunction: =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \definemathcommand[cos]{\mfunction{\mathlabeltext{cos}}} % Or \definemathcommand[cos]{\mfunction[nolop]{\mathlabeltext{cos}}}, it is the same. \definemathcommand[det]{\mfunction[limop]{\mathlabeltext{det}}} \definemathcommand[diff]{\normalmathop{\text{\mathfunctionstyle d}}\mathopen{}} %etc. =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 or =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \definemathfunction[cos]{\mathlabeltext{cos}} % Or \definemathfunction[cos][nolop]{\mathlabeltext{cos}}, it is the same. \definemathfunction[det][limop]{\mathlabeltext{det}} \definemathcommand[diff]{\normalmathop{\text{\mathfunctionstyle d}}\mathopen{}} % It is a special function so it should still be treated with the more general \definemathcommand. %etc. =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 Notice the removal of [nolop] and [limop] which are already present in \mfunction and \mfunction[limop] respectively (since we now use the 2nd definition of \mfunction for all the reasons we gave above). Now before concluding, here is a little example illustrating the new mechanism of Hans (functionstyle, functioncolor, textstyle and textcolor keys in \setupmathematics) of which I improved the consistency and simplicity of the related macros (\mtext and \mfunction, and the new \definemathfunction) in practical use. In this example as I still don't have access to the last beta I didn't use the new keys of \setupmathematics (functionstyle, textstyle) but local definitions. For Aditya, this time the given example works correctly contrary to my last post where I realized afterwards that \rm was not working in \setupmathematics because of the use of \mathop which converts it to \mf (hence my use of \normalmathop in this post as explained earlier). EXAMPLE. =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \define\mathtextstyle{\rm\tf} \define[1]\mtext{\text{\mathtextstyle #1}} \define\mfunction{\dosingleempty\domfunction} \def\domfunction[#1]#2{% \iffirstargument \doifelse{#1}{op}{\normalmathop{\text{\mathfunctionstyle #2}}}{\doifelse{#1}{limop}{\normalmathop{\text{\mathfunctionstyle #2}}}{\normalmathop{\text{\mathfunctionstyle #2}}\nolimits}} \else \normalmathop{\text{\mathfunctionstyle #2}}\nolimits \fi} \define\mathfunctionstyle{\rm\tf} \define\definemathfunction{\dodoubleempty\dodefinemathfunction} \def\dodefinemathfunction[#1][#2]#3{% \ifsecondargument \definemathcommand[#1]{\mfunction[#2]{#3}} \else \definemathcommand[#1]{\mfunction{#3}} \fi} \setupmathlabeltext[arsinh=3DArsinh] \definemathfunction[arsinh]{\mathlabeltext{arsinh}} \starttext \startbuffer $\arsinh x\ \text{and}\ n_{\mtext{air}}$ \stopbuffer \defineparagraphs[myparagraphs][n=3D5, rule=3Don] \setupparagraphs[myparagraphs][1][width=3D\dimexpr 0.3\textwidth\relax] \setupparagraphs[myparagraphs][2][width=3D\dimexpr 0.3\textwidth\relax] \setupparagraphs[myparagraphs][3][width=3D\dimexpr 0.3\textwidth\relax] \section{{\tt \backslash setupmathematics[functionstyle=3D\backslash rm\backslash tf,textstyle=3D\backslash rm\backslash tf]} (default setup)} \define\mathfunctionstyle{\rm\tf} \define\mathtextstyle{\rm\tf} \startmyparagraphs \switchtobodyfont[rm] {\tt \backslash switchtobodyfont[rm]}\crlf {\tt \backslash tf}: {\tf \getbuffer}\par {\tt \backslash it}: {\it \getbuffer}\par {\tt \backslash sl}: {\sl \getbuffer}\par {\tt \backslash bf}: {\bf \getbuffer}\par {\tt \backslash bi}: {\bi \getbuffer}\par {\tt \backslash bs}: {\bs \getbuffer}\par \nextmyparagraphs \switchtobodyfont[ss] {\tt \backslash switchtobodyfont[ss]}\crlf {\tt \backslash tf}: {\tf \getbuffer}\par {\tt \backslash it}: {\it \getbuffer}\par {\tt \backslash sl}: {\sl \getbuffer}\par {\tt \backslash bf}: {\bf \getbuffer}\par {\tt \backslash bi}: {\bi \getbuffer}\par {\tt \backslash bs}: {\bs \getbuffer}\par \nextmyparagraphs \switchtobodyfont[tt] {\tt \backslash switchtobodyfont[tt]}\crlf {\tt \backslash tf}: {\tf \getbuffer}\par {\tt \backslash it}: {\it \getbuffer}\par {\tt \backslash sl}: {\sl \getbuffer}\par {\tt \backslash bf}: {\bf \getbuffer}\par {\tt \backslash bi}: {\bi \getbuffer}\par {\tt \backslash bs}: {\bs \getbuffer}\par \stopmyparagraphs \section{{\tt \backslash setupmathematics[functionstyle=3D\backslash tf,textstyle=3D\backslash tf]}} \define\mathfunctionstyle{\tf} \define\mathtextstyle{\tf} \startmyparagraphs \switchtobodyfont[rm] {\tt \backslash switchtobodyfont[rm]}\crlf {\tt \backslash tf}: {\tf \getbuffer}\par {\tt \backslash it}: {\it \getbuffer}\par {\tt \backslash sl}: {\sl \getbuffer}\par {\tt \backslash bf}: {\bf \getbuffer}\par {\tt \backslash bi}: {\bi \getbuffer}\par {\tt \backslash bs}: {\bs \getbuffer}\par \nextmyparagraphs \switchtobodyfont[ss] {\tt \backslash switchtobodyfont[ss]}\crlf {\tt \backslash tf}: {\tf \getbuffer}\par {\tt \backslash it}: {\it \getbuffer}\par {\tt \backslash sl}: {\sl \getbuffer}\par {\tt \backslash bf}: {\bf \getbuffer}\par {\tt \backslash bi}: {\bi \getbuffer}\par {\tt \backslash bs}: {\bs \getbuffer}\par \nextmyparagraphs \switchtobodyfont[tt] {\tt \backslash switchtobodyfont[tt]}\crlf {\tt \backslash tf}: {\tf \getbuffer}\par {\tt \backslash it}: {\it \getbuffer}\par {\tt \backslash sl}: {\sl \getbuffer}\par {\tt \backslash bf}: {\bf \getbuffer}\par {\tt \backslash bi}: {\bi \getbuffer}\par {\tt \backslash bs}: {\bs \getbuffer}\par \stopmyparagraphs \section{{\tt \backslash setupmathematics[functionstyle=3D\backslash bf,textstyle=3D\backslash bf]}} \define\mathfunctionstyle{\bf} \define\mathtextstyle{\bf} \startmyparagraphs \switchtobodyfont[rm] {\tt \backslash switchtobodyfont[rm]}\crlf {\tt \backslash tf}: {\tf \getbuffer}\par {\tt \backslash it}: {\it \getbuffer}\par {\tt \backslash sl}: {\sl \getbuffer}\par {\tt \backslash bf}: {\bf \getbuffer}\par {\tt \backslash bi}: {\bi \getbuffer}\par {\tt \backslash bs}: {\bs \getbuffer}\par \nextmyparagraphs \switchtobodyfont[ss] {\tt \backslash switchtobodyfont[ss]}\crlf {\tt \backslash tf}: {\tf \getbuffer}\par {\tt \backslash it}: {\it \getbuffer}\par {\tt \backslash sl}: {\sl \getbuffer}\par {\tt \backslash bf}: {\bf \getbuffer}\par {\tt \backslash bi}: {\bi \getbuffer}\par {\tt \backslash bs}: {\bs \getbuffer}\par \nextmyparagraphs \switchtobodyfont[tt] {\tt \backslash switchtobodyfont[tt]}\crlf {\tt \backslash tf}: {\tf \getbuffer}\par {\tt \backslash it}: {\it \getbuffer}\par {\tt \backslash sl}: {\sl \getbuffer}\par {\tt \backslash bf}: {\bf \getbuffer}\par {\tt \backslash bi}: {\bi \getbuffer}\par {\tt \backslash bs}: {\bs \getbuffer}\par \stopmyparagraphs \stoptext =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 CONCLUSION. =E2=80=94 It all comes down to the choice of the best user inte= rface for math functions and math texts (usually used as subscripts of variables). Their styles and colors is handled with \setupmathematics. There are two choices of user interface: 1. $\normalmathop{\mfunction{Arsinh}}\nolimits x\ \text{and}\ n_{\mtext{air}}$. 2. $\mfunction{Arsinh} x\ \text{and}\ n_{\mtext{air}}$. First, the default functionstyle and textstyle in \setupmathematics should be \rm\tf (the text mode equivalent of \mathupright, as we are always in text mode thanks to the \text hardcoded in \mfunction and \mtext). Then, in the 1st solution \normalmathop is used instead of \mathop because the latter is modified by ConTeXt to convert \rm to \mf, which makes \setupmathematics[functionstyle=3D\rm] without effect. The 2nd solution is obviously way cleaner, that is why I think it should be preferred. The implementation is given in my '2nd DEFINITION of \mfunction' for replacing the existing definition in math-ini.mkiv: =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \unexpanded\def\mfunction{\dosingleempty\domfunction} \def\domfunction[#1]#2% {\iffirstargument \doifelse{#1}{op}{\normalmathop{\text{\usemathematicsstyleandcolor\c!funct= ionstyle\c!functioncolor#2}}}{\doifelse{#1}{limop}{\normalmathop{\text{\use= mathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}}{\normalmathop= {\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}\nol= imits}} \else \normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functio= ncolor#2}}\nolimits \fi} =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 We also saw that \mfunctionlabeltext is inconsistent with ConTeXt \labeltext because the former has a style attached to it, so \mfunctionlabeltext should be removed from math-ini.mkiv and \mfunction{\mathlabeltext } should be used instead when needed. To go even further in userfriendlyness, we the new macro \definemathcommand should be added in math-ini.mkiv: =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \unexpanded\def\definemathfunction{\dodoubleempty\dodefinemathfunction} \def\dodefinemathfunction[#1][#2]#3% {\ifsecondargument \definemathcommand[#1]{\mfunction[#2]{#3}} \else \definemathcommand[#1]{\mfunction{#3}} \fi} =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 Finally, with this new \mfunction definition and the removal of the misleading \mfunctionlabeltext, the functions defined in math-def.mkiv should be rewrite as: =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \definemathcommand[cos]{\mfunction{\mathlabeltext{cos}}} % Or \definemathcommand[cos]{\mfunction[nolop]{\mathlabeltext{cos}}}, it is the same. \definemathcommand[det]{\mfunction[limop]{\mathlabeltext{det}}} \definemathcommand[diff]{\normalmathop{\text{\mathfunctionstyle d}}\mathopen{}} %etc. =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 or =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \definemathfunction[cos]{\mathlabeltext{cos}} % Or \definemathfunction[cos][nolop]{\mathlabeltext{cos}}, it is the same. \definemathfunction[det][limop]{\mathlabeltext{det}} \definemathcommand[diff]{\normalmathop{\text{\mathfunctionstyle d}}\mathopen{}} % It is a special function so it should still be treated with the more general \definemathcommand. %etc. =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 ConTeXt users are now provided, if Hans agrees to implement the code given in this conclusion, with three extremely useful macros: =E2=80=94 \mtext (that should be used for all math texts such as subscripts= of variables): $n_{\mtext{air}}$; =E2=80=94 \mfunction (the equivalent of LaTeX \operatorname macro of the am= sopn package): $\mfunction{Arsinh} x$ $\mfunction[op]{Arsinh} x$ or equivalently $\mfunction[limop]{Arsinh} x$; =E2=80=94 \definemathfunction (the equivalent of LaTeX \DeclareMathOperator= macro of the amsopn package): \definemathfunction[arsinh]{Arsinh} $\arsinh x$ \definemathfunction[arsinh][op]{Arsinh} $\arsinh x$ or equivalently \definemathfunction[arsinh][limop]{Arsinh} $\arsinh x$. Maggyero --20cf302237891567dc0515f89725 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
> Hans Hagen:
> mfunction will stay a= s it is also needed for tagged pdf and exporting
> (basically = it's an apply math function thing) so if something else is
&g= t; needed another name/mechanism have to be made (with appropriate tagging)=
> the label itself is a special case as it's optional (an= d is just there
> for cultural differences as not all countrie= s use the english names)
> so, \rho_{\mathlabel{air}} is somet= hing different then, some kind of
> multi-character variable?<= /div>

Actually no, it has nothing to do with ConTeXt lab= el texts (that is why I removed the word 'text' in it to avoid the = confusion), \mathlabel was just a name that I gave to encompass two differe= nt things that are usually typeset the same way (upright): the names of fun= ctions (\mfunction) and the names often used in the subscripts of variables= . But after some thought and your new suggestion (\mtext) for the latter ca= se, I find that my 'mathlabel' is misleading and that it is better = for the user to keep them separate (with \mfunction AND \mtext), and it giv= es him more control.

> Hans Hagen:
&g= t; \unexpanded\def\mtext#1{\text{\usemathematicsstyleandcolor\c!textstyle\c= !textcolor#1}}
> which can be used as:
> $x^{\mte= xt{effe}}$
> and obeys
> \setupmathematics[textst= yle=3Dbold, textcolor=3Ddarkgreen]

Perfect! Not on= ly \mtext is short but also very meaningful and symmetrical with \mfunction= , therefore easy to memorize. I totally agree with that new definition.

QUESTION 1. =E2=80=94 Did you include the \text comma= nd as well in the definition of your new \mfunction (like below)?

1st DEFINITION of \mfunction.
=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
\unexpanded\def\mfunction= #1{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#1}}
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94

Because like in \mtext, the \text command is ESSENTIAL (fo= r the function names to have the mathcodes, kerning and ligatures of the te= xt mode instead of the ones of the math mode).

>= ; Hans Hagen:
> next beta: when one of the stylealternatives t= ext mode else mathmode
> (default nothing =3D=3D mathupright)<= /div>

> Aditya Mahajan:
> The default sh= ould be \mathupright (as is the case in amstex
and latex, and pro= bably also plaintex).

No, I strongly disagree. Yes= it should be upright by default, but it should always be in TEXT mode, eve= n by default, that is why I used the \text command in the definition of \mf= unction. \mathupright in math mode doesn't solve the problems of mathco= des, kerning and ligatures (if you want call your function 'AVL' or= 'low-frequency' for instance, the result is terrible with \mathupr= ight: the space between A and V is too large and the hyphen between w and f= becomes a minus sign binary operator=E2=80=94try $\mathupright{AVL}$ and $= \mathupright{low-frequency}$). \text{\rm\tf} does. Consequently \rm\tf shou= ld be the default functionstyle and textstyle in \setupmathematics. (And Ad= itya, don't forget that \mathupright is just a macro for \rm\tf in math= mode.)

So now, let us see what the user have to w= rite to get a math function and a math text (usually used as the subscript = of a variable):
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94
\setupmathematics[functionstyle=3Dbold, functioncolor= =3Dred, textstyle=3Dbold, textcolor=3Dgreen]
\starttext
=C2=A0 $\mathnolop{\mfunction{Arsinh}} x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94

The syntax is okay but a bit complica= ted since the symmetry is not perfect (\mtext vs \mathnolop{\mfunction}). S= ymmetry is important in a user interface so I think the user expects simply= \mtext and \mfunction (not \mathnolop{\mfunction}). Therefore we need to w= rap this \mathnolop in \mfunction. And the possibility to choose \mathop (s= ynonym: \mathlimop) instead of \mathnolop=E2=80=94which should be the defau= lt=E2=80=94should be given to the user with an optional argument. To keep i= t consistent with the ConTeXt syntax, the optional argument should be [op] = (synonym: [limop]). So let us redefine our \mfunction.

=
2nd DEFINITION of \mfunction.
=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94
\unexpanded\def\mfunction{\dosingleem= pty\domfunction}
\def\domfunction[#1]#2%
=C2=A0 {\iffir= stargument
=C2=A0 =C2=A0 =C2=A0\doifelse{#1}{op}{\normalmathop{\t= ext{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}}{\doif= else{#1}{limop}{\normalmathop{\text{\usemathematicsstyleandcolor\c!function= style\c!functioncolor#2}}}{\normalmathop{\text{\usemathematicsstyleandcolor= \c!functionstyle\c!functioncolor#2}}\nolimits}}
=C2=A0 =C2=A0\els= e
=C2=A0 =C2=A0 =C2=A0\normalmathop{\text{\usemathematicsstyleand= color\c!functionstyle\c!functioncolor#2}}\nolimits
=C2=A0 =C2=A0\= fi}
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94

Notice in that new definition that we use \normalmat= hop instead of \mathop because the \mathop in ConTeXt uses a modified versi= on of the normal \mathop (the latter is renamed \normalmathop by ConTeXt) t= hat converts the serif font style command \rm to the math font style comman= d \mf, which as a result makes \rm without effect in \setupmathematics[func= tionstyle=3D\rm] as I came to realize after some testing. Indeed, ConTeXt h= as currently the following lines in math-ini.mkiv:

\let\normalmathop\mathop
\unexpanded\def\mathop
=C2=A0= {\normalmathop
=C2=A0 =C2=A0\bgroup
=C2=A0 =C2=A0\let\= rm\mf
=C2=A0 =C2=A0\let\nexttoken=3D}

QU= ESTION 2. =E2=80=94 By the way, why this conversion of \rm to \mf inside \m= athop atoms (\let\rm\mf)?

So with the new definiti= on for \mfunction, the user can now simply and elegantly write this:
<= div>=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
\= setupmathematics[functionstyle=3Dbold, functioncolor=3Dred, textstyle=3Dbol= d, textcolor=3Dgreen]
\starttext
=C2=A0 $\mfunction{Ars= inh} x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94

With that new \mfunction, ConTeXt users now have an equivalent macro to t= he LaTeX \operatorname macro of the amsopn package, which I think was very = missing.

Now, let us look at how the user can DEFI= NE his math function.

A. With the 1st definition o= f \mfunction (the one that doesn't include \mathnolop or \mathop), the = user can write this (notice again that we use \normalmathop \nolimits inste= ad of \mathnolop=E2=80=94or equivalently [nolop]=E2=80=94to avoid the conve= rsion of \rm to \mf that would make \setupmathematics[functionstyle=3D\rm] = without effect):
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94
\definemathcommand[arsinh]{\normalmathop{\mfunction{Ars= inh}}\nolimits}
\setupmathematics[functionstyle=3Dbold, functionc= olor=3Dred, textstyle=3Dbold, textcolor=3Dgreen]
\starttext
=
=C2=A0 $\arsinh x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94

or, alternatively this (if the user wants also to define a= label text for his function):
=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94
\setupmathlabeltext[arsinh=3DArsinh]
\definemathcommand[arsinh]{\normalmathop{\mfunctionlabeltext{arsinh}= }\nolimits}
\setupmathematics[functionstyle=3Dbold, functioncolor= =3Dred, textstyle=3Dbold, textcolor=3Dgreen]
\starttext
=C2=A0 $\arsinh x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
=
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
<= br>
assuming that \mfunctionlabeltext is defined the following wa= y (which I think is already the case in the last beta).

1st DEFINITION of \mfunctionlabeltext.
=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
\unexpanded\def\mfunction= labeltext#1{\mfunction{\mathlabeltext{#1}}}
=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94

Thus with the= 1st definition of \mfunction (and \mfunctionlabeltext), the definition of = a math function for the user is a bit complicated (he has to write \normalm= athop \nolimits in addition to \mfunction or \mfunctionlabeltext, unless Ha= ns decides to remove \let\rm\mf from his redefinition of \mathop in which c= ase the user just has to add the optional argument [nolop] instead of the v= erbose and hard to remember \normalmathop \nolimits).

<= div>B. With the 2nd definition of \mfunction (the one that includes \mathno= lop or \mathop), the user can write this:
=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94
\definemathcommand[arsinh]{\= mfunction{Arsinh}}
\setupmathematics[functionstyle=3Dbold, functi= oncolor=3Dred, textstyle=3Dbold, textcolor=3Dgreen]
\starttext
=C2=A0 $\arsinh x\ \text{and}\ n_{\mtext{air}}$.
\stoptex= t
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
=

or, alternatively this (if the user wants also to defin= e a label text for his function):
=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94
\setupmathlabeltext[arsinh=3DArsinh]<= /div>
\definemathcommand[arsinh]{\mfunctionlabeltext{arsinh}}
\setupmathematics[functionstyle=3Dbold, functioncolor=3Dred, textstyle=3Db= old, textcolor=3Dgreen]
\starttext
=C2=A0 $\arsinh x\ \= text{and}\ n_{\mtext{air}}$.
\stoptext
=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94

assumin= g that \mfunctionlabeltext is defined the following way (the additional opt= ional argument is for that of \mfunction).

2nd DEF= INITION of \mfunctionlabeltext.
=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94
\unexpanded\def\mfunctionlabeltext{\dosi= ngleempty\domfunctionlabeltext}
\def\domfunctionlabeltext[#1]#2%<= /div>
=C2=A0 {\iffirstargument
=C2=A0 =C2=A0 =C2=A0\mfunction= [#1]{\mathlabeltext{#2}}
=C2=A0 =C2=A0\else
=C2=A0 =C2= =A0 =C2=A0\mfunction{\mathlabeltext{#2}}
=C2=A0 =C2=A0\fi}
<= div>=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
<= br>
Thus with the 2nd definition of \mfunction (and \mfunctionlab= eltext), the definition of a math function for the user is easier (no need = to write \normalmathop \nolimits since it is taken into account in \mfuncti= on, and Hans doesn't have to remove \let\rm\mf from his redefinition of= \mathop). It confirms that the 2nd definition of \mfunction (and \mfunctio= nlabeltext) is the way to go.

However the command = \mfunctionlabeltext is unnecessary and inconsistent with the other ConTeXt = command \labeltext since it has a style attached to it, so may confuse the = user. The direct command \mathlabeltext (the math equivalent of \labeltext)= should be preferred. Therefore I think Hans should remove \mfunctionlabelt= ext from math-ini.mkiv and the user should use \mfunction{\mathlabeltext } = when needed:
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94
\setupmathlabeltext[arsinh=3DArsinh]
\definemath= command[arsinh]{\mfunction{\mathlabeltext{arsinh}}}
\setupmathema= tics[functionstyle=3Dbold, functioncolor=3Dred, textstyle=3Dbold, textcolor= =3Dgreen]
\starttext
=C2=A0 $\arsinh x\ \text{and}\ n_{= \mtext{air}}$.
\stoptext
=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94

But we can go a little= further in user friendliness by wrapping the \mfunction in a new macro, th= at we should name \definemathfunction to be consistent with the other macro= s (\definemathcommand, \definemathsymbol, \definemathcharacter, etc.). The = possibility to choose between \mathop (synonym: \mathlimop) and \mathnolop= =E2=80=94which should be the default=E2=80=94is once more given to the user= with the optional argument [op] (synonym: [limop]) to be consistent with t= he ConTeXt syntax. The macro is defined as follows.

DEFINITION of \definemathfunction.
=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94
\unexpanded\def\definemathfunction= {\dodoubleempty\dodefinemathfunction}
\def\dodefinemathfunction[#= 1][#2]#3%
=C2=A0 {\ifsecondargument
=C2=A0 =C2=A0 =C2= =A0\definemathcommand[#1]{\mfunction[#2]{#3}}
=C2=A0 =C2=A0\else<= /div>
=C2=A0 =C2=A0 =C2=A0\definemathcommand[#1]{\mfunction{#3}}
<= div>=C2=A0 =C2=A0\fi}
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94

Notice that we use again \normalma= thop for the same reasons as before. That new \definemathfunction macro now= allows the user to write this:
=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94
\definemathfunction[arsinh]{arsinh}
\setupmathematics[functionstyle=3Dbold, functioncolor=3Dred, textstyl= e=3Dbold, textcolor=3Dgreen]
\starttext
=C2=A0 $\arsinh= x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94

o= r, alternatively this (if the user wants also to define a label text for hi= s function):
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94
\setupmathlabeltext[arsinh=3DArsinh]
\definemath= function[arsinh]{\mathlabeltext{arsinh}}
\setupmathematics[functi= onstyle=3Dbold, functioncolor=3Dred, textstyle=3Dbold, textcolor=3Dgreen]
\starttext
=C2=A0 $\arsinh x\ \text{and}\ n_{\mtext{air}= }$.
\stoptext
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94

With that new \definemathfuncti= on, ConTeXt users now have an equivalent macro to the LaTeX \DeclareMathOpe= rator macro of the amsopn package, which I think was very missing as well.<= /div>

The math functions defined in math-def.mkiv should= of course use \mfunction{\mathlabeltext } instead of the old \mfunctionlab= eltext, or the new macro \definemathfunction:
=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
\definemathcommand[cos]{\= mfunction{\mathlabeltext{cos}}} % Or \definemathcommand[cos]{\mfunction[nol= op]{\mathlabeltext{cos}}}, it is the same.
\definemathcommand[det= ]{\mfunction[limop]{\mathlabeltext{det}}}
\definemathcommand[diff= ]{\normalmathop{\text{\mathfunctionstyle d}}\mathopen{}}
%etc.
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94

or
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94
\definemathfunction[cos]{\mathlabeltext{cos}} % Or \= definemathfunction[cos][nolop]{\mathlabeltext{cos}}, it is the same.
<= div>\definemathfunction[det][limop]{\mathlabeltext{det}}
\definem= athcommand[diff]{\normalmathop{\text{\mathfunctionstyle d}}\mathopen{}} % I= t is a special function so it should still be treated with the more general= \definemathcommand.
%etc.
=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94

Notice the removal = of [nolop] and [limop] which are already present in \mfunction and \mfuncti= on[limop] respectively (since we now use the 2nd definition of \mfunction f= or all the reasons we gave above).

Now before conc= luding, here is a little example illustrating the new mechanism of Hans (fu= nctionstyle, functioncolor, textstyle and textcolor keys in \setupmathemati= cs) of which I improved the consistency and simplicity of the related macro= s (\mtext and \mfunction, and the new \definemathfunction) in practical use= . In this example as I still don't have access to the last beta I didn&= #39;t use the new keys of \setupmathematics (functionstyle, textstyle) but = local definitions. For Aditya, this time the given example works correctly = contrary to my last post where I realized afterwards that \rm was not worki= ng in \setupmathematics because of the use of \mathop which converts it to = \mf (hence my use of \normalmathop in this post as explained earlier).

EXAMPLE.
=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94
\define\mathtextstyle{\rm\tf}
= \define[1]\mtext{\text{\mathtextstyle #1}}

\define= \mfunction{\dosingleempty\domfunction}
\def\domfunction[#1]#2{%
=C2=A0 =C2=A0 \iffirstargument
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 \doifelse{#1}{op}{\normalmathop{\text{\mathfunctionstyle #2}}}{\doifels= e{#1}{limop}{\normalmathop{\text{\mathfunctionstyle #2}}}{\normalmathop{\te= xt{\mathfunctionstyle #2}}\nolimits}}
=C2=A0 =C2=A0 \else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \normalmathop{\text{\mathfunctionstyle #2}}\= nolimits
=C2=A0 =C2=A0 \fi}

\define\math= functionstyle{\rm\tf}
\define\definemathfunction{\dodoubleempty\d= odefinemathfunction}
\def\dodefinemathfunction[#1][#2]#3{%
<= div>=C2=A0 =C2=A0 \ifsecondargument
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \= definemathcommand[#1]{\mfunction[#2]{#3}}
=C2=A0 =C2=A0 \else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \definemathcommand[#1]{\mfunction{#3}}
=C2=A0 =C2=A0 \fi}

\setupmathlabeltext[ar= sinh=3DArsinh]
\definemathfunction[arsinh]{\mathlabeltext{arsinh}= }

\starttext
\startbuffer
=C2= =A0 =C2=A0 $\arsinh x\ \text{and}\ n_{\mtext{air}}$
\stopbuffer

\defineparagraphs[myparagraphs][n=3D5, rule=3Don]
\setupparagraphs[myparagraphs][1][width=3D\dimexpr 0.3\textwidth\r= elax]
\setupparagraphs[myparagraphs][2][width=3D\dimexpr 0.3\text= width\relax]
\setupparagraphs[myparagraphs][3][width=3D\dimexpr 0= .3\textwidth\relax]

\section{{\tt \backslash setup= mathematics[functionstyle=3D\backslash rm\backslash tf,textstyle=3D\backsla= sh rm\backslash tf]} (default setup)}
\define\mathfunctionstyle{\= rm\tf}
\define\mathtextstyle{\rm\tf}

\st= artmyparagraphs
\switchtobodyfont[rm]
{\tt \backslash s= witchtobodyfont[rm]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\p= ar
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \back= slash sl}: {\sl \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuf= fer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt= \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[ss]
{\tt \backslash switchtobod= yfont[ss]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash sl}:= {\sl \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslas= h bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[tt]
{\tt \backslash switchtobodyfont[tt]}= \crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \b= ackslash it}: {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \get= buffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{= \tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\b= s \getbuffer}\par
\stopmyparagraphs

\sec= tion{{\tt \backslash setupmathematics[functionstyle=3D\backslash tf,textsty= le=3D\backslash tf]}}
\define\mathfunctionstyle{\tf}
\d= efine\mathtextstyle{\tf}

\startmyparagraphs
<= div>\switchtobodyfont[rm]
{\tt \backslash switchtobodyfont[rm]}\c= rlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \bac= kslash it}: {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \getbu= ffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\t= t \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\bs = \getbuffer}\par
\nextmyparagraphs

\switc= htobodyfont[ss]
{\tt \backslash switchtobodyfont[ss]}\crlf
<= div>{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}= : {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par<= /div>
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backsla= sh bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer= }\par
\nextmyparagraphs

\switchtobodyfon= t[tt]
{\tt \backslash switchtobodyfont[tt]}\crlf
{\tt \= backslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \ge= tbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
= {\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\= bi \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\stopmyparagraphs

\section{{\tt \backslash s= etupmathematics[functionstyle=3D\backslash bf,textstyle=3D\backslash bf]}}<= /div>
\define\mathfunctionstyle{\bf}
\define\mathtextstyle{\b= f}

\startmyparagraphs
\switchtobodyfont[= rm]
{\tt \backslash switchtobodyfont[rm]}\crlf
{\tt \ba= ckslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \getb= uffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\= tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\bi= \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
<= div>\nextmyparagraphs

\switchtobodyfont[ss]
<= div>{\tt \backslash switchtobodyfont[ss]}\crlf
{\tt \backslash tf= }: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par=
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backsl= ash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffe= r}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextm= yparagraphs

\switchtobodyfont[tt]
{\tt \= backslash switchtobodyfont[tt]}\crlf
{\tt \backslash tf}: {\tf \g= etbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bf}: {= \bf \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\stopmyparagraph= s
\stoptext
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94

CONCLUSION. =E2=80=94 It all comes= down to the choice of the best user interface for math functions and math = texts (usually used as subscripts of variables). Their styles and colors is= handled with \setupmathematics. There are two choices of user interface:
1. $\normalmathop{\mfunction{Arsinh}}\nolimits x\ \text{and}\ n_{\= mtext{air}}$.
2. $\mfunction{Arsinh} x\ \text{and}\ n_{\mtext{air= }}$.

First, the default functionstyle and textstyl= e in \setupmathematics should be \rm\tf (the text mode equivalent of \mathu= pright, as we are always in text mode thanks to the \text hardcoded in \mfu= nction and \mtext).

Then, in the 1st solution \nor= malmathop is used instead of \mathop because the latter is modified by ConT= eXt to convert \rm to \mf, which makes \setupmathematics[functionstyle=3D\r= m] without effect.

The 2nd solution is obviously w= ay cleaner, that is why I think it should be preferred. The implementation = is given in my '2nd DEFINITION of \mfunction' for replacing the exi= sting definition in math-ini.mkiv:
=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94
\unexpanded\def\mfunction{\dosingleem= pty\domfunction}
\def\domfunction[#1]#2%
=C2=A0 {\iffir= stargument
=C2=A0 =C2=A0 =C2=A0\doifelse{#1}{op}{\normalmathop{\t= ext{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}}{\doif= else{#1}{limop}{\normalmathop{\text{\usemathematicsstyleandcolor\c!function= style\c!functioncolor#2}}}{\normalmathop{\text{\usemathematicsstyleandcolor= \c!functionstyle\c!functioncolor#2}}\nolimits}}
=C2=A0 =C2=A0\els= e
=C2=A0 =C2=A0 =C2=A0\normalmathop{\text{\usemathematicsstyleand= color\c!functionstyle\c!functioncolor#2}}\nolimits
=C2=A0 =C2=A0\= fi}
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94

We also saw that \mfunctionlabeltext is inconsistent= with ConTeXt \labeltext because the former has a style attached to it, so = \mfunctionlabeltext should be removed from math-ini.mkiv and \mfunction{\ma= thlabeltext } should be used instead when needed.

= To go even further in userfriendlyness, we the new macro \definemathcommand= should be added in math-ini.mkiv:
=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94
\unexpanded\def\definemathfunction{\d= odoubleempty\dodefinemathfunction}
\def\dodefinemathfunction[#1][= #2]#3%
=C2=A0 {\ifsecondargument
=C2=A0 =C2=A0 =C2=A0\d= efinemathcommand[#1]{\mfunction[#2]{#3}}
=C2=A0 =C2=A0\else
=
=C2=A0 =C2=A0 =C2=A0\definemathcommand[#1]{\mfunction{#3}}
= =C2=A0 =C2=A0\fi}
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94

Finally, with this new \mfunction def= inition and the removal of the misleading \mfunctionlabeltext, the function= s defined in math-def.mkiv should be rewrite as:
=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
\definemathcommand[cos= ]{\mfunction{\mathlabeltext{cos}}} % Or \definemathcommand[cos]{\mfunction[= nolop]{\mathlabeltext{cos}}}, it is the same.
\definemathcommand[= det]{\mfunction[limop]{\mathlabeltext{det}}}
\definemathcommand[d= iff]{\normalmathop{\text{\mathfunctionstyle d}}\mathopen{}}
%etc.=
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
=

or
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94
\definemathfunction[cos]{\mathlabeltext{cos}} % O= r \definemathfunction[cos][nolop]{\mathlabeltext{cos}}, it is the same.
\definemathfunction[det][limop]{\mathlabeltext{det}}
\defi= nemathcommand[diff]{\normalmathop{\text{\mathfunctionstyle d}}\mathopen{}} = % It is a special function so it should still be treated with the more gene= ral \definemathcommand.
%etc.
=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94

ConTeXt users ar= e now provided, if Hans agrees to implement the code given in this conclusi= on, with three extremely useful macros:
=E2=80=94 \mtext (that sh= ould be used for all math texts such as subscripts of variables):
=C2=A0 $n_{\mtext{air}}$;
=E2=80=94 \mfunction (the equivalent o= f LaTeX \operatorname macro of the amsopn package):
=C2=A0 $\mfun= ction{Arsinh} x$
=C2=A0 $\mfunction[op]{Arsinh} x$ or equivalentl= y $\mfunction[limop]{Arsinh} x$;
=E2=80=94 \definemathfunction (t= he equivalent of LaTeX \DeclareMathOperator macro of the amsopn package):
=C2=A0 \definemathfunction[arsinh]{Arsinh} $\arsinh x$
= =C2=A0 \definemathfunction[arsinh][op]{Arsinh} $\arsinh x$ or equivalently = \definemathfunction[arsinh][limop]{Arsinh} $\arsinh x$.


M= aggyero
--20cf302237891567dc0515f89725-- --===============0915164369== 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= --===============0915164369==--