markdownPad2显示数学公式,使用MathJax

  1. 参考博客https://blog.csdn.net/jearmy/article/details/49803343

  2. 可以使用以下两种

    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
    </script>
    
    <script type="text/javascript" src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML'></script>
    

    更多细节可以查看MathJax在web平台使用

  3. 不知为何不能实时预览,但是可以F6在浏览器预览,确实正确显示了。

  4. 在github下载MathJax,可以离线使用MathJax,但是用绝对路径引用js时加载失败。在控制台查看,会出现如下:

    指向“d:\software\MathJax\MathJax.js?config=TeX-MML-AM_CHTML-full”的 <script> 加载失败
    

    这时需要加上协议名file

    <script type="text/javascript" src="file:\\\D:\software\MathJax\MathJax.js?config=TeX-MML-AM_CHTML-full"></script>
    
  5. 使用MathJax行内公式是\\(\\),而不是$$,可以修改过来,如下

    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        extensions: ["tex2jax.js"],
        jax: ["input/TeX", "output/HTML-CSS"],
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"] ],
          displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
          processEscapes: true
        },
        "HTML-CSS": { fonts: ["TeX"] }
      });
    </script>
    <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
    </script>
    
  6. csdn支持latex公式,例子:

    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} $$
    	
    $$
    \begin{aligned}
    \dot{x} & = \sigma(y-x) \\
    \dot{y} & = \rho x - y - xz \\
    \dot{z} & = -\beta z + xy
    \end{aligned}
    $$
    

When ( a ≠ 0 ) ( a \ne 0 ) (a̸=0), there are two solutions to ( a x 2 + b x + c = 0 ) (ax^2 + bx + c = 0) (ax2+bx+c=0) and they are:
x = − b ± b 2 − 4 a c 2 a x = {-b \pm \sqrt{b^2-4ac} \over 2a} x=2ab±b24ac

x ˙ = σ ( y − x ) y ˙ = ρ x − y − x z z ˙ = − β z + x y \begin{aligned} \dot{x} &amp; = \sigma(y-x) \\ \dot{y} &amp; = \rho x - y - xz \\ \dot{z} &amp; = -\beta z + xy \end{aligned} x˙y˙z˙=σ(yx)=ρxyxz=βz+xy

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

aabond

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值