From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: Reproducing a table Date: Tue, 14 Mar 2017 08:35:28 +0100 Message-ID: References: <874lyxje0m.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnhVH-0007RX-Uz for emacs-orgmode@gnu.org; Tue, 14 Mar 2017 04:08:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnhVB-0000O9-CP for emacs-orgmode@gnu.org; Tue, 14 Mar 2017 04:08:23 -0400 Received: from mailer-211-194.hitrost.net ([91.185.211.194]:55148) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cnhVB-0000Md-4t for emacs-orgmode@gnu.org; Tue, 14 Mar 2017 04:08:17 -0400 In-reply-to: <874lyxje0m.fsf@iki.fi> 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" To: Jarmo Hurri Cc: emacs-orgmode@gnu.org You can simplify it even further to #+begin_src elisp :var data=my-table :hlines yes data #+end_src which is sane enough for me. To get simpler than that, I think you need #+INCLUDE and a separate file. I can't tell from the example why you need to define it in one place and reproduce it in another, though, instead of just giving it a name right where you want it to appear. (One situation where it would be helpful, obviously, is if you want the same table to appear in multiple documents that you export from the same .org file.) Yours, Christian Jarmo Hurri writes: > Greetings (again). > > What is the smartest way to reproduce a table without defining the table > as an Org source block (constraint explained below). > > I can do the following, but it doesn't seem very sane (need to use elisp > or some other language just to funnel the table). > > # ----------------------------------------------------------------- > * define table > #+name: my-table > | row 1 | 1 | 2 | > | row 2 | 3 | 4 | > |-------+-------+-------| > | | col 1 | col 2 | > * reproduce entire table > I need to be able to reproduce the entire table in my document > #+BEGIN_SRC elisp :var data=my-table :hlines yes > (print data) > #+END_SRC > > #+RESULTS: > | row 1 | 1 | 2 | > | row 2 | 3 | 4 | > |-------+-------+-------| > | | col 1 | col 2 | > * reproduce only data > I also need to be able to pass only the data to functions > #+BEGIN_SRC elisp :var data=my-table[0:1,1:2] > (print data) > #+END_SRC > > #+RESULTS: > | 1 | 2 | > | 3 | 4 | > # ----------------------------------------------------------------- > > The reason I can _not_ define the table as an Org source block is the > second example. I need to pass parts of the table as data to functions, > and constructs like my-table()[0:1,1:2] don't work. (At least I have not > been able to get them to work.) > > Jarmo