emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Problem with org-export to LaTeX and babel


From: Stefan-W. Hahn
Subject: [O] Problem with org-export to LaTeX and babel
Date: Tue, 31 May 2011 19:53:17 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hello,

I tried to use org-mode the first time with LaTeX export and embedded
babel block. But it doesn't do the right thing.

Following test:

---------- snip
* gnuplot example

  Just a test.

#+begin_src gnuplot :session none :file out.png
set terminal png
set xlabel "gx";set ylabel "gy";set zlabel "gz"
set grid xtics ytics
set view 0,0
plot cos(x)
#+end_src
---------- snip

This in an org-mode file and than exporting to LaTeX I always get
following error message from babel:

---- snip from *Messages*:
Export buffer: 
Exporting to LaTeX...
org-babel-exp processing...
executing Gnuplot code block...
gnuplot-mode 0.6.0 (gnuplot 4.4) -- report bugs with "C-c C-u"
split-string: Wrong type argument: stringp, nil
---- snip

I'm using 
 GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1)
   of 2010-12-11 on brahms, modified by Debian
and
 org-mode
 commit cec8711a44a9a1ac6552546c05ec0623a2bf9e45

I tried to trace this down till

 org-babel-execute:gnuplot (body params)
   where params is nil.
 which ist called by
 org-babel-execute-src-block (&optional arg info params)
   where params is nil
 which is called by
   org-babel-exp-results (info type &optional silent hash)
     in this function (nth 2 info) does contain the scanned
     parameters, but org-babel-execute-src-block is called
     just with with two not three parameters.

After trying the patch:

diff --git a/.emacs-lisp/org-mode/ob-exp.el b/.emacs-lisp/org-mode/ob-exp.el
index 09e85ca..baccba5 100644
--- a/.emacs-lisp/org-mode/ob-exp.el
+++ b/.emacs-lisp/org-mode/ob-exp.el
@@ -262,7 +262,8 @@ inhibit insertion of results into the buffer."
                       (equal hash (org-babel-exp-in-export-file (nth 0 info)
                                     (org-babel-result-hash info))))))
     (let ((lang (nth 0 info))
-         (body (nth 1 info)))
+         (body (nth 1 info))
+         (params (nth 2 info)))
       ;; skip code blocks which we can't evaluate
       (when (fboundp (intern (concat "org-babel-execute:" lang)))
        (org-babel-eval-wipe-error-buffer)
@@ -275,11 +276,11 @@ inhibit insertion of results into the buffer."
                    `((:results . ,(if silent "silent" "replace")))))))
          (cond
           ((or (equal type 'block) (equal type 'inline))
-           (org-babel-execute-src-block nil info))
+           (org-babel-execute-src-block nil info params))
           ((equal type 'lob)
            (save-excursion
              (re-search-backward org-babel-lob-one-liner-regexp nil t)
-             (org-babel-execute-src-block nil info)))))))))
+             (org-babel-execute-src-block nil info params)))))))))
 
 (provide 'ob-exp)
 
it worked. But I'm not sure if my using of babel is correct and
if yes, wheter the patch will do the right thing in all usings 
babel. (I'm just learning to understand lisp programming.)

Any suggestions?

Stefan

-- 
Stefan-W. Hahn                          It is easy to make things.
                                        It is hard to make things simple.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]