emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: emacs-orgmode@gnu.org
Subject: [babel] using #+call for inline results
Date: Wed, 22 Jun 2011 12:07:57 +0100	[thread overview]
Message-ID: <87mxhaunsi.fsf@ucl.ac.uk> (raw)

Hello,

I have been playing with org babel for putting results inline within an
exported latex file.  A simple example is here:

--8<---------------cut here---------------start------------->8---
* testing inline evaluation of babel source blocks
  
  #+srcname: benzene-chlorobenzene-relative-volatility
  #+begin_src octave :exports none :results output raw :var T=25
format bank
pb = 10^(6.89272 - 1203.531/(T+219.888));
pc = 10^(7.10690 - 1500.0  /(T+224.000));
alpha = pb/pc;
disp(alpha)
  #+end_src

  1. The first step is to evaluate the relative volatility at \(T=25 ^{\circ} C\): 
     #+call: benzene-chlorobenzene-relative-volatility[:results output raw](T=25) :exports results

  2. Compare this to the value we get at 50 \(^{\circ}C\):
     #+call: benzene-chlorobenzene-relative-volatility(T=50) :exports results 

  3. Next we use this value to draw an equilibrium curve.
      
--8<---------------cut here---------------end--------------->8---

If I evaluate the code block, I get what I expect:

,----
|   #+results: benzene-chlorobenzene-relative-volatility
|   7.86
`----

However, when I export the file, the #+call lines get wrapped in a
verbatim environment regardless of what or where I specify for
the :results header arguments.  E.g.:

,----
| \begin{enumerate}
| \item The first step is to evaluate the relative volatility at \(T=25 ^{\circ} C\): 
| 
| 
| \begin{verbatim}
|       7.86
| \end{verbatim}
| 
| \item Compare this to the value we get at 50 \(^{\circ}C\):
| 
| 
| \begin{verbatim}
|       6.32
| \end{verbatim}
`----

What am I doing wrong?  I have tried various permutations of the
placement of the :results header and various options for it but do not
seem to have hit on the right combination.

Ideally, I would like the number to appear completely inline with the
text the precedes and follows the #+call statement.  I would prefer to
not have a new paragraph started, for instance.

On a related note, although the manual seems to indicate that "raw" and
"org" are synonymous, they behave differently when evaluating a code
block with the latter encapsulating the output within #+begin_org
and #+end_org.  The behaviour is fine but maybe the documentation,
assuming I have understand things correctly, should be changed to
reflect the difference in behaviour?

Thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.418.ge860.dirty)

             reply	other threads:[~2011-06-22 11:08 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22 11:07 Eric S Fraga [this message]
2011-06-22 16:23 ` [babel] using #+call for inline results Eric Schulte
2011-06-22 18:22   ` Eric S Fraga
2011-06-23  5:32     ` Eric Schulte
2011-06-23  8:10       ` Eric S Fraga
2011-06-23 13:49         ` Nicolas Goaziou
2011-06-23 15:39           ` chris.m.malone
2011-06-23 17:30           ` Eric S Fraga
2011-06-23 19:55             ` Nicolas Goaziou
2011-06-24  8:11               ` Eric S Fraga
2011-06-23  9:25       ` Christian Moe
2011-06-24 22:36         ` Eric Schulte
2011-06-25 19:33           ` Eric S Fraga
2011-06-26 11:56           ` Christian Moe
2011-06-27  0:14             ` Eric Schulte
2011-06-27  6:16               ` Christian Moe
2011-06-27 17:43                 ` Eric Schulte
2011-06-27 19:01                   ` Christian Moe
2011-06-28  8:04                   ` Sebastien Vauban
2011-06-28 20:31                     ` Eric Schulte
2011-06-29  7:40                       ` Sebastien Vauban
2011-06-29 17:12                         ` Eric Schulte
2011-06-29 17:25                           ` Eric Schulte
2011-06-27 17:09           ` Eric S Fraga
2011-06-27 18:45             ` Eric Schulte
2011-06-29 16:38               ` Eric S Fraga
2011-06-29 17:59                 ` Eric Schulte
2011-06-22 17:53 ` Juan Pechiar

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=87mxhaunsi.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /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).