From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: [babel] using #+call for inline results Date: Thu, 23 Jun 2011 09:10:35 +0100 Message-ID: <874o3hvuh0.fsf@ucl.ac.uk> References: <87mxhaunsi.fsf@ucl.ac.uk> <87mxh9omwb.fsf@gmail.com> <87mxh9pvz8.fsf@ucl.ac.uk> <87sjr1i040.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:50257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZfOp-0003oC-Gj for emacs-orgmode@gnu.org; Thu, 23 Jun 2011 04:36:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZfOm-0005aL-Il for emacs-orgmode@gnu.org; Thu, 23 Jun 2011 04:36:31 -0400 Received: from vscani-b2.ucl.ac.uk ([144.82.108.135]:32784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZfOk-0005Sm-He for emacs-orgmode@gnu.org; Thu, 23 Jun 2011 04:36:27 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Eric Schulte 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 --=-=-= Content-Type: text/org Content-Disposition: attachment; filename=babelcall.org Content-Description: inline babel call #+ -*- 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. --=-=-= Content-Type: text/plain -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.421.ge734e) --=-=-=--