Skip to content

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

pkra edited this page Apr 5, 2013 · 2 revisions

From https://groups.google.com/d/msg/mathjax-users/iePWZiiH9Wk/zdiglUa0GJgJ

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

Clone this wiki locally