gpt4 book ai didi

css - MathJax 中的颜色

转载 作者:行者123 更新时间:2023-12-02 15:20:41 25 4
gpt4 key购买 nike

我想在我的博客上以红色显示问题,以蓝色显示答案。在问题和解答中,我使用 MathJax 2 来渲染 MathML。我正在使用 CSS 控制 MathJax 的着色,如下所示。

h3, h2, h4, h5
{
text-align: left;
font-weight: bold;
font-family: Verdana;
}

.question
{
text-align: left;
color: Red;

}

.centerit
{
color: Blue;
text-align: center;
}

在 IE 中工作得很好,但在 Firefox 中它总是以黑色显示 MathJax。有什么解决方法可以解决这个问题吗?

最佳答案

MathJax 支持 \color 宏,但其工作方式与 LaTeX 不同。在 LaTeX 中,\color 的工作方式类似于普通 TeX 命令,例如 \bf,但 MathJax 将其视为 LaTeX 命令,例如 \textbf

\[ \color{red} The whole sentence is red in LaTeX,
but only the initial T is colored in MathJax. \]

关于css - MathJax 中的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11096214/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com