joeyuping / quick_latex_obsidian

MIT License
326 stars 21 forks source link

Auto-complete $ + Auto-enclose #19

Closed nathancartlidge closed 2 years ago

nathancartlidge commented 2 years ago

Would it be possible to enable the auto-enclose functionality for latex blocks - i.e. when a latex expression in text is highlighted and the $ key is pressed, could the latex be enclosed within this

This appears to work when Autoclose $$ is disabled, but not when it is enabled

Thanks!

joeyuping commented 2 years ago

Thank you!! I can add that function in the same way as how I have implemented the "selecting text and press open brackets encloses the expression in brackets" function. Will add that into the next version!

ndharari commented 2 years ago

+1 on the request!

Thanks for your work!

jenshda commented 2 years ago

+1

I was just about to write the same request. Highlighting some text and adding brackets and parenthesises are such a great tool and I would love for the same to work with the dollar signs for LaTEX code. Would save so much time

Great to hear that it's on the roadmap :)

Thanks for the fantastic work, this is one of the plugins that provide the most value to me. I really wish these features worked as seamlessly in my LaTEX program.

joeyuping commented 2 years ago

Hi all!!

so sorry for the really long wait! has been hectic weeks~

I have just published version 1.5.6 incorporating the above functionality. Please kindly update the plugin and see if that works ok.

Thanks again to all! @infinityiowastaken @ndharari @jenshda

jenshda commented 2 years ago

Hello again,

This latest update seem to have removed the auto-close functionality, but only for the $ sign. I still prefer the new auto-enclose functionality over auto-close but just thought you should know that this seems to have removed the earlier functionality. :)

nathancartlidge commented 2 years ago

Hmm, I can't replicate this issue on my machine, I seem to have both auto-enclose and auto-close working. Are you using the live preview mode? I think that breaks it

jenshda commented 2 years ago

Yes I'm working in Live Preview. I see, at least that explains it 👍

joeyuping commented 2 years ago

Hi !

I am using the new Live Preview mode. on my machine, it seems that the auto-enclose function is now inbuilt into obsidian. so even when the plugin is disabled, the auto enclose function is still present (selecting some text and press the $ symbol or any open brackets). And this apparently works in both new live preview mode and legacy editor mode.

thats why I removed the auto enclose function from the plugin.

does this now inbuilt operation not happen in your machine?

jenshda commented 2 years ago

The auto-enclose is now built into Obsidian, that's true, but the previous: pressing $ and getting $$ is now no longer working in either live preview mode.

I attach a screenshot of the feature no longer working for me:

Screenshot 2022-01-09 at 14 50 42
joeyuping commented 2 years ago

thank you, I see..

sorry though... I wasnt able to reproduce the issue on my machine... the $$ function you mention works ok for me whether in live preview mode or legacy mode...

might you like to try reinstalling the plugin? or see if it might be some compatibility issue with other plugin, or theme? if possible, could you help me try switching back to the obsidian default theme and test again, if you are actually using a custom theme?

jenshda commented 2 years ago

Ok, seems likely it's a bug then! That's good, then I'll be able to solve it myself :) Thanks for your replies and your effort with this