orsharir / github-mathjax

Chrome extension for rendering LaTeX equations in GitHub with MathJax
Other
154 stars 49 forks source link

Many formulas are not rendered #18

Open scruel opened 6 years ago

scruel commented 6 years ago

$$J(\theta_0, \theta1) = \dfrac {1}{2m} \displaystyle \sum {i=1}^m \left ( \hat{y}{i}- y{i} \right)^2 = \dfrac {1}{2m} \displaystyle \sum {i=1}^m \left (h\theta (x{i}) - y{i} \right)^2$$

This formula could not be rendered in the following link, and there are much more formulas could not be rendered like this, although it can be rendered in this issue post. https://github.com/scruel/ML-AndrewNg-Notes/blob/master/notes/week1.md#22-%E6%8D%9F%E5%A4%B1%E5%87%BD%E6%95%B0cost-function

snipaste20180107_200058

$ h_\theta(x) \geqslant 0.5 $ shows error "Undefined control sequence \geqslant"

muzimuzhi commented 5 years ago

\geqslant is defined by MathJax extension AMSsymbol [1], and it can be loaded by [2]

TeX: {
  extensions: ["AMSmath.js", "AMSsymbols.js"]
}

However, github-mathjax does not load any MathJax TeX extensions. Hence \geqslant is undefined. https://github.com/orsharir/github-mathjax/blob/d73c97dd2643d53e6b0bde3a721eb13913b64524/mathjax_config.js#L11

[1] http://docs.mathjax.org/en/latest/tex.html#g [2] MathJax doc - How to load extension AMSsymbol

xwang233 commented 5 years ago

@muzimuzhi Thanks! This works for me.