io12 / org-fragtog

Automatically toggle Org mode LaTeX fragment previews as the cursor enters and exits them
MIT License
397 stars 14 forks source link

Generating new pictures asynchronously #2

Closed contrun closed 4 years ago

contrun commented 4 years ago

Hi, thank you for your efforts. I find this really helpful.

My only complaint is that when I move the point out of latex fragments, emacs blocks. It takes about 2 seconds for me to generate a new picture, and I am not able to do anything. My emacs-fu is not so good as to contribute this package. Can you give me some technical details on this issue? Is it possible to generate new pictures in the background and display it when it is ready without blocking my editing?

io12 commented 4 years ago

I'm glad you find my package helpful!

The blocking is because rendering org fragments takes time. If you render fragments without org-fragtog, it also blocks. The previews are cached by default in ltximg/, which helps a bit, but new renders are still slow.

Unfortunately, I don't think async org latex fragments are currently possible, but I can look into other packages for async latex rendering like texfrag.

fbob commented 4 years ago

Thanks for your great package ! :) Is it possible to combine both: texfrag + org-fragtog ?

io12 commented 4 years ago

I don't think that's possible, since org-fragtog relies on org-mode's built-in inline latex fragments and (as far as I know) texfrag replaces this with AUCTeX previews.