asciimath / asciimathml

A new home for asciimathml
http://asciimath.org/
MIT License
957 stars 183 forks source link

Make comma `,` escapable without making it a text `","` #139

Closed Epyxoid closed 2 years ago

Epyxoid commented 2 years ago

In my country we use comma for decimal point (15,41) instead of a dot (15.41) and I want to use asciimath just like that as well, but it separates the numbers before and after a comma (like this: 15, 41), like they were separate numbers. I can undo this by making the number a "text" (`"15,41"` or `15","41` -> 15,41 without the space).

This is a plausible solution to my problem, but I need a simpler one so that I don't have to put everything in quotation marks. I was thinking of a couple escaping methods, like `15,,41` (following the example of `//` and `\\`), or `15\,41` (it's a little uglier) or `15.,41` or something like that.

Or maybe the formatting of `,` could be moved to `, ` (comma+space), so basically if you want to use the comma as before, then now you must put a space after it (I now it'd make this change not backward compatible, so it's might be a too wild idea), and then the single comma (without space after it) could be the not formatted version without escaping it.

I don't know what would be the best to achieve what I want, but I certainly want to use asciimath as we write math here. That's what it's for, right? To be able to write in math on the internet as we do on paper, and it's so cool it's possible thanks to you!

drlippman commented 2 years ago

What you're looking for is the decimalsign configuration value, which lets you specify that , is your decimal sign, which will cause ASCIIMathML to treat 3,456 as a single number rather than two separated by a comma.

If you're using ASCIIMathML natively, you edit that config option at the top of the file. If you're using MathJax as your renderer, you can change it in the configuration. See https://docs.mathjax.org/en/latest/options/input/asciimath.html#asciimath-options for details.

Epyxoid commented 1 year ago

Wow, thank you! Sorry for my ignorance. I'll definitely look into it!