From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Pechiar Subject: Re: conditional export based on target Date: Sat, 23 Oct 2010 21:46:08 -0200 Message-ID: <20101023234608.GD14385@soloJazz.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=49500 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9nmx-00022Y-BT for emacs-orgmode@gnu.org; Sat, 23 Oct 2010 19:46:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9nmw-0002Yv-85 for emacs-orgmode@gnu.org; Sat, 23 Oct 2010 19:46:15 -0400 Received: from cpoproxy3-pub.bluehost.com ([67.222.54.6]:35525) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1P9nmv-0002Yp-Up for emacs-orgmode@gnu.org; Sat, 23 Oct 2010 19:46:14 -0400 Content-Disposition: inline In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ezequiel Birman Cc: emacs-orgmode@gnu.org On Thu, Oct 07, 2010 at 01:24:28AM -0300, Ezequiel Birman wrote: > Is there something like conditional export? I'd like to use tikz when > exporting to latex but my own hand-made ascii drawing when exporting to > ascii/latin1/utf8. Hi, I've been thinking on your request, and today this appeared on the list which is quite similar: http://lists.gnu.org/archive/html/emacs-orgmode/2010-10/msg01106.html It seems as if block settings can be lisp function calls rather than a fixed string. So, for example: //------------------------------------------------------------ ** Test conditional export #+source: test_output #+begin_src octave :results value vector :exports (if (and (boundp 'htmlp) htmlp) "none" "results" ) rand(2) #+end_src #+results: test_output | 0.3982018019389448 | 0.3879818701032038 | | 0.8053847746148466 | 0.3333630867175288 | ------------------------------------------------------------ Will export nothing to HTML, and the resulting output to other formats. Values for 'exports' can be 'both', 'none', 'code' or 'results'; and there are export flags latexp, htmlp, asciip, docbookp. I tested the above example, and it "mostly" works. Sometimes not, and I don't yet know why. BR .j.