[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ob-calc duplicate stack-element issue
From: |
Eric S Fraga |
Subject: |
Re: ob-calc duplicate stack-element issue |
Date: |
Sun, 15 Mar 2020 12:06:46 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
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
--
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.6-412-ge18415