[Tex/LaTex] How to define a math operator behaving like \lim or \sum with limits

math-modemath-operators

I want to define \ext to behave exactly like \lim.

I tried \newcommand{\ext}{{\mathrm{ext}}\,} but that doesn't behave exactly like \lim.

Best Answer

If you use amsmath, which is recommendable for math texts in any way, a similar definition to \lim is

\def\ext{\qopname\relax m{ext}}

since amsmath, specifically amsopn.sty, defines:

\def\lim{\qopname\relax m{lim}}