emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Include results in a table


From: Michael Brand
Subject: Re: [O] Include results in a table
Date: Tue, 28 Oct 2014 11:54:10 +0100

Hi Thierry

On Tue, Oct 28, 2014 at 10:02 AM, abonnements
<address@hidden> wrote:
> #+call: gen(A)
> #+results: A
> : 10
>
> #+call: gen(B)
> #+results: B
> : 20
>
> Is there a simple mean to aggregate the results in a table, i.e to get
> | A | 10 |
> | B | 20 |

One solution with TBLFM is:

#+BEGIN_SRC emacs-lisp
  '(10)
#+END_SRC

#+NAME: A
#+RESULTS:
| 10 |

#+BEGIN_SRC emacs-lisp
  '(20)
#+END_SRC

#+NAME: B
#+RESULTS:
| 20 |

Aggregate multiple tables:
| Table | Value |
|-------+-------|
| A     |    10 |
| B     |    20 |
#+TBLFM: @<<$2..@>$2 = remote($1, @1$1)

Requires Emacs 24.4 or an Org version from at least 2014.

For reference see also the unit test in the Org source
testing/lisp/test-org-table.el test-org-table/remote-reference-indirect

Michael



reply via email to

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