-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Improve MathJax support by enabling $$ for math equations #400
Comments
Couldn't this be implemented entirely in JavaScript (see the MathJax Docs)? |
Ah thanks for reminding me, I forgot the most important part of this issue! Currently, math expressions will collide with markdown syntax. If you write So to make mathjax fully usable, we need to preprocess the equations and replace it with something that will be skipped by the markdown parser. The solution in my first post will therefore not work. What I propose is to wrap the math equations with html tags. For inline |
I would like to look into this. Will start a branch and send in a WIP pull request |
First commit in a branch dedicated to improving MathJax support. See issue rust-lang#400.
I'm wondering if it would be better to switch to using code-fences for embedded markup languages, as suggested in this thread on the CommonMark forums, eg:
This would also have the advantage of making the github previews look much nicer. We might have to wait for this to go through the pipeline of standardization though. :/ |
I'll naively plug tectonic. It is a full LaTeX engine partially written in rust that could potentially integrate with mdBook for advanced formatting needs. |
Does anyone happen to be working on this right now? If not, the Rust ML WG is interested in picking this task up. |
@vadixidav I doubt anyone is looking at it. Feel free to take a look, though I'm not up to speed with what the problems are (I think maybe mathjax needs to be a preprocessor?). |
I am not @vadixidav. |
I'm not working on this, but I'll leave two pointers here which are hopefully useful to people who are:
|
Hey, I created recently a small plugin for scientific |
This is exactly a great feature to be considered. |
Github seems to have no problem of using MathJax over Markdown using the obvious Latex syntax |
I think this is overall blocked on pulldown-cmark/pulldown-cmark#622. |
mdbook-katex is now quite feature-complete, capable of producing completely static outputs. It is also capable of rendering inside See https://github.com/SichangHe/mdbook_katex_static_css/ Any reason why the CDN-delivered MathJax must have the exclusive privilege of being the "default"? |
Since I got lost in this and a few other open issues: https://github.com/lzanini/mdbook-katex works well. |
@ehuss Would you consdier, also from a maintainability viewpoint, to drop MathJax and recommend users to use an extension such as |
Currently, Mathjax is a little akward to use because we only support the
\( ... \)
and\[ ... \]
method to indicate inline and block equations respectively. On top of that, backslashes need to be escaped so that the markdown parser doesn't remove them. Thus, equations need to be written like:So when mathjax support is enabled in the configuration, it would be great to add a preprocessor that rewrites the
\[ ... \]
forms to\\[ ... \\]
and add support for the$$ ... $$
math delimiters.The text was updated successfully, but these errors were encountered: