remarkjs/remark-math

Will \( \) style math formula be supported

Ir1d opened this issue · 12 comments

Ir1d commented

Subject of the feature

Describe your issue here.

in some mathjax configs people write \(a+b\) as formulas, will this be supported?

Problem

If the feature requests relates to a problem, please describe the problem you are trying to solve here.

Expected behaviour

What should happen? Please describe the desired behaviour.

parse \(\) as inline and \[\] as dispay

Alternatives

What are the alternative solutions? Please describe what else you have considered?

possible related #21

While supporting this wouldn’t be too hard to implement (although brittle: the backslashes, parens, and square brackets will interfere with other Markdown constructs, whereas dollars are not in use), I’m not really in favor of adding it: I prefer that remark (and other markdown parsers) push a single way to do things. Having multiple ways to do a similar extension makes the Markdown you write less portable.

Ir1d commented

I totally agree with you. Lets stick with $ and $$

If someone wants this btw, packages/remark-math can be forked to add that. rehype-katex and such will still work if you expose the same math node in Markdown!

Ir1d commented

yeah I understand, that's nice. I believe using $ only will be better, even though it takes more time to migrate, it's worth the effort.

twavv commented

I (a person on the internet) disagree with this decision.

Using \( is not a config option, it's part of LaTeX syntax and is actually ENCOURAGED: https://tex.stackexchange.com/questions/510/are-and-preferable-to-dollar-signs-for-math-mode.

I understand that TeX !== LaTeX but it still feels like a thing that should be supported.

We’re not necessarily covering (la)tex here though: it’s about math in markdown in general, which could be mathml or asciimath syntax too.

And, see #39 (comment): you can do this yourself if you want to!

twavv commented

I don't feel like users should have to fork the project to be able to do this. Is it really that complex to implement here? It seems like it's not (but I might be mistaken).

@travigd there's a fine line here.
Adding configuration for markers may have value to discuss on it's own.

The push back is on reason presented, which appears to be "it's in latex, so it should be here".
That is a non-goal, markdown is not latex.

If you want a latex transformer, contributions towards syntax-tree/ideas#6 are welcome!
If there is a markdown focused reason, it may be worth exploring.

twavv commented

Sure, sure, I get it.

From my perspective, I'm just trying to give the best experience possible to the users of my editor (users who are at least partially accustomed to the \( syntax). I'm not arguing that this project should support all things LaTeX (e.g., supporting \begin{align}), but I am arguing that supporting \( is a very pragmatic thing to do.

I don’t think it’d be good for markdown to standardize several syntaxes. I think we’re in a position to push for one syntax, as the most popular markdown parser, and I think we should do that. Again: you can do whatever you want with plugins, but I don‘t think we should make it easier.

If someone wants this btw, packages/remark-math can be forked to add that. rehype-katex and such will still work if you expose the same math node in Markdown!

Can you give some examples on how to do this exactly? Looking at the package code, I'm a little lost albeit I haven't made my own plugin before.