问题
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>0,y>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