emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: Heiko Schmidt <Heiko.Schmidt@webbedtables.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: ob-calc duplicate stack-element issue
Date: Sun, 15 Mar 2020 12:06:46 +0000	[thread overview]
Message-ID: <87imj5n7op.fsf@ucl.ac.uk> (raw)
In-Reply-To: <9eed12f5-face-eb4f-4006-e8ee7890e0a9@webbedtables.de> (Heiko Schmidt's message of "Sun, 15 Mar 2020 11:46:29 +0100")

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

  reply	other threads:[~2020-03-15 12:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-15 10:46 ob-calc duplicate stack-element issue Heiko Schmidt
2020-03-15 12:06 ` Eric S Fraga [this message]
2020-03-15 15:08   ` Heiko Schmidt
2020-03-18 14:47 ` Marco Wahl
2020-03-18 15:50   ` Eric S Fraga
2020-03-18 16:23     ` Marco Wahl
2020-03-18 16:41       ` Eric S Fraga
2020-04-06  4:39     ` Heiko Schmidt
2020-04-06  4:16   ` Heiko Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87imj5n7op.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=Heiko.Schmidt@webbedtables.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).