From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Selective export of Babel code blocks Date: Mon, 18 Jun 2012 09:53:57 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgdLB-0000rM-PQ for emacs-orgmode@gnu.org; Mon, 18 Jun 2012 10:54:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgdL6-0000d5-Ua for emacs-orgmode@gnu.org; Mon, 18 Jun 2012 10:54:05 -0400 Received: from mail-bk0-f41.google.com ([209.85.214.41]:64805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgdL6-0000cv-LF for emacs-orgmode@gnu.org; Mon, 18 Jun 2012 10:54:00 -0400 Received: by bkcjm19 with SMTP id jm19so4880626bkc.0 for ; Mon, 18 Jun 2012 07:53:57 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode I recently started a paper using Babel in a more full-functioned way to display both R code as well as output. Previously I've just used the convenience of headings and src blocks to create R plots and have the code stored nicely for future reference. I'm exporting via LaTeX to create something to promote R and why it's awesome in conjunction with org-mode at work, which is a Minitab environment. Thus, I'd like to include actual R code to familiarize others. On with the problem. I'm also using tikzDevice. Thus, my paper so far is about like so: ---------- * Plotting this vs. that Not we'll plot this vs. that. Here's the R code: #+begin_src R :exports none tikzDevice("file.tex", width=6, height=4, standAlone=T) #+end_src #+begin_src R :exports both data <- read.csv("file.csv", header=T) sub <- subset(data, output > 5) ggplot(sub, aes(x=x, y=y)) + geom_point() #+end_src #+begin_src R :exports none dev.off() tools::texi2pdf("file.tex") #+end_src ---------- Anyway, something like this. This isn't a huge poroblem... I'm generating a lot of the same type of scatterplot just using different variables, so I can copy and yank the blocks and just change variable/file names. Doing this got me to thinking how it would be quite neat to run code in a block but mark it to be omitted from export for these kind of "setup" lines that are necessary for the desired graphs but unnecessary for your reader to see over and over again. Thoughts? I'm quite a novice and very possibly missed something that can already do this. Thanks! John