emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Multiple calc commands with orgbabel


From: Eric S Fraga
Subject: Re: Multiple calc commands with orgbabel
Date: Wed, 05 May 2021 07:33:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

On Wednesday,  5 May 2021 at 07:46, pietru@caramail.com wrote:
> Have been trying to execute multiple calc commands, but when I
> evaluate the calc expressions, I get just one result.

ob-calc returns the top element of the stack when finished and this will
be the result of the last operation in the src block.  I don't think
there's any way around this.

I use embedded Calc for this reason.  You could rewrite your equations
as simple lines (separated by empty lines from the surroundings) and
evaluate each in turn with "C-x * u":

fsolve(x 2 + x = 4, x) => x = 1.33333333333

fsolve([x + y = a, x - y = b], [x, y]) => [x = a + (b - a) / 2, y = (a - b) / 2]

I added the "=>" at the end of each expression so that the result is
shown to the right instead of replacing the expression itself (default
embedded Calc behaviour).

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-395-g82fbdd



reply via email to

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