在 Hexo 中显示公式

问题

尝试在 Hexo 中显示公式,采用了 pandoc + mathjax 的方法。 但是在下标中仍然不能有 # 或 \# ,现在也没有找到解决办法

详细信息

安装的 node_modules :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ npm ls
hexo-site@0.0.0 E:\Document\Blog
├── hexo-deployer-git@4.0.0
├── hexo-filter-flowchart@1.0.4
├── hexo-filter-mathjax@0.9.0
├── hexo-generator-archive@2.0.0
├── hexo-generator-category@2.0.0
├── hexo-generator-index@3.0.0
├── hexo-generator-tag@2.0.0
├── hexo-renderer-ejs@2.0.0
├── hexo-renderer-pandoc@0.4.0
├── hexo-renderer-stylus@3.0.1
├── hexo-server@3.0.0
├── hexo-theme-next@8.19.2
└── hexo@7.1.1

在 _config.yml 中添加:

1
2
3
4
5
6
7
8
9
10
11
12
# Mathjax
mathjax:
tags: none # or 'ams' or 'all'
single_dollars: true # enable single dollar signs as in-line math delimiters
cjk_width: 0.9 # relative CJK char width
normal_width: 0.6 # relative normal (monospace) width
append_css: true # add CSS to pages rendered by MathJax
every_page: false # if true, every page will be rendered by MathJax regardless the `mathjax` setting in Front-matter
packages: # extra packages to load
extension_options: {}
# you can put your extension options here
# see http://docs.mathjax.org/en/latest/options/input/tex.html#tex-extension-options for more detail

通过 winget 安装了 pandoc 3.1.12.2