Math & ScienceWhat is an operator (\operatorname{…}) and what is not

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
yoblanco
Posts: 4
Joined: Fri Jun 08, 2012 2:09 am

What is an operator (\operatorname{…}) and what is not

Post by yoblanco »

My question is about when should I use upright roman

Code: Select all

\operatorname{blah}
or in the whole document with

Code: Select all

\DeclareMathOperator{\foo}{blah}
to 'name' a function.

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)
$
d(x,y) means the distance, Var the variance of a distribution, P the probability, E the average (or mean of a distribution), Bin the binomial distribution, B the ball with center l and radius epsilon, O the http://en.wikipedia.org/wiki/Big_O_notation.

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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

What is an operator (\operatorname{…}) and what is not

Post by cgnieder »

This isn't really a LaTeX question but a question of definition and (typographical) mathematical conventions. Maybe you'll find some insight in mathematics into type.

Regards
site moderator & package author
yoblanco
Posts: 4
Joined: Fri Jun 08, 2012 2:09 am

What is an operator (\operatorname{…}) and what is not

Post by yoblanco »

Good book, but it only say that one should know what goes upright and what doesn't. May be it's not absolute LaTeX related, but I think the question what does LaTeX understands as math operator? is related, and someone can add extra info about what should and what shouldn't be an operator.

Thank you for your answer.
Post Reply