jQuery and wordpress plugins giving instant preview of LaTeX as you type it in text areas.

154 views
Skip to first unread message

Christian Perfect

unread,
Jun 20, 2012, 8:53:13 AM6/20/12
to mathja...@googlegroups.com
Hello,
   I've written a jQuery plugin which, when applied to an editable area in a page, such as a <textarea> tag or an element with the `contenteditable` attribute, gives a little floating preview box above the cursor when you enter LaTeX. I've made a demo page, which has a link to the code, at http://christianp.github.com/writemaths/. It also works on TinyMCE editors.

I've also rolled it in to a wordpress plugin which gives the preview when typing a comment on a post. I've had MathJax enabled on my blog for a while now but very few commenters have used it - I think they were dissuaded by the fact they wouldn't know if they'd got their LaTeX right until they submitted their comments. This plugin should help with that. 

I've never written a wordpress plugin before, so it has no configuration options and might not work on your blog; please contact me if you can't get it to work. If you want to see it running, I've got it installed on my blog - http://checkmyworking.com/2012/06/instant-mathjax-preview-of-latex-typed-into-html-textareas/

You can get the WordPress plugin from https://github.com/christianp/wp-writemaths-plugin, and it should be in the official WordPress plugins repository soon.


Thanks!
  Christian

Peter Krautzberger

unread,
Jun 20, 2012, 9:08:24 AM6/20/12
to mathja...@googlegroups.com
Great stuff, Christian!
Reply all
Reply to author
Forward
0 new messages