mathjax - 如何更改 MathJax 的字体

标签 mathjax asciimath

我无法让 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/

    相关文章:

    javascript - 在 for 循环中定义函数

    javascript - 为什么 Chrome 和 Firefox 使用 MathJax 缓慢渲染我的主页?

    javascript - iPhone 上的 mathJax 与设备宽度产生图像字体

    latex - 如何将 asciimath 转换为 latex

    javascript - 如何使用AsciiMath与MathJax一起显示?

    mathjax - MathJax 中的双括号

    python - 使用 python-markdown-math 渲染 markdown 时出现问题

    javascript - 包含带索引的多次求和的 MathJax 方程

    javascript - 如何让 MathJax/ASCIIMath 忽略某些单词