Browse Source

Fix the ltxpng path for HTML and ODT exporters

* org-html.el (org-export-html-preprocess)
(org-export-html-format-image): Use
`org-latex-preview-ltxpng-directory'.

* org-odt.el (org-export-odt-do-preprocess-latex-fragments):
Ditto.

Commit 8474115b20ff2ac907d62f30a0f543064318f47d breaks LaTeX
image exports as HTML and ODT.  This fixes it.
Abdó Roig-Maranges 12 years ago
parent
commit
cb34324a82
2 changed files with 3 additions and 3 deletions
  1. 2 2
      lisp/org-html.el
  2. 1 1
      lisp/org-odt.el

+ 2 - 2
lisp/org-html.el

@@ -763,7 +763,7 @@ The default is an extended format of the ISO 8601 specification."
   (when (and org-current-export-file
 	     (plist-get parameters :LaTeX-fragments))
     (org-format-latex
-     (concat "ltxpng/" (file-name-sans-extension
+     (concat org-latex-preview-ltxpng-directory (file-name-sans-extension
 			(file-name-nondirectory
 			 org-current-export-file)))
      org-current-export-dir nil "Creating LaTeX image %s"
@@ -2031,7 +2031,7 @@ PUB-DIR is set, use this as the publishing directory."
 (defun org-export-html-format-image (src par-open)
   "Create image tag with source and attributes."
   (save-match-data
-    (if (string-match "^ltxpng/" src)
+    (if (string-match (regexp-quote org-latex-preview-ltxpng-directory) src)
 	(format "<img src=\"%s\" alt=\"%s\"/>"
                 src (org-find-text-property-in-string 'org-latex-src src))
       (let* ((caption (org-find-text-property-in-string 'org-caption src))

+ 1 - 1
lisp/org-odt.el

@@ -2658,7 +2658,7 @@ using `org-open-file'."
 	 cache-dir display-msg)
     (cond
      ((eq latex-frag-opt 'dvipng)
-      (setq cache-dir "ltxpng/")
+      (setq cache-dir org-latex-preview-ltxpng-directory)
       (setq display-msg "Creating LaTeX image %s"))
      ((member latex-frag-opt '(mathjax t))
       (setq latex-frag-opt 'mathml)