One can install MathJax on their server and use it to include beautifully-typeset math in their webpages. To get it to work in Blogger, follow the steps below.
- ssh into your server and install MathJax as described here (preferably with the svn method so that you can easily update MathJax in the future).
- Since (most likely) Blogger is not hosted on your server, follow the instructions here. You basically need to create the file
.htaccess
in the server'smathjax/fonts/HTML-CSS/TeX/otf
folder and paste the following text in it:
<FilesMatch "\.(ttf|otf|eot)$"> <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "*" </IfModule> </FilesMatch>
- Finally, go to your Blogger account, click "Design", and then "Edit HTML". After the first
<head>
you see, paste
<script type="text/javascript" src="your-server/mathjax/MathJax.js"> mathjax.Hub.Config({ extensions: ["tex2jax.js","TeX/AmsMath.js","TeX/AMSsymbols.js"], jax: ["input/TeX","output/HTML-CSS"], tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ], processEscapes: true, }, "HTML-CSS": { availableFonts: ["TeX"] } }); </script>
whereyour-server
is to be substituted with your server's http address.
$...$
or \(...\)
for inline equations, and $$...$$
or\[...\]
for equations that are centered in their own line.Time for an example:\[\sin^2\theta+\cos^2\theta=1.\]Note that the code above loads
AMSmath.js
and AMSsymbols.js
, so that the macros and environments they provide are defined for use on your blog.
This comment has been removed by the author.
ReplyDeleteGood read
ReplyDelete