Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加 LaTeX 支持 #52

Closed
cristime opened this issue Jul 11, 2022 · 3 comments
Closed

添加 LaTeX 支持 #52

cristime opened this issue Jul 11, 2022 · 3 comments
Labels
优化 提供新想法&新意见
Milestone

Comments

@cristime
Copy link

这个想法是哪个方面的?

新增功能 / 用户体验

这个想法要做到什么?

支持 LaTeX 渲染

这个想法能为项目提供什么帮助?

便于技术类文章编写

是否有具体的实现思路?

在主题中原生引入 Mathjax / Katex 的 js 文件()

@cristime cristime added the 优化 提供新想法&新意见 label Jul 11, 2022
@bhaoo
Copy link
Owner

bhaoo commented Jul 12, 2022

暂时性的解决办法如下:

你可以前往 includes/footer.php 中的第 34 行后插入一下代码

<script>
MathJax = {
  tex:{
    inlineMath: [['$','$'], ["\\(","\\)"]],
    displayMath: [['$$','$$'], ["\\[","\\]"]]
  },
  svg:{
    fontCache:"global"
  }
};
</script>
<script src="https://cdn.bootcdn.net/ajax/libs/mathjax/3.2.2/es5/tex-chtml.js" async></script>

并前往主题设置 - 高级设置 - PJAX回调 中插入一下代码

MathJax.typeset($('.post-content'));

@bhaoo
Copy link
Owner

bhaoo commented Jul 12, 2022

由于 MathJax 的静态文件体积过大,估计得写成配套插件了(

@bhaoo bhaoo added this to the v2.0.2 milestone Jul 12, 2022
@cristime
Copy link
Author

谢谢,问题已解决😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
优化 提供新想法&新意见
Projects
None yet
Development

No branches or pull requests

2 participants