Hexo-theme-next: MathJax have no effect

Created on 21 Jul 2017  ·  8Comments  ·  Source: iissnan/hexo-theme-next

Expected behavior (预期行为)

I am using the Typora Markdown local editor, his grammar is to comply with the GFM standard, I wrote the latex formula in the editor, the local editor shows the correct result!

typoa

latex

Actual behavior (实际行为)

But the formula can not be displayed on the web page
default

Steps to reproduce the behavior (重现步骤)

NexT Information

Add the ✔ sign before an item which is affected by this behavior.

NexT Version:

  • Master
    ✔- Latest Release
  • Old version -

NexT Scheme:

  • All schemes
    ✔ - Muse
  • Mist
  • Pisces

Other Information (Like Browser, System, Screenshots)

When the beginning of the problem, I first looked at other people's issues, found that the problem is quite common, and the reasons for a variety of. I started to see #1154, I used their method, but found no effect. I uninstalled the kramed plugin and reused the hexo's rendering engine. Later, some people say that the default mathjax cdn has been invalid, I changed a cdn. Anyway, try a lot of ways, but do not know where the problem lies

here is my theme's config.yml
mathjax

Most helpful comment

这个帖子里有提到解决方法 (This post has a solution)

try to replace default with
//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML

最后的代码是 (final code)

mathjax:
  enable: true
  per_page: true
  #cdn: //cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML
  cdn: //cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML

All 8 comments

Please I need a help!

@BarryLiu1995 can u check #1672? Mb, it can help.

@ivan-nginx This is not the problem

@BarryLiu1995 may be u right, but anyway i think what problem is not in Next theme.
Theme Next - it's just templates and styles with some javascripts engines.
Mathjax - it's third party javascript and not Next maintenance it. And as markdown engine too.
It seems, problem in markdown engine in compilation with mathjax or any third-party plugins, what directly support markdown and/or Hexo. And i really don't know about mathjax and how it work, but u may also try to research in our issues by this link or ask in MathJax | Markdown | NodeJS issues. Next it's just template, u must know and understand it.

@ivan-nginx Ok, I got it. I will try to fix my problem by myself.

@BarryLiu1995 i don't know what this is, but see - it's working:
In _config.yml:

# MathJax Support
mathjax:
  enable: true
  per_page: false
  cdn: //cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML

In *.md file:

## MathJax fast test

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

image

@ivan-nginx I change Front-matter like this and it work
g

这个帖子里有提到解决方法 (This post has a solution)

try to replace default with
//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML

最后的代码是 (final code)

mathjax:
  enable: true
  per_page: true
  #cdn: //cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML
  cdn: //cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML
Was this page helpful?
0 / 5 - 0 ratings

Related issues

dev-fancyluo picture dev-fancyluo  ·  3Comments

ifyour picture ifyour  ·  4Comments

aiplay picture aiplay  ·  4Comments

DVD0423 picture DVD0423  ·  3Comments

keltoy picture keltoy  ·  3Comments