我面臨的問題是如何在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