{"id":804,"date":"2011-12-18T14:02:51","date_gmt":"2011-12-18T18:02:51","guid":{"rendered":"http:\/\/hargaden.com\/enda\/?p=252"},"modified":"2021-04-17T15:06:46","modified_gmt":"2021-04-17T15:06:46","slug":"latex-mathematical-expectation-shortcut","status":"publish","type":"post","link":"https:\/\/hargaden.com\/enda\/latex-mathematical-expectation-shortcut\/","title":{"rendered":"LaTeX mathematical expectation shortcut"},"content":{"rendered":"<p>I find it cumbersome to typeset \\({mathbb E}[x]\\), &#8220;the expectation of x&#8221;, in LaTeX. I&#8217;ve simplified the code a little.<\/p>\n<p>First, include these lines in the header of your document:<\/p>\n<pre style=\"font-size: 21px; font-style: normal; font-weight: 300;\"><code>usepackage{amsmath}\nusepackage{amsfonts}\nnewcommand{e}[1]{{mathbb E}left[ #1 right]}<br><\/code><\/pre>\n<p>This calls on the necessary packages and makes a new function <tt style=\"font-style: inherit; color: var( --e-global-color-text );\">e<\/tt> which takes one argument. The outcome is that argument within appropriately-sized square brackets and prefaced with the expectation sign.<\/p>\n<p>For example, the code <tt>e{x^2}=10<\/tt> results in \\({mathbb E}[x^2]=10\\).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I find it cumbersome to typeset , &#8220;the expectation of x&#8221;, in LaTeX. I&#8217;ve simplified the code a little. First, include these lines in the header of your document: usepackage{amsmath} usepackage{amsfonts} newcommand{e}[1]{{mathbb E}left[ #1 right]}&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-804","post","type-post","status-publish","format-standard","hentry","category-latex"],"_links":{"self":[{"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/posts\/804","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/comments?post=804"}],"version-history":[{"count":3,"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/posts\/804\/revisions"}],"predecessor-version":[{"id":1204,"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/posts\/804\/revisions\/1204"}],"wp:attachment":[{"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/media?parent=804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/categories?post=804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hargaden.com\/enda\/wp-json\/wp\/v2\/tags?post=804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}