emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: John Hendy <jw.hendy@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Using :results output org with new exporter exporting as verbatim with LaTeX
Date: Sat, 23 Mar 2013 16:12:00 -0600	[thread overview]
Message-ID: <871ub5rbgi.fsf@gmail.com> (raw)
In-Reply-To: CA+M2ft-PWUXGA_3tk5a_7oP-gT90J_9n=iRUh+OEjJN2Ww+8pw@mail.gmail.com

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

  reply	other threads:[~2013-03-23 22:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2013-03-24  1:40   ` John Hendy
2013-03-24 16:00     ` Charles Berry
2013-03-24 17:14       ` 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=871ub5rbgi.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jw.hendy@gmail.com \
    /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).