joeyuping / quick_latex_obsidian

MIT License
327 stars 21 forks source link

Feature Request: Possible custom bracket expansions #43

Closed mayurankv closed 1 year ago

mayurankv commented 2 years ago

A request that is pretty low priority (but may be easy to implement?), I was wondering if one could choose how brackets auto expand. I have defined paired delimeters for both square brackets and parenthesis (and others) and would ideally like the $(...)$ brackets to expand to my $\pbrac{...}$ instead of $\left(...\right)$. Could this be an option in settings?

In a similar vein, would auto expansion for other delimiters like \lver\rvert, \langle\rangle and {} be possible?

joeyuping commented 1 year ago

Hi!!

sorry for the really late reply...

Now with custom shorthand, may I suggest employing the shorthand, may be in a form like below:

vb:::\lvert #cursor \rvert ab:::\langle #cursor \rangle

or something along those lines? add these to the shorthand parameter in the setting page.

mayurankv commented 1 year ago

Sorry, let me make myself a bit clearer. One of the settings in the plugin is for brackets to auto expand. For example, when you type $(\frac{1}{2})$, the brackets will auto expand to $\left(\frac{1}{2}\right)$. I would like to optionally have the brackets to expand to alternative delimiting pairs - in my case $\brac{\frac{1}{2}}$. So instead of the transformation ['(',')'] -> ['\left(','\right)'], an optional custom transformation of ['(',')'] -> ['\brac{','}'].