MathJax 数学符号测试

当 \(a \ne 0\) 时,一元二次方程 \(ax^2+bx+c=0\) 有 \begin{equation} x = {-b \pm \sqrt{b^2-4ac} \over 2a} \end{equation} 两个根。

沃日,MathJax 好几把炫酷。

顺带贴出教程

理解本教程,需要读者先懂点 HTML。首先在网页里加两个 Script 标签:

<script type='text/x-mathjax-config'>
MathJax.Hub.Config({
    TeX: {
        equationNumbers: {
            autoNumber: "AMS"
        }
    }
});
</script> <!-- 给单独成一行的等式加上行号 -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML' async>
</script>

顺带一提:这俩标签加在 Head 或者 Body 里面都可以。然后,在网页里加一段 P 标签:

<p>
When \(a \ne 0\), equation \(ax^2+bx+c=0\) has two solutions, namely
\begin{equation}
    x = {-b \pm \sqrt{b^2-4ac} \over 2a}
\end{equation}
</p>

就好了。

← 在 MySQL 里,别用“utf8”!用“utf8mb4”! 大 O、大 Omega、大 Theta 记号的笔记 →