emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Pranshu Sharma <pranshu@bauherren.ovh>,
	TEC <orgmode@tec.tecosaur.net>,
	karthikchikmagalur@gmail.com
Cc: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <87r05z9alk.fsf@localhost> (raw)
In-Reply-To: <87r06jv8zx.fsf@bauherren.ovh>

[-- Attachment #1: Type: text/plain, Size: 590 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-html-format-latex-Store-LaTeX-images-alongside-t.patch --]
[-- Type: text/x-patch, Size: 1053 bytes --]

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


[-- Attachment #3: Type: text/plain, Size: 223 bytes --]


-- 
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	other threads:[~2024-12-22 12:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-07 14:54 [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/)] Pranshu Sharma
2024-12-22 12:16 ` Ihor Radchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r05z9alk.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=karthikchikmagalur@gmail.com \
    --cc=orgmode@tec.tecosaur.net \
    --cc=pranshu@bauherren.ovh \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).