如何召回或重新启动MathJax? [英] How to recall or restart MathJax?

查看:177
本文介绍了如何召回或重新启动MathJax?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要MathJax再次检查我的所有页面。



我的意思是当页面被创建时,它确实很棒。但是我需要在window.onload之后调用它来重新分页,因为其内容在此期间已经改变。



我该如何做这样的事情?

解决方案

请参阅 http://docs.mathjax.org/en/latest/typeset.html


如果您正在撰写一个动态的网页
,其中包含数学
的内容可能在MathJax已经在
排版页面的其余部分之后出现,那么你
将需要告诉MathJax寻找
再次在
中产生新内容时再次在页面中进行数学运算。要做
,你需要使用
MathJax.Hub.Typeset()方法。这个
将导致预处理器(如果有任何
被加载)再次在页面
上运行,然后MathJax将在页面
上查找
未处理的数学和排版它,保持已经排版的任何
数学不变。



但是,您不应该直接调用此方法。 [你应该]排版排版动作,[使用这个]命令:
$ b $ p $ MathJax.Hub.Queue([Typeset,MathJax。 Hub]);


此处演示: http://cdn.mathjax.org/mathjax/latest/test/sample-dynamic.html


I need MathJax to recheck again all my page.

I mean when the page is created it does all great. But I need to call it after window.onload to reparse the page, as its contents have changed in the meantime.

How would I do such a thing?

解决方案

See http://docs.mathjax.org/en/latest/typeset.html:

If you are writing a dynamic web page where content containing mathematics may appear after MathJax has already typeset the rest of the page, then you will need to tell MathJax to look for mathematics in the page again when that new content is produced. To do that, you need to use the MathJax.Hub.Typeset() method. This will cause the preprocessors (if any were loaded) to run over the page again, and then MathJax will look for unprocessed mathematics on the page and typeset it, leaving unchanged any math that has already been typeset.

You should not simply call this method directly, however. [You should instead] queue the typeset action, [using this] command:

MathJax.Hub.Queue(["Typeset",MathJax.Hub]);

Demo here: http://cdn.mathjax.org/mathjax/latest/test/sample-dynamic.html

这篇关于如何召回或重新启动MathJax?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆