Page 1 of 1

MathJax in Serendipity

Posted: Tue Nov 29, 2011 5:50 pm
by cebola
I have a s9y 1.6 installation with crudely added support for MathJax (see http://www.mathjax.org) at http://blog.math.ist.utl.pt. MathJax is probably too large and too special interest to be bundled with s9y but it might be interesting to consider to provide a plugin mechanism suitable for this where one might indicate the url for mathjax.
After making the changes I have noticed the existence of plugin Sample! which purports to do at least part of what is needed. I have not tried to use Sample! yet but I suspect it would not cover the preview iframe while editing.
If there is interest I can try to submit code. Some 5 or 6 years ago I submitted translations for European Portuguese. I am registered at github as cebola2 but never figured out to submit plugins. I suspect that minor changes to s9y itself would be needed also.

João Palhoto Matos

Re: MathJax in Serendipity

Posted: Wed Nov 30, 2011 3:25 am
by Don Chambers
The plugin you are referring to is "HTML-Code inside head (HTML-Head Nugget) (serendipity_event_head_nugget)". According to the MathJax site, all it needs is just a tiny bit of code to make it work within the document <head> as follows:

Code: Select all

<script type="text/javascript"
   src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
Easiest way to do that is exactly with the plugin you mentioned. An alternative would be to modify your template's index.tpl file, adding this code before </head>.