![](https://secure.gravatar.com/avatar/3d131c6a351a6b0092c19b389bd99cf0.jpg?s=120&d=mm&r=g)
Hi,
On Mon, May 1, 2023 at 5:27 PM Stefan Haller via ntg-context
Hi all,
I wanted to define a custom math function (similar to log etc.) for argmax. However, I wanted to have a small space between "arg" and "max" and limits should work properly. I am using a up-to-date LMTX installation.
Without the first constraint it's easy:
% old way: \definemathcommand[argmax][limop]{\mfunction[argmax]} % new way, discoverd by looking into math-def.mkxl \definemathfunction[argmax]
However, both methods do not work if I want to have "arg\,max" printed (error about \endcsname missing). With mkiv the first method works and can also be found in the wiki[1].
What's the current way to define such a custom math function?
Thanks! Stefan
This works here (but maybe there should be a simpler way): \definemathfunction [argmax] [mathlimits=auto] \setupmathlabeltext [en] [argmax=arg\sixperemspace max] \startTEXpage[offset=1ts] \im{ \argmax_{a\in A} f(a) } \blank[big] \dm{ \argmax_{a\in A} f(a) } \stopTEXpage /Mikael