【发布时间】:2021-08-01 07:05:14
【问题描述】:
我正在尝试使用 Django 以及 CKEditor 在我的模板中呈现数学方程式。当我在检查元素中渲染我的数学方程式时,它看起来像这样:
<p><span class="mathjax-latex">\(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)</span></p></p>
但是,即使启用了 MathJax 脚本,当我查看公式时,它也不会呈现。这是模板中的 MathJax 脚本:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showProcessingMessages: false, //Close js loading process information
messageStyle: "none", //Do not display information
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ["$", "$"] ], //In-line formula selection$
displayMath: [ ["$$","$$"] ], //The formula selection in the paragraph$$
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre','code','a'], //Avoid certain tags
ignoreClass:"comment-content", //Avoid tags containing the Class
processClass: "mathjax-latex",
},
"HTML-CSS": {
availableFonts: ["STIX","TeX"], //Optional font
showMathMenu: false //Close the right-click menu display
}
});
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
</script>
<script src="https://cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
我需要做什么来渲染带有span标签的数学方程?
【问题讨论】:
标签: django latex ckeditor mathjax