From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: [bug?] [babel] cannot generate table format output for octave results Date: Fri, 14 Jan 2011 09:22:22 +0000 Message-ID: <8762trdelt.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=49842 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdgT3-0007in-5D for emacs-orgmode@gnu.org; Fri, 14 Jan 2011 05:01:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdgT1-0001UJ-Oh for emacs-orgmode@gnu.org; Fri, 14 Jan 2011 05:01:12 -0500 Received: from vscani-e.ucl.ac.uk ([144.82.108.33]:63778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdgT1-0001UE-I5 for emacs-orgmode@gnu.org; Fri, 14 Jan 2011 05:01:11 -0500 Received: from pinto.chemeng.ucl.ac.uk ([128.40.74.171] helo=localhost) by vscani-e.ucl.ac.uk with esmtp (Exim 4.72) (envelope-from ) id 1PdgSw-0002Ek-2x for emacs-orgmode@gnu.org; Fri, 14 Jan 2011 10:01:06 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Emacs Org mode mailing list Hello, I want an octave babel code block to generate an org table as the /result/ so that it can be used by another code block elsewhere in my document. Typically, because of how I generate my data, I would like babel to create the table from the /output/ of the octave code, not the value. However, specifying =:results output table= doesn't seem to work (for me, in any case). The following is an example with two octave babel code blocks. The first asks for the /value/ of the block to be extracted and converted to an org table. This works fine. The second block asks for the /output/ to be converted. This doesn't work in that the output is not converted to org table syntax *and* the output is encapsulated in an /example/ block. --8<---------------cut here---------------start------------->8--- #+srcname: valueresult #+begin_src octave :results value table values = []; for i=1:15 values(end+1,:) = [i, i^3]; endfor ans = values #+end_src #+results: valueresult | 1 | 1 | | 2 | 8 | | 3 | 27 | | 4 | 64 | | 5 | 125 | | 6 | 216 | | 7 | 343 | | 8 | 512 | | 9 | 729 | | 10 | 1000 | | 11 | 1331 | | 12 | 1728 | | 13 | 2197 | | 14 | 2744 | | 15 | 3375 | #+srcname: outputresult #+begin_src octave :results output table values = []; for i=1:15 values(end+1,:) = [i, i^3]; endfor disp(values) #+end_src #+results: outputresult #+begin_example 1 1 2 8 3 27 4 64 5 125 6 216 7 343 8 512 9 729 10 1000 11 1331 12 1728 13 2197 14 2744 15 3375 #+end_example --8<---------------cut here---------------end--------------->8--- I should add that I am having a great deal of fun with org and babel at the moment! I am finishing off a paper and the presentation of the results of my research requires me to run some code (octave) to generate a rather large set of results that go into a number of data files. I then process these files with a shell script block using awk to extract the necessary information for presentation. The output of this is passed to another octave block which does some data analysis. The analysis results are then passed to a gnuplot block. Very simple chain of blocks that I used to do all separately but that I can now have in a single document. In fact, I have two chains from the same initial code to present two different aspects of the results. Babel is fantastic basically. Well, so is org, of course. Thanks (again and again) to all org and babel implementers! -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1 : using Org-mode version 7.4 (release_7.4.174.g163cd)