emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problem with org-export to LaTeX and babel
@ 2011-05-31 17:53 Stefan-W. Hahn
  2011-05-31 22:31 ` Eric S Fraga
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan-W. Hahn @ 2011-05-31 17:53 UTC (permalink / raw)
  To: emacs-orgmode

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.

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

end of thread, other threads:[~2011-05-31 22:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-31 17:53 Problem with org-export to LaTeX and babel Stefan-W. Hahn
2011-05-31 22:31 ` Eric S Fraga

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