How do I do a one-shot MathOperator?

You are looking for \mathop: http://www.giss.nasa.gov/tools/latex/stackrel.html , for example \mathop{\sum \sum}_{i,j=1}^{N} a_i a_j.

If you really want to do exactly what amsmath does then \operatorname is a better choice.


You can go back to the TeXbook and do it the Knuth way, using \mathop

\def\limsup{\mathop{\overline{\rm lim}}}

\[\limsup\]

Edit

If you really only want a one shot, you can type:

\[\mathop{\overline{lim}}_{n=1}\limits\]

I would rather have something like:

\def\oneshot#1{\mathop{\mathrm{#1}}\limits}

\[\oneshot{Diag}_{n=1}^m\]

One can extend the command \oneshot to the \nolimits version for consistency. Why I prefer a two shot approach i.e, defining it first and then using it, is that good software practice dictates that you should try and re-use code. You could stick the command in your master style file, if you have one. It will also with a shorter name make reading the LaTeX source easier.

Would you really use an operator only once in a mathematics write-up?