From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Programmatically constructing org documents Date: Mon, 27 Jun 2016 08:12:20 -0400 Message-ID: References: <878txr7mrl.fsf@systemreboot.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHVOw-0006dn-V5 for emacs-orgmode@gnu.org; Mon, 27 Jun 2016 08:12:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHVOr-00046P-7I for emacs-orgmode@gnu.org; Mon, 27 Jun 2016 08:12:29 -0400 Received: from mail-qt0-x22b.google.com ([2607:f8b0:400d:c0d::22b]:35985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHVOr-00046G-1y for emacs-orgmode@gnu.org; Mon, 27 Jun 2016 08:12:25 -0400 Received: by mail-qt0-x22b.google.com with SMTP id w59so20624236qtd.3 for ; Mon, 27 Jun 2016 05:12:25 -0700 (PDT) In-reply-to: <878txr7mrl.fsf@systemreboot.net> 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: Arun Isaac Cc: "emacs-orgmode@gnu.org" After some more thought, I am not sure it is possible to setup just a parse tree for this. It works ok for src blocks, e.g. #+BEGIN_SRC emacs-lisp (org-element--interpret-data-1 '(src-block (:language "emacs-lisp" :switches nil :parameters ":results code" :value "(org-element-context)\n" :post-blank 1 :parent nil)) nil) #+END_SRC #+RESULTS: : #+BEGIN_SRC emacs-lisp :results code : (org-element-context) : #+END_SRC : On the other hand, it isn't clear how to use this to make a table. e.g. this table: | 5 | 6 | | 6 | 7 | was represented as an element like this. (table (:begin 5133 :end 5154 :type org :tblfm nil :contents-begin 5133 :contents-end 5153 :value nil :post-blank 1 :post-affiliated 5133 :parent nil)) There is no data in that representation, just points in the buffer where the data is. Does anyone know how to do this? Related to this, I have wanted to be able to have code blocks output full figures and tables with captions and attributes. I usually do this by building up strings and using :results org drawer, but it might be nice to build an element and render it. I feel like what you really want is this: http://oremacs.com/2015/01/23/eltex/ for org-mode. Arun Isaac writes: >> I don't know if there is a "correct" way. It might depend on how >> sophisticated the document is. I usually use strings and format. >> Sometimes that is a pain though, if there is a lot of conditional >> formatting. So the question is which is easier for your situation, and I >> would say easier is "correct" ;) > > Fair enough. Sounds good. Thank you. -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu