# When to use \nolimits when defining a math operator?

In plain TeX, \cos is defined as \mathop {\rm cos}\nolimits but \gcd as \mathop {\rm gcd}.

In what case to use \nolimits when defining a math operator to be typeset in roman?

I'm afraid this is not a TeX question, but a math one. Anyway, this is the list in plain.tex:

\def\log{\mathop{\rm log}\nolimits}
\def\lg{\mathop{\rm lg}\nolimits}
\def\ln{\mathop{\rm ln}\nolimits}
\def\lim{\mathop{\rm lim}}
\def\limsup{\mathop{\rm lim\,sup}}
\def\liminf{\mathop{\rm lim\,inf}}
\def\sin{\mathop{\rm sin}\nolimits}
\def\arcsin{\mathop{\rm arcsin}\nolimits}
\def\sinh{\mathop{\rm sinh}\nolimits}
\def\cos{\mathop{\rm cos}\nolimits}
\def\arccos{\mathop{\rm arccos}\nolimits}
\def\cosh{\mathop{\rm cosh}\nolimits}
\def\tan{\mathop{\rm tan}\nolimits}
\def\arctan{\mathop{\rm arctan}\nolimits}
\def\tanh{\mathop{\rm tanh}\nolimits}
\def\cot{\mathop{\rm cot}\nolimits}
\def\coth{\mathop{\rm coth}\nolimits}
\def\sec{\mathop{\rm sec}\nolimits}
\def\csc{\mathop{\rm csc}\nolimits}
\def\max{\mathop{\rm max}}
\def\min{\mathop{\rm min}}
\def\sup{\mathop{\rm sup}}
\def\inf{\mathop{\rm inf}}
\def\arg{\mathop{\rm arg}\nolimits}
\def\ker{\mathop{\rm ker}\nolimits}
\def\dim{\mathop{\rm dim}\nolimits}
\def\hom{\mathop{\rm hom}\nolimits}
\def\det{\mathop{\rm det}}
\def\exp{\mathop{\rm exp}\nolimits}
\def\Pr{\mathop{\rm Pr}}
\def\gcd{\mathop{\rm gcd}}
\def\deg{\mathop{\rm deg}\nolimits}


and you can see that \nolimits is for symbols of function taking a fixed number of arguments (mostly one, but \hom takes two), whereas \limits is for functions with any number of arguments (or whose standard argument is a set).

Exception: the limit related symbols (which originated the others not taking \nolimits).

Trig functions are often used with superscripts You can see why \nolimits are needed as you don't want limits


$$\mathop{\rm cos}^2 + \mathop{\rm cos}^2 = 1$$

$$\mathop{\rm cos}\nolimits^2 + \mathop{\rm cos}\nolimits^2 = 1$$

\bye

• er I think one of those cos ought to be sin :-) Oct 27 at 22:51
• If you fixed it, you could also add $$\max_{x \in I} f(x)$$. Oct 28 at 19:31
• Will \operatorname save us having to introduce \nolimits? Oct 30 at 11:44
• @hesham I don't understand the question, you almost never need \nolimits in a document \cos is defined to use \nolimits, \operatorname is just an amsmath macro that defines commands using \mathop and optionally with \nolimits so it is the same as shown here. Oct 30 at 11:49
• @David Carlisle Thanks, that is what I needed to make sure of. That is, if we used \operatorname with amsmath , in that case we don't need to worry about adding \nolimits to display the square power properly. Oct 30 at 11:56

Use \nolimits when you do not want superscripts and subscripts to appear above and below the operator in display mode, the way they do for \lim, \sum or \int. An example is \cos^2 t, which should display as cos² t, and not with a 2 above the letter o.