How to change padding of math in MathJax?

こ雲淡風輕ζ 提交于 2019-12-23 18:17:01

问题


Like, when I have my piece of Math in my div, it would look like this, where I have set the padding of my div to 0:

So, is there a way to change the value of the padding of the math?


回答1:


Found from here (and to believe I answered this question, and forgot about it):

MathJax.Hub.Config({
    jax: ["input/TeX","output/HTML-CSS"],
    displayIndent: "2em"
});



回答2:


The simplest way to customize this would be call MathJax.Hub.Config(...) before you load the MathJax config file in your header. For example:

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    "HTML-CSS": {
        styles: {
            ".MathJax nobr": {
                padding: "0.2em 0.2em"
            },
        }
    }
});
</script>
<script type="text/javascript" src="/path/to/MathJax.js?config=TeX-AMS_HTML" charset="utf-8"></script>

Where you change the path to your MathJax installation.

Alternatively, you can either modify an existing config file or setup your own config via the method outlined here: http://docs.mathjax.org/en/latest/configuration.html#config-files



来源:https://stackoverflow.com/questions/12707094/how-to-change-padding-of-math-in-mathjax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!