From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schmidt Subject: Re: ob-calc duplicate stack-element issue Date: Sun, 15 Mar 2020 16:08:56 +0100 Message-ID: <5a3648cf-7eb4-e5d6-a4af-2848ff7b918e@webbedtables.de> References: <9eed12f5-face-eb4f-4006-e8ee7890e0a9@webbedtables.de> <87imj5n7op.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:49409) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDUsu-0006vR-AX for emacs-orgmode@gnu.org; Sun, 15 Mar 2020 11:09:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDUst-00046b-8d for emacs-orgmode@gnu.org; Sun, 15 Mar 2020 11:09:00 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:58999) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDUss-0003vM-Vo for emacs-orgmode@gnu.org; Sun, 15 Mar 2020 11:08:59 -0400 Received: from mail.home.webbedtables.de ([178.2.222.63]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MeknF-1jm0Ds0PH3-00anwI for ; Sun, 15 Mar 2020 16:08:57 +0100 Received: from [192.168.2.21] (cheetah2.fritz.box [192.168.2.21]) by mail.home.webbedtables.de (Postfix) with ESMTP id A4AC083B38 for ; Sun, 15 Mar 2020 16:08:56 +0100 (CET) In-Reply-To: <87imj5n7op.fsf@ucl.ac.uk> Content-Language: de-DE 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Several times I made exactly similar experiences with ob-calc as you mentioned (units, do what I want), nevertheless I decided to be dependent of orgmode and I'd really appreciate to use ob-calc for "literate calculation". "Embedded calc" seems interesting but I refuse using more tools or modes because they always tend to create open loops which I'm having enough. I think ob-calc is underestimated in the org-babel world - there is only a few documentation on it. It could be of more value to document calculations. Thanks, Heiko On 15.03.20 13:06, Eric S Fraga wrote: > On Sunday, 15 Mar 2020 at 11:46, Heiko Schmidt wrote: >> - I want to use ob-calc to do some "literate calculation" with the >>   purpose to document what I thought at the time I wrote it. > I have never managed to get ob-calc to do what I want either so I cannot > help you directly with your query. Instead, I use embedded calc mode, > along these lines: > > --8<---------------cut here---------------start------------->8--- > Number of cars (PKW) in germany: > > ncars := 45000000. > > Yearly mileage in [km/y] > > mileage := 15000 km/y > > Calculate amount of complete km per year > > mileage ncars => 675000000000. km / y > > --8<---------------cut here---------------end--------------->8--- > > > You have to activate embedded mode. By default, calc will look for > expressions surrounded by empty lines. The := operator assigns values > to variables and the => operator says to show the result here instead of > replacing the expression with the result. > > As an aside, calc understands units which is quite nice... > > HTH, > eric >