如何从本地文件配置MathJax?

时间:2018-06-06 15:11:01

标签: javascript mathjax

我正在HTML页面内的一段脚本中配置MathJax,

<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/latest.js' async></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    jax: ["input/TeX","output/CommonHTML"],
    extensions: ["tex2jax.js"],
    tex2jax: {
      inlineMath: [ ['$','$'] ],
      processEscapes: true
    },
    minScaleAdjust: 90
  });
</script>

我想将此配置放入config.js文件中。所以我做了:

<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/latest.js' async></script>
<script src="scripts/config.js" type="text/x-mathjax-config"></script>

并在scripts/config.js文件中:

MathJax.Hub.Config({
  jax: ["input/TeX","output/CommonHTML"],
  extensions: ["tex2jax.js"],
  tex2jax: {
    inlineMath: [ ['$','$'] ],
    processEscapes: true
  },
  minScaleAdjust: 90
});

但是,热潮!,没有任何工作了,tex表达式不再显示了。
我必须准确地说我是Javascript的新手,这可能是一个愚蠢的新手错误:)

0 个答案:

没有答案