From mboxrd@z Thu Jan 1 00:00:00 1970 From: suvayu ali Subject: Re: Selective export of Babel code blocks Date: Mon, 18 Jun 2012 18:08:02 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgeV8-0004lV-Or for emacs-orgmode@gnu.org; Mon, 18 Jun 2012 12:08:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgeV6-00059F-WA for emacs-orgmode@gnu.org; Mon, 18 Jun 2012 12:08:26 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:63750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgeV6-000593-Np for emacs-orgmode@gnu.org; Mon, 18 Jun 2012 12:08:24 -0400 Received: by obbtb8 with SMTP id tb8so2820184obb.0 for ; Mon, 18 Jun 2012 09:08:23 -0700 (PDT) In-Reply-To: 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: John Hendy Cc: emacs-orgmode Hi John, On Mon, Jun 18, 2012 at 4:53 PM, John Hendy wrote: > 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. Hopefully I understood your question correctly. My solution to "setup" code blocks is use the noweb syntax. Following is an example with Gnuplot. #+PROPERTY: noweb yes #+PROPERTY: results silent #+BIND: org-confirm-babel-evaluate nil * Gnuplot source #+name: preamble #+begin_src gnuplot reset set terminal pdfcairo color size 21cm,14.8cm set termoption enhanced set encoding utf8 set termoption font "DejaVuSerif,8" # ... #+end_src #+begin_src gnuplot :noweb yes :var limits=Bpluslimits <> plot "$limits" using 1:2 title 'Theory' set output #+end_src * Table #+tblname: Bpluslimits | | Theory | | | | |---+---------| | 1 | 3.6E-14 | | 2 | 3.6E-14 | | 3 | 6.3E-13 | | 4 | 6.3E-13 | | 5 | 1.7E-14 | | 6 | 1.7E-14 | | 7 | | #+tblfm: $1=(@#-2) * COMMENT local setup # Local Variables: # org-export-allow-BIND: t # End: HTH -- Suvayu Open source is the future. It sets us free.