WordPress and jsMath

WordPress and jsMath

Well… I’ve been using jsMath on my Wiki, and now I’m keen to use it on my blog.  There does not seem to be a WordPress plugin explicitly for jsMath (if anyone knows of one, please let me know), but you don’t need one. Using jsMath from WordPress is actually easy via a different plugin.

The plugin is WP Hooks. This is a plugin that lets you add content to the page head, and that’s just what we want!

  1. Download and install jsMath on your local server.
  2. Download, install, and activate WP Hooks in WordPress.
  3. Configure this and add the following to the header (change the path to point to your local installation of jsMath):
    <SCRIPT SRC="jsMath/easy/load.js"></SCRIPT>
  4. Start writing math on pages.

This seems to work fine. Here’s an example. \[\int \sin x\ dx= -\cos\ x + C\]

This was created as a display equation via writing \[\int \sin x\ dx= -\cos\ x + C\] in the page.

Update: As pointed out in the comments, you need to install the fonts on the client (browser) side for things to look really nice and for math rendering to be fast; otherwise you get a warning and bitmap fonts.  It’s really easy; the instructions are here.

Update: As others have discovered, you will need to clear your browser cache to be know whether this is working or not.  You should also clear your jsMath cache, as it caches the images it creates, and can cache blank or bad ones while you are trying to get it to work.  Instructions at the jsMath page.


stacy

I do whatever it is that I do. Typically that's formal methods in software engineering and security.

14 COMMENTS
  • stacy
    Reply

    Comments, too! \[x\in \mathcal{S}\]

  • darkersideofcode blog » Hello world!
    Reply

    […] I got WordPress up and running. Using the method described here I got jsMath enabled, as you can see here [ frac{partial^2 u}{partial t^2} = c^2nabla^2u […]

  • kerry
    Reply

    Thanks for the information! I had to install jsMath fonts to get it work though.

  • Ariel Balter
    Reply

    I can’t seem to get it to work. Check the source off my pages, and you will see that the script call is there. I currently have it via the “In the Loop” plugin because I am fooling around with themes. But, it doesn’t work when I explicitly put it in the header either.

    jsMath definitely works on my server: http://arielbalter.com/mathtest.html

    An html copy of this page is in the blog, and none of it renders.

    I’d love any advice or suggestions. Thanks, Ariel

  • Kito
    Reply

    x^2
    x\in X

  • Kito
    Reply

    x\in \mathcal{S}

  • stacy
    Reply

    Kito:
    You need the delimiters. In this case, dollar signs.
    $x^2$
    $x\in X$

  • stacy
    Reply

    For display equations, you need \[ ... \] delimiters. \[x^2\] \[x\in X\]

  • chun li costume
    Reply

    I follow your website for quite a extended time and really tell that your articles always prove to be of a high value and quality for readers.

  • Jann Kmiec
    Reply

    Hi, I was looking for information on Mimaki spares. Your article popped up on Ask. I found what I wanted here: DX4 printheads

  • Math related subjects - Sense or Simplicity
    Reply

    […] in WordPress works. ( I am trying to implement the instructions given by StacyProwell.com ( link […]

  • Online LaTeX Update | JS Tips
    Reply

    […] be resized, rather than using images. It works best  (but not exclusively) with TeX fonts.WordPress and jsMath has instructions for using  jsMath in WordPress blogs.Math support in Sphinx can use […]

  • LaTeX | Oak Tree Solutions
    Reply

    […] used the instructions here, but must ahve done something wrong This entry was posted in Mathematics and tagged LaTeX, […]

  • Day hoc qua mạng • Blog Archive • H??ng d?n s? d?ng WordPress
    Reply

    […] WordPress and jsMath has instructions for using  jsMath in WordPress blogs. […]

Leave a Reply

Your email address will not be published. Required fields are marked *