widcardw / obsidian-asciimath

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

Semicolon in function #24

Open ShahriarKh opened 2 months ago

ShahriarKh commented 2 months ago

image I want to put semicolon in function. I tried $f(t;mu,sigma)$ but the output is a vector: image

Is it a bug in the plugin or AsciiMath Parser? because https://asciimath.org/ works: image

Update

I see that you mentioned that the matrix operator is different from original asciimath. If that's the case, how can I have the semicolon in function?

ShahriarKh commented 2 months ago

One hacky solution is to use ; (Greek question mark) instead of ; (semicolon)

widcardw commented 2 months ago

That is because this package use semicolon as the line separator of a matrix, while in original asciimath, it usese nested parens (or brackets) to indicate the matrix. However, I am also not sure how many users may complain about this bug.

A quick temporary solution is to define another symbol that will be directly transformed into a semicolon.

  1. Open the Obsidian asciimath plugin settings
  2. Add a line <your custom symbol> , ; to Custom symbols section
  3. Then use the symbol above to represent the semicolon.

In my custom settings, I use ;; to represent ;

I will talk to another contributor about this problem.

ShahriarKh commented 2 months ago

Thanks for the blazing fast response. The custom symbol solution looks okay to me 👍🏽

widcardw commented 2 months ago

Or another solution is to wrap the semicolon with double quotes, but this problem sometimes also confuses me. I am still not sure how to make the rule convinced and exact...

ShahriarKh commented 2 months ago

double quotes make the comma disappear

widcardw commented 2 months ago

double quotes make the comma disappear

Okay, just turn to custom symbols T_T