From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: Error with :wrap org in babel and 8.0-pre Date: Mon, 15 Apr 2013 16:24:53 -0500 Message-ID: References: <87li8ncqzq.fsf@gmail.com> <87li8jfysj.fsf@gmail.com> <87y5cjy3du.fsf@gmail.com> <87txn7y2hb.fsf@gmail.com> <874nf7fsix.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URqtU-0006Uq-IP for emacs-orgmode@gnu.org; Mon, 15 Apr 2013 17:24:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URqtT-0000iS-9p for emacs-orgmode@gnu.org; Mon, 15 Apr 2013 17:24:56 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:38645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URqtS-0000gi-UO for emacs-orgmode@gnu.org; Mon, 15 Apr 2013 17:24:55 -0400 Received: by mail-lb0-f172.google.com with SMTP id u10so4972132lbi.3 for ; Mon, 15 Apr 2013 14:24:54 -0700 (PDT) In-Reply-To: <874nf7fsix.fsf@gmail.com> 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 , Nicolas Goaziou On Mon, Apr 15, 2013 at 3:28 PM, Eric Schulte wrote: > Nicolas Goaziou writes: > >> John Hendy writes: >> >>> On Mon, Apr 15, 2013 at 2:56 PM, Nicolas Goaziou wrote: >>>> Hello, >>>> >>>> John Hendy writes: >>>> >>>>> #+RESULTS: >>>>> #+BEGIN_org >>>>> With the assumption of 100 lbs. of input material 1 and 200 lbs. of material 2, >>>>> we can produce the following number of widgets based on injection mold >>>>> wall thicknesses. >>>>> | wall | vals | widgets | >>>>> |-------+------+----------| >>>>> | 5 mil | 0.01 | 40000.00 | >>>>> | 6 mil | 0.01 | 33333.00 | >>>>> | 8 mil | 0.01 | 25000.00 | >>>>> #+END_org >>>> >>>> This is wrong. We discussed it months ago on this ML and, IIRC, Babel >>>> should produce "#+begin_src org" blocks, not "#+begin_org". Org >>>> documentation specifies it too. >>>> >>> >>> "Wrong," as in =:wrap org= behavior is currently a bug? Or "wrong" in >>> that for my given use case, I shouldn't be using =:wrap org=? >> >> Wrong as is "the current behaviour is a bug". It is expected to produce >> "#+begin_src org" blocks. Its use case is to generate dead data: >> > > I disagree, the current behavior is *not* a bug. From the manual. > > ,---- > | 14.8.2.23 ':wrap' > | ................. > | > | The ':wrap' header argument is used to mark the results of source block > | evaluation. The header argument can be passed a string that will be > | appended to '#+BEGIN_' and '#+END_', which will then be used to wrap the > | results. If not string is specified then the results will be wrapped in > | a '#+BEGIN/END_RESULTS' block. > `---- > > I think you're confusing ":results org" with ":wrap org". > > That said, I don't think there is ever a case when you would want to use > ":wrap org". The solution to the original question is to use ":results > drawer". Here's my summary of possible options from this thread and others in which I've tried to do similar things (=:exports results= used in all cases): 1) =:results output wrap=. - Documentation: none seems to suggest that this combination is even possible. - Behavior: Suggested in mailing list thread with Eric Schulte and works properly for me. 2) =:results output org=. - Documentation: "The results are will be enclosed in a BEGIN_SRC org block." - Behavior: Results look correct in Org buffer, but exports to LaTeX in \begin/end{verbatim}. 3) =:results output :wrap org=. - Documentation: Produces =#+begin/end_org= results block - Behavior: Wraps results in \begin/end{org}, throws error on compilation, but compiles into PDF correctly. 4) =:results output drawer=. - Documentation: "The result is wrapped in a RESULTS drawer. This can be useful for inserting raw or org syntax results in such a way that their extent is known and they can be automatically removed or replaced." - Behavior: Looks correct in both .tex and resultant PDF. 5) =:results output raw= - Documentation: "The results are interpreted as raw Org mode code and are inserted directly into the buffer." - Behavior: Seems like exactly what I want... but I get double results This has helped me know which work and which don't, however I still find the behavior counter-intuitive and difficult to remember. For example, there's no reason I would expect =wrap= or =drawer= to have anything to do with what I'm trying to accomplish. I'm trying to use R to spit out syntax that's Org compatible... so my intuition would be to use =:results output org= (or raw) for this. Either way, I still find the documentation lacking. This thread has motivated me to dive a bit deeper into a documentation with examples of *all* results outputs, at least in R since that's what I'm used to. Not sure if the behavior is tremendously different with other languages. Eric, I was thinking of appending it to this page: - http://orgmode.org/worg/org-contrib/babel/header-args.html Something perhaps with Org results and then a screenshot of side by side LaTeX output? Best regards, John > > Best, > > -- > Eric Schulte > http://cs.unm.edu/~eschulte