【发布时间】:2021-11-02 22:12:14
【问题描述】:
我正在使用MkDocs 1.2.2 和MathJax 3.2,通过Arithmatex 来自pymdown-extensions。我试图让 Arithmatex 将 \\[ 和 \\](而不是默认的 \[ ... \])中的数学识别为显示数学。从基本配置开始,
markdown_extensions:
- footnotes
- pymdownx.arithmatex
- pymdownx.highlight
- pymdownx.superfences
extra_javascript:
- javascripts/mathjax-config.js
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg-full.js
其中mathjax-config.js 在Loading MathJax 部分中恰好包含the code under the tab "Default – MathJax 3",在Markdown 输入文件中写入以下内容,
\\[
\Sigma_n
\\]
生产
像这样更改 MkDocs 配置文件以添加 tex_block_wrap,
markdown_extensions:
- footnotes
- pymdownx.arithmatex:
tex_block_wrap: ['\\\\[', '\\\\]']
- pymdownx.highlight
- pymdownx.superfences
不改变输出。我尝试了\ 字符数的变化,但没有效果。通过将以下内容添加到我的 mathjax-config.js 文件中,我在 MathJax 端尝试了类似的配置更改:
window.MathJax = {
tex: {
displayMath: [ ["\\\\[", "\\\\]"] ],
},
....
还有\ 字符数的变化,但没有成功。
如何在 MkDocs 中获取 Arithmatex+MathJax 以允许使用 \\[ 和 \\] 作为显示数学分隔符?
【问题讨论】: