I am in the process of moving my personal website to Google Sites. The main reason being the ease of creation and access control. Unfortunately, Google Sites do not allow Javascript, which is a bit problematic as I would like to use MathJax to render \( \LaTeX \) equations. After searching for a while, I realized that many people are not happy for this design decision. There are some application specific workarounds that embed JavaScript in gadgets.
However, since I am mostly interested in displaying math equations on a subset of the site used for personal note taking, I found an interesting solution after some digging. The main idea was to be able to see math equations on websites that intentionally do not render them, like arxiv.org. There seem to be a couple of solutions and I will present the one that I found most appealing. Note: an access to a server installation of MathJax is required.
In order to be render \( \LaTeX \), the following code should be inserted into a bookmarklet. Note that the code should be preceded with javascript:.
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "/MathJax/MathJax.js"; // use the location of your MathJax
var config = 'MathJax.Hub.Config({' +
'extensions: ["tex2jax.js"],' +
'jax: ["input/TeX","output/HTML-CSS"]' +
'});' +
'MathJax.Hub.Startup.onload();';
if (window.opera) {script.innerHTML = config}
else {script.text = config}
document.getElementsByTagName("head")[0].appendChild(script);
})();
Then whenever one wants to view the equations one only needs to press the bookmarked link.
More details on running MathJax dynamically can be found in the online documentation. Especially one should take a look at how to customize the display.