Hexo-theme-next: 数学公式渲染为什么只有博客首页会加载mathjax, 而进入post页面之后,就不加载mathjax了?

Created on 11 Feb 2017  ·  7Comments  ·  Source: iissnan/hexo-theme-next

Expected behavior

MathJax Support

mathjax:
enable: true
per_page: true
cdn: //cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML

Actual behavior (实际行为)

结果只有首页渲染了数学公式,post页面并没有

Most helpful comment

mathjax 的 per_page 选项当初是我加进去的。加这个选项是考虑到有些博客可能100篇博文中只有几篇需要显示公式,如果给每个页面都载入 mathjax 会很慢,所以加了 per_page 选项使得只有首页以及用户指定的页面才加载 mathjax。

具体使用方法见 #887,我不确定文档里是否有更新 mathjax 的使用说明。

All 7 comments

还有这种事?

@Neveryu 这个也不能发截图,是真的!我打开chrome调试里面,加载首页的时候可以看到mathjax加载了,并且首页预览的公式可以被渲染,但是点进去看具体博客的时候,发现不加载那个mathjax了,也没能渲染

然后我直接看源代码,发现发布的public里面博客index.html 的确没得加载mathjax的语句,但是首页的index.html尽然有,我也觉得奇怪啊,我不会js web?请问这是什么bug啊,谢谢 @Neveryu

@kitianFresh
我刚才测试了一下是没有问题的。

mathjax:
  enable: true
  cdn: //cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML

只需要配置这两行就可以了,所以你要将你的配置文件中的 per_page: true 去掉。
我下面给一个数学公式给你,你放在你的文章中,看结果

$$lim_{1\to+\infty}P(|\frac{1}{n}\sum_i^nX_i-\mu|<\epsilon)=1, i=1,...,n$$

@Neveryu 感谢,去掉 per_page 可以了! 不过对数学公式支持不好,下面的不认识,希望能改进

\begin{equation}
\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{bmatrix}+
\begin{bmatrix}
10 & 11 & 12 \\
13 & 14 & 15 \\
16 & 17 & 18
\end{bmatrix}=
\begin{bmatrix}
11 & 13 & 15 \\
17 & 19 & 21 \\
23 & 25 & 27
\end{bmatrix}
\end{equation}

mathjax 的 per_page 选项当初是我加进去的。加这个选项是考虑到有些博客可能100篇博文中只有几篇需要显示公式,如果给每个页面都载入 mathjax 会很慢,所以加了 per_page 选项使得只有首页以及用户指定的页面才加载 mathjax。

具体使用方法见 #887,我不确定文档里是否有更新 mathjax 的使用说明。

@kitianFresh don't understand u, write in English if not solved. If solved, close it please. Thank's!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

blueyi picture blueyi  ·  5Comments

bingstyle picture bingstyle  ·  3Comments

dev-fancyluo picture dev-fancyluo  ·  3Comments

winterrain5 picture winterrain5  ·  4Comments

online picture online  ·  3Comments