I have discovered, taking a look at the Org Manual, that exists an embedded mode for Calc.

https://www.gnu.org/software/emacs/manual/html_mono/calc.html#Assignments-in-Embedded-Mode

Using "C-x * e" it solves this kind of formula with units:

a := 3 m / s

t := 7 s

a t =>



> From:     Ihor Radchenko
> Subject:     Re: LIterate programming with calc (help)
> Date:     Tue, 01 Nov 2022 07:22:18 +0000

------------------------------------------------------------------------
"Fraga, Eric"<e.fr...@ucl.ac.uk>  writes:

>/> I guess that the main problem is that calc is tightly integrated with/
>/> interactive commands. Maybe ob-calc could be extended to somehow/
>/> indicate the commands to be executed in addition to inputting stack/
>/> entries./
>/>/
>/> Not sure if there is much interest in such feature though./
>//
>/Thinking out loud, what would be better, but I have no idea how feasible/
>/it would be, would be to have ob-calc make use of the embedded calc/
>/functionality and syntax, so that you could write something like this:/
>//
>/#+begin_src calc/
>/a := 300 m/
>/b := 2 a =>/
>/#+end_src/
>//
>/which would output the result of any line with => on it./

I am CCing Tom Gillespie, the maintainer of ob-calc. Maybe he has
something to say.

--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



        

        

        

Reply via email to