Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-16 Thread Nicolas Goaziou


Hello,

Sebastien Vauban
wxhgmqzgwmuf-genee64ty+gs+fvcfc7...@public.gmane.org writes:

 Nicolas Goaziou wrote:
 John Hendy jw.hendy-re5jqeeqqe8avxtiumw...@public.gmane.org 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 | 4.00 |
 | 6 mil | 0.01 | 3.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.

 Here, I think we confound two different syntaxes:

 - :results org, which produces #+BEGIN_SRC org..#+END_SRC
 - :wrap org, which produces #+BEGIN_org..END_org

Duh. You're right.

So this is a user error: #+begin_org blocks don't mean anything, neither
do :wrap org header.


Regards,

-- 
Nicolas Goaziou




Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-16 Thread Sebastien Vauban
Hello,

Eric Schulte wrote:
 - Can we prune some options/syntax that's no longer necessary? For
 example, what does =:wrap= (no argument provided) do?

 Wrap has been deprecated for some time.

No, it hasn't been deprecated. :results wrap has; not :wrap...

 Perhaps it has been long enough that we can go ahead and remove it entirely
 from the code and documentation at this point.

 Or =:wrap src org= / =:results output org=? It seems that these once
 served a purpose but no longer accomplish anything useful.

 I would be happy to remove support for =:results org=.  It has been
 supplanted by =:results drawer=, and I don't believe there is any other
 use for it.  Unless someone complains, I'd be happy to remove both.

:results org and :results drawer are not the same regarding Org results:
the first does comma-escape the result lines, not the second.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-16 Thread Christian Moe

Eric Schulte writes:
 - Is =:results drawer= what we want as the syntax to get org syntax
 parsed by the exporter?

 Yes.

 Just guessing from the name, it strikes me as a fix or enhancement for
 some other behavior/option that's now being applied to code as an
 after thought.


 As I recall this solution came about because drawers are the best (maybe
 only) way to demarcate a region without changing its semantics (which is
 exactly what we want in this case).

I suppose you've considered delimiting results in general with e.g. a
line like #+END_RESULTS?

Needless clutter for the most part, I know. But perhaps useful in this
kind of case. Also safe, semantically neutral, and possibly more
intuitive than drawers, with less special behaviors in terms of
visibility and export.

Yours,
Christian





Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-16 Thread John Hendy
On Tue, Apr 16, 2013 at 3:23 AM, Christian Moe m...@christianmoe.com wrote:

 Eric Schulte writes:
 - Is =:results drawer= what we want as the syntax to get org syntax
 parsed by the exporter?

 Yes.

 Just guessing from the name, it strikes me as a fix or enhancement for
 some other behavior/option that's now being applied to code as an
 after thought.


 As I recall this solution came about because drawers are the best (maybe
 only) way to demarcate a region without changing its semantics (which is
 exactly what we want in this case).

 I suppose you've considered delimiting results in general with e.g. a
 line like #+END_RESULTS?


As in compiling with simply =:results output raw= and then adding my
own #+end_results line after the block?

If so, I haven't tried that. But :wrap with no second argument creates
#+begin/end_results, which doesn't export correctly.


Thanks,
John

 Needless clutter for the most part, I know. But perhaps useful in this
 kind of case. Also safe, semantically neutral, and possibly more
 intuitive than drawers, with less special behaviors in terms of
 visibility and export.

 Yours,
 Christian





Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-16 Thread Eric Schulte
John Hendy jw.he...@gmail.com writes:

 On Tue, Apr 16, 2013 at 3:23 AM, Christian Moe m...@christianmoe.com wrote:

 Eric Schulte writes:
 - Is =:results drawer= what we want as the syntax to get org syntax
 parsed by the exporter?

 Yes.

 Just guessing from the name, it strikes me as a fix or enhancement for
 some other behavior/option that's now being applied to code as an
 after thought.


 As I recall this solution came about because drawers are the best (maybe
 only) way to demarcate a region without changing its semantics (which is
 exactly what we want in this case).

 I suppose you've considered delimiting results in general with e.g. a
 line like #+END_RESULTS?



Drawers are the preferred solution here.  Thanks,


 As in compiling with simply =:results output raw= and then adding my
 own #+end_results line after the block?

 If so, I haven't tried that. But :wrap with no second argument creates
 #+begin/end_results, which doesn't export correctly.


 Thanks,
 John

 Needless clutter for the most part, I know. But perhaps useful in this
 kind of case. Also safe, semantically neutral, and possibly more
 intuitive than drawers, with less special behaviors in terms of
 visibility and export.

 Yours,
 Christian



-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-16 Thread Christian Moe

Hi, John, 

My apologies; the question/suggestion below was meant for Eric and
concerned a possible change in Babel that might help. It was not meant
as a tip to you about something you could try now. 

In any case, Eric has replied that drawers are the preferred solution,
so I suppose something along the lines of my suggestion /has/ been
considered and rejected, and I'll leave it there.

Yours,
Christian

John Hendy writes:
 On Tue, Apr 16, 2013 at 3:23 AM, Christian Moe m...@christianmoe.com wrote:
 [...]
 I suppose you've considered delimiting results in general with e.g. a
 line like #+END_RESULTS?


 As in compiling with simply =:results output raw= and then adding my
 own #+end_results line after the block?

 If so, I haven't tried that. But :wrap with no second argument creates
 #+begin/end_results, which doesn't export correctly.





Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread John Hendy
On Fri, Apr 12, 2013 at 5:24 PM, Eric Schulte schulte.e...@gmail.com wrote:
 John Hendy jw.he...@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.

Is =:wrap org= appropriate for anything? I understood it as telling
Org-mode, Hey, I want you to parse this results block as if it was
written directly in Org-mode. That seems like what I want to do.

Since I posted this question, I decided it would be easier to display
results in a small table. Something like this:

#+begin_src R :session r :exports results :results output :wrap org

library(ascii)

cat(Blah blah blah and this value is, var1,  \n)

qty_table - ascii(qtys[, c(1, 3, 4)], header = T, include.colnames =
T, include.rownames = F)

print(qty_table, type = org)

#+end_src

That exports correctly (get my paragraphs and LaTeX table), but I
still get an error about \begin{org}. Using =:wrap latex= does not
work, as it's not interpreting the Org table properly.


Thanks for the assistance,
John

P.S. Sorry for the venty tone... I just hate 1) pestering the list
again and again for what I think are similar things and feeling
foolish and defeated by the documentation, and 2) having to wait to
have mysteries unveiled... especially when I'm using Org for
time-critical work things!

 Cheers,


 I've got a statement interspersing some prose with variable values like so:

 cat(This and such value was, var1, , and this one was, var2, .\n)

 The results block looks fine, but LaTeX is spitting out \begin{org}
 and \end{org} around it, which results in a compilation error:

 ! LaTeX Error: Environment org undefined.

 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H return  for immediate help.
  ...

 l.51 \begin{org}


 ! LaTeX Error: \begin{document} ended by \end{org}.

 Suggestions?


 Thanks,
 John


 --
 Eric Schulte
 http://cs.unm.edu/~eschulte



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Eric Schulte
John Hendy jw.he...@gmail.com writes:

 On Fri, Apr 12, 2013 at 5:24 PM, Eric Schulte schulte.e...@gmail.com wrote:
 John Hendy jw.he...@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


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.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread John Hendy
On Mon, Apr 15, 2013 at 1:12 PM, Eric Schulte schulte.e...@gmail.com wrote:
 John Hendy jw.he...@gmail.com writes:

 On Fri, Apr 12, 2013 at 5:24 PM, Eric Schulte schulte.e...@gmail.com wrote:
 John Hendy jw.he...@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 | 4.00 |
| 6 mil | 0.01 | 3.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  4.00\\
6 mil  0.01  3.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?), 

Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Sebastien Vauban
Dear Eric,

Eric Schulte wrote:
 John Hendy jw.he...@gmail.com writes:
 On Fri, Apr 12, 2013 at 5:24 PM, Eric Schulte schulte.e...@gmail.com wrote:
 John Hendy jw.he...@gmail.com writes:

 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

Playing a bit with the above code, removing `:results output' to see what
would happen, I'm amazed by the results:

#+begin_src sh :wrap org
cat EOF
| a | b |
|---+---|
| 1 | 2 |
EOF
#+end_src

#+results:
#+BEGIN_org
|   | | a |   |   | b |   |
|   | ---+--- |   |   |   |   |   |
|   | | 1 |   |   | 2 |   |
#+END_org

Is it expected?

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Andreas Leha
Hi John,

John Hendy jw.he...@gmail.com writes:

 On Mon, Apr 15, 2013 at 1:12 PM, Eric Schulte schulte.e...@gmail.com wrote:
 John Hendy jw.he...@gmail.com writes:

 On Fri, Apr 12, 2013 at 5:24 PM, Eric Schulte schulte.e...@gmail.com 
 wrote:
 John Hendy jw.he...@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 | 4.00 |
 | 6 mil | 0.01 | 3.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  4.00\\
 6 mil  0.01  3.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 

Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread John Hendy
On Mon, Apr 15, 2013 at 2:48 PM, Andreas Leha
andreas.l...@med.uni-goettingen.de wrote:
 Hi John,

 John Hendy jw.he...@gmail.com writes:

 On Mon, Apr 15, 2013 at 1:12 PM, Eric Schulte schulte.e...@gmail.com wrote:
 John Hendy jw.he...@gmail.com writes:

 On Fri, Apr 12, 2013 at 5:24 PM, Eric Schulte schulte.e...@gmail.com 
 wrote:
 John Hendy jw.he...@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 | 4.00 |
 | 6 mil | 0.01 | 3.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  4.00\\
 6 mil  0.01  3.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 

Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Nicolas Goaziou
Hello,

John Hendy jw.he...@gmail.com 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 | 4.00 |
 | 6 mil | 0.01 | 3.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.

I didn't read the thread carefully, but you may want to use drawer
output instead.


Regards,

-- 
Nicolas Goaziou



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Eric Schulte

 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.



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 EOF
| a | b |
|---+---|
| 1 | 2 |
EOF
#+end_src

#+RESULTS:
:RESULTS:
| a | b |
|---+---|
| 1 | 2 |
:END:

My sincere apologies.


 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 | 4.00 |
 | 6 mil | 0.01 | 3.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  4.00\\
 6 mil  0.01  3.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}


 Thanks,
 John

 --
 Eric Schulte
 http://cs.unm.edu/~eschulte

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread John Hendy
On Mon, Apr 15, 2013 at 2:56 PM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Hello,

 John Hendy jw.he...@gmail.com 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 | 4.00 |
 | 6 mil | 0.01 | 3.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=?

 I didn't read the thread carefully, but you may want to use drawer
 output instead.


In general and permanently moving forward, or as a workaround for the
above (taking the first interpretation that =:wrap org= is
misbehaving)?


Thanks,
John


 Regards,

 --
 Nicolas Goaziou



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Sebastien Vauban
Hello Nicolas,

Nicolas Goaziou wrote:
 John Hendy jw.he...@gmail.com 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 | 4.00 |
 | 6 mil | 0.01 | 3.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.

Here, I think we confound two different syntaxes:

- :results org, which produces #+BEGIN_SRC org..#+END_SRC
- :wrap org, which produces #+BEGIN_org..END_org

 I didn't read the thread carefully, but you may want to use drawer output
 instead.

My mind isn't clear yet about those use cases.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Nicolas Goaziou
John Hendy jw.he...@gmail.com writes:

 On Mon, Apr 15, 2013 at 2:56 PM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Hello,

 John Hendy jw.he...@gmail.com 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 | 4.00 |
 | 6 mil | 0.01 | 3.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:

  #+begin_src org
  ,#+AUTHOR: test
  #+end_src

In that case, the #+AUTHOR keyword isn't applied to current set-up. On
the other hand, if you want to generate live data, use drawer:

  #+results:
  :RESULTS:
  #+AUTHOR: test
  :END:

In this example, the keyword is really installed in the buffer.


Regards,

-- 
Nicolas Goaziou



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Eric Schulte
Nicolas Goaziou n.goaz...@gmail.com writes:

 John Hendy jw.he...@gmail.com writes:

 On Mon, Apr 15, 2013 at 2:56 PM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Hello,

 John Hendy jw.he...@gmail.com 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 | 4.00 |
 | 6 mil | 0.01 | 3.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.

Best,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Sebastien Vauban
Eric Schulte wrote:
 Nicolas Goaziou n.goaz...@gmail.com writes:
 John Hendy jw.he...@gmail.com writes:
 On Mon, Apr 15, 2013 at 2:56 PM, Nicolas Goaziou n.goaz...@gmail.com 
 wrote:
 John Hendy jw.he...@gmail.com writes:

 #+RESULTS:
 #+BEGIN_org
 ...
 #+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.

And it's even possible to use :wrap SRC org to get the same as :results
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.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread John Hendy
On Mon, Apr 15, 2013 at 3:28 PM, Eric Schulte schulte.e...@gmail.com wrote:
 Nicolas Goaziou n.goaz...@gmail.com writes:

 John Hendy jw.he...@gmail.com writes:

 On Mon, Apr 15, 2013 at 2:56 PM, Nicolas Goaziou n.goaz...@gmail.com 
 wrote:
 Hello,

 John Hendy jw.he...@gmail.com 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 | 4.00 |
 | 6 mil | 0.01 | 3.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



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread John Hendy
On Mon, Apr 15, 2013 at 3:51 PM, Sebastien Vauban
wxhgmqzgw...@spammotel.com wrote:
 Eric Schulte wrote:
 Nicolas Goaziou n.goaz...@gmail.com writes:
 John Hendy jw.he...@gmail.com writes:
 On Mon, Apr 15, 2013 at 2:56 PM, Nicolas Goaziou n.goaz...@gmail.com 
 wrote:
 John Hendy jw.he...@gmail.com writes:

 #+RESULTS:
 #+BEGIN_org
 ...
 #+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.

 And it's even possible to use :wrap SRC org to get the same as :results
 org...

True, however I don't get the same output as I used to with this and
think it's essentially useless now. =#+begin_src org/end_src= used to
give me the equivalent of essentially a block of Org-mode syntax that
would be interpreted and parsed just as if it had no #+begin/end
around it. Now, it's output to LaTeX in \begin{verbatim} /
\end{verbatim}. It's treated like source code, not Org-mode text to be
exported.

=#+begin_src org= seems to be no different than =#+begin_example= or
=#+begin_src lang :exports code :eval no=


John


 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.

 Best regards,
   Seb

 --
 Sebastien Vauban





Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread John Hendy
On Mon, Apr 15, 2013 at 2:47 PM, Sebastien Vauban
wxhgmqzgw...@spammotel.com wrote:
 Dear Eric,

 Eric Schulte wrote:
 John Hendy jw.he...@gmail.com writes:
 On Fri, Apr 12, 2013 at 5:24 PM, Eric Schulte schulte.e...@gmail.com 
 wrote:
 John Hendy jw.he...@gmail.com writes:

 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

 Playing a bit with the above code, removing `:results output' to see what
 would happen, I'm amazed by the results:

 #+begin_src sh :wrap org
 cat EOF
 | a | b |
 |---+---|
 | 1 | 2 |
 EOF
 #+end_src

 #+results:
 #+BEGIN_org
 |   | | a |   |   | b |   |
 |   | ---+--- |   |   |   |   |   |
 |   | | 1 |   |   | 2 |   |
 #+END_org

 Is it expected?

Seems so: http://orgmode.org/worg/org-contrib/babel/header-args.html

That's the example from that page and without adding =verbatim= to the
list of =:results= args, it does that.

As a similar inquiry to behavior, what is the expected output of simply:

#+begin_results

stuff

#+end_results

If I use :wrap with no arguments, I get blocks like that, and the same
LaTeX error as I do for =:wrap org= (even though I know I shouldn't
use that). Just curious what the use-case would be for :wrap with no
args?

! LaTeX Error: Environment results undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H return  for immediate help.
 ...

l.33 \begin{results}

(/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{results}.


Best regards,
John


 Best regards,
   Seb

 --
 Sebastien Vauban





Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Sebastien Vauban
John,

John Hendy wrote:
 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.

Just to be complete, :results wrap has been deprecated since Org 7.9.2, and
replaced by :results drawer.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Sebastien Vauban
John,

John Hendy wrote:
 I think you're confusing :results org with :wrap org.

 And it's even possible to use :wrap SRC org to get the same as :results
 org...

 True, however I don't get the same output as I used to with this and
 think it's essentially useless now. =#+begin_src org/end_src= used to
 give me the equivalent of essentially a block of Org-mode syntax that
 would be interpreted and parsed just as if it had no #+begin/end
 around it. Now, it's output to LaTeX in \begin{verbatim} /
 \end{verbatim}. It's treated like source code, not Org-mode text to be
 exported.

 =#+begin_src org= seems to be no different than =#+begin_example=

Yes, but for the syntax highlighting.

 or =#+begin_src lang :exports code :eval no=

Yes, except that lang must be the same in the source and results block: so a
SQL code block producing SQL code, or R producing R, etc.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread John Hendy
On Mon, Apr 15, 2013 at 4:44 PM, Sebastien Vauban
wxhgmqzgw...@spammotel.com wrote:
 John,

 John Hendy wrote:
 I think you're confusing :results org with :wrap org.

 And it's even possible to use :wrap SRC org to get the same as :results
 org...

 True, however I don't get the same output as I used to with this and
 think it's essentially useless now. =#+begin_src org/end_src= used to
 give me the equivalent of essentially a block of Org-mode syntax that
 would be interpreted and parsed just as if it had no #+begin/end
 around it. Now, it's output to LaTeX in \begin{verbatim} /
 \end{verbatim}. It's treated like source code, not Org-mode text to be
 exported.

 =#+begin_src org= seems to be no different than =#+begin_example=

 Yes, but for the syntax highlighting.

 or =#+begin_src lang :exports code :eval no=

 Yes, except that lang must be the same in the source and results block: so a
 SQL code block producing SQL code, or R producing R, etc.


I don't think so. I took the results from my code example above, put
them in a new headline and then only exported that headline with =C-c
C-e C-s l p=:

* Heading

Block isolated from everything la la la.

#+BEGIN_src R :exports code :eval no
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 | 4.00 |
| 6 mil | 0.01 | 3.00 |
| 8 mil | 0.01 | 25000.00 |
#+END_src


That exports verbatim and looks no different than =#+begin_src org=
and =#+begin_example=. There is only a code block, no results in this
case.


John

 Best regards,
   Seb

 --
 Sebastien Vauban





Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Eric Schulte
John Hendy jw.he...@gmail.com writes:

 On Mon, Apr 15, 2013 at 3:28 PM, Eric Schulte schulte.e...@gmail.com wrote:
 Nicolas Goaziou n.goaz...@gmail.com writes:

 John Hendy jw.he...@gmail.com writes:

 On Mon, Apr 15, 2013 at 2:56 PM, Nicolas Goaziou n.goaz...@gmail.com 
 wrote:
 Hello,

 John Hendy jw.he...@gmail.com 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 | 4.00 |
 | 6 mil | 0.01 | 3.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):


Please submit patches to the documentation where it is inaccurate or
insufficient.


 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


I bet that this is appearing twice in the export, because with raw it is
impossible to remove results, so if you have results existing in the
buffer, and you are re-evaluating on export, then you'll get duplicates.
Evaluate this code block again in the buffer and then re-export and I
bet you'll get triplicate 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


Sounds great.  Where your results generalize past R, please think about
a documentation patch as well.


 Something perhaps with Org results and then a screenshot of side by
 side LaTeX output?


Sounds great.  Thanks for helping to improve the documentation!



 Best regards,
 John




 Best,

 --
 Eric Schulte
 http://cs.unm.edu/~eschulte

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread John Hendy
On Mon, Apr 15, 2013 at 5:38 PM, Eric Schulte schulte.e...@gmail.com wrote:
 John Hendy jw.he...@gmail.com writes:

 On Mon, Apr 15, 2013 at 3:28 PM, Eric Schulte schulte.e...@gmail.com wrote:
 Nicolas Goaziou n.goaz...@gmail.com writes:

 John Hendy jw.he...@gmail.com writes:

 On Mon, Apr 15, 2013 at 2:56 PM, Nicolas Goaziou n.goaz...@gmail.com 
 wrote:
 Hello,

 John Hendy jw.he...@gmail.com 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 | 4.00 |
 | 6 mil | 0.01 | 3.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):


 Please submit patches to the documentation where it is inaccurate or
 insufficient.


 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


 I bet that this is appearing twice in the export, because with raw it is
 impossible to remove results, so if you have results existing in the
 buffer, and you are re-evaluating on export, then you'll get duplicates.
 Evaluate this code block again in the buffer and then re-export and I
 bet you'll get triplicate results. :)


Agreed, and this came up with you and I before on the list:
- http://lists.gnu.org/archive/html/emacs-orgmode/2012-08/msg01224.html

The solution was to do =:results output org= instead of =:results
output raw=. That's no longer the case.


 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


 Sounds great.  Where your results generalize past R, please think about
 a documentation patch as well.


 Something perhaps with Org results and then a screenshot of side by
 side LaTeX output?


 Sounds great.  Thanks for helping to improve the documentation!


No problem. Prior to that, I have unanswered questions:
- Is the \begin/end{verbatim} wrapping the expected result for

Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Eric Schulte


 Sounds great.  Thanks for helping to improve the documentation!


 No problem. Prior to that, I have unanswered questions:
 - Is the \begin/end{verbatim} wrapping the expected result for
 #+begin/end_src org?


Yes, this is the default export for any src block, see the following
page of the manual.  There are other options as well.

  (info (org)Literal Examples)


 - Is =:results drawer= what we want as the syntax to get org syntax
 parsed by the exporter?

Yes.

 Just guessing from the name, it strikes me as a fix or enhancement for
 some other behavior/option that's now being applied to code as an
 after thought.


As I recall this solution came about because drawers are the best (maybe
only) way to demarcate a region without changing its semantics (which is
exactly what we want in this case).


 - Can we prune some options/syntax that's no longer necessary? For
 example, what does =:wrap= (no argument provided) do?

Wrap has been deprecated for some time.  Perhaps it has been long enough
that we can go ahead and remove it entirely from the code and
documentation at this point.

 Or =:wrap src org= / =:results output org=? It seems that these once
 served a purpose but no longer accomplish anything useful.


I would be happy to remove support for =:results org=.  It has been
supplanted by =:results drawer=, and I don't believe there is any other
use for it.  Unless someone complains, I'd be happy to remove both.

Cheers,



 Thanks,
 John



 Best regards,
 John




 Best,

 --
 Eric Schulte
 http://cs.unm.edu/~eschulte

 --
 Eric Schulte
 http://cs.unm.edu/~eschulte

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Thomas S. Dye
Hi all,

Eric Schulte schulte.e...@gmail.com writes:


 - Can we prune some options/syntax that's no longer necessary? For
 example, what does =:wrap= (no argument provided) do?

 Wrap has been deprecated for some time.  Perhaps it has been long enough
 that we can go ahead and remove it entirely from the code and
 documentation at this point.


I think :wrap is useful.  It provides a very direct way to generate code
that can be exported to an arbitrary LaTeX environment.  Say I find a new
LaTeX package that defines a =cutemarkup= environment, so I want
something like this the LaTeX file:

\begin{cutemarkup}
...
\end{cutemarkup}

Then, with babel:

#+begin_src lang :wrap cutemarkup
...
#+end_src

gets me what I want,

#+begin_cutemarkup
...
#+end_cutemarkup

IIRC, this is one reason why :wrap is there (thanks, Eric).

Perhaps this result is possible some other way? I don't know, but it
seems to me that :wrap is still potentially useful and we might want to
keep it around.

Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-15 Thread Eric Schulte
t...@tsdye.com (Thomas S. Dye) writes:

 Hi all,

 Eric Schulte schulte.e...@gmail.com writes:


 - Can we prune some options/syntax that's no longer necessary? For
 example, what does =:wrap= (no argument provided) do?

 Wrap has been deprecated for some time.  Perhaps it has been long enough
 that we can go ahead and remove it entirely from the code and
 documentation at this point.


 I think :wrap is useful.  It provides a very direct way to generate code
 that can be exported to an arbitrary LaTeX environment.  Say I find a new
 LaTeX package that defines a =cutemarkup= environment, so I want
 something like this the LaTeX file:

 \begin{cutemarkup}
 ...
 \end{cutemarkup}

 Then, with babel:

 #+begin_src lang :wrap cutemarkup
 ...
 #+end_src

 gets me what I want,

 #+begin_cutemarkup
 ...
 #+end_cutemarkup

 IIRC, this is one reason why :wrap is there (thanks, Eric).

 Perhaps this result is possible some other way? I don't know, but it
 seems to me that :wrap is still potentially useful and we might want to
 keep it around.

 Tom

Hi Tom,

This is a reasonable use case, and I personally don't know of another
way to get these results.  So I guess it is just the use of wrap to
delimit Org-mode results which is deprecated, and we *do* still have a
use for the :wrap header argument in general.

Thanks,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] Error with :wrap org in babel and 8.0-pre

2013-04-12 Thread Eric Schulte
John Hendy jw.he...@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.

Cheers,


 I've got a statement interspersing some prose with variable values like so:

 cat(This and such value was, var1, , and this one was, var2, .\n)

 The results block looks fine, but LaTeX is spitting out \begin{org}
 and \end{org} around it, which results in a compilation error:

 ! LaTeX Error: Environment org undefined.

 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H return  for immediate help.
  ...

 l.51 \begin{org}


 ! LaTeX Error: \begin{document} ended by \end{org}.

 Suggestions?


 Thanks,
 John


-- 
Eric Schulte
http://cs.unm.edu/~eschulte



[O] Error with :wrap org in babel and 8.0-pre

2013-04-11 Thread John Hendy
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've got a statement interspersing some prose with variable values like so:

cat(This and such value was, var1, , and this one was, var2, .\n)

The results block looks fine, but LaTeX is spitting out \begin{org}
and \end{org} around it, which results in a compilation error:

! LaTeX Error: Environment org undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H return  for immediate help.
 ...

l.51 \begin{org}


! LaTeX Error: \begin{document} ended by \end{org}.

Suggestions?


Thanks,
John