emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dan Davison <dandavison7@gmail.com>
To: Dov Grobgeld <dov.grobgeld@gmail.com>
Cc: Jeff Horn <jrhorn424@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: Generated images in buffer
Date: Sun, 28 Nov 2010 22:34:04 +0000	[thread overview]
Message-ID: <87mxotgjs3.fsf@gmail.com> (raw)
In-Reply-To: <AANLkTikvdQoejvFLa9Yx1Dj-suiD37DRkbRZfVSHfX=D@mail.gmail.com> (Dov Grobgeld's message of "Sun, 28 Nov 2010 22:43:40 +0200")

Dov Grobgeld <dov.grobgeld@gmail.com> 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 <dandavison7@gmail.com> 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

      reply	other threads:[~2010-11-28 22:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-28  7:04 Generated images in buffer Dov Grobgeld
2010-11-28  7:34 ` Jeff Horn
2010-11-28  8:11   ` Dov Grobgeld
2010-11-28 14:46     ` Eric Schulte
2010-11-28 17:27       ` Dan Davison
2010-11-28 20:43         ` Dov Grobgeld
2010-11-28 22:34           ` Dan Davison [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxotgjs3.fsf@gmail.com \
    --to=dandavison7@gmail.com \
    --cc=dov.grobgeld@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jrhorn424@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).