joeyuping / quick_latex_obsidian

MIT License
326 stars 21 forks source link

Auto placement of "\\" and "&" on enter within the enabled shortcut blocks #68

Closed fvcci closed 2 years ago

fvcci commented 2 years ago

If I have the align, matrix, or cases shortcut blocks enabled I get the characters "\\" and "&" automatically placed on an enter while I am in the corresponding block:

image

As you can see on enter it places a "\\" on the current line then skips an indentation and places a "&" immediately after. But a lack of indentation is not my main complaint. It may be convenient to automatically place these characters on enter, but in many cases this may not be what a user wants.

On the first line I have an overly long line in the code, so I would want it to be in typed in separate lines. But when it is being displayed I want it to be in one line since it can fit in one line. Adding the "\\" on enter makes it so that a user would have to delete them every time their code is too long but when it is being displayed it would not be.

On the last line I want to display the variable again to show that I am square rooting both sides. This would be a common reason to display the left hand side to an equation, and with the auto placement of "&" it is inconvenient to do because it must be deleted to get the alignment correct.

There are many other reasons to why the auto placement is inconvenient other than these, which is why I think this feature should be removed or separated from the functionality of shortcut blocks because I think shortcut blocks are really useful and I would use them if it weren't for "\\" and "&".

joeyuping commented 2 years ago

Hi @fvcci !

Thank you so much for the suggestion! I did some modification to the functionality (see v2.4.0)

I hope the above changes would improve the workflow for the use case you mentioned above. Thank you!