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

It seems that hexo can't work well with MathJaX when meets "_" #1888

Closed
veya2ztn opened this issue Apr 14, 2016 · 4 comments
Closed

It seems that hexo can't work well with MathJaX when meets "_" #1888

veya2ztn opened this issue Apr 14, 2016 · 4 comments

Comments

@veya2ztn
Copy link

下述代码包含了利用MathJax在markdown中显示数学公式,包括行间的使用$$ $$和行内的使用$ $

### Mathtype in List
+ Transverse Ising model
  $$
  H=-\sum_{i=1}^N (\sigma_{i}^x \sigma_{i+1}^x+g \sigma_{i}^z)
  $$
###Mathtype between lines
$$
H=-\sum_{i=1}^N (\sigma_i^x \sigma_{i+1}^x+g \sigma_i^z)
$$
### Mathtype inline in list
+ the particle has only two state $\left| \uparrow \right\rangle$ and $\left| \downarrow \right\rangle$, which means that $\sigma^z \left| \uparrow \right\rangle =1 \left| \uparrow \right\rangle$

Expected behavior (预期行为)

预期的行为应当是

Actual behavior (实际行为)

Guessing Reason (原因猜测)

我用了一下最新的hexo-math支持的KaTex
I use the KaTex for testing

{% math %}
\begin{aligned}
H=-\sum_{i=1}^N (\sigma_i^x \sigma_{i+1}^x+g \sigma_i^z)
\end{aligned}
{% endmath %}

是可以实现的,然后我把所有的“_”符号给删去,
And I find it works. And if I delete all the script _ in LaTeX code

  $$
  H=-\sum^N (c^x c^y+g c^z)
  $$

mathJaX 就可以渲染了,所以问题在于hexo 在渲染的时候会把一些_给丢去,导致mathjax无法识别
it now can work.
So the problem is that when the hexo change the ".md" into web file the text in ".md" changed and some notation like "_" lost

@whatbeg
Copy link

whatbeg commented Dec 1, 2016

同样困扰于这个问题,请问官方考不考虑解决一下呢?

@jeffkzhao
Copy link

遇到同样的问题

@NoahDragon
Copy link
Member

将MathJax代码放置在<% raw %> <% endraw %> 之间。

@jeffkzhao
Copy link

jeffkzhao commented Jan 19, 2017

前面的issue提到了这个问题,请参考#524 ,建议关闭该issue。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants