joeyuping / quick_latex_obsidian

MIT License
326 stars 21 forks source link

Issue (or possible bug?) using the underscore _ after curly brackets {}. #42

Closed mayurankv closed 2 years ago

mayurankv commented 2 years ago

Hi, just want to say thank you so much for the plugin! It makes using obsidian for maths not only bearable but very flowing.

I have a slight issue which is after using curly brackets {} (for example $\vec{x}$), then using the underscore character _ creates a pair of underscores as I would expect in the normal obsidian editor but within the latex delimiters, I would expect just one to be inserted as it is when inserted after for example $x$. This also creates an issue with the automatic enclosing of things following the underscore since where $x2$ goes to $x{2}$ and $\vec{x}2$ goes to $\vec{x}{2}$, with the double insertion and blindly typing onwards, $\vec{x}$ goes to $\vec{x}2$ which goes to $\vec{x}2}{$ which is definitely not desired behaviour (and means one has to go back to fix the resulting mess breaking the flow of typing) nor can I see a ruleset which would cause this.

This would be completely solved by not pairing _ characters within the latex delimiters I believe!

joeyuping commented 2 years ago

hi @mayurankv !

sorry, I don't seem to be able to replicate the issue you are facing. on my machine, typing \vec{x} followed by the underscore creates only one underscore.

mayurankv commented 2 years ago

Ah, it turns out that I had automatic pairing of markdown syntax (so _ and *) on in obsidian as a whole. I realised I never really use this feature outside math blocks anyway since I use Cmd I and Cmd B for italics and bold anyway so I've just turned it off and that now works for me! Thanks!