JavaScript Integrated Formula Editor

Online examples

https://latexeasy.com/en/demo/sdk

Usage

Basic usage methods

<iframe id="liveEditor"
        frameborder="0"
        style="width:100%;height:400px;border:0;outline:none;"
        src="https://latexeasy.com/editor"></iframe><script src="https://latexeasy.com/vendor/LatexEasyEditor/editor/sdk.js"></script><script>
    var letexeasy = new window.LatexEasy(document.getElementById('liveEditor'));
    letexeasy.on('ready', function () {
        console.log('LatexEasy.ready');
        letexeasy.call('set.latex', {
            latex: 'x=\\frac {-b\\pm \\sqrt \{\{b\}^\{2\}-4ac\}\} {2a}'
        });
    });
    letexeasy.init();</script>

method

Set the content of set.latex

letexeasy.call('set.latex', {
    latex: 'x=\\frac {-b\\pm \\sqrt \{\{b\}^\{2\}-4ac\}\} {2a}'});

Get Latex to retrieve Latex content

letexeasy.call('get.latex', {}, function(data){
    console.log(data);});

Get. svg to retrieve svg content

letexeasy.call('get.svg', {}, function(data){
    console.log(data);});

event

Ready initialization completed

latexeasy.on('ready', function(){
    console.log('latex init finished');});
Updated At 2024-01-05 13:19:51
 
Language