joeyuping / quick_latex_obsidian

MIT License
326 stars 21 forks source link

tab and break in all matrices #58

Closed julianmueller closed 2 years ago

julianmueller commented 2 years ago

Hi, I like the feature, where you can use TAB and ENTER in the \begin{pmatrix}\end{pmatrix}environment to insert & and \\. But unfortunately, i also use other types of matrices like the following, which this feature does not work for:

I did not test all of them, and Im not certain if thats all of Mathjax Matrix-alikes, that are supported by Obsidian.

Is it possible to adept the plugin for TAB and ENTER auto-completition in these environments? Thanks

joeyuping commented 2 years ago

Thank you so much for this suggestion!!

I have included the tab and enter function for some of the matrixes as suggested: \begin{matrix} ... \end{matrix} \begin{bmatrix} ... \end{bmatrix} \begin{Bmatrix} ... \end{Bmatrix} \begin{vmatrix} ... \end{vmatrix} \begin{Vmatrix} ... \end{Vmatrix} \begin{smallmatrix} ... \end{smallmatrix}

Please update to v2.3.4 and see if its ok. Also, a quick way to write all these matrixes is to add statements like the following into the custom shorthand : Bm:\begin{Bmatrix}#cursor\end{Bmatrix}; vm:\begin{vmatrix}#cursor\end{vmatrix}; ...

this way, by typing "Bm" and space bar, the matrix begin and end text will be pasted and cursor will be placed in between. the tab and enter function should work within the matrix environment.

Thanks again!

julianmueller commented 2 years ago

Thank you very much! Great idea. So far I used the matrix shorthand CTRL+SHIFT+M for a matrix and then added p/b/v in begin/end to fit it to my needs. But unfortunately, related to #57 cursor does not work for me.

julianmueller commented 2 years ago

sorry to say... but the TAB and ENTER in not working for me, for the listed matrix types... :(

joeyuping commented 2 years ago

@julianmueller Hi!

I have just updated another v2.3.7, could you kindly update and see if the issue may have been resolved?

julianmueller commented 2 years ago

Thank you very much! Issue is fixed, everything is working as expected. Also this resolves issue #57, #cursor and #tab are working correctly.

julianmueller commented 2 years ago

I just learned about rcases which is like cases but with the brakets on the right. You might want to add this as well :) (or make an option where one can specify all the environments where they want the TAB and ENTER option working.