# IOP Publication amsmath

I'm using iopart.cls file and need to define arg max operator. So I defined the following:

\newcommand{\argmax}[1]{\underset{#1}{\operatorname{arg}\,\operatorname{max}}\;}

This needs amsmath but since IOP provides \underset, I think it should be fine but this operator gives me undefined control sequence.

I would appreciate any ideas.

• Welcome to TeX SX! Isn't iopart.cls compatible with amsmath? – Bernard Apr 7 '19 at 20:59
• Hello Bernard, thank you for the response. In here: tex.stackexchange.com/questions/95817/…, someone suggested to put \expandafter\let\csname equation*\endcsname\relax and \expandafter\let\csname endequation*\endcsname\relax before \usepackage{amsmath}. I am not sure what it does but the error goes away. Do you have any idea about it? – eet Apr 7 '19 at 21:12
• But maybe it is not incompatible with amsopn.sty which defines \operatorname and \DeclareMathOperator? – Bernard Apr 7 '19 at 21:19

If neither amsopn.sty is compatible with iopart, you can define the command directly

\newcommand{\argmax}{\mathop{\mathrm{arg\,max}}}


that should be called like

 \argmax_{x\in X}f(x)


and will print the subscript underneath “argmax” when in display style.

If loading amsopn is possible, then you can just do

\usepackage{amsopn}

\DeclareMathOperator*{\argmax}{arg\,max}


and call \argmax the same way.