From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Error with :wrap org in babel and 8.0-pre Date: Mon, 15 Apr 2013 13:56:13 -0600 Message-ID: <878v4jfu02.fsf@gmail.com> References: <87li8ncqzq.fsf@gmail.com> <87li8jfysj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URpWJ-00045n-I9 for emacs-orgmode@gnu.org; Mon, 15 Apr 2013 15:56:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URpWI-00056t-9Q for emacs-orgmode@gnu.org; Mon, 15 Apr 2013 15:56:55 -0400 Received: from mail-pb0-f43.google.com ([209.85.160.43]:39858) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URpWI-00056l-0k for emacs-orgmode@gnu.org; Mon, 15 Apr 2013 15:56:54 -0400 Received: by mail-pb0-f43.google.com with SMTP id md4so2689599pbc.2 for ; Mon, 15 Apr 2013 12:56:52 -0700 (PDT) In-Reply-To: (John Hendy's message of "Mon, 15 Apr 2013 14:35:19 -0500") 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: John Hendy Cc: emacs-orgmode , Eric Schulte >> >> Use :wrap org if your code block produces raw org. E.g., >> >> #+begin_src sh :results output :wrap org >> cat <> | a | b | >> |---+---| >> | 1 | 2 | >> EOF >> #+end_src >> >> #+RESULTS: >> #+BEGIN_org >> | a | b | >> |---+---| >> | 1 | 2 | >> #+END_org >> >> Let me know if that leave any mysteries or doesn't address part of your >> question. I apologize for any contribution my often terse and hurried >> responses have made to this confusion. >> > Oh! I miss-spoke. There really are a staggering number of options. I actually don't know what ":wrap org" would be used for. What *you* want is a drawer. This has the benefit of delimiting your results, while allowing them to be pure Org-mode with no special export behavior. #+begin_src sh :results output drawer cat < > This is also what I would have thought. In other words, =:wrap latex= > if you will have pure LaTeX in the blocks, and =:wrap org= if it's too > be interpreted just as if you'd typed the exact same thing in your > Org-mode file outside of the given results block. > > But this was the reason for the original post. Here's my document: > > #+begin_org_document > > * Heading > > #+begin_src R :session :exports results :results output :wrap org > > library(ascii) > > var1 <- 100 > var2 <- 200 > > cat("With the assumption of", var1, "lbs. of input material 1 and", > var2, "lbs. of material 2, > we can produce the following number of widgets based on injection mold > wall thicknesses.\n") > > qtys <- data.frame(wall = c("5 mil", "6 mil", "8 mil"), vals = c(.005, > .006, .008)) > qtys$widgets <- trunc(var2 / qtys$vals) > > qty_table <- ascii(qtys, header = T, include.colnames = T, include.rownames = F) > print(qty_table, type = "org") > > #+end_src > > #+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 > > #+end_org_document > > > Everything looks to be correct. I get this LaTeX upon compilation for > the results section: > > #+begin_latex_output > > \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. > \begin{center} > \begin{tabular}{lrr} > \toprule > wall & vals & widgets\\ > \midrule > 5 mil & 0.01 & 40000.00\\ > 6 mil & 0.01 & 33333.00\\ > 8 mil & 0.01 & 25000.00\\ > \bottomrule > \end{tabular} > \end{center} > \end{org} > % Generated by Org mode 8.0-pre in Emacs 24.3.1. > \end{document} > > #+end_latex_output > > This is in the *Org PDF LaTeX Output* buffer: > > ! LaTeX Error: Environment org undefined. > > See the LaTeX manual or LaTeX Companion for explanation. > Type H for immediate help. > ... > > l.33 \begin{org} > > (/home/jwhendy/.texlive/2012/texmf-dist/tex/latex/wasysym/uwasy.fd) > (/home/jwhendy/.texlive/2012/texmf-dist/tex/latex/base/ulasy.fd) > (/home/jwhendy/.texlive/2012/texmf-dist/tex/latex/amsfonts/umsa.fd) > (/home/jwhendy/.texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd) > > ! LaTeX Error: \begin{document} ended by \end{org}. > > > > So it seems like something is awry: > - Either the exporter is supposed to convert #+begin/end_org into > something else (I would assume there shouldn't be any \begin/end{org} > around it since it should just be including the LaTeX results as if it > wasn't in a #+RESULTS block at all, right?), OR > - I'm missing some sort of definition for an =org= environment in > LaTeX setup so that it knows what to do with \begin/end{org} > > > Thanks, > John > >> -- >> Eric Schulte >> http://cs.unm.edu/~eschulte -- Eric Schulte http://cs.unm.edu/~eschulte