From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: conditional export based on babel result Date: Wed, 05 Sep 2012 12:08:19 -0600 Message-ID: <87fw6wqr2b.fsf@gmx.com> References: <87k3w8bq9z.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9K3I-0004D2-S5 for emacs-orgmode@gnu.org; Wed, 05 Sep 2012 14:10:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9K3G-0003Q0-OJ for emacs-orgmode@gnu.org; Wed, 05 Sep 2012 14:10:12 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:60864) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1T9K3G-0003Nv-96 for emacs-orgmode@gnu.org; Wed, 05 Sep 2012 14:10:10 -0400 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: Andreas Leha Cc: emacs-orgmode@gnu.org Andreas Leha writes: > Hi all, > > is there a possibility to exclude (or include) parts of the document > based on some babel source block result? > > First some use case: > Say, I am doing a statistical test. And only if the test turns out to be > significant, a follow-up analysis is carried out. > > Is that possible? > > One thinkable and ugly option would be to allow lisp-generated tags like > in this dummy example: > > #+begin_org > > * The Test > #+name: sometest > #+begin_src R > test_result <- 0.03 > #+end_src > > > ** export maybe (if (< (string-to-number (sbe sometest)) 0.05) ":export:" ":noexport:") > The follow-up > > #+end_org > > > Regards, > Andreas > > Hi Andreas, When doing something this complex you may just want to write your own function which could say... take a subtree ID and a boolean flag as arguments and then set the export flag on that subtree as appropriate. The org-id-goto and org-toggle-comment functions may help in implementing this function. Best, -- Eric Schulte http://cs.unm.edu/~eschulte