From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gary Oberbrunner Subject: Re: Evaluating simple inline expressions in org-mode Date: Wed, 3 Feb 2016 11:14:44 -0500 Message-ID: References: <87twlpwzbw.fsf@delle7240.chemeng.ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1140205492603c052adfeaa0 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR04x-0002Hy-9h for emacs-orgmode@gnu.org; Wed, 03 Feb 2016 11:14:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aR04s-0002ME-8F for emacs-orgmode@gnu.org; Wed, 03 Feb 2016 11:14:51 -0500 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]:34121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR04r-0002M2-UT for emacs-orgmode@gnu.org; Wed, 03 Feb 2016 11:14:46 -0500 Received: by mail-lf0-x22a.google.com with SMTP id j78so17293488lfb.1 for ; Wed, 03 Feb 2016 08:14:45 -0800 (PST) In-Reply-To: <87twlpwzbw.fsf@delle7240.chemeng.ucl.ac.uk> 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: Gary Oberbrunner , Orgmode Mailing List --001a1140205492603c052adfeaa0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks Ken, that works great! With session as a file property (#+PROPERTY: header-args:python :session foo) the inline expressions aren't even _all_ that verbose. And I can use arbitrary python, not just math. Very nice! On Wed, Feb 3, 2016 at 11:09 AM, Eric S Fraga wrote: > On Wednesday, 3 Feb 2016 at 08:45, Gary Oberbrunner wrote: > > [...] > > > Of course I made up that {{{}}} syntax, that's not a real thing. I've > seen > > org-mode tables with calc, but I'm hoping for something simpler, just > > inline math expression eval. (I'm fine with elisp, calc, whatever.) > > As Ken has shown=C2=B8 you can use babel for inline evaluation. Note tha= t > Emacs calc is one of the languages supported by babel so src_calc(2*pi) > works as well. I'm not sure how you define variables in calc however... > -- > : Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213= aa > --=20 Gary --001a1140205492603c052adfeaa0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks Ken, that works great! With session as a file prope= rty (#+PROPERTY: header-args:python :session foo) the inline expressions ar= en't even _all_ that verbose. And I can use arbitrary python, not just = math. Very nice!

On Wed, Feb 3, 2016 at 11:09 AM, Eric S Fraga <e.fraga@ucl.ac.uk&= gt; wrote:
On Wednesday,=C2=A0 3 F= eb 2016 at 08:45, Gary Oberbrunner wrote:

[...]

> Of course I made up that {{{}}} syntax, that's not a real thing. I= 've seen
> org-mode tables with calc, but I'm hoping for something simpler, j= ust
> inline math expression eval. (I'm fine with elisp, calc, whatever.= )

As Ken has shown=C2=B8 you can use babel for inline evaluation.=C2= =A0 Note that
Emacs calc is one of the languages supported by babel so src_calc(2*pi)
works as well.=C2=A0 I'm not sure how you define variables in calc howe= ver...
--
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213aa=



--
Gary
--001a1140205492603c052adfeaa0--