io12 / org-fragtog

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

feature request: display all expressions as rendered when first visiting buffer #19

Closed holtzermann17 closed 3 years ago

holtzermann17 commented 3 years ago

@io12 I think what the poster in #9 meant was (paraphrasing):

Would it be possible to add a command to rerender all LaTeX expressions in the buffer, so that I can add that to my org-mode-hook?

At the level of implementation, perhaps it's also possible to cache the images somewhere, so that they aren't actually rerendered but simply re-inserted in the buffer.

I think it's a good feature request!

io12 commented 3 years ago

Thanks. After rereading #9's post, I think you're right. Org-mode already supports this with org-startup-with-latex-preview and caches the images in org-preview-latex-image-directory. Hopefully this is good enough and doesn't warrant a new org-fragtog feature.

holtzermann17 commented 3 years ago

Yep, perfect! I'd suggest a quick note about this feature in the README to spread awareness.

holtzermann17 commented 3 years ago

Also, if anyone wants to toggle all of the images this exists as well, but is a bit hidden.

There doesn't seem to be a variable making the state (on or off) explicit from a programmatic standpoint.