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?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityIn 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
\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, 2021 at 11:49
\operatorname
either, normally you would declare a command like \cos using \DeclareMathOperator
but in either case you have the same choice \operatorname*
or \operatorname
with the star form controlling whether \nolimits
is used.
Oct 30, 2021 at 12:03
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.