emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Vincent Beffara <vbeffara+ml@gmail.com>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: Problem with org-html-format-latex
Date: Thu, 7 Feb 2013 16:44:19 +0100	[thread overview]
Message-ID: <20E4E4D8E34D465D9CF893C7EE0BBEFC@gmail.com> (raw)

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

             reply	other threads:[~2013-02-08  0:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-07 15:44 Vincent Beffara [this message]
2013-02-07 16:26 ` Problem with org-html-format-latex 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20E4E4D8E34D465D9CF893C7EE0BBEFC@gmail.com \
    --to=vbeffara+ml@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).