widcardw / obsidian-asciimath

Asciimath support for Obsidian (based on asciimath-parser)
MIT License
29 stars 3 forks source link

Symbol subsets don't work when using a notation with multiple arguments #6

Closed nikp123 closed 1 year ago

nikp123 commented 1 year ago

For example:

int_(-oo) ^(0_-) (asd)

Renders like this in AsciiMath.org: image

And fails in Obsidian: image

The 0_- is needed if you want to describe a very small (in this case negative) number that is approaching zero.

Thankfully 0_+ works fine, no issue there.

Workaround: You can break the - character by doing 0_"-" instead but that shortens the minus sign and makes it almost invisible.

widcardw commented 1 year ago

At first I would like to support e^-x, but the parser should look forward and take the x as the param of -, and wrap it like {- x}.

However, I did not tkink of this problem, the parser should not look forward when meeting the right paren. I just consider - as an operator that has one param after it.

Thanks for finding out this problem. I will try to fix it in time.

BTW, the temporary solution is as follows

int_(-oo) ^(0_-{::}) (asd)

Since the - takes the empty brace as its param.