Syntax#
\operatornames*starm:O{name}operator nameArgspec s m:O — one optional and one mandatory argument. Reading argspecs
Common tasks#
How to write a multi-letter operator#
How to write an operator with limits#
The star form places limits like \lim; the plain form keeps side scripts.
How to write a named map#
Examples#
In TeXForm#
TeXForm parses this entry as prefix syntax; the package determines its argument specification.
Rewrite plain operatorname arguments to equivalent base named-function or named-operator commands.
\operatorname{#1} \#1Equivalent forms#
\DeclareMathOperator{\myop}{name}approximateDefines a new command that behaves like
\operatorname{name}\mathop{\mathrm{#2}}approximateOperator spacing and font style are applied, similar to wrapping in
\mathopand\mathrm, but\operatornamecorrectly handles limits positioning according to the star argument.
Test cases#
| Input | Case | MathJax | KaTeX | XeTeX |
|---|---|---|---|---|
\operatorname{a} | Positive · baseline | Pass | Pass | Pass |
\operatorname*{a} | Positive · vary:s[0] | Pass | Pass | Pass |
\operatorname a | Positive · bare[1] | Pass | Pass | Pass |