{"id":473,"date":"2011-07-11T15:05:13","date_gmt":"2011-07-11T15:05:13","guid":{"rendered":"https:\/\/blogs.mathworks.com\/desktop\/2011\/07\/11\/latex-formula-publishing\/"},"modified":"2011-07-13T12:07:33","modified_gmt":"2011-07-13T12:07:33","slug":"latex-formula-publishing","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2011\/07\/11\/latex-formula-publishing\/","title":{"rendered":"LaTeX Formula Publishing"},"content":{"rendered":"<p>A long time ago the Publish team added the ability to include LaTeX formulas in published MATLAB files. This was seen as a nice way to include pretty-formatted formulas and equations without having to resort to ASCII art. In order to make sure the published formulas are cross-browser compatible, the generated formulas are included into the published document as images. <\/p>\n<p>New in MATLAB R2011a is the ability to include inline LaTeX formulas. Previously they were only available in their own block. An inline LaTeX formula is surrounded by single &#8220;<tt>$<\/tt>&#8220;&#8216;s, and a block is separated by double &#8220;<tt>$$<\/tt>&#8220;&#8216;s. Sample markup can also be added using the top-level Cell Menu: &#8220;Cell -> Insert Text Markup -> LaTeX Inline Math&#8221; for inline markup and &#8220;Cell > Insert Text Markup > LaTeX Display Math&#8221; for block markup.<\/p>\n<p>In this example I&#8217;ve included both Inline and Display Block LaTeX formulas:<\/p>\n<pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\"><span style=\"color: #228B22\">%<\/span>\r\n<span style=\"color: #228B22\">% Some people's favorite equation is the quadratic formula: $x = \\frac{-b<\/span>\r\n<span style=\"color: #228B22\">% \\pm \\sqrt{b^2 - 4ac}}{2a}$. But some people prefer the Fundamental Theorem<\/span>\r\n<span style=\"color: #228B22\">% of Calculus:<\/span>\r\n<span style=\"color: #228B22\">%<\/span>\r\n<span style=\"color: #228B22\">% $$f(x) = {\\mathrm{d} \\over \\mathrm{d}x} \\int\\limits_a^x f(s)\\mathrm{d}s$$<\/span>\r\n<span style=\"color: #228B22\">%<\/span><\/pre>\n<p>Here are the published results:<\/p>\n<div style=\"padding: 10px; border:1px solid\">\n<p>Some people&#8217;s favorite equation is the quadratic formula: <img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_publishing\/latex_eq47174.png\"> . But some people prefer the Fundamental Theorem of Calculus:\n   <\/p>\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_publishing\/latex_eq98180.png\"> <\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A long time ago the Publish team added the ability to include LaTeX formulas in published MATLAB files. This was seen as a nice way to include pretty-formatted formulas and equations without having&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2011\/07\/11\/latex-formula-publishing\/\">read more >><\/a><\/p>\n","protected":false},"author":38,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[136,137,135,138,139,134],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/473"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/comments?post=473"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/473\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}