Browser $$和\\未使用MathJax在浏览器中呈现数学方程

Browser $$和\\未使用MathJax在浏览器中呈现数学方程,browser,mathjax,mathematical-expressions,dollar-sign,Browser,Mathjax,Mathematical Expressions,Dollar Sign,我使用MathJax在浏览器中渲染数学方程,代码如下: 动态HTML内容: <td style="vertical-align: top; text-align: left; width: 95%;"> <span>$$If\ \ f(x) \ \ is \ continuous \ on \ [0,8]\ defined \ as$$<br> $$f(x) = x^2 +ax + 6 \ \ \ \ for \ \ 0 <x < 2$$<b

我使用MathJax在浏览器中渲染数学方程,代码如下:

动态HTML内容:

<td style="vertical-align: top; text-align: left; width: 95%;">
<span>$$If\ \ f(x) \ \ is \ continuous \ on \ [0,8]\ defined \ as$$<br>
$$f(x) = x^2 +ax + 6 \ \ \ \ for \ \ 0 <x < 2$$<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $$= 3x +2 \ \ \ \ \ \ for \ 2<x<4$$<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $$= 2ax + 5b \ \ \ \ \ \ \ for \ 2<x<8$$<br>
Find <em>a</em>&nbsp;and <em>b</em></span>
</td>

但它不起作用,破坏了整个表达式的渲染

如果要对齐方程式,请不要使用这样的空格。使用
\
创建换行符,用
\begin{align}
\end{align}
包装所有方程式,并用
&
标记对齐点。你的
如果你想对齐方程,不要使用那样的空格。使用
\
创建换行符,用
\begin{align}
\end{align}
包装所有方程式,并用
&
标记对齐点。您的
尝试从未来转义
注释:cdn.mathjax.org即将结束,请查看迁移提示。尝试从未来转义
注释:cdn.mathjax.org即将结束,请查看迁移提示。Thanx获取您的答案。但正如我在问题中提到的,HTML内容是动态生成的(以显示主观问题)。我刚才提到了一段不起作用的代码。所以我们无法更改HTML文本。那么只要替换
@Akshaygajarawari即可。我已经尝试过了。但不起作用。它破坏了整个渲染并在浏览器中显示纯文本。@Akshaygajarawar我不知道为什么。但它在这里起作用了。尝试运行代码段。你能再次发布你的HTML吗?谢谢你的回答。但正如我在问题中提到的,HTML内容是动态生成的(以显示主观问题)。我刚才提到了一段不起作用的代码。所以我们无法更改HTML文本。那么只要替换
@Akshaygajarawari即可。我已经尝试过了。但不起作用。它破坏了整个渲染并在浏览器中显示纯文本。@Akshaygajarawar我不知道为什么。但它在这里起作用了。尝试运行代码段。你能再次发布你的HTML吗?
<script type='text/x-mathjax-config'>
MathJax.Hub.Config({                  
tex2jax: {                  
inlineMath: [ ['$','$'], ["\[","\]"] ],                  
},                  
"HTML-CSS": {                  
linebreaks: {                  
automatic: true                   
}                  
}                  
});                  
</script>                  
<script type="text/javascript" async src = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script> 
&lt;td style="vertical-align: top; text-align: left; width: 95%;">
                                    &lt;span>$$If\ \ f(x) \ \ is \ continuous \ on \ [0,8]\ defined \ as$$&lt;br>
$$f(x) = x^2 +ax + 6 \ \ \ \ for \ \ 0 &lt;x &lt; 2$$&lt;br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $$= 3x +2 \ \ \ \ \ \ for \ 2&lt;x&lt;4$$&lt;br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $$= 2ax + 5b \ \ \ \ \ \ \ for \ 2&lt;x&lt;8$$&lt;br>
Find &lt;em>a&lt;/em>&nbsp;and &lt;em>b&lt;/em>&lt;/span>
                                &lt;/td>