emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ob-calc duplicate stack-element issue


From: Heiko Schmidt
Subject: Re: ob-calc duplicate stack-element issue
Date: Sun, 15 Mar 2020 16:08:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]