CSDN博客上数学公式显示的测试

本文用于对CSDN博客上数学公式显示的测试。

这个公式是用MathJAX写的,在电脑版上应能正确显示,但在手机版上显示不正常。
代码:

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

显示为:
When a 0 , there are two solutions to (ax^2 + bx + c = 0) and they are

x = b ± b 2 4 a c 2 a .

下面的代码借用了codecogs.com的公式转换功能,所以公式将以图片形式显示,通用性好。
代码:

<center>
![][matrix]
[matrix]: http://latex.codecogs.com/svg.latex?\begin{bmatrix}1&x&x^2\\1&y&y^2\\1&z&z^2\\\end{bmatrix}
</center>

显示为:



如果博客网页允许使用javascript,则使用Mathjax在手机上显示也正常。

<script type="text/x-mathjax-config">   MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); </script>

<script type="text/javascript" async   src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"> </script>

猜你喜欢

转载自blog.csdn.net/shaoyubin999/article/details/79645027