From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: ob-calc duplicate stack-element issue Date: Sun, 15 Mar 2020 12:06:46 +0000 Message-ID: <87imj5n7op.fsf@ucl.ac.uk> References: <9eed12f5-face-eb4f-4006-e8ee7890e0a9@webbedtables.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:48513) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDS2q-0003Rp-UE for emacs-orgmode@gnu.org; Sun, 15 Mar 2020 08:07:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDS2p-0000TI-Se for emacs-orgmode@gnu.org; Sun, 15 Mar 2020 08:07:04 -0400 Received: from mail-eopbgr140095.outbound.protection.outlook.com ([40.107.14.95]:6086 helo=EUR01-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDS2p-0000Kg-Ij for emacs-orgmode@gnu.org; Sun, 15 Mar 2020 08:07:03 -0400 In-Reply-To: <9eed12f5-face-eb4f-4006-e8ee7890e0a9@webbedtables.de> (Heiko Schmidt's message of "Sun, 15 Mar 2020 11:46:29 +0100") 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: Heiko Schmidt Cc: emacs-orgmode@gnu.org On Sunday, 15 Mar 2020 at 11:46, Heiko Schmidt wrote: > - I want to use ob-calc to do some "literate calculation" with the > =C2=A0 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 :=3D 45000000. Yearly mileage in [km/y] mileage :=3D 15000 km/y Calculate amount of complete km per year mileage ncars =3D> 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 :=3D operator assigns values to variables and the =3D> 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 --=20 : Eric S Fraga via Emacs 28.0.50, Org release_9.3.6-412-ge18415