在线示例
https://latexeasy.com/en/demo/sdk
应用形式
根底应用形式
<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>
办法
set.latex 设置内容
letexeasy.call('set.latex', {latex: 'x=\\frac {-b\\pm \\sqrt \{\{b\}^\{2\}-4ac\}\} {2a}'
});
get.latex 获取 latex 内容
letexeasy.call('get.latex', {}, function(data){console.log(data);
});
get.svg 获取 svg 内容
letexeasy.call('get.svg', {}, function(data){console.log(data);
});
事件
ready 初始化实现
latexeasy.on('ready', function(){console.log('latex init finished');
});