tecosaur / org-latex-preview-todos

A tracker for the Org LaTeX Preview effort on https://git.tecosaur.net/tec/org-mode
5 stars 0 forks source link

Preview image file storage location for HTML exports #12

Closed karthink closed 8 months ago

karthink commented 9 months ago

Leaving preview images in org-persist-dir when exporting Org documents to HTML with tex:dvisvgm or tex:dvipng makes the files non-portable and should be avoided.

As a result, there are two questions:

  1. Where do we place the image files relative to the exported HTML document?
  2. How is this location specified by the user?

We've been unable to find an intuitive/least-surprise solution to either of the questions. Here is the current system:

image

And here are a few different options we've considered. There are more possibilities because of the org-persist/temporary storage option (for non-export previews) and the option to inline the images in the HTML document:

Option 1

image

Option 2

image

Option 3

image

tecosaur commented 9 months ago

I'm not a fan of the complexity, but I'm most inclined towards (2) currently, based on the following thought process:

  1. Inline images need to be an option
  2. Having files locally/next to the .org file seems important for publishing
  3. I think it would be undesirable to have to accept a local folder if you want in-buffer previews
  4. There are legitimate reasons for wanting to switch between persist/temp preview storage, separately to the axis of publishing concerns
karthink commented 9 months ago
  1. I think it would be undesirable to have to accept a local folder if you want in-buffer previews

Based on the number of questions about ltximg/ online, I think many users will want control over where in-buffer previews are placed. The limited choice of org-persist-dir or /tmp is going to annoy them. (Maybe this should be a separate issue?)

karthink commented 9 months ago

I'm not a fan of the complexity, but I'm most inclined towards (2) currently, based on the following thought process:

  1. Inline images need to be an option
  2. Having files locally/next to the .org file seems important for publishing

I agree broadly, but I'm looking for a better option than all of these, one with fewer arrows. Some modification of option 2 perhaps.

tecosaur commented 9 months ago

Based on the number of questions about ltximg/ online, I think many users will want control over where in-buffer previews are placed. The limited choice of org-persist-dir or /tmp is going to annoy them. (Maybe this should be a separate issue?)

We could have two variables

karthink commented 9 months ago

Conclusion from discussion: Let's do it, with the name as org-latex-preview-cache for now.

tecosaur commented 8 months ago

Done.