From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: [babel] Replace results with ascii package caption Date: Mon, 05 Mar 2012 07:25:21 -1000 Message-ID: References: <87linfask2.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4bfJ-0000l2-0D for emacs-orgmode@gnu.org; Mon, 05 Mar 2012 12:26:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4bfD-0008NQ-PG for emacs-orgmode@gnu.org; Mon, 05 Mar 2012 12:25:40 -0500 Received: from oproxy9.bluehost.com ([69.89.24.6]:33227) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1S4bfD-0008Mz-GZ for emacs-orgmode@gnu.org; Mon, 05 Mar 2012 12:25:35 -0500 In-Reply-To: <87linfask2.fsf@gmx.com> (Eric Schulte's message of "Mon, 05 Mar 2012 10:03:41 -0700") 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: Eric Schulte Cc: emacs-orgmode@gnu.org Hi Eric, Eric Schulte writes: > Would it be possible to swap the results and caption lines? The caption lines are part of the ascii output. I think I'd have to swap them manually. > > e.g., this > >> #+RESULTS: test-replace-results >> #+CAPTION: Test replace results >> | 0% | 25% | 50% | 75% | 100% | >> |------+------+------+------+------| >> | 0.02 | 0.28 | 0.49 | 0.78 | 0.98 | > > to this > >> #+CAPTION: Test replace results >> #+RESULTS: test-replace-results >> | 0% | 25% | 50% | 75% | 100% | >> |------+------+------+------+------| >> | 0.02 | 0.28 | 0.49 | 0.78 | 0.98 | > > everything following #+results is expected to be part of the results, > and it would be simpler to not add special cases to this behavior for > lines that look like Org-mode comment constructs. > This is an interesting case. As other packages start to provide Org Mode output this kind of problem might crop up again. Is there any limit to the Org Mode output a third party might produce? All the best, Tom > Best, > > tsd@tsdye.com (Thomas S. Dye) writes: > >> Aloha all, >> >> The code block at the bottom appends its results, rather than replacing >> them. Here are the header arguments: >> >> Name: test-replace-results >> Lang: R >> Header Arguments: >> :cache no >> :exports code >> :hlines no >> :noweb yes >> :padnewline yes >> :results raw output replace >> :session none >> :tangle no >> >> Everything works fine without the ascii package caption argument. >> >> * Babel replace results >> #+name: test-replace-results >> #+header: :results output raw >> #+BEGIN_SRC R >> library(ascii) >> cap <- "Test replace results" >> x <- runif(100) >> y <- ascii(quantile(x),include.colnames=T,header=T,caption=cap) >> print(y,type="org") >> rm(cap,x,y) >> #+END_SRC >> #+RESULTS: test-replace-results >> #+CAPTION: Test replace results >> | 0% | 25% | 50% | 75% | 100% | >> |------+------+------+------+------| >> | 0.02 | 0.28 | 0.49 | 0.78 | 0.98 | >> #+CAPTION: Test replace results >> | 0% | 25% | 50% | 75% | 100% | >> |------+------+------+------+------| >> | 0.01 | 0.21 | 0.44 | 0.76 | 1.00 | >> >> I'm using Org-mode version 7.8.03 (release_7.8.03.546.gf6ea). >> >> All the best, >> Tom -- Thomas S. Dye http://www.tsdye.com