如何更改 MathJax 的字体
How to change font for MathJax
我无法让 MathJax 更改它用来呈现用 AsciiMath 编写的公式的字体。我已经在 Whosebug 和网络上的其他地方阅读了类似问题的答案:
- Styling MathJax
- Changing mathjax's font size
- MathJax font matching and pairing
- Can MathJax use font xxxx?
这是我用作测试用例的完整 HTML5 文档:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>MathJax Font</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"CommonHTML" : { preferredFont:"Asana Math" }
});
</script>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_CHTML"></script>
</head>
<body>
<p>`v = pi r^2`</p>
</body>
</html>
我做错了什么?请帮我更改 MathJax 的字体。
我在 docs.mathjax.org/en/latest/output.html
找到了这个
The CommonHTML output processor produces high-quality output in all modern browsers, with results that are consistent across browsers and operating systems. This is MathJax’s primary output mode since MathJax v2.6. Its major advantage is its quality, consistency, and speed as well as support for server-side generation. Its browser supports starts with IE9 and equivalent browsers and it degrades gracefully on older browsers. The CommonHTML output uses web-based fonts so that users don’t have to have math fonts installed on their computers. It currently only supports MathJax’s default TeX fonts.
我不得不更改我的文件以使用 HTML-CSS 输出处理器而不是 CommonHTML 输出处理器。更改后我的测试文件现在看起来像这样:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>MathJax Font</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS" : {
availableFonts : ["STIX"],
preferredFont : "STIX",
webFont : "STIX-Web",
imageFont : null
}
});
</script>
<script type="text/javascript"
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_HTMLorMML"></script>
</head>
<body>
<p>`v = pi r^2`</p>
</body>
</html>
我无法让 MathJax 更改它用来呈现用 AsciiMath 编写的公式的字体。我已经在 Whosebug 和网络上的其他地方阅读了类似问题的答案:
- Styling MathJax
- Changing mathjax's font size
- MathJax font matching and pairing
- Can MathJax use font xxxx?
这是我用作测试用例的完整 HTML5 文档:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>MathJax Font</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"CommonHTML" : { preferredFont:"Asana Math" }
});
</script>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_CHTML"></script>
</head>
<body>
<p>`v = pi r^2`</p>
</body>
</html>
我做错了什么?请帮我更改 MathJax 的字体。
我在 docs.mathjax.org/en/latest/output.html
找到了这个The CommonHTML output processor produces high-quality output in all modern browsers, with results that are consistent across browsers and operating systems. This is MathJax’s primary output mode since MathJax v2.6. Its major advantage is its quality, consistency, and speed as well as support for server-side generation. Its browser supports starts with IE9 and equivalent browsers and it degrades gracefully on older browsers. The CommonHTML output uses web-based fonts so that users don’t have to have math fonts installed on their computers. It currently only supports MathJax’s default TeX fonts.
我不得不更改我的文件以使用 HTML-CSS 输出处理器而不是 CommonHTML 输出处理器。更改后我的测试文件现在看起来像这样:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>MathJax Font</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS" : {
availableFonts : ["STIX"],
preferredFont : "STIX",
webFont : "STIX-Web",
imageFont : null
}
});
</script>
<script type="text/javascript"
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_HTMLorMML"></script>
</head>
<body>
<p>`v = pi r^2`</p>
</body>
</html>