Defining a new log-like function in LaTeX

Use the \mathop command, as in:


Subscripts and superscripts on \diag will be placed below and above the function name, as they are on \lim. If you want your subscripts and superscripts always placed to the right, do:


The amsmath bundle (in its amsopn package, which is automatically loaded by amsmath) provides a command \DeclareMathOperator that takes does the same job as the first definition above. To create our original \diag command, one would say:


\DeclareMathOperator* declares the operator always to have its sub- and superscripts in the « “\limits” position ».

The amsopn command \operatorname allows you to introduce ad hoc operators into your mathematics, so \[ \operatorname{foo}(bar) \] typesets the same as

\[ \foo(bar) \]

As with \DeclareMathOperator there's a starred version \operatorname* for sub- and superscripts in the limits position.

(It should be noted that “log-like” was reportedly a joke on Lamport's part; it is of course clear what was meant.)

Source: Defining a new log-like function in LaTeX

4_domaines_specialises/mathematiques/definir_un_nouvel_operateur.txt · Dernière modification: 2021/06/15 08:54 par jejust
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0