AllanChain / logseq-live-math

Type LaTeX in live mode!
Apache License 2.0
46 stars 2 forks source link

[FR] Add a keyboard shortcut to trigger the plugin #9

Closed proItheus closed 11 months ago

proItheus commented 11 months ago

I feel typing /m<Enter every time I want to input math a bit cumbersome, especially when it's just sth short like $x\inX$.

I think we can add a shortcut, like ctrl+m? To trigger the math input like \math.

AllanChain commented 11 months ago

This can be implemented, but it doesn't feel necessary, at least for me. I prefer triggering using $$, which is as simple as ctrl+m. And if I'm typing short math, I'll do it without triggering the plugin.

Maybe there are some cases where you think ctrl+m is better than $$? Please share the feedback.

proItheus commented 11 months ago

It's indeed only slightly better I think, better in fewer keystroke.

I prefer to have a unified interface when I want to type some math, so I'll use the trigger heavily, which is why I think it matters. And I believe when implemented, logseq will also automatically allow user to change this keybinding.

Anyway, it's upon you whether to implement it. That's just my usecase.

And thanks for this wonderful plugin! It made my Latex writing experience a LOT more fluid, and now I'm writing all my course notes&reports&assignments using logseq+mathlive.

AllanChain commented 11 months ago

Released https://github.com/AllanChain/logseq-live-math/releases/tag/v1.2.1. I bound it to ctrl+shift+m by default, since ctrl+m minimized the Logseq window on Linux.

AllanChain commented 10 months ago

Maybe there are some cases where you think ctrl+m is better than $$?

I actually realized the case that a keyboard shortcut would be useful.

Previously, selection-and-edit feature requires selecting exactly the math to edit, which is not convenient. With a keyboard shortcut, I was able to implement a feature that searches relevant math automatically and opens the popup. See c244214f8280036573ef522cd76301d89418503c (not released yet).

Thanks again for this great idea and inspiration!