From: "Stefan-W. Hahn" <info@s-hahn.de>
To: emacs-orgmode@gnu.org
Subject: Problem with org-export to LaTeX and babel
Date: Tue, 31 May 2011 19:53:17 +0200 [thread overview]
Message-ID: <20110531175317.GE7386@scotty.home> (raw)
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.
next reply other threads:[~2011-05-31 17:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-31 17:53 Stefan-W. Hahn [this message]
2011-05-31 22:31 ` Problem with org-export to LaTeX and babel Eric S Fraga
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=20110531175317.GE7386@scotty.home \
--to=info@s-hahn.de \
--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).