在线示例
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');
});
标签:function,latex,console,log,LatexEasy,JavaScript,编辑器,letexeasy,ready
From: https://blog.51cto.com/u_15680272/7323937