Skip to content

Instantly share code, notes, and snippets.

@hiamandeep
Last active March 12, 2016 20:33
Show Gist options
  • Save hiamandeep/c2f53eddfbdf4303a005 to your computer and use it in GitHub Desktop.
Save hiamandeep/c2f53eddfbdf4303a005 to your computer and use it in GitHub Desktop.
var mathFieldSpan = document.getElementById('math-field');
var latexSpan = document.getElementById('latex');
var MQ = MathQuill.getInterface(2); // for backcompat
var mathField = MQ.MathField(mathFieldSpan, {
spaceBehavesLikeTab: true, // configurable
handlers: {
edit: function() { // useful event handlers
latexSpan.textContent = mathField.latex(); // simple API
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment