all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vladimir Lomov <lomov.vl@gmail.com>
To: Nick Dokos <nicholas.dokos@hp.com>
Cc: Emacs Org Mode <emacs-orgmode@gnu.org>
Subject: Re: How to export both Asymptote code and its result
Date: Wed, 30 May 2012 17:01:32 +0900	[thread overview]
Message-ID: <20120530080132.GC998@smoon> (raw)
In-Reply-To: <8635.1338363062@alphaville>

Hello,
** Nick Dokos [2012-05-30 03:31:02 -0400]:

> Vladimir Lomov <lomov.vl@gmail.com> wrote:

>> * Asymptote example

>> Hello, can someone enlighten me what's the problem with the following
>> example:

>> I want to export both the Asymptote code and its (PNG) result:
>> #+NAME: fig1
>> #+BEGIN_SRC asymptote :export code

> This should be ``:exports both''

> See
> 	(info "(org) exports")

> Nick

Thanks Nick, a typo :)

I changed that and added ``:file "fig1.png"'' in header so now HTML has both: code
and image.

>> size(100);

>> draw((0,0)--(1,0)--(1,1)--cycle);
>> #+END_SRC

>> This must be the result:
>> #+CALL: fig1 :file "fig1.png"

So I don't get the idea of ``#+CALL''. It doesn't work in this case. I
thought I can show code and after small explanation the resulted
image. But seems I'm allowed to get PNG file only with BEGIN|END_SRC
block while image be placed right after the block.

I came to this:

#+NAME: fig1
#+BEGIN_SRC asymptote :exports both :results silent :file "fig1.png"
<<CODE>>
#+END_SRC

Result:\\
[[./fig1.png]]

This is essential that I want.

Thanks again.

>> What I expect: the (highlighted) code and below it the resulted image.

>> I added Asymptote to the list of Babel "active" languages
>> #+BEGIN_SRC emacs-lisp
>> ;;; Before lines are skipped
>> (org-babel-do-load-languages
>>   'org-babel-load-languages
>>   '((emacs-lisp . t)
>>     (gnuplot . t)
>>     (asymptote . t)
>>     (latex . t)
>>     (perl . t)
>>     (sh . t))
>> )
>> ;;; Rest lines are too.
>> #+END_SRC

>> When I export to HTML I confirm the code evaluation,
>> but instead of the code and result I get nothing.

>> If I comment the =asymptote= setting in above code then I get the code
>> but not the image.

>> Is it limitation of Asymptote support or I do something wrong?

>> Also, I don't understand why viewer is run to show me the result of
>> code evaluation (actually I know, because of ~-V~ option passed to
>> ~asy~, but why it is passed to it?).

>> My env:
>> Emacs 24.1.50.1 (compiled from BZR trunk)
>> Org-mode version 7.8.11 (=release_7.8.11-18-g244331 @ /usr/share/emacs/site-lisp/org/=)

---
WBR, Vladimir Lomov

-- 
A prisoner of war is a man who tries to kill you and fails, and then
asks you not to kill him.
		-- Sir Winston Churchill, 1952

  reply	other threads:[~2012-05-30  8:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30  7:13 How to export both Asymptote code and its result Vladimir Lomov
2012-05-30  7:31 ` Nick Dokos
2012-05-30  8:01   ` Vladimir Lomov [this message]
2012-05-30 15:22     ` Eric Schulte

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

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

  git send-email \
    --in-reply-to=20120530080132.GC998@smoon \
    --to=lomov.vl@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nicholas.dokos@hp.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.