我面临的问题是如何在ckeditor中显示匹配公式的正确格式,我试图用很多方法搜索,但它似乎不能..如何在ckeditor中显示数学公式的正确格式
这是我的来源:
<html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="https://cdn.ckeditor.com/4.7.3/standard/ckeditor.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['\\(','\\)']]}});</script>
<script type="text/javascript">
$(function(){
init();
});
</script>
<script language="javascript">
function init()
{
var strArea = "";
strArea += "<table border='0' cellpadding='0' cellspacing='0' align='left' valign='top' width='100%' id='contents2'>";
strArea += "<tr><td>";
strArea += "<table border='0' cellpadding='0' cellspacing='0' align='left' valign='top' width='100%'>";
strArea += "<tr><td height='20'></td></tr><tr><td>";
strArea += "<table border='3' cellpadding='0' cellspacing='0' align='left' valign='top'>";
strArea += "<tr>";
strArea += "<td width='20' valign='top' style='line-height:2.1'><div id='quizno'>\(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)</div></td>";
strArea += "<td width='5'></td>";
strArea += "<td style='line-height:2.1'><H1><div id='quiz'>aaaa</div></H1></td>";
strArea += "</tr>";
strArea += "</table></td></tr>";
strArea += "<tr><td height='7'>bbb</td></tr><tr><td>";
strArea += "<table border='1' cellpadding='0' cellspacing='0' align='left' valign='top'>";
strArea += "</table></td></tr></table></td></tr>";
strArea += "</table></td></tr></table>";
document.all.quizdiv.innerHTML = strArea;
// CKEDITOR.instances.ir4.getData()
// CKEDITOR.instances.quizdiv.getData(document.getElementById('quizdiv').innerHTML) = strArea;
}
</script>
</head>
<body>
<div style="overflow: auto; height: 700; width: 100%" id="centerdiv">
<div id="quizdiv" style="width: 100%;"></div>
</div>
</body>
</html>
我尝试用数学公式的默认要显示的文本是:(X = {-b \时\ SQRT {b^2-4ac} \ 2A超}),但并不正确显示
如何显示正确的数学公式格式?感谢..
就是你能正确的显示意思? –
嗨@Mahbubul,这是数学公式ckeditor .. – luongkhanh