The calculation of the correct parentheses size fails when a letter with a \hat
accent is in between:
\left(\hat{x}\right)
Manually specifying the size of the brackets would be a lot of work as they are part of a command (statistics: expected value):
\newcommand{\E}[1]{\mathbb{E}\left[{#1}\right]}
Is there a way to modify the command to produce correctly-sized brackets?
Meta: Is there a way to have LaTeX code converted to images? Maybe it's that obvious that the help page do not mention it …
Best Answer
This is another case showing that automatic resizing with
\left
and\right
should be used with care. It gives unwanted spaces in some cases and wrong results in others like this.The best thing I can suggest you is to avoid
\left
and\right
for this command or at least to use the facilities offered bymathtools
.For example, you could define
so that
will give the following result (
\left
and\right
are applied only when the you call\E*
instead of\E
):One can also specify explicit size of the brackets with an optional argument:
will produce slightly bigger brackets than $\E{A}$.