# Declare Math Operator

For some times I've faced the problem with an absence of an operator \argmax and one should use arg\max which is not nice. Usually in LaTeX one uses DeclareMathOperator. In MathJaX help on the right side of the page this operator is also described - but it doesn't work when you try to write the post on the site. Is it possible to fix it?

The \DeclareMathOperator macro makes the argument a math operator with limits above and below. This can be achieved on an ad-hoc basis by using the \mathop{...} command, which turns what is inside the declaration into a mathoperator, followed by the \limits command, which will place limits above and below (in essence, you are just typing out what the DeclareMathOperator does).
So, for example, you can do $\mathop{\arg\,\max}\limits_x$ to produce $\mathop{\arg\,\max}\limits_x$.
I know it's a chore and not necessarily a good solution, but at least you get a good outcome. (Also, I suspect that enabling macros like \DeclareMathOperator occurs at the Mathjax level, rather than the stackexchange level, but I could be wrong).
• It seems to me that you're right and thanks anyway for the solution. On the other hand, Declare[...] is presented in MathJaX help (which indeed seems to be just a LaTeX howto) - that's why I thought that it's realized in MathJaX. – Ilya Apr 11 '11 at 17:12
• @Gortaur: Well, for me the \DeclareMathOperator environment works. You just have to make sure you put it inside a math environment (that is, between $ or $\$ or \\[) so that it can be seen by the MathJax engine. – t.b. Apr 11 '11 at 17:21