From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: adding attributes to tables in results Date: Sat, 21 Nov 2015 13:04:30 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0CWc-00008S-4U for emacs-orgmode@gnu.org; Sat, 21 Nov 2015 13:04:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0CWY-0003H6-V3 for emacs-orgmode@gnu.org; Sat, 21 Nov 2015 13:04:38 -0500 Received: from mail-qg0-x236.google.com ([2607:f8b0:400d:c04::236]:35753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0CWY-0003H0-Qz for emacs-orgmode@gnu.org; Sat, 21 Nov 2015 13:04:34 -0500 Received: by qgec40 with SMTP id c40so92495600qge.2 for ; Sat, 21 Nov 2015 10:04:34 -0800 (PST) In-reply-to: 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: "Charles C. Berry" Cc: Org Mode Thanks. That gets me pretty close to what I want. Charles C. Berry writes: > On Sat, 21 Nov 2015, John Kitchin wrote: > >> Hi everyone, >> >> I am trying to figure out a way to automatically add some attributes to >> tables generated from code blocks. >> > > With ob-org loaded: > > #+BEGIN_SRC emacs-lisp > (require 'ob-org) > #+END_SRC > > this src block (n.b. there is a backslash escaped n in the #+HEADER line > just before the #+ATTR - I hope it doesn't linewrap in email or gnus > readers) > > --8<---------------cut here---------------start------------->8--- > #+HEADER: :wrap "src org :exports results :results replace \n#+ATTR_LATEX: :environment longtable" > #+BEGIN_SRC emacs-lisp :exports results > (list (+ 2 4) 4 5) > #+END_SRC > --8<---------------cut here---------------end--------------->8--- > > exports as > > --8<---------------cut here---------------start------------->8--- > > \begin{longtable}{rrr} > 6 & 4 & 5\\ > \end{longtable} > \end{document} > > --8<---------------cut here---------------end--------------->8--- > > > HTH, > > Chuck -- 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