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

Math formula support ? #49

Closed
waynenilsen opened this issue Sep 10, 2015 · 4 comments
Closed

Math formula support ? #49

waynenilsen opened this issue Sep 10, 2015 · 4 comments

Comments

@waynenilsen
Copy link
Contributor

Great work with this project! I would love to see mathjax or katex integration. I use math formulas frequently and pandoc supports this. Here is a render from pandoc with mathjax integration

image

and the same thing in mdbook

image

I am using them in parallel for this reason right now.

@azerupi
Copy link
Contributor

azerupi commented Sep 10, 2015

I would love that too ;) Actually that is one of the features I want most, because I plan to use mdBook for my school notes. But the best place to implement this is in the markdown parser (pulldown-cmark). There is already a request there, but it's not very active.

@azerupi
Copy link
Contributor

azerupi commented Sep 10, 2015

I added the MathJax JS files (from the CDN) you can already add math equations but sometimes it collides with the markdown rules, for example:
*$$ 1 * 2 + 3 = 5 $$ works but *$$1*2+3=5$$ does not.

@waynenilsen
Copy link
Contributor Author

Yea, I agree that it should be in the markdown parser. As a workaround you could sanitize the MD by replacing the math with random, non-repeating characters a-z and keeping a lookup table, then putting the math back into the generated HTML. Maybe there is an easier way?

@azerupi
Copy link
Contributor

azerupi commented Dec 23, 2015

At the moment, it should work using:

Blocks

\\[ Your math here... \\]

Inline

\\( Your math here... \\)

You have to double-escape, because the markdown parser is going to remove one backslash. I have used this and I haven't had any problems. The dollar signs do not work well and would need support in the markdown parser.

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

2 participants