emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: "G. Jay Kerns" <gkerns@ysu.edu>
Cc: emacs-orgmode@gnu.org
Subject: Re: Formatting R output
Date: Mon, 10 Sep 2012 11:06:39 -0400	[thread overview]
Message-ID: <25606.1347289599@alphaville> (raw)
In-Reply-To: Message from "G. Jay Kerns" <gkerns@ysu.edu> of "Mon, 10 Sep 2012 10:48:49 EDT." <CAJKctop5ouB=OVrhGssDNsEjNVQCqiCUecLdM-GpESCctATyyQ@mail.gmail.com>

G. Jay Kerns <gkerns@ysu.edu> wrote:

> > From: Neuwirth Erich <erich.neuwirth <at> univie.ac.at>
> > ...
> > 1) a mild annoyance.
> >
> > src_R{1+1} inserts the result 2 in the output. In fact, it inserts =2=.
> > When one runs the file repeatedly, org-mode does not remove older results.
> > So if I replace src_R{1+1} by src_R{2+2} and do not remove the last output,
> > My file will contain
> >
> > src_R{2+2} =4= =2=
> >
> > Also, If I run the inline code segment by C-c C-c one, the org file ail contain just 1
> > correct result, bit if afterwards I export the file (to LaTeX or html),
> > the exported file will have 2 copies of the result.
> >
> > Is there anything the developers can do about this?
> I can confirm that if a person does not remove old output but changes
> input to the inline code segment then the exported file will have both
> the correct output plus the (old) incorrect output.  My strategy to
> avoid this is use C-c C-c sparingly just to check whether the output
> is as expected, then always erase output.  If I am going to use an org
> file with C-c C-c a lot (for a lecture, say), then I keep a copy for
> exporting clean and separate from the one I am going to do a lot of
> C-c C-c'ing with.  YMMV.

IMO, the solution would come in two pieces:

- an org-babel-before-execute-hook to complement the org-babel-after-execute-hook
- fixing org-remove-result to work with inline source code blocks - my
  attempt to use it zapped the closing brace as well as the actual
  result: "This is R code: src_R{2 + 2".

Given these two however, you could add the remove function to the hook and
that'd be that.



  reply	other threads:[~2012-09-10 15:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-10 14:48 Formatting R output G. Jay Kerns
2012-09-10 15:06 ` Nick Dokos [this message]
2012-09-10 15:17   ` Nick Dokos
  -- strict thread matches above, loose matches on Subject: below --
2012-09-10 12:12 Neuwirth Erich

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:

  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=25606.1347289599@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gkerns@ysu.edu \


* 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


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).