From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: Re: Error with :wrap org in babel and 8.0-pre
Date: Mon, 15 Apr 2013 21:48:44 +0200 [thread overview]
Message-ID: <87haj78tib.fsf@med.uni-goettingen.de> (raw)
In-Reply-To: CA+M2ft8kSUEf7Zm5gTNXKN+ReWLO-88ZjPwRG3yrgPrsGQuu8g@mail.gmail.com
Hi John,
John Hendy <jw.hendy@gmail.com> writes:
> On Mon, Apr 15, 2013 at 1:12 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
>> John Hendy <jw.hendy@gmail.com> writes:
>>
>>> On Fri, Apr 12, 2013 at 5:24 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
>>>> John Hendy <jw.hendy@gmail.com> writes:
>>>>
>>>>> I thought this was the proper syntax for printing stuff directly to a
>>>>> LaTeX document:
>>>>>
>>>>> #+begin_src R :session :exports results :results output :wrap org
>>>>>
>>>>
>>>> I think you want either ":results latex" or ":wrap latex".
>>>>
>>>
>>> Trying my best to follow the evolution here.... I've tried to discern
>>> from the manual and Worg the best way to do something, generally try
>>> it and fail. Then I post to the list and get an answer. A short time
>>> later, I try doing what I think is approximately the same thing to
>>> find that it seems to have changed since the last time:
>>>
>>> To print multiple file names and =#+attr_stuff= options, the answer
>>> was =:results output org :exports results=
>>> - http://lists.gnu.org/archive/html/emacs-orgmode/2012-08/msg01224.html
>>>
>>> Trying to do the same exact thing a bit later was =:results output
>>> wrap=, shortly followed up with the instruction to use =:wrap org=
>>> - http://lists.gnu.org/archive/html/emacs-orgmode/2013-03/msg01599.html
>>>
>>> Now, it's =:wrap latex=, but I'm not sure why.
>>>
>>
>> I may have miss-understood your question.
>>
>>>
>>> Is =:wrap org= appropriate for anything?
>>
>> Use :wrap latex if your code block produces raw latex. E.g.,
>>
>> #+begin_src sh :results output :wrap latex
>> cat <<EOF
>> \begin{tabular}{rr}
>> a & b\\
>> \hline
>> 1 & 2\\
>> \end{tabular}
>> EOF
>> #+end_src
>>
>> #+RESULTS:
>> #+BEGIN_latex
>> \begin{tabular}{rr}
>> a & b\
>> \hline
>> 1 & 2\
>> \end{tabular}
>> #+END_latex
>>
>
> That makes sense, but it's not what I'm doing or at least not in full.
> I may insert LaTeX here or there, but am also using Org-specific
> syntax in many places as well (#+attr_blah lines and such).
>
>>
>> Use :wrap org if your code block produces raw org. E.g.,
>>
>> #+begin_src sh :results output :wrap org
>> cat <<EOF
>> | 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.
>>
>
> 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 <return> 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}
>
I am not sure, if this is the intended solution, but you can use
something like this:
#+LATEX_HEADER: \newenvironment{org}{}{}
in your org file.
HTH,
Andreas
next prev parent reply other threads:[~2013-04-15 19:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-11 22:45 Error with :wrap org in babel and 8.0-pre John Hendy
2013-04-12 22:24 ` Eric Schulte
2013-04-15 17:59 ` John Hendy
2013-04-15 18:12 ` Eric Schulte
2013-04-15 19:35 ` John Hendy
2013-04-15 19:48 ` Andreas Leha [this message]
2013-04-15 19:52 ` John Hendy
2013-04-15 19:56 ` Nicolas Goaziou
2013-04-15 20:05 ` John Hendy
2013-04-15 20:15 ` Nicolas Goaziou
2013-04-15 20:28 ` Eric Schulte
2013-04-15 20:51 ` Sebastien Vauban
2013-04-15 21:29 ` John Hendy
2013-04-15 21:44 ` Sebastien Vauban
2013-04-15 21:51 ` John Hendy
2013-04-15 21:24 ` John Hendy
2013-04-15 21:42 ` Sebastien Vauban
2013-04-15 22:38 ` Eric Schulte
2013-04-15 22:48 ` John Hendy
2013-04-15 23:27 ` Eric Schulte
2013-04-15 23:56 ` Thomas S. Dye
2013-04-16 2:37 ` Eric Schulte
2013-04-16 7:58 ` Sebastien Vauban
2013-04-16 8:23 ` Christian Moe
2013-04-16 14:58 ` John Hendy
2013-04-16 15:24 ` Eric Schulte
2013-04-16 21:06 ` Christian Moe
2013-04-15 20:09 ` Sebastien Vauban
2013-04-15 20:22 ` Nicolas Goaziou
2013-04-15 19:56 ` Eric Schulte
2013-04-15 19:47 ` Sebastien Vauban
2013-04-15 21:38 ` John Hendy
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=87haj78tib.fsf@med.uni-goettingen.de \
--to=andreas.leha@med.uni-goettingen.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).