<style type="text/css">
    /* Add Social Bookmars Plugin By Aditya Subawa @ www.adityawebs.com */
    ul.aditya-social { list-style:none; margin:15px auto;display:inline-block; }
    ul.aditya-social li { display:inline; float:left; background-repeat:no-repeat; }
    ul.aditya-social li a { display:block; width:48px; height:48px; padding-right:10px; position:relative; text-decoration:none; }
    ul.aditya-social li a strong { font-weight:normal; position:absolute; left:20px; top:-1px; color:#fff; padding:3px; z-index:9999; text-shadow:1px 1px 0 rgba(0, 0, 0, 0.75); background-color:rgba(0, 0, 0, 0.7); -moz-border-radius:3px; -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); -webkit-border-radius:3px; -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); border-radius:3px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);}
    ul.aditya-social li.aditya-facebook { background-image:url("/wp-content/plugins/wp-add-socialbookmarks/images/facebook.png"); }
    ul.aditya-social li.aditya-twitter { background-image:url("/wp-content/plugins/wp-add-socialbookmarks/images/twitter.png"); }
    ul.aditya-social li.aditya-stumbleupon { background-image:url("/wp-content/plugins/wp-add-socialbookmarks/images/stumbleupon.png"); }
    ul.aditya-social li.aditya-digg { background-image:url("/wp-content/plugins/wp-add-socialbookmarks/images/digg.png"); }
    ul.aditya-social li.aditya-delicious { background-image:url("/wp-content/plugins/wp-add-socialbookmarks/images/delicious.png"); }
    ul.aditya-social li.aditya-yahoo { background-image:url("/wp-content/plugins/wp-add-socialbookmarks/images/yahoo.png"); }
    ul.aditya-social li.aditya-reddit { background-image:url("/wp-content/plugins/wp-add-socialbookmarks/images/reddit.png"); }
    ul.aditya-social li.aditya-technorati { background-image:url("/wp-content/plugins/wp-add-socialbookmarks/images/technorati.png"); }
    #aditya-cssanime:hover li { opacity:0.2; }
    #aditya-cssanime li { -webkit-transition-property: opacity; -webkit-transition-duration: 500ms;-moz-transition-property: opacity; -moz-transition-duration: 500ms; }
    #aditya-cssanime li a strong { opacity:0; -webkit-transition-property: opacity, top; -webkit-transition-duration: 300ms; -moz-transition-property: opacity, top; -moz-transition-duration: 300ms; }
    #aditya-cssanime li:hover { opacity:1; }
    #aditya-cssanime li:hover a strong { opacity:1; top:-10px; }
    /* Add Social Bookmarks Plugins By Aditya Subawa @ www.adityawebs.com */
    </style>

{"id":946,"date":"2012-10-04T16:03:39","date_gmt":"2012-10-04T16:03:39","guid":{"rendered":"http:\/\/johncanning.net\/wordpress\/?p=946"},"modified":"2012-10-04T16:03:39","modified_gmt":"2012-10-04T16:03:39","slug":"displaying-equations-online","status":"publish","type":"post","link":"http:\/\/johncanning.net\/wp\/?p=946","title":{"rendered":"Displaying equations online without using images"},"content":{"rendered":"<p><span style=\"color: #ff0000;\">This is an \"additional information\" page I have written for the forthcoming<\/span> <a href=\"http:\/\/statisticsforhumanities.net\">humanities statistics resource<\/a>. <span style=\"color: #ff0000;\">I was going to use images, but was unsatisfied with the results. This solution took me a while to work out, but I thought I would share it here as well.<\/span><\/p>\n<p>1. The easiest way to display an equation online is to use an image. If you create your equation in MS Word or Open Office you can use the snipping tool (In Windows 7) to make it into an image for website display.<\/p>\n<p>2. The better (though much harder) way is to use LaTeX Math and it\u00a0 requires some web development knowledge. This is not a comprehensive guide, but hopefully provides a good starting point.<\/p>\n<p>LaTeX is used for preparing academic articles, mainly in the sciences. LaTeX is actually a language which can be understood with practice. If you plan to use a lot of equations online is probably worth investing some time in becoming familiar with LaTeX.<\/p>\n<p>For example The LaTeX code for the correlation co-efficient is:<\/p>\n<pre>\nr=frac{{1}\/{n}{(x_1-bar{x})(y_1-bar{y})+(x_2-bar{x})(y_2-bar{y}) ... + .... (x_n-bar{x})(y_n-bar{y})}}{SD_x SD_y}\n<\/pre>\n<p>Which rendered in LaTeX produces:<\/p>\n<p>[ r=frac{{1}\/{n}{(x_1-bar{x})(y_1-bar{y})+(x_2-bar{x})(y_2-bar{y}) ... + .... (x_n-bar{x})(y_n-bar{y})}}{SD_x SD_y}].<\/p>\n<p>LaTeX looks complicated, but is actually surprising logical once you start to get the hang of it. A number of free open source <a title=\"TeX editors\" href=\"http:\/\/en.wikipedia.org\/wiki\/Comparison_of_TeX_editors\">LaTeX editors are available<\/a> and the results can be exported into .pdf format. However, the editors are not needed when displaying equations online.<\/p>\n<p>Unfortunately understanding LaTeX is not the only necessary step to publishing equations online. LaTeX is not html and will not work on a website without additional plugins.<span style=\"color: #800080;\">*<\/span> The statistics website I am developing is built in Drupal and uses the add-on module <a href=\"http:\/\/drupal.org\/project\/mathjax\">MathJax<\/a> to render the LaTeX online. It can be also used in WordPress (which I am using for this blog) and a variety of other applications.\u00a0 See the MathJax, Drupal or WordPress websites to find details of the installation process. <span style=\"color: #800080;\">*[Added 23\/10\/2012] I've since learnt that wordpress.com supports LaTeX natively, but I have not checked this.<\/span><\/p>\n<p><a title=\"LaTeX math\" href=\"ftp:\/\/ftp.ams.org\/ams\/doc\/amsmath\/short-math-guide.pdf\">Short Math Guide for LaTex <\/a>by Michael Downes (American Mathematical society website).<\/p>\n<p><a title=\"Mathjax\" href=\"http:\/\/www.mathjax.org\/\">Mathjax <\/a><\/p>\n<p><a title=\"Drupal Mathjax\" href=\"http:\/\/drupal.org\/project\/mathjax\">Mathjax drupal module<\/a><\/p>\n<p><a title=\"Wordpress Mathjax\" href=\"http:\/\/wordpress.org\/extend\/plugins\/mathjax-latex\/\">Mathjax WordPress.org plugin<\/a><\/p>\n<p><strong>Added 6th October 2012<\/strong><\/p>\n<p>As life would have it MathJax seems to have stopped working on my Drupal site. (It worked fine a couple of days back)\u00a0 However, this code at the top of any page where you wish to use LaTex does seem to be working now.<\/p>\n<p>I am grateful to the author of <a href=\"http:\/\/narnia.cs.ttu.edu\/drupal\/node\/129\">this website\u00a0 <\/a>for the code to place on the page.<\/p>\n<blockquote>\n<pre>&lt;script src=\"http:\/\/cdn.mathjax.org\/mathjax\/latest\/MathJax.js\" type=\"text\/javascript\"&gt;\n    MathJax.Hub.Config({\n        extensions: [\"tex2jax.js\",\"TeX\/AmsMath.js\",\"TeX\/AMSsymbols.js\"],\n        jax: [\"input\/TeX\",\"output\/HTML-CSS\"],\n        tex2jax: {\n            inlineMath: [ ['$','$'], [\"<span class='MathJax_Preview'><img src='http:\/\/johncanning.net\/wp\/wp-content\/plugins\/latex\/cache\/tex_de2fce482459a94c2af1ab3ac8b4257d.gif' style='vertical-align: middle; border: none; ' class='tex' alt=\"\" \/><\/span><script type='math\/tex'><\/script>\"] ],\n            displayMath: [ ['<span class='MathJax_Preview'><img src='http:\/\/johncanning.net\/wp\/wp-content\/plugins\/latex\/cache\/tex_433beb9a090abf694184e96d76b3046d.gif' style='vertical-align: middle; border: none; ' class='tex' alt=\"\" \/><\/span><script type='math\/tex'><\/script>'], [\"<p style='text-align:center;'><span class='MathJax_Preview'><img src='http:\/\/johncanning.net\/wp\/wp-content\/plugins\/latex\/cache\/tex_de2fce482459a94c2af1ab3ac8b4257d.gif' style='vertical-align: middle; border: none;' class='tex' alt=\"\" \/><\/span><script type='math\/tex;  mode=display'><\/script><\/p>\"] ],\n            processEscapes: true,\n        },\n        \"HTML-CSS\": { availableFonts: [\"TeX\"] }\n    });\n&lt;\/script&gt;<\/pre>\n<\/blockquote>\n\n\n<ul class=\"aditya-social\" id=\"aditya-cssanime\">\n<li class=\"aditya-twitter\"><a href=\"http:\/\/twitter.com\/share?url=http%3A%2F%2Fjohncanning.net%2Fwp%2F%3Fp%3D946&amp;url=http%3A%2F%2Fjohncanning.net%2Fwp%2F%3Fp%3D946\" target=\"_blank\" rel=\"nofollow\" title=\"Twitter\"><img decoding=\"async\" src=\"http:\/\/johncanning.net\/wp\/wp-content\/plugins\/wp-add-social-bookmarks\/images\/twitter.png\" alt=\"Twitter\" title=\"Twitter\" \/><\/a><\/li>\n<li class=\"aditya-delicious\"><a href=\"http:\/\/del.icio.us\/post?url=http%3A%2F%2Fjohncanning.net%2Fwp%2F%3Fp%3D946&amp;title=Displaying+equations+online+without+using+images\" target=\"_blank\" rel=\"nofollow\" title=\"del.icio.us\"><img decoding=\"async\" src=\"http:\/\/johncanning.net\/wp\/wp-content\/plugins\/wp-add-social-bookmarks\/images\/delicious.png\" alt=\"del.icio.us\" title=\"del.icio.us\" \/><\/a><\/li>\n<li class=\"aditya-digg\"><a href=\"http:\/\/digg.com\/submit?phase=2&amp;url=http%3A%2F%2Fjohncanning.net%2Fwp%2F%3Fp%3D946&amp;title=Displaying+equations+online+without+using+images\" target=\"_blank\" rel=\"nofollow\" title=\"Digg\"><img decoding=\"async\" src=\"http:\/\/johncanning.net\/wp\/wp-content\/plugins\/wp-add-social-bookmarks\/images\/digg.png\" alt=\"Digg\" title=\"Digg\" \/><\/a><\/li>\n<li class=\"aditya-facebook\"><a href=\"http:\/\/facebook.com\/sharer.php?u=http%3A%2F%2Fjohncanning.net%2Fwp%2F%3Fp%3D946&amp;t=Displaying+equations+online+without+using+images\" target=\"_blank\" rel=\"nofollow\" title=\"Facebook\"><img decoding=\"async\" src=\"http:\/\/johncanning.net\/wp\/wp-content\/plugins\/wp-add-social-bookmarks\/images\/facebook.png\" alt=\"Facebook\" title=\"Facebook\" \/><\/a><\/li>\n<li class=\"aditya-technorati\"><a href=\"http:\/\/technorati.com\/faves?add=http%3A%2F%2Fjohncanning.net%2Fwp%2F%3Fp%3D946\" target=\"_blank\" rel=\"nofollow\" title=\"Technorati\"><img decoding=\"async\" src=\"http:\/\/johncanning.net\/wp\/wp-content\/plugins\/wp-add-social-bookmarks\/images\/technorati.png\" alt=\"Technorati\" title=\"Technorati\" \/><\/a><\/li>\n<li class=\"aditya-reddit\"><a href=\"http:\/\/reddit.com\/submit?url=Displaying+equations+online+without+using+images&amp;u=http%3A%2F%2Fjohncanning.net%2Fwp%2F%3Fp%3D946\" target=\"_blank\" rel=\"nofollow\" title=\"Reddit\"><img decoding=\"async\" src=\"http:\/\/johncanning.net\/wp\/wp-content\/plugins\/wp-add-social-bookmarks\/images\/reddit.png\" alt=\"Reddit\" title=\"Reddit\" \/><\/a><\/li>\n<li class=\"aditya-yahoo\"><a href=\"http:\/\/buzz.yahoo.com\/submit?submitUrl=Displaying+equations+online+without+using+images&amp;u=http%3A%2F%2Fjohncanning.net%2Fwp%2F%3Fp%3D946\" target=\"_blank\" rel=\"nofollow\" title=\"Yahoo Buzz\"><img decoding=\"async\" src=\"http:\/\/johncanning.net\/wp\/wp-content\/plugins\/wp-add-social-bookmarks\/images\/yahoo.png\" alt=\"Yahoo Buzz\" title=\"Yahoo Buzz\" \/><\/a><\/li>\n<li class=\"aditya-stumbleupon\"><a href=\"http:\/\/stumbleupon.com\/submit?url=http%3A%2F%2Fjohncanning.net%2Fwp%2F%3Fp%3D946&amp;title=Displaying+equations+online+without+using+images&amp;newcomment=Displaying+equations+online+without+using+images\" target=\"_blank\" rel=\"nofollow\" title=\"StumbleUpon\"><img decoding=\"async\" src=\"http:\/\/johncanning.net\/wp\/wp-content\/plugins\/wp-add-social-bookmarks\/images\/stumbleupon.png\" alt=\"StumbleUpon\" title=\"StumbleUpon\" \/><\/a><\/li>\n<\/ul>\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>This is an \"additional information\" page I have written for the forthcoming humanities statistics resource. I was going to use images, but was unsatisfied with the results. This solution took me a while to work out, but I thought I would share it here as well. 1. The easiest way to display an equation online &hellip; <a href=\"http:\/\/johncanning.net\/wp\/?p=946\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Displaying equations online without using images<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,34,49,66,79,81],"tags":[],"class_list":["post-946","post","type-post","status-publish","format-standard","hentry","category-drupal","category-latex","category-open-source-software","category-statistics","category-websites","category-wordpress"],"_links":{"self":[{"href":"http:\/\/johncanning.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/johncanning.net\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/johncanning.net\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/johncanning.net\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/johncanning.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=946"}],"version-history":[{"count":0,"href":"http:\/\/johncanning.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/946\/revisions"}],"wp:attachment":[{"href":"http:\/\/johncanning.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/johncanning.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=946"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/johncanning.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}