From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: include value of single table cell in text? Date: Tue, 27 Jul 2010 08:43:59 -0600 Message-ID: <87lj8xc7dc.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=56113 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OdlOB-00053V-5F for emacs-orgmode@gnu.org; Tue, 27 Jul 2010 10:44:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OdlO1-0005zy-BI for emacs-orgmode@gnu.org; Tue, 27 Jul 2010 10:44:13 -0400 Received: from mail-pz0-f41.google.com ([209.85.210.41]:58232) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdlO1-0005zf-2q for emacs-orgmode@gnu.org; Tue, 27 Jul 2010 10:44:05 -0400 Received: by pzk33 with SMTP id 33so3384784pzk.0 for ; Tue, 27 Jul 2010 07:44:03 -0700 (PDT) In-Reply-To: (Austin Frank's message of "Tue, 27 Jul 2010 04:45:22 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Austin Frank Cc: emacs-orgmode@gnu.org 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 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 > > <> > > 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