emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] Html making 'ltximg' directory in source folder, rather than o


From: Ihor Radchenko
Subject: Re: [BUG] Html making 'ltximg' directory in source folder, rather than out folder [9.7.11 (release_9.7.11 @ /home/pranshu/Documents/appsource/emacs/lisp/org/)]
Date: Sun, 22 Dec 2024 12:16:23 +0000

Pranshu Sharma <pranshu@bauherren.ovh> writes:

> When doing:
> (org-export-to-file 'html "~/new/path/thing.html")
> and the file option has the path "~/other/path/file.org", the 'ltximg'
> directory is made in "~/other/path/", which is not intutive, or useful
> behaviour.
>
>
> (the option 'tex' is set to 'dvisvgm')

Confirmed.
Something like the attached patch should fix this.

However,
1. It will be a breaking change
2. We are in the process of rewriting LaTeX preview backend, so this may
   need to be addressed differently

I'd like to hear from Timothy or Karhik on this first.

>From e881f3a64b1b16fe3f32cd838d8cc88d79c0fd29 Mon Sep 17 00:00:00 2001
Message-ID: 
<e881f3a64b1b16fe3f32cd838d8cc88d79c0fd29.1734869662.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Sun, 22 Dec 2024 13:14:07 +0100
Subject: [PATCH] org-html-format-latex: Store LaTeX images alongside the HTML
 output

---
 lisp/ox-html.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 716b7e9596..1ca7c81485 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -3063,7 +3063,7 @@ (defun org-html-format-latex (latex-frag processing-type 
info)
              (concat (file-name-as-directory org-preview-latex-image-directory)
                      (file-name-sans-extension
                       (file-name-nondirectory bfn)))
-             cache-dir (file-name-directory bfn))
+             cache-dir (file-name-directory (plist-get info :output-file)))
        ;; Re-create LaTeX environment from original buffer in
        ;; temporary buffer so that dvipng/imagemagick can properly
        ;; turn the fragment into an image.
-- 
2.47.1

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]