how to render formula's with MathQuill

647 views Asked by At

I'm trying to render formulas with MathQuill, without much succes. I've tried different ways.

For example, if I do

$('#formula').mathquill('latex', 'a_n x^n');

it renders the formula, except that it starts with $$

Here is a simple DEMO

Any suggestions what I'm doing wrong here ?

1

There are 1 answers

0
Kunal Manchekar On

This is because of .prepend('<span class="selectable">$'+root.latex()+'$</span>'); used in mathquill.js [line no. 1338- function: createRoot]

It does this for non-editable textboxes.(Doesn't get why?) But to avoid this you can make text area editable and then revert it as: fiddle

Please suggest if found any better way.