jsMath Experiments
Is jsMath the way to go for displaying TeX formulas?
The jsMath package is a Javascript that interprets TeX expressions and renders them in a half-decent way on the HTML page. Simple installation instructions for Plone are here. As always with Plone, simple instructions don't work at all. There are two big problems:
- In our current Plone, there is no such thing as Site section of the Site Setup and no way to easily add Javascripts to the header. The hard way is to go to ZMI, customize
/portal_skins/plone_content/document_view, and edit/portal_skins/custom/document_viewto add the following code within the<head>...</head>tags:<metal:block metal:fill-slot="javascript_head_slot"> <script type="text/javascript" src="/tex/jsMath/easy/load.js"> </script> </metal:block>
That will load the script only from standard documents (not AT documents, not blog entries like this one, etc.).
- The Javascript
load.jsmust be served from the same host as the current page. Rather than dumping entire jsMath hierarchy into Plone database, it is better to override the Apache proxy configuration to allow certain directory to be served directly by Apache even within Plone URL. Inhttpd.conf, add the following before the mainProxyPasslines:ProxyPass /tex/ http://hostname:8080/tex/ ProxyPassReverse /tex/ http://hostname:8080/tex/
to serve the
textop-level directory via Apache. Of course, any Plone page that may exist at/texURL will become inaccessible.
With that, we can type something like: <span class="math">x^2 = 9</span> and see it as beautiful math... On a standard web page, not in a blog entry... Try this test page .




