1.Institute of Theoretical Computing, Shanghai Key Laboratory of Trustworthy Computing, East China Normal University; 2.Information Engineering College, Hangzhou Dianzi University
Show less
History+
Published Online
2008-03-05
PDF
(158KB)
Abstract
The aim of this paper is to extend the probabilistic choice in probabilistic programs to sub-probabilistic choice, i.e., of the form 等标签切断的公式,并移除 \begin{document}
html = html.replace(/\$([\s\S]+?)\$/g, function(match, formula) {
let clean = formula.replace(/<[^>]+>/g, '') // 删掉公式内部的 HTML 标签
.replace(/\\begin\{document\}/g, '')
.replace(/\\end\{document\}/g, '')
.replace(/ /g, ' '); // 修复空格实体
return '$' + clean.trim() + '$';
});
// B. 清理残留的预览层和无效 ID (防止 MathJax 跳过)
container.innerHTML = html;
$(container).find('.MathJax_Preview, .MathJax_Display, .MathJax').remove();
// --- 3. 触发渲染 ---
if (window.MathJax && MathJax.Hub) {
// 确保配置允许解析 $...$
MathJax.Hub.Config({
tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] }
});
MathJax.Hub.Queue(["Typeset", MathJax.Hub, container]);
}
}
$(document).ready(function() {
mag_renderAllMath('zhaiyaojs_text');
});