Re: [O] Problem with ltxpng path for html and odt exports

2012-09-14 Thread Bastien
Hi Abdó,

Abdó Roig-Maranges abdo.r...@gmail.com writes:

 Here is a patch fixing a bug introduced in commit
 8474115b20ff2ac907d62f30a0f543064318f47d. That commit added a config
 variable with the path for the ltxpng directory (latex images) but
 didn't take into account html and odt exports.

Applied, thanks.

(PS: I edited the changelog a bit, please see my edits for further
commits and ChangeLogs.)

-- 
 Bastien



[O] Problem with ltxpng path for html and odt exports

2012-09-13 Thread Abdó Roig-Maranges

Here is a patch fixing a bug introduced in commit
8474115b20ff2ac907d62f30a0f543064318f47d. That commit added a config
variable with the path for the ltxpng directory (latex images) but
didn't take into account html and odt exports.

Abdó Roig.

From 02435c7ac59611278d49b8499ce117033b415d86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Abd=C3=B3=20Roig-Maranges?= abdo.r...@gmail.com
Date: Thu, 13 Sep 2012 22:35:44 +0200
Subject: [PATCH] Fixes ltxpng path for html and odt exports

Commit 8474115b20ff2ac907d62f30a0f543064318f47d breaks latex image
exports as html and odt. This fixes it.

* org-html.el (org-export-html-preprocess): replaces explicit ltxpng/
(org-export-html-format-image): replaces ^ltxpng/ regexp.

* org-odt.el (org-export-odt-do-preprocess-latex-fragments):
replaces ltxpng/
---
 lisp/org-html.el | 4 ++--
 lisp/org-odt.el  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org-html.el b/lisp/org-html.el
index 209e3ec..79b0286 100644
--- a/lisp/org-html.el
+++ b/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))
diff --git a/lisp/org-odt.el b/lisp/org-odt.el
index c3fc325..e7d4e31 100644
--- a/lisp/org-odt.el
+++ b/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)
-- 
1.7.12