emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: Generated images in buffer


From: Dan Davison
Subject: [Orgmode] Re: Generated images in buffer
Date: Sun, 28 Nov 2010 22:34:04 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Dov Grobgeld <address@hidden> 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 <address@hidden> 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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]