(一)设置hexo支持Latex公式

本文介绍了如何在Hexo博客中配置支持Latex公式,包括使用pandoc渲染引擎、安装mathjax插件,并提供了一个实例展示了公式渲染效果。同时提到了设置步骤和参考资料链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


欢迎访问个人网络日志🌹🌹知行空间🌹🌹


1.设置hexo支持Latex公式

网页上对Latex的支持需要借助能够解析Latex语法的插件引擎,将Latex语法转成HTML元素,常用的
Latex公式引擎有Katex,mathjax引擎等,如优快云使用的就是Katex

  • 渲染引擎改成pandoc
npm uninstall hexo-rendered-marked
npm install hexo-rendered-pandoc
  • 安装mathjax插件
npm install hexo-filter-mathjax
  • 修改站点_config.yaml文件,注意不是themes中的_config.yaml
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
  • 每个页面.md头部加入mathjax: true

2.效果

$$
f(x) = \frac{x^2}{x+y}
$$

渲染结果为:
f ( x ) = x 2 x + y f(x) = \frac{x^2}{x+y} f(x)=x+yx2

参考资料

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值