[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Problem with org-html-format-latex
From: |
Vincent Beffara |
Subject: |
[O] Problem with org-html-format-latex |
Date: |
Thu, 7 Feb 2013 16:44:19 +0100 |
Hi,
Trying out the new exporter and hoping to have it work with o-blog ...
A bug occurs with org-html-format-latex (in ox-html.el) when called from a
non-file buffer. In the context of o-blog, it gets called as
(org-html-format-latex "$x$" 'mathjax) but still tries to bind some ltxpng
related support. This ends up calling file-name-sans-extension to the output of
(file-name-nondirectory (buffer-file-name)) which is nil ...
Crashing in such a case makes sense for ltxpng but not for mathjax.
This makes it work:
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index f4fc27b..03e09aa 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1994,8 +1994,8 @@ CONTENTS is nil. INFO is a plist holding contextual
information."
(defun org-html-format-latex (latex-frag processing-type)
(let* ((cache-relpath
(concat "ltxpng/" (file-name-sans-extension
- (file-name-nondirectory (buffer-file-name)))))
- (cache-dir (file-name-directory (buffer-file-name )))
+ (file-name-nondirectory (or (buffer-file-name) "")))))
+ (cache-dir (file-name-directory (or (buffer-file-name) "")))
(display-msg "Creating LaTeX Image..."))
(with-temp-buffer
but feels like the wrong solution, probably cache-relpath and cache-dir should
be set to nil in such a case ...
Regards,
/v
--
Vincent Beffara
- [O] Problem with org-html-format-latex,
Vincent Beffara <=
- Re: [O] Problem with org-html-format-latex, Vincent Beffara, 2013/02/07
- Re: [O] Problem with org-html-format-latex, Bastien, 2013/02/08
- Re: [O] Problem with org-html-format-latex, Vincent Beffara, 2013/02/10
- Re: [O] Problem with org-html-format-latex, Vincent Beffara, 2013/02/10
- Re: [O] Problem with org-html-format-latex, Bastien, 2013/02/11
- Re: [O] Problem with org-html-format-latex, Vincent Beffara, 2013/02/11
- Re: [O] Problem with org-html-format-latex, Bastien, 2013/02/12
- Re: [O] Problem with org-html-format-latex, Vincent Beffara, 2013/02/12