How to use math jax?

倖福魔咒の 提交于 2019-12-13 10:56:33

问题


I've been read the docs and I still don't get how to apply it from TeX

so basically i wanted to convert this string

<p><span class='math-tex'>\\( x&gt;0,y&gt;0 \\)</span></p>

<p><span class='math-tex'>( (\\frac{2}{7},\\frac{2}{18}) )</span></p>

they are tex version right ? using \\( \\)

from my API and I still have no idea how to convert it

    <script>
       MathJax = {
        tex: {
        inlineMath: [['$', '$'], ['\\(', '\\)']],
        }
         };
      </script>

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

    </script>
    <p>
     <span class='math-tex'>( (\\frac{2}{7},\\frac{2}{18}) )</span> 
    </p>

I also have been inspect the example and even the live demo

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

and i still have no idea how to convert this tex $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$


回答1:


You are using \\ instead you should use \.

Here is your working code.

<script>
  MathJax = {
    tex: {
      inlineMath: [
        ['$', '$'],
        ['\\(', '\\)']
      ],
    }
  };
</script>

<script type='text/javascript' async src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML'>
</script>
<p>
  <span class='math-tex'>( \(\frac{2}{7},\frac{2}{18}\) )</span>
</p>


来源:https://stackoverflow.com/questions/58172412/how-to-use-math-jax

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