joeyuping / quick_latex_obsidian

MIT License
327 stars 21 forks source link

Auto close | | (absolute value) #60

Closed Yoav6 closed 2 years ago

Yoav6 commented 2 years ago

It would be nice to have the vertical line | work like brackets, so when you type it another one is immediately created and your cursor will be place between them, and if you select an expression an type | it would enclose the selection instead of deleting it.

joeyuping commented 2 years ago

Thank you so much for the suggestion!

However, as the | symbol is also used very commonly in the conditional probability context (e.g. P(x|y) ) , I am afraid that having this function may affect this other usage.

Yoav6 commented 2 years ago

That's a good point! I think if it is toggle-able then we could have best of both worlds - If you work with lots of absolute values, turn it on. If you work with conditional probability or anything that uses singular |, turn it off. And the default could be either mode.