[Tex/LaTex] Declaring a math operator with cursor placement, e.g. expected value


I'd like to declare a new math operator \ev for representing the expected value, in the form: E<.> so that it looks like the following but with an argument


Is there a way of declaring a math operator to take an argument so that I can call it using \ev{.} or would a TeXShop macro be more appropriate that prints:

\mathrm{E}\left*<\right> where the cursor would be placed at *?

Best Answer

The best approach is with \DeclarePairedDelimiter of \mathtools:


This will allow you to say


The first will use the delimiters at natural size, in the following four lines the size of the delimiters is selected, the last line shows how to use automatic sizing (which should be used sparingly and only when really necessary).

Complete example:





enter image description here