MathJax in Serendipity

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
cebola
Posts: 2
Joined: Tue Nov 29, 2011 4:48 pm

MathJax in Serendipity

Post 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
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: MathJax in Serendipity

Post 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>.
=Don=
Post Reply