hexo-theme-yinwang
hexo-theme-yinwang copied to clipboard
如何支持公式块
你好,请问如何让这个主题支持公式块呢?就像makedown格式的那样。
刚才更新了一下,试一下好用吗?
$$V_{sphere} = \frac{4}{3}\pi r^3$$
行间公式块可以很好地转换了,不知道能不能使行内公式块也同样支持呢?
我把主题恢复到之前的代码了,关于 Latex 的支持,你可以用一下这个 hexo 插件:
https://github.com/next-theme/hexo-filter-mathjax
按照里面的步骤安装使用就好了,我试了一下是好用的。
感谢,mathjax我配置了后发现还是不行的,不过最后通过分析其它主题的代码找到了解决方法。我对/layout/layout.pug文件进行了修改,最终是这样子的:
if theme.mathjax.enable
script(src="https://polyfill.io/v3/polyfill.min.js?features=es6")
script(async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js")
script.
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
},
svg: {
fontCache: 'global'
}
};
感谢,mathjax我配置了后发现还是不行的,不过最后通过分析其它主题的代码找到了解决方法。我对/layout/layout.pug文件进行了修改,最终是这样子的:
if theme.mathjax.enable
script(src="https://polyfill.io/v3/polyfill.min.js?features=es6")
script(async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js")
script.
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
},
svg: {
fontCache: 'global'
}
};