* Using :results output org with new exporter exporting as verbatim with LaTeX
@ 2013-03-22 23:05 John Hendy
2013-03-23 22:12 ` Eric Schulte
0 siblings, 1 reply; 5+ messages in thread
From: John Hendy @ 2013-03-22 23:05 UTC (permalink / raw)
To: emacs-orgmode
I have an org file with R src block that spits out some file names to
embed. I don't think I need to reproduce the block for testing
purposes, but the gist is that I use cat() to spit out some
=#+begin_center= and =[[filename]]= stuff.
R code block header:
#+name: src-block-name
#+begin_src R :session r :exports results :results output org
I'm getting a results block like so:
#+RESULTS: src-block-name
#+BEGIN_SRC org
[[./plots/filename1.pdf]]
[[./plots/filename2.pdf]]
[[./plots/filename3.pdf]]
#+END_SRC
I used this setup previously (and successfully) as described in this
mailing list thread. That particular post described my near successful
block, with the same sort of cat(paste()) commands I was using to
output the filenames in [[filename.pdf]] orgmode syntax. The final
success happened at the very end when Eric Schulte suggested I change
from :results output raw to :results output org.
- http://lists.gnu.org/archive/html/emacs-orgmode/2012-08/msg01222.html
Hence, I started with :results output org this time, but it didn't
work. It's being exported verbatim using =C-c C-e l p=. (Appears in
\begin{verbatim} ... \end{verbatim} in the output .tex file)
If I change to :results output raw, I simply get:
#+results
[[filename.pdf]]
This exports correctly.
If I change the :results output org #+results block to the following,
it also works correctly:
#+begin_org
[[filename.pdf]]
#+end_org
From the ob-doc-R, it appears that orgmode export might be expecting
#+begin_org, not #+begin_src org:
- http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html
#+begin_quote
The Org Mode source code block specifies :results org so the output is
wrapped in #+BEGIN_ORG … #+END_ORG. This way, arbitrary output can be
included and easily replaced on subsequent evaluations of the source
code block.
#+end_quote
Let me know the current proper way to accomplish what I'm trying to do.
Thanks,
John
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Using :results output org with new exporter exporting as verbatim with LaTeX
2013-03-22 23:05 Using :results output org with new exporter exporting as verbatim with LaTeX John Hendy
@ 2013-03-23 22:12 ` Eric Schulte
2013-03-24 1:40 ` John Hendy
0 siblings, 1 reply; 5+ messages in thread
From: Eric Schulte @ 2013-03-23 22:12 UTC (permalink / raw)
To: John Hendy; +Cc: emacs-orgmode
John Hendy <jw.hendy@gmail.com> writes:
> I have an org file with R src block that spits out some file names to
> embed. I don't think I need to reproduce the block for testing
> purposes, but the gist is that I use cat() to spit out some
> =#+begin_center= and =[[filename]]= stuff.
>
> R code block header:
>
> #+name: src-block-name
> #+begin_src R :session r :exports results :results output org
>
>
> I'm getting a results block like so:
>
> #+RESULTS: src-block-name
> #+BEGIN_SRC org
>
> [[./plots/filename1.pdf]]
>
> [[./plots/filename2.pdf]]
>
> [[./plots/filename3.pdf]]
>
> #+END_SRC
>
> I used this setup previously (and successfully) as described in this
> mailing list thread. That particular post described my near successful
> block, with the same sort of cat(paste()) commands I was using to
> output the filenames in [[filename.pdf]] orgmode syntax. The final
> success happened at the very end when Eric Schulte suggested I change
> from :results output raw to :results output org.
> - http://lists.gnu.org/archive/html/emacs-orgmode/2012-08/msg01222.html
>
> Hence, I started with :results output org this time, but it didn't
> work. It's being exported verbatim using =C-c C-e l p=. (Appears in
> \begin{verbatim} ... \end{verbatim} in the output .tex file)
>
> If I change to :results output raw, I simply get:
>
> #+results
>
> [[filename.pdf]]
>
> This exports correctly.
>
> If I change the :results output org #+results block to the following,
> it also works correctly:
>
> #+begin_org
>
> [[filename.pdf]]
>
> #+end_org
>
> From the ob-doc-R, it appears that orgmode export might be expecting
> #+begin_org, not #+begin_src org:
> - http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html
>
> #+begin_quote
> The Org Mode source code block specifies :results org so the output is
> wrapped in #+BEGIN_ORG & #+END_ORG. This way, arbitrary output can be
> included and easily replaced on subsequent evaluations of the source
> code block.
> #+end_quote
>
>
> Let me know the current proper way to accomplish what I'm trying to do.
>
>
>
> Thanks,
> John
>
Hi John,
There has been some churn in results handling in the last year, in part
this is related to the new exporter. I think the following is the
current best approach.
#+begin_src sh :results output wrap
cat <<EOF
[[./plots/filename1.pdf]]
[[./plots/filename2.pdf]]
[[./plots/filename3.pdf]]
EOF
#+end_src
#+RESULTS:
:RESULTS:
[[./plots/filename1.pdf]]
[[./plots/filename2.pdf]]
[[./plots/filename3.pdf]]
:END:
I do feel bad that we had to add yet another results type (i.e. "wrap"),
but as I recall there were very good reasons for this decision and it
has made things cleaner on the implementation side.
Cheers,
--
Eric Schulte
http://cs.unm.edu/~eschulte
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Using :results output org with new exporter exporting as verbatim with LaTeX
2013-03-23 22:12 ` Eric Schulte
@ 2013-03-24 1:40 ` John Hendy
2013-03-24 16:00 ` Charles Berry
0 siblings, 1 reply; 5+ messages in thread
From: John Hendy @ 2013-03-24 1:40 UTC (permalink / raw)
To: Eric Schulte; +Cc: emacs-orgmode
On Sat, Mar 23, 2013 at 5:12 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
> John Hendy <jw.hendy@gmail.com> writes:
>
>> I have an org file with R src block that spits out some file names to
>> embed. I don't think I need to reproduce the block for testing
>> purposes, but the gist is that I use cat() to spit out some
>> =#+begin_center= and =[[filename]]= stuff.
>>
>> R code block header:
>>
>> #+name: src-block-name
>> #+begin_src R :session r :exports results :results output org
>>
>>
>> I'm getting a results block like so:
>>
>> #+RESULTS: src-block-name
>> #+BEGIN_SRC org
>>
>> [[./plots/filename1.pdf]]
>>
>> [[./plots/filename2.pdf]]
>>
>> [[./plots/filename3.pdf]]
>>
>> #+END_SRC
>>
>> I used this setup previously (and successfully) as described in this
>> mailing list thread. That particular post described my near successful
>> block, with the same sort of cat(paste()) commands I was using to
>> output the filenames in [[filename.pdf]] orgmode syntax. The final
>> success happened at the very end when Eric Schulte suggested I change
>> from :results output raw to :results output org.
>> - http://lists.gnu.org/archive/html/emacs-orgmode/2012-08/msg01222.html
>>
>> Hence, I started with :results output org this time, but it didn't
>> work. It's being exported verbatim using =C-c C-e l p=. (Appears in
>> \begin{verbatim} ... \end{verbatim} in the output .tex file)
>>
>> If I change to :results output raw, I simply get:
>>
>> #+results
>>
>> [[filename.pdf]]
>>
>> This exports correctly.
>>
>> If I change the :results output org #+results block to the following,
>> it also works correctly:
>>
>> #+begin_org
>>
>> [[filename.pdf]]
>>
>> #+end_org
>>
>> From the ob-doc-R, it appears that orgmode export might be expecting
>> #+begin_org, not #+begin_src org:
>> - http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html
>>
>> #+begin_quote
>> The Org Mode source code block specifies :results org so the output is
>> wrapped in #+BEGIN_ORG & #+END_ORG. This way, arbitrary output can be
>> included and easily replaced on subsequent evaluations of the source
>> code block.
>> #+end_quote
>>
>>
>> Let me know the current proper way to accomplish what I'm trying to do.
>>
>>
>>
>> Thanks,
>> John
>>
>
> Hi John,
>
> There has been some churn in results handling in the last year, in part
> this is related to the new exporter. I think the following is the
> current best approach.
>
> #+begin_src sh :results output wrap
> cat <<EOF
> [[./plots/filename1.pdf]]
>
> [[./plots/filename2.pdf]]
>
> [[./plots/filename3.pdf]]
> EOF
> #+end_src
>
> #+RESULTS:
> :RESULTS:
> [[./plots/filename1.pdf]]
>
> [[./plots/filename2.pdf]]
>
> [[./plots/filename3.pdf]]
> :END:
>
> I do feel bad that we had to add yet another results type (i.e. "wrap"),
> but as I recall there were very good reasons for this decision and it
> has made things cleaner on the implementation side.
I'm fine with whatever, though I think ob-R-doc is in need of a
refresher, since I don't particularly think raw vs. org (and now wrap,
which is non-existent in formal documentation from what I've seen) is
explained extremely well. I'd be happy to help, but I don't understand
the differences myself.
For example, in our previous discussion (from the thread linked in my
original post), it seems like raw was the /gist/ of what I wanted, but
raw didn't know how to replace org-specific syntax [[filename]]
properly, so I needed org.
I also can't find any references to =output wrap=. Tried googling
=output wrap R orgmode babel= and then ="output wrap" R orgmode babel=
to try to find some discussions on this.
Thanks for letting me know,
John
>
> Cheers,
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Using :results output org with new exporter exporting as verbatim with LaTeX
2013-03-24 1:40 ` John Hendy
@ 2013-03-24 16:00 ` Charles Berry
2013-03-24 17:14 ` John Hendy
0 siblings, 1 reply; 5+ messages in thread
From: Charles Berry @ 2013-03-24 16:00 UTC (permalink / raw)
To: emacs-orgmode
John Hendy <jw.hendy <at> gmail.com> writes:
[deleted]
> wrap [...] is non-existent in formal documentation from what I've seen
It is in the manual:
14.8.2.23 `:wrap'
See
http://orgmode.org/manual/wrap.html#wrap
or from emacs:
C-h i m org RET C-s wrap RET RET
HTH,
Chuck
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Using :results output org with new exporter exporting as verbatim with LaTeX
2013-03-24 16:00 ` Charles Berry
@ 2013-03-24 17:14 ` John Hendy
0 siblings, 0 replies; 5+ messages in thread
From: John Hendy @ 2013-03-24 17:14 UTC (permalink / raw)
To: Charles Berry; +Cc: emacs-orgmode
On Sun, Mar 24, 2013 at 11:00 AM, Charles Berry <ccberry@ucsd.edu> wrote:
> John Hendy <jw.hendy <at> gmail.com> writes:
>
> [deleted]
>
>> wrap [...] is non-existent in formal documentation from what I've seen
>
> It is in the manual:
>
> 14.8.2.23 `:wrap'
>
> See
>
> http://orgmode.org/manual/wrap.html#wrap
>
> or from emacs:
>
> C-h i m org RET C-s wrap RET RET
Ah. Forgive my denseness! I guess I'm just perplexed by what "level"
these options fall in. The suggestion was to use =:results output
wrap=, not :wrap (hence searching for that instead of just ":wrap".
:wrap gets it's own high level documentation page while the other
options used similarly (if =:results output wrap= is the right syntax)
seem to be considred "sub options" of something else:
- http://orgmode.org/manual/results.html#results
(Also note that =wrap= doesn't appear on that list, even though it
does work with :results output). On that note, is there a discernible
difference in practice between:
:wrap syntax:
#+begin_results
blah
#+end_results
and :results output wrap syntax:
:results:
blah
:end:
John
>
> HTH,
>
> Chuck
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-24 17:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-22 23:05 Using :results output org with new exporter exporting as verbatim with LaTeX John Hendy
2013-03-23 22:12 ` Eric Schulte
2013-03-24 1:40 ` John Hendy
2013-03-24 16:00 ` Charles Berry
2013-03-24 17:14 ` John Hendy
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.