Allows to include equations into the editable content see example or try it online summernote-equation-pligin
- This plugin uses MathJax library. Install and configure it (sample works, but you may optimize parametres)
<link href="dist/main.css" rel="stylesheet">
<script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [["$", "$"], ["\\(", "\\)"]]
},
"HTML-CSS": {
linebreaks: { automatic: true }
}
});
</script>
- Insert HTML
<div class="container">
<button id="run">edit</button>
<div id='text'></div>
</div>
- Initialize summernote with params
<link href="dist/main.css" rel="stylesheet">
<script src="summernote-ext-equation.js"></script>
<script>
$(document).ready(function() {
$('#run').on('click', function() {
$('#texto').summernote({
toolbar: [
['insert', ['equation']]
],});
});
});
</script>
- Remember to include css and js libraries (jQuery, Bootstrap, Summernote)
- You can see it here
P.S: This plug-in works but it have some problems. (stable in Mozilla in Crome some functions dose not work, need to rewrite it) If you want to use it in professional projects, you must improve it. Please write me if you want to make stable version.