gpt4 book ai didi

mathjax - 如何更改 MathJax 的字体

转载 作者:行者123 更新时间:2023-12-03 23:19:22 35 4
gpt4 key购买 nike

我无法让 MathJax 更改它用于呈现以 AsciiMath 编写的公式的字体。我已经在 StackOverflow 和网络上的其他地方阅读了类似问题的答案:

  • 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 - 如何更改 MathJax 的字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41474096/

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