emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] using #+call for inline results
Date: Thu, 23 Jun 2011 09:10:35 +0100	[thread overview]
Message-ID: <874o3hvuh0.fsf@ucl.ac.uk> (raw)
In-Reply-To: 87sjr1i040.fsf@gmail.com

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

Eric Schulte <schulte.eric@gmail.com> writes:

[...]

>> Yes and no.  I *do* want the effect that is achieved by using an inline
>> block but I do *not* want to write the whole block inline
>
> I find the following pattern
>
>   #+source: big-block
>   #+begin_src emacs-lisp :exports none
>     "something complex"
>   #+end_src
>
>   Here is some text with src_emacs-lisp[:var it=big-block]{it} in the
>   middle.
>
> to be helpful in these situations.

Okay, this is very useful!  It's difficult to get this working with
Octave but I think I have managed it.  It also doesn't allow for
parametrised calls to the source code block but that's easy to simulate
with a two level approach, I think.

For completeness, I've attached a file which shows that it *can* work
but also that it confuses the export of lists (Nicolas?) if the inline
code is in a list item.

[...]

> nope, there is no way to issue an in-line call, although maybe this
> wouldn't be the worst idea if only for the added brevity over an inline
> code block.
>
> I'll put it on my long-term low-priority stack. :)

Brilliant.  Low priority is perfectly fine.  A solution is possible as
it stands and that's what matters!

Thanks,
eric

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: inline babel call --]
[-- Type: text/org, Size: 1024 bytes --]

#+ -*- org-confirm-babel-evaluate: nil; -*-

* testing inline evaluation of babel source blocks

  #+tblname: benzene-chlorobenzene-antoine-coefficients
  | Species       |       A |        B |       C |
  |---------------+---------+----------+---------|
  | benzene       | 6.89272 | 1203.531 | 219.888 |
  | chlorobenzene | 7.10690 |   1500.0 |     224 |

  #+srcname: benzene-chlorobenzene-relative-volatility
  #+begin_src octave :exports none :results value :var T=25 :var coeff=benzene-chlorobenzene-antoine-coefficients[2:-1,1:-1]
format bank
b=1; # row indices
c=2;
A=1; # column indices
B=2;
C=3;
for i=1:2, p(i) = 10^(coeff(i,A) - coeff(i,B)/(T+coeff(i,C))); endfor
p(b)/p(c)
  #+end_src

  The relative volatility is src_octave[:var it=benzene-chlorobenzene-relative-volatility :results output raw]{disp(it);}.

  If I put the result in a list:
  - it does not work as the result is src_octave[:var it=benzene-chlorobenzene-relative-volatility :results output raw]{disp(it);} and the list processing is confused.

[-- Attachment #3: Type: text/plain, Size: 121 bytes --]


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

  reply	other threads:[~2011-06-23  8:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22 11:07 [babel] using #+call for inline results Eric S Fraga
2011-06-22 16:23 ` 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 [this message]
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=874o3hvuh0.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@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).