MathJax:处理时隐藏数学表达式 [英] MathJax: hide math expression while processing
问题描述
我正在开发一种应用程序,该应用程序可以根据表单内容显示数学表达式.
Im developing an application that shows a mathematical expression in function of the content of a form.
网页在呈现表达式时会显示表达式的不同状态,我只想显示最后一个状态.
The webpage show the different states of the expression while its rendering, and I would like to show only the last state.
我已经隐藏了MathJax渲染时以Tex语言显示的数学表达式.
I have already hidden the mathematical expression while its shown in Tex language while MathJax is rendering.
但是还有两个状态:
- 处理:表达式使用更大的字体.
- Typesetted :最终版本,使用较小的字体.
- Processing: The expression is in a bigger font.
- Typesetted: The final version, in a smaller font.
我正试图通过以下方法隐藏其中之一:
Im trying to hide one of them through:
排版前停止 MathJax
或
在处理表达式时隐藏表达式
Hide the expression while processing it
有可能吗?
这是创建数学表达式的代码.
This is the code to create the mathematial expression.
JAVASCRIPT
JAVASCRIPT
window.UpdateMath = function () {
values = document.getElementsByClassName('level');
arrayvalues = toArray(values);
var formula = "$10 \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/
推荐答案
您要关闭预处理器预览和快速预览.尝试将配置设置为此
You want to turn off preprocessor previews and the fast previews. Try setting your configuration to this
MathJax.Hub.Config({
"fast-preview": {disabled:true},
tex2jax: {
preview: "none",
inlineMath: [["$","$"],["\\(","\\)"]]
}
});
这应该使事情更像您想要的工作.
This should make things work a bit more like what you want.
这篇关于MathJax:处理时隐藏数学表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!