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

Undefined control sequence \binom #4

Open
karamellpelle opened this issue May 22, 2015 · 2 comments
Open

Undefined control sequence \binom #4

karamellpelle opened this issue May 22, 2015 · 2 comments

Comments

@karamellpelle
Copy link

Using binomials works in preview mode, but not for the created note: "Undefined control sequence \binom". See: http://www.texpaste.com/n/s2p9dc71

PS: very nice page :)

@nvquanghuy
Copy link
Owner

Thanks for reporting the error! Will look at it real soon.

On Saturday, 23 May 2015, karamellpelle [email protected] wrote:

Using binomials works in preview mode, but not for the created note:
"Undefined control sequence \binom". See:
http://www.texpaste.com/n/s2p9dc71

PS: very nice page :)


Reply to this email directly or view it on GitHub
#4.

@rctay
Copy link

rctay commented May 23, 2015

I did some debugging on this.

The \binom symbol requires AMSmath. Usually, this is loaded via MathJax.Hub.Config({Tex: extensions: ["AMSmath.js"], ... }) Looking at our mathjax configuration, we aren't loading it. So one should expect that \binom wouldn't work. So why does it work in the "preview" mode but not when displaying a saved note?

In the preview mode, we were loading lots of symbols for the cheatsheet on the left (via symbols.json). One of them is the \begin{align*} example under "Aligned Equations". It turns out that mathjax loads AMSmath for it - see [1]! So there you have it - why \binom works in "preview" mode but not in the saved note.

One way would be to make saved mode also show a cheatsheet, like in preview. That way, we would have all the "incidental" extensions mathjax loaded.

We could also add the AMSmath etc to extensions in the Mathjax config. It also has the benefit of making clearer what mathjax extensions we would definitely provide. However, the network trace in Chrome between preview and saved mode is still different - preview is loading more stuff, like fonts, etc. So we might still have some symbols that would be able to work in preview mode but not in saved mode.

So, we could continue tracing mathjax and dig up which extensions are being loaded, and put them in the extensions config.

I wonder if we could get mathjax to resolve the missing extension, load them, and re-render...

[1] https://github.com/mathjax/MathJax/blob/4292f9ed6bd2b57ceb740bf475d0aafbd7a8cb63/unpacked/jax/input/TeX/jax.js#L1026

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

3 participants