Mathjax 呈现不正确

Mathjax is incorrectly rendered

我注意到 MathJax 呈现不正确。 这里 https://www.emathhelp.net/calculators/calculus-2/integral-calculator/?f=xsinx&var=&steps=on 在 "the integral of the cosine is ..." 下,只有左侧余弦和右侧正弦的积分应该是红色的,而不是等号和 -xcos(x).

但是,当我单击 "show math as tex commands" 时,我得到 - x \cos{\left(x \right)} + \color{red}{\int{\cos{\left(x \right)} d x}} = - x \cos{\left(x \right)} + \color{red}{\sin{\left(x \right)}},这是没有任何错误的字符串。

什么原因导致显色不正确?

您 link 使用 MathJax 的 color 扩展的站点,它重新定义了 \color 宏以与 LaTeX 版本兼容。在 LaTeX 中,\color 是一个从那里改变颜色的开关,而不是 MathJax 的版本,其中 \color 接受一个参数,即要着色的内容。所以像 \color{red}{x} + y 这样的东西通常会产生一个红色 "x" 和一个黑色的“+ y”,但是 color 扩展会产生红色 "x + y"。这就是为什么您在 link 访问的网站中看到完全红色的表达式。