Mathjax/Katex顯示測試
testing for mathjax, for katex. The reason that I tried to use katex instead of mathjax is related to the Next theme. If I tried to use next theme with markdown-it render, I should also use markdown-it-katex instead of the mathjax.
Latex中的數學表達式
The Gamma function satisfying $\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N$ is via the Euler integral
$$
x = {-b \pm \sqrt{b^2-4ac} \over 2a}.
$$
$$
\Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt,.
$$
1 | $\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$ |
${\sum_{i=0}^n i^2}$
$\theta^{n+1}=\theta^n-\eta\nabla C\left( \theta^n\right)$
如果是在字裡行間的話可以這樣$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$
簡單講把你要的東西用$ $包起來,就可以拉!
更多關於 LaTeX 數學表達式 ^5
手把手使用Katex做渲染的方式
以Next的主題爲例,如果要用Katex作為渲染,必須要將預先安裝的markdown渲染器hexo-renderer-marked改為hexo-renderer-markdown-it。[^3]
換好之後,再安裝markdown-it-katex[^4]
記得修改系統跟佈景主題中的_config.yml!(以下只列出需要修改的部分。)
themes/next/_config.yml
1 | # Math Equations Render Support |
_config.yml
1 | markdown: |
Mathjax
這是舊版的支援方式,不選擇的使用原因是速度相對慢。下面的連結作為紀念用,表示以前有努力過。有興趣用Mathjax的人可以參考看看
您可以使用 MathJax 語法 來產生 LaTeX 數學表達式^1
有關使用MathJax在Hexo中可以參考必富客的網誌^2。
[^3]: Chris 技術筆記-換Hexo的markdown渲染器
[^4]: Chris 技術筆記-hexo 加上數學式 MathJax; Hexo 博客支持 KaTeX(回爐版); Hexo 書寫 LaTeX 公式時的一些問題及解決方法
- 標題: Mathjax/Katex顯示測試
- 作者: 溯言|Rhett Caen
- 撰寫於 : 2018-03-29 11:46:21
- 更新於 : 2018-03-30 11:46:21
- 連結: https://fractalrhythm.vercel.app/2018/03/29/hexo-test-math-katex/
- 版權宣告: 本作品採用 CC BY-NC-SA 4.0 進行許可。