How to enable markdown mathematical formula rendering in hexo blog
How to enable markdown mathematical formula rendering in hexo blog
After you build your personal blog with hexo, you may not notice that it cannot render mathematical formulas in markdown file normally. But you always run into this problem after a few posts. I will tell you how to enable this formula rendering function.
Replace Hexo’s markdown rendering engine
The default rendering engine hexo-renderer-marked has some bugs, so it is best to uninstall it and replace it with a more stable one.
npm uninstall hexo-renderer-marked –save
npm install hexo-renderer-kramed –save
Modify the node_modules\kramed\lib\rules\inline.js file
There are still some bugs in the rendering engine that we need to fix.
1 |
|
1 |
|
Modify the _config.yml file of your theme
Find the math switch in the _config.yml file of your theme, and turn it on.
Redeploy hexo
1 |
|
Reference
How to enable markdown mathematical formula rendering in hexo blog
http://example.com/2024/07/24/How-to-enable-markdown-mathematical-formula-rendering-in-hexo-blog/