gtg922r / obsidian-numerals

An obsidian plugin which turns a math code block into a full featured calculator
Other
389 stars 7 forks source link

Fixing latex input render in math-tex #33

Closed tdaron closed 9 months ago

tdaron commented 1 year ago

Hey ! I tried to fix my problem, here is my solution !

This is probably not a beautiful solution, but it actually works !

(i think there should be a switch in parameters to enable/disable it)

Here is before: image

q_etu = 5
toto = 2

here is after (using my pr): image

q_{etu} = 5
toto = 2
gtg922r commented 1 year ago

Thanks for the PR, I really appreciate it! mathjs uses {...} to define objects. Stripping braces out would prevent objects from being used. Let me do some more research and see if that would be an actual problem, or if there are any other options for ways to enable this.

Its possible with a regex I can only pull out braces from inside a variable name which would limit the damage

gtg922r commented 1 year ago

I'm trying to close out fixing of the number formatting issue (the bug you originally surfaced), including letting the user select the desired formatting. Then I'll look at this. I agree it'd be nice to be able to have the subscript in rendered variable names!

tdaron commented 1 year ago

Oh i didn't know mathjs used brackets for something, i looked too fast their docs !

Anyway, if needed, i would be glad to help !