Code: Select all
\operatorname{blah}
Code: Select all
\DeclareMathOperator{\foo}{blah}
Here's an example, I hope you can tell me how do you decide what goes upright (as an operator) and what keeps italic:
Code: Select all
$\displaystyle \int f(x) \, dx \quad d(x,y) \quad \operatorname{d}(x,y) \quad \mathit{Var}(x) \quad \operatorname{Var}(x) \quad P(X=x) \quad \operatorname{P}(X=x) \quad E[X] \quad \operatorname{E}[X] \quad \mathit{Bin}(n,p) \quad \operatorname{Bin}(n,p) \quad B(\ell,\varepsilon) \quad \operatorname{B}(\ell,\varepsilon) \quad O(x) \quad \operatorname{O}(x)
$
Which is the correct way to typeset all this function/operators? What is what we call operator in LaTeX? Any convincing law or rule to choose if writing as an operator (upright) or leave it italic?
Thank you in advance.