Re: [O] Problem with org-html-format-latex
Hi, > > (let ((cache-relpath "") (cache-dir "") bfn) > > Mhh... okay. Now should be good. Yep, thanks! > Thanks for your patience. No thanks needed, nor patience either for that matter, you and the other devs are the ones who should be thanked ... /v > > -- > Bastien
Re: [O] Problem with org-html-format-latex
Vincent Beffara writes: >> > so simply testing >> > on the value of processing-type would work better, maybe? >> >> Yes, should be okay now, let me know! > > Nope, exactly the same. cache-relpath and cache-dir are not allowed to be > nil. Meaning that if processing-type is 'mathjax they should be set to > _some_ string anyway (the contents will be ignored eventually, but far down > the line unfortunately ...) Something like instead of your 'let' line > works: > > (let ((cache-relpath "") (cache-dir "") bfn) Mhh... okay. Now should be good. Thanks for your patience. -- Bastien
Re: [O] Problem with org-html-format-latex
> > so simply testing > > on the value of processing-type would work better, maybe? > > Yes, should be okay now, let me know! Nope, exactly the same. cache-relpath and cache-dir are not allowed to be nil. Meaning that if processing-type is 'mathjax they should be set to _some_ string anyway (the contents will be ignored eventually, but far down the line unfortunately ...) Something like instead of your 'let' line works: (let ((cache-relpath "") (cache-dir "") bfn) /v
Re: [O] Problem with org-html-format-latex
Vincent Beffara writes: > so simply testing > on the value of processing-type would work better, maybe? Yes, should be okay now, let me know! -- Bastien
Re: [O] Problem with org-html-format-latex
> > thanks for reporting this and for the patch, I've push > > a slightly different fix. Please test and let me know. > > Sounds good to me, thanks! ... well it did sound good to me, but it still fails. Put this in *scratch*, (org-html-format-latex "x" 'mathjax) and C-x C-e. Within org-format-latex, file-name-nondirectory is still called on the first argument (prefix) which your patch sets to nil. The error occurs one layer deeper in the tree but still does. My patch kind of fixed that by accident, but it should be safe at least in the case of mathjax which AFAICT will never create files anywhere - so simply testing on the value of processing-type would work better, maybe? /v > > /v > > > > Best, > > > > -- > > Bastien >
Re: [O] Problem with org-html-format-latex
> thanks for reporting this and for the patch, I've push > a slightly different fix. Please test and let me know. Sounds good to me, thanks! /v > > Best, > > -- > Bastien
Re: [O] Problem with org-html-format-latex
Hi Vincent, Vincent Beffara writes: > Cleaner patch uses ignore-errors, that's simpler... thanks for reporting this and for the patch, I've push a slightly different fix. Please test and let me know. Best, -- Bastien
[O] Problem with org-html-format-latex
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
Re: [O] Problem with org-html-format-latex
Hi again, > 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 ... Cleaner patch uses ignore-errors, that's simpler... /v 0001-Fix-the-non-file-buffer-bug.patch Description: Binary data