在排版MathJax之前更改Fomula [英] Change Fomula before typesetting MathJax

查看:68
本文介绍了在排版MathJax之前更改Fomula的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我在页面上有很多公式.

Suppose, I have many formulae on the page.

我想将每个公式括在\large{}中,即$x+1$变为$\large{x+1}$.

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

我可以用MathJax做到这一点吗?还是需要将skipstartup设置为true,手动添加然后排字排版?

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

MathJax有什么方法可以获取这些公式?

Is there any way MathJax could fetch those formulae?

谢谢.

推荐答案

答案是使用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> 

这篇关于在排版MathJax之前更改Fomula的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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