{"id":1057,"date":"2011-07-06T20:39:31","date_gmt":"2011-07-06T18:39:31","guid":{"rendered":"http:\/\/raftaman.net\/?p=1057"},"modified":"2021-05-15T11:46:39","modified_gmt":"2021-05-15T09:46:39","slug":"typesetting-formuals-with-mathjax","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=1057","title":{"rendered":"Typesetting formuals with MathJax"},"content":{"rendered":"<p>Most hosting providers don&#8217;t have <a href=\"http:\/\/en.wikipedia.org\/wiki\/LaTeX\">LaTeX<\/a> packages installed on their servers and installing LaTeX yourself is usually only possible on rootservers, which are quite a bit more expensive (and therefore much less common) than regular hosting plans.<\/p>\n<p>However, there is a great project called <strong><a href=\"http:\/\/www.mathjax.org\/\">MathJax<\/a><\/strong>, that enables you to display formulas directly inside your wordpress posts without the need to install any LaTeX packages on your server. While you can install the javascript that is used to typeset your formula from either LaTeX or <a href=\"http:\/\/en.wikipedia.org\/wiki\/Mathml\">MathML<\/a> code locally, the easiest way to use MathJax is probably to their <strong>content delivery network<\/strong>. For even more convenience, there is even a <a href=\"http:\/\/wordpress.org\/extend\/plugins\/mathjax-latex\/\">wordpress plugin<\/a> that makes typesetting formulas easy as pie.<\/p>\n<p>First, enable the CDN option in <em>MathJax-Latex Plugin Options<\/em>:<\/p>\n<div id=\"attachment_1062\" style=\"width: 418px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/possiblelossofprecision.net\/wordpress\/wp-content\/uploads\/2011\/07\/MathJax-LatexPluginOptions.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1062\" src=\"https:\/\/possiblelossofprecision.net\/wordpress\/wp-content\/uploads\/2011\/07\/MathJax-LatexPluginOptions.jpg\" alt=\"MathJax-LatexPluginOptions\" title=\"MathJax-LatexPluginOptions\" width=\"408\" height=\"654\" class=\"size-full wp-image-1062\" srcset=\"https:\/\/possiblelossofprecision.net\/wordpress\/wp-content\/uploads\/2011\/07\/MathJax-LatexPluginOptions.jpg 408w, https:\/\/possiblelossofprecision.net\/wordpress\/wp-content\/uploads\/2011\/07\/MathJax-LatexPluginOptions-343x550.jpg 343w\" sizes=\"auto, (max-width: 408px) 100vw, 408px\" \/><\/a><p id=\"caption-attachment-1062\" class=\"wp-caption-text\">Enable &quot;Use MathJax CDN Server&quot; and save the changes<\/p><\/div>\n<p>You can now use regular LaTeX code within your post:<\/p>\n<p><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;&#x5B;latex] S = \\frac{1}{(1 - P) + \\frac{P}{N}}\\leq\\frac{1}{1-P} &#x5B;\/latex]]\r\n<\/pre>\n<\/p>\n<p>will be typesettet as <\/p>\n<p><center>\\(S = \\frac{1}{(1 &#8211; P) + \\frac{P}{N}}\\leq\\frac{1}{1-P}\\)<\/center><\/p>\n<p>For a more detailed explanation, have a look at the <a href=\"http:\/\/wordpress.org\/extend\/plugins\/mathjax-latex\/\">plugin&#8217;s description<\/a>.<\/p>\n<p>Of course, there are quite a few other CDNs, that will typeset your LaTeX formulas. But usually, they just render an image that can be embedded in your post or use flash.<br \/>\nThe main advantage of <strong>MathJax<\/strong> is that you get your formula as <strong>scalable instance<\/strong> that will fit nicely even if you resize your text. You can also access a formula&#8217;s source and <a href=\"http:\/\/www.mathjax.org\/demos\/copy-and-paste\/\">copy and paste<\/a> it into your math application (like <a href=\"http:\/\/en.wikipedia.org\/wiki\/Mathematica\">Mathematica<\/a>). Have you tried <strong>right-clicking the formula<\/strong> above?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most hosting providers don&#8217;t have LaTeX packages installed on their servers and installing LaTeX yourself is usually only possible on rootservers, which are quite a bit more expensive (and therefore much less common) than regular hosting plans. However, there is a great project called MathJax, that enables you to display formulas directly inside your wordpress posts without the need to&#8230; <a href=\"https:\/\/possiblelossofprecision.net\/?p=1057\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[42,3],"class_list":["post-1057","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-latex","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1057"}],"version-history":[{"count":56,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1057\/revisions"}],"predecessor-version":[{"id":1817,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1057\/revisions\/1817"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}