emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problem with org-html-format-latex
@ 2013-02-07 15:44 Vincent Beffara
  2013-02-07 16:26 ` Vincent Beffara
  0 siblings, 1 reply; 9+ messages in thread
From: Vincent Beffara @ 2013-02-07 15:44 UTC (permalink / raw)
  To: Org Mode List

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

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

end of thread, other threads:[~2013-02-12 20:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-07 15:44 Problem with org-html-format-latex Vincent Beffara
2013-02-07 16:26 ` Vincent Beffara
2013-02-08 18:49   ` Bastien
2013-02-10 23:28     ` Vincent Beffara
2013-02-10 23:43       ` Vincent Beffara
2013-02-11 15:12         ` Bastien
2013-02-11 21:44           ` Vincent Beffara
2013-02-12  7:39             ` Bastien
2013-02-12 20:26               ` Vincent Beffara

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