emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [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/)]
@ 2024-12-07 14:54 Pranshu Sharma
  2024-12-22 12:16 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Pranshu Sharma @ 2024-12-07 14:54 UTC (permalink / raw)
  To: emacs-orgmode


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')


Emacs  : GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0)
 of 2024-11-27
Package: Org mode version 9.7.11 (release_9.7.11 @ /home/pranshu/Documents/appsource/emacs/lisp/org/)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* 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/)]
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-12-22 12:16 UTC (permalink / raw)
  To: Pranshu Sharma, TEC, karthikchikmagalur; +Cc: emacs-orgmode

[-- 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>

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-22 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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).