From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: Generated images in buffer Date: Sun, 28 Nov 2010 22:34:04 +0000 Message-ID: <87mxotgjs3.fsf@gmail.com> References: <87bp594iau.fsf@gmail.com> <87y68d9x4w.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=52118 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PMppc-00068h-LE for emacs-orgmode@gnu.org; Sun, 28 Nov 2010 17:34:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PMppb-00081P-FB for emacs-orgmode@gnu.org; Sun, 28 Nov 2010 17:34:52 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:44942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PMppb-00081K-4R for emacs-orgmode@gnu.org; Sun, 28 Nov 2010 17:34:51 -0500 In-Reply-To: (Dov Grobgeld's message of "Sun, 28 Nov 2010 22:43:40 +0200") 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: Dov Grobgeld Cc: Jeff Horn , emacs-orgmode@gnu.org Dov Grobgeld writes: > Thanks! This is exactly what I was looking for. And indeed it is as easy to > output a graph from python (or any other language) as it is from ditaa: > > * A ditaa image > #+begin_src ditaa :file example.png [...] > * A Python image > #+begin_src python :file circle.png [...] > I'm wondering over one thing though. When exporting to HTML, the ditaa > source code is omitted, but the python source code is included. Is there any > way of controlling this in begin_src? Hi Dov, Yes, see the documentation of the :exports header argument. http://orgmode.org/manual/Exporting-code-blocks.html#Exporting-code-blocks Header arguments such as :exports can be set in various different ways. http://orgmode.org/manual/Using-header-arguments.html#Using-header-arguments The difference in behavior you see stems from the value of the variable org-babel-default-header-args, and the language-specific versions of that variable. Note below that although :exports in general defaults to "code", for ditaa this default is overridden to "results". The reason for which was that ditaa code is typically going to be there to generate graphics, whereas that is only occasionally true for python. #+begin_src emacs-lisp :results pp org-babel-default-header-args #+end_src #+results: : ((:session . "none") : (:results . "replace") : (:exports . "code") : (:cache . "no") : (:noweb . "no") : (:hlines . "no") : (:tangle . "no")) #+begin_src emacs-lisp :results pp org-babel-default-header-args:ditaa #+end_src #+results: : ((:results . "file") : (:exports . "results")) #+begin_src emacs-lisp :results pp org-babel-default-header-args:python #+end_src #+results: : nil Dan > > Thanks! > Dov > > > On Sun, Nov 28, 2010 at 19:27, Dan Davison wrote: > >> (add-hook 'org-babel-after-execute-hook >> (lambda () (org-display-inline-images nil t))) >> > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode