I want to define a new command to format \mathbb{E}
in the same way as \sum
- same size in display/inline formulae, and same treatment of sub/superscripts. The following seems to work...
\newcommand*{\bbe}{%
\ifinner
\mathbb{E}%
\else
\mathop{\displaystyle\vcenter{\hbox{\huge$\mathbb{E}$}}}%
\fi
}
...except that in display formulae, when inside automatically sized brackets (e.g. \left( \bbe_x \right)
) it reverts to treating it as if it were in an inline formula (so smaller size, subscripts to the right not beneath).
I'm not sure what's causing this issue; any advice would be greatly appreciated!
`
, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the “code” button (with “{}” on it). As I did in my edit. Furthermore I cleaned you definition to make it more readable …