当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Change Fomula before typesetting MathJax

问题描述:

Suppose, I have many formulae on the page.

I want to enclose each formula in \large{}, i.e. $x+1$ becomes $\large{x+1}$.

Is there any way I can do this with MathJax or I need to set skipstartup to true, manually add and then queue typeset?

Is there any way MathJax could fetch those formulae?

Thank you.

网友答案:

Answer is to use prefilter:

https://groups.google.com/d/msg/mathjax-users/MXqOpqPeBF4/h-hry2ITzz4J

  <script type="text/x-mathjax-config"> 
        MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { 
          MathJax.InputJax.TeX.prefilterHooks.Add(function (data) { 
            data.math = '\\large{'+data.math+'}'; 
          }); 
        }); 
  </script> 
分享给朋友:
您可能感兴趣的文章:
随机阅读: