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

HackMD doesn't allow inline math syntax that has space character right after/before the opening/closing dollar sign #669

Closed
brlin-tw opened this issue Jan 9, 2018 · 5 comments

Comments

@brlin-tw
Copy link
Contributor

brlin-tw commented Jan 9, 2018

For example, $ \frac{3}{4} $ should also be interpreted as $\frac{3}{4}$. Is there any reason not so support this behavior?

@brlin-tw brlin-tw changed the title HackMD doesn't allow single dollar sign inline math syntax that has space character right after/before the opening/closing dollar sign HackMD doesn't allow inline math syntax that has space character right after/before the opening/closing dollar sign Jan 9, 2018
@jackycute
Copy link
Member

Hi @Lin-Buo-Ren
But that's part of the design of the inline math syntax.
You shouldn't put space around the opening/closing dollar sign.

refer to our package: https://github.com/classeur/markdown-it-mathjax

@brlin-tw brlin-tw closed this as completed Jan 9, 2018
@brlin-tw
Copy link
Contributor Author

brlin-tw commented Jan 9, 2018

Thanks for the pointers! I never notice the syntax until now 🤦‍

@cben
Copy link

cben commented Mar 23, 2019

I see that CodiMD (and HackMD) also support \\(inline\\) and \\[display\\] syntaxes. But these are not documented in https://demo.codimd.org/features?both#MathJax — do you consider them "official"?

Only single-dollar syntax has this limitation about spaces (to reduce false-positives for people using dollar sign without intention or even awareness of math syntax). \\( a^2 \\)4, \\[ a^2 \\]4, and $$ a^2 $$ all parse as math alright; newlines instead of spaces work too.

@SISheogorath
Copy link
Contributor

@cben I would really welcome a Pull Request including an example to our docs page :)

This would make it official 👍 (at least for CodiMD)

@brlin-tw
Copy link
Contributor Author

I would really like to make it configurable via YAML though...

and \escape all the regular usage of the dollar sign.

This issue was closed.
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

4 participants