From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Include single values from a org-table into a code-block Date: Fri, 14 Dec 2012 12:22:52 -0700 Message-ID: <876244h20j.fsf@gmail.com> References: <20121214200842.47bb9a40@asmara> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tjaqf-0008Sw-3i for emacs-orgmode@gnu.org; Fri, 14 Dec 2012 14:23:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tjaqd-0001ab-BJ for emacs-orgmode@gnu.org; Fri, 14 Dec 2012 14:23:05 -0500 Received: from mail-ia0-f169.google.com ([209.85.210.169]:53403) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tjaqd-0001aQ-6A for emacs-orgmode@gnu.org; Fri, 14 Dec 2012 14:23:03 -0500 Received: by mail-ia0-f169.google.com with SMTP id r4so3522987iaj.0 for ; Fri, 14 Dec 2012 11:23:02 -0800 (PST) In-Reply-To: <20121214200842.47bb9a40@asmara> (Florian Adamsky's message of "Fri, 14 Dec 2012 20:08:42 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Florian Adamsky Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Florian Adamsky writes: > Hello, > > at the moment I'm drafting a paper and I would like to insert values > from a org-table into a code-block. After searching a bit a found a mail > thread from 2010 [1] which says I have to do the following: > > src_emacs-lisp[:var d=test-table[3,1]]{d} > > This works fine but only in non code-blocks. But I want to insert these > values in a LaTeX block, since I want to generate a pgfplot. Is there > another way to get values from a org-table? Or is it possible to combine > the above code with a Macro? In the following you'll find an example: > > #+Begin_LaTeX > \begin{tikzpicture} > %% pgfplot code > \addplot coordinates {(0, src_emacs-lisp[:var d=test-table[3,1]]{d})}; > \end{tikzpicture} > #+End_LaTeX > > Thanks in advance. > > Best, > Florian > > [1] > http://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg01104.html > You can use a latex code block (however you must enable support for evaluating latex code blocks). See the attached example. --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=example.org #+Options: toc:nil * Example Here is a table. #+Caption: I am the table. #+name: a-table | 1 | | 2 | | 3 | | 4 | #+begin_src latex :var foo=a-table[0,0] The first value of this table is foo. #+end_src --=-=-= Content-Type: text/plain -- Eric Schulte http://cs.unm.edu/~eschulte --=-=-=--