From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Stefan-W. Hahn" Subject: Problem with org-export to LaTeX and babel Date: Tue, 31 May 2011 19:53:17 +0200 Message-ID: <20110531175317.GE7386@scotty.home> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRTAT-0000eP-WD for emacs-orgmode@gnu.org; Tue, 31 May 2011 13:55:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRTAS-00012i-8K for emacs-orgmode@gnu.org; Tue, 31 May 2011 13:55:49 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:57931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRTAR-00011D-Oc for emacs-orgmode@gnu.org; Tue, 31 May 2011 13:55:48 -0400 Received: from scotty.home (hs@localhost [127.0.0.1]) by scotty.home (8.14.3/8.14.3/Debian-9.4) with ESMTP id p4VHrMpk024410 for ; Tue, 31 May 2011 19:53:22 +0200 Received: (from hs@localhost) by scotty.home (8.14.3/8.14.3/Submit) id p4VHrHB2024407 for emacs-orgmode@gnu.org; Tue, 31 May 2011 19:53:17 +0200 Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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.