How to write Mathematical expectation and Probability in the following form

What commands should I use to type the following operators and ?

This looks just like a sans serif font to me. So I would do the following.

% arara: pdflatex

\documentclass{article}
\newcommand*{\expect}{\mathsf{E}}
\newcommand*{\prob}{\mathsf{P}}

\begin{document}
$\expect X = \int\displaylimits_{\Omega} X(\omega)\prob}(d\omega)$
\end{document}


• The \displaylimits is just used in order to get the first image of your referred homepage. I would leave it away.
• I have not checked, if the new commands are defined by other packages. You could rename them, if you encounter any clash with these.
• d\omega would look better as \mathrm{d}\omega in my eyes. Matter of taste.

• perhaps \DeclareMathOperator, rather than \newcommand*? – Bernard Dec 9 '14 at 10:26
• @Bernard One could do that, but I can't see the advantage right know. Could you elaborate a bit more on this? – LaRiFaRi Dec 9 '14 at 11:28
• Finer tuning of horizontal spacing (parentheses and aother delimiters). Most of the time the difference will be infinitesimal, of course. Similarly, there can be spacing problems with mathrm{d}, and there a solution from @egreg (don't remember in which thread): \AtBeginDocument{\renewcommand*{\d}{\mathop{\kern0pt\mathrm{d}}\!{}}}%  – Bernard Dec 9 '14 at 12:04