Personal tools
You are here: Home / Members / Marek Behr / Marek's Weblog / jsMath Experiments
Navigation
 

jsMath Experiments

by Marek Behr posted on Oct 05, 2008 04:02 PM last modified Oct 05, 2008 04:02 PM —

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_view to 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.js must 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. In httpd.conf, add the following before the main ProxyPass lines:

    ProxyPass /tex/ http://hostname:8080/tex/
    ProxyPassReverse /tex/ http://hostname:8080/tex/

    to serve the tex top-level directory via Apache. Of course, any Plone page that may exist at /tex URL 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 .

« May 2013 »
May
MoTuWeThFrSaSu
12345
6789101112
13141516171819
20212223242526
2728293031
Upcoming Events
Marine 2013 May 29, 2013 - May 31, 2013 — Hamburg, Germany
MPF 2013 Jun 11, 2013 - Jun 14, 2013 — Sardinia, Italy
Coupled Problems 2013 Jun 17, 2013 - Jun 19, 2013 — Ibiza, Spain
USNCCM 12 Jul 22, 2013 - Jul 25, 2013 — Raleigh, North Carolina
GACM 2013 Sep 30, 2013 - Oct 02, 2013 — Hamburg, Germany
Upcoming events…