cirry

cirry

我的原生博客地址:https://cirry.cn

Markdown添加mathjax支持

添加 Mathjax#

<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        inlineMath: [
          ["\\(", "\\)"],
        ],
      },
    });
  </script>
{
mathjax &&
<script async type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/mathjax/3.2.2/es5/tex-chtml.min.js"></script>
}

测试展示#

$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$

When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are
x=b±b24ac2ax = {-b \pm \sqrt{b^2-4ac} \over 2a}

优点:不需要添加其他插件即可在页面上直接显示公式。

缺点:添加了 mathjax 支持之后,网页加载会变慢。

参考文档#

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.