防止 MathJax 将版本附加到包含的 JS
Prevent MathJax to append version to included JS
我无法阻止 MathJax 将版本附加到每个 JS 包含?
为澄清起见,请遵循开发者控制台的快照:
编辑 添加一个config.js 不起作用
编辑 2 使用更简单的解决方案进行更改但仍然无法正常工作加代码段
正如我在代码中看到的,一种可能的解决方案是覆盖 cdnVersion
属性.
按照默认值 属性 的 MathJax.js
的快照:
MathJax.cdnVersion = "2.7.1"; // specifies a revision to break caching
根据 Mathjax 文档的建议(http://docs.mathjax.org/en/latest/options/index.html
) 你可以使用 MathJax.Hub.Config()
来完成这项工作。
我试过这个配置不起作用:
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML", "output/PreviewHTML"],
tex2jax: {inlineMath: [["$$","$$"]]},
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js", "fast-preview.js", "AssistiveMML.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
},
cdnVersion: null
});
下面是一个演示片段:
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML", "output/PreviewHTML"],
tex2jax: {inlineMath: [["$$","$$"]]},
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js", "fast-preview.js", "AssistiveMML.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
},
cdnVersion: null
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js"></script>
$$ \frac{3}{4}x^2 $$
这是不可能的,因为它们不是 config/default.js
中定义的设置,来自 config documentation
The various components of MathJax, including its input and output
processors, its preprocessors, its extensions, and the MathJax core,
all can be configured through the config/default.js
file, or via a
MathJax.Hub.Config()
call (indeed, if you look closely, you will see
that config/default.js
is itself one big call to
MathJax.Hub.Config()
). Anything that is in config/default.js
can be
included in-line to configure MathJax.
我无法阻止 MathJax 将版本附加到每个 JS 包含?
为澄清起见,请遵循开发者控制台的快照:
编辑 添加一个config.js 不起作用
编辑 2 使用更简单的解决方案进行更改但仍然无法正常工作加代码段
正如我在代码中看到的,一种可能的解决方案是覆盖 cdnVersion
属性.
按照默认值 属性 的 MathJax.js
的快照:
MathJax.cdnVersion = "2.7.1"; // specifies a revision to break caching
根据 Mathjax 文档的建议(http://docs.mathjax.org/en/latest/options/index.html
) 你可以使用 MathJax.Hub.Config()
来完成这项工作。
我试过这个配置不起作用:
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML", "output/PreviewHTML"],
tex2jax: {inlineMath: [["$$","$$"]]},
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js", "fast-preview.js", "AssistiveMML.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
},
cdnVersion: null
});
下面是一个演示片段:
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML", "output/PreviewHTML"],
tex2jax: {inlineMath: [["$$","$$"]]},
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js", "fast-preview.js", "AssistiveMML.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
},
cdnVersion: null
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js"></script>
$$ \frac{3}{4}x^2 $$
这是不可能的,因为它们不是 config/default.js
中定义的设置,来自 config documentation
The various components of MathJax, including its input and output processors, its preprocessors, its extensions, and the MathJax core, all can be configured through the
config/default.js
file, or via aMathJax.Hub.Config()
call (indeed, if you look closely, you will see thatconfig/default.js
is itself one big call toMathJax.Hub.Config()
). Anything that is inconfig/default.js
can be included in-line to configure MathJax.