MathJax:在处理时隐藏数学表达式
MathJax: hide math expression while processing
我正在开发一个应用程序来显示表格内容的数学表达式。
网页在渲染时显示了表情的不同状态,我想只显示最后的状态。
我已经在 MathJax 渲染时隐藏了数学表达式,而它以 Tex 语言显示。
但是还有两种状态:
- 处理中: 表达式字体变大
- 已排版: 最终版本,字体较小。
我试图通过以下方式隐藏其中之一:
Stopping MathJax before typesetting
or
Hide the expression while processing it
可能吗?
这是创建数学表达式的代码。
JAVASCRIPT
window.UpdateMath = function () {
values = document.getElementsByClassName('level');
arrayvalues = toArray(values);
var formula = " \log (";
for (i = 0; i < arrayvalues.length; i++) {
if (i == 0){
formula = formula + " 10^{ \frac{" + arrayvalues[i] + "}{10}} ";
}else{
formula = formula + " + 10^{ \frac{" + arrayvalues[i] + "}{10}} ";
}
}
formula = formula + ")$";
document.getElementById('MathOutput').style.visibility = "hidden";
document.getElementById("MathOutput").innerHTML = formula;
//reprocess the MathOutput Element
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"MathOutput"]);
MathJax.Hub.Queue(
function () {
document.getElementById('MathOutput').style.visibility = "";
}
);
}
})();
完整代码在这里:
http://jsfiddle.net/AqDCA/888/
您想关闭预处理器预览和快速预览。尝试将您的配置设置为此
MathJax.Hub.Config({
"fast-preview": {disabled:true},
tex2jax: {
preview: "none",
inlineMath: [["$","$"],["\(","\)"]]
}
});
这应该会让事情更像你想要的那样。
我正在开发一个应用程序来显示表格内容的数学表达式。
网页在渲染时显示了表情的不同状态,我想只显示最后的状态。
我已经在 MathJax 渲染时隐藏了数学表达式,而它以 Tex 语言显示。
但是还有两种状态:
- 处理中: 表达式字体变大
- 已排版: 最终版本,字体较小。
我试图通过以下方式隐藏其中之一:
Stopping MathJax before typesetting
or
Hide the expression while processing it
可能吗?
这是创建数学表达式的代码。
JAVASCRIPT
window.UpdateMath = function () {
values = document.getElementsByClassName('level');
arrayvalues = toArray(values);
var formula = " \log (";
for (i = 0; i < arrayvalues.length; i++) {
if (i == 0){
formula = formula + " 10^{ \frac{" + arrayvalues[i] + "}{10}} ";
}else{
formula = formula + " + 10^{ \frac{" + arrayvalues[i] + "}{10}} ";
}
}
formula = formula + ")$";
document.getElementById('MathOutput').style.visibility = "hidden";
document.getElementById("MathOutput").innerHTML = formula;
//reprocess the MathOutput Element
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"MathOutput"]);
MathJax.Hub.Queue(
function () {
document.getElementById('MathOutput').style.visibility = "";
}
);
}
})();
完整代码在这里: http://jsfiddle.net/AqDCA/888/
您想关闭预处理器预览和快速预览。尝试将您的配置设置为此
MathJax.Hub.Config({
"fast-preview": {disabled:true},
tex2jax: {
preview: "none",
inlineMath: [["$","$"],["\(","\)"]]
}
});
这应该会让事情更像你想要的那样。