emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] include value of single table cell in text?


From: Eric Schulte
Subject: Re: [Orgmode] include value of single table cell in text?
Date: Tue, 27 Jul 2010 08:43:59 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

The following should work.  It uses an inline code block

--8<---------------cut here---------------start------------->8---
#+TBLNAME:  test-table
| key | value |
|-----+-------|
| a   |     1 |
| b   |     2 |

Is there any way to refer to cell @2$2 within the text of an org-mode
document, and have that reference converted to the value
src_emacs-lisp[:var d=test-table[3,1]]{d} during export?
--8<---------------cut here---------------end--------------->8---

Best -- Eric

Austin Frank <address@hidden> writes:

> Hello!
>
> Is it possible to include the value of a single cell from an org-mode
> table in the body of an org-mode document? That is, given
>
> #+TBLNAME:  test-table
> | key | value |
> |-----+-------|
> | a   |     1 |
> | b   |     2 |
>
> Is there any way to refer to cell @2$2 within the text of an org-mode
> document, and have that reference converted to the value "2" during
> export?
>
> I believe one approach would be to use babel's in-line source evaluation
> capabilities along with the remote() function from the org spreadsheet
> editor.  But I haven't yet been able to identify the right combination
> of those functions to get the desired result.  This, for example,
> doesn't work for me:
>
> #+TBLNAME:  test-table
> | key | value |
> |-----+-------|
> | a   | 1     |
> | b   | 2     |
>
> I'm testing to see whether
> src_emacs-lisp{(org-table-eval-formula "remote(test-table @2$2)")}
> works.
>
> It throws an error during export, because I'm not in a table data field.
>
>
> Additionally, if there's not already a built-in way to do this, I'd
> nominate this functionality for some special syntax.  Following babel's
> inlining and remote reference conventions, maybe
>
>   table{test-table @2$2}
>
> or
>
>   <<test-table:@2$2>>
>
> This would make it very easy to refer to specific elements the tabular
> output of babel blocks, adding to the utility of babel as a
> meta-programming language for org-mode.
>
>
> Thanks for any help!
> /au



reply via email to

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